From f09e17c3c564e8310125a10c03397cbf473ff643 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser <albrechts.fltk@online.de> Date: Wed, 1 Jul 2020 18:03:10 +0200 Subject: [PATCH] Remove $Id$ tags, update URL's, and more - remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers. --- .clang-format | 56 +- .gitattributes | 54 +- .gitlab-ci.yml | 4 +- CHANGES.txt | 2 +- CHANGES_1.0.txt | 1337 +++-- CHANGES_1.1.txt | 5155 ++++++++--------- CHANGES_1.3.txt | 1488 ++--- CMake/Android/abi-version.cmake.in | 10 +- CMake/FLTKConfig.cmake.in | 4 - CMake/FindSDL2.cmake | 132 +- CMake/UseFLTK.cmake.in | 4 - CMake/android.cmake | 8 +- CMake/export.cmake | 10 +- CMake/install.cmake | 8 +- CMake/macros.cmake | 84 +- CMake/options.cmake | 8 +- CMake/resources.cmake | 32 +- CMake/setup.cmake | 8 +- CMake/variables.cmake | 8 +- CMakeLists.txt | 8 +- COPYING | 6 +- CREDITS.txt | 110 +- DartConfig.cmake | 6 +- FL/Enumerations.H | 638 +- FL/Fl.H | 308 +- FL/Fl_Adjuster.H | 14 +- FL/Fl_BMP_Image.H | 10 +- FL/Fl_Bitmap.H | 14 +- FL/Fl_Box.H | 14 +- FL/Fl_Browser.H | 36 +- FL/Fl_Browser_.H | 112 +- FL/Fl_Button.H | 28 +- FL/Fl_Cairo.H | 54 +- FL/Fl_Cairo_Window.H | 20 +- FL/Fl_Chart.H | 40 +- FL/Fl_Check_Browser.H | 24 +- FL/Fl_Check_Button.H | 12 +- FL/Fl_Choice.H | 16 +- FL/Fl_Clock.H | 60 +- FL/Fl_Color_Chooser.H | 32 +- FL/Fl_Copy_Surface.H | 20 +- FL/Fl_Counter.H | 16 +- FL/Fl_Device.H | 20 +- FL/Fl_Dial.H | 22 +- FL/Fl_Double_Window.H | 16 +- FL/Fl_Export.H | 16 +- FL/Fl_File_Browser.H | 52 +- FL/Fl_File_Chooser.H | 102 +- FL/Fl_File_Icon.H | 108 +- FL/Fl_File_Input.H | 45 +- FL/Fl_Fill_Dial.H | 12 +- FL/Fl_Fill_Slider.H | 12 +- FL/Fl_Float_Input.H | 12 +- FL/Fl_FormsBitmap.H | 14 +- FL/Fl_FormsPixmap.H | 12 +- FL/Fl_Free.H | 42 +- FL/Fl_GIF_Image.H | 12 +- FL/Fl_Gl_Window.H | 50 +- FL/Fl_Graphics_Driver.H | 24 +- FL/Fl_Group.H | 34 +- FL/Fl_Help_Dialog.H | 18 +- FL/Fl_Help_View.H | 224 +- FL/Fl_Hold_Browser.H | 14 +- FL/Fl_Hor_Fill_Slider.H | 12 +- FL/Fl_Hor_Nice_Slider.H | 12 +- FL/Fl_Hor_Slider.H | 12 +- FL/Fl_Hor_Value_Slider.H | 12 +- FL/Fl_Image.H | 44 +- FL/Fl_Image_Surface.H | 28 +- FL/Fl_Input.H | 32 +- FL/Fl_Input_.H | 112 +- FL/Fl_Input_Choice.H | 12 +- FL/Fl_Int_Input.H | 12 +- FL/Fl_JPEG_Image.H | 12 +- FL/Fl_Light_Button.H | 18 +- FL/Fl_Line_Dial.H | 12 +- FL/Fl_Menu.H | 12 +- FL/Fl_Menu_.H | 14 +- FL/Fl_Menu_Bar.H | 12 +- FL/Fl_Menu_Button.H | 26 +- FL/Fl_Menu_Item.H | 80 +- FL/Fl_Menu_Window.H | 12 +- FL/Fl_Multi_Browser.H | 18 +- FL/Fl_Multi_Label.H | 16 +- FL/Fl_Multiline_Input.H | 14 +- FL/Fl_Multiline_Output.H | 14 +- FL/Fl_Native_File_Chooser.H | 86 +- FL/Fl_Nice_Slider.H | 12 +- FL/Fl_Object.H | 12 +- FL/Fl_Output.H | 16 +- FL/Fl_Overlay_Window.H | 14 +- FL/Fl_PNG_Image.H | 12 +- FL/Fl_PNM_Image.H | 12 +- FL/Fl_Pack.H | 10 +- FL/Fl_Paged_Device.H | 26 +- FL/Fl_Pixmap.H | 14 +- FL/Fl_Plugin.H | 24 +- FL/Fl_Positioner.H | 14 +- FL/Fl_PostScript.H | 70 +- FL/Fl_Preferences.H | 66 +- FL/Fl_Printer.H | 34 +- FL/Fl_Progress.H | 32 +- FL/Fl_RGB_Image.H | 12 +- FL/Fl_Radio_Button.H | 12 +- FL/Fl_Radio_Light_Button.H | 12 +- FL/Fl_Radio_Round_Button.H | 12 +- FL/Fl_Rect.H | 30 +- FL/Fl_Repeat_Button.H | 12 +- FL/Fl_Return_Button.H | 14 +- FL/Fl_Roller.H | 16 +- FL/Fl_Round_Button.H | 12 +- FL/Fl_Round_Clock.H | 12 +- FL/Fl_SVG_File_Surface.H | 4 +- FL/Fl_SVG_Image.H | 22 +- FL/Fl_Scroll.H | 46 +- FL/Fl_Scrollbar.H | 14 +- FL/Fl_Secret_Input.H | 12 +- FL/Fl_Select_Browser.H | 12 +- FL/Fl_Shared_Image.H | 50 +- FL/Fl_Simple_Counter.H | 18 +- FL/Fl_Simple_Terminal.H | 12 +- FL/Fl_Single_Window.H | 16 +- FL/Fl_Slider.H | 30 +- FL/Fl_Spinner.H | 41 +- FL/Fl_Sys_Menu_Bar.H | 36 +- FL/Fl_Table.H | 510 +- FL/Fl_Table_Row.H | 98 +- FL/Fl_Tabs.H | 58 +- FL/Fl_Text_Buffer.H | 20 +- FL/Fl_Text_Display.H | 222 +- FL/Fl_Text_Editor.H | 32 +- FL/Fl_Tile.H | 12 +- FL/Fl_Tiled_Image.H | 16 +- FL/Fl_Timer.H | 20 +- FL/Fl_Toggle_Button.H | 14 +- FL/Fl_Toggle_Light_Button.H | 12 +- FL/Fl_Toggle_Round_Button.H | 12 +- FL/Fl_Tooltip.H | 18 +- FL/Fl_Tree.H | 82 +- FL/Fl_Tree_Item.H | 134 +- FL/Fl_Tree_Item_Array.H | 36 +- FL/Fl_Tree_Prefs.H | 108 +- FL/Fl_Valuator.H | 16 +- FL/Fl_Value_Input.H | 36 +- FL/Fl_Value_Output.H | 18 +- FL/Fl_Value_Slider.H | 14 +- FL/Fl_Widget.H | 272 +- FL/Fl_Widget_Surface.H | 12 +- FL/Fl_Window.H | 84 +- FL/Fl_Wizard.H | 10 +- FL/Fl_XBM_Image.H | 12 +- FL/Fl_XPM_Image.H | 14 +- FL/Makefile.in | 13 +- FL/android.H | 13 +- FL/filename.H | 16 +- FL/fl_ask.H | 14 +- FL/fl_draw.H | 112 +- FL/fl_message.H | 12 +- FL/fl_show_colormap.H | 12 +- FL/fl_show_input.H | 12 +- FL/fl_types.h | 16 +- FL/fl_utf8.h | 10 +- FL/forms.H | 278 +- FL/gl.h | 12 +- FL/gl2opengl.h | 8 +- FL/gl_draw.H | 13 +- FL/glu.h | 12 +- FL/glut.H | 240 +- FL/mac.H | 14 +- FL/math.h | 17 +- FL/names.h | 16 +- FL/platform.H | 10 +- FL/platform_types.h | 22 +- FL/win32.H | 20 +- FL/x.H | 14 +- GL/glut.h | 12 +- Makefile | 13 +- README.Android.md | 6 +- README.CMake.txt | 38 +- README.Cairo.txt | 18 +- README.Unix.txt | 94 +- README.Windows.txt | 12 +- README.abi-version.txt | 18 +- README.bundled-libs.txt | 4 +- README.macOS.md | 98 +- README.txt | 51 +- cairo/Fl_Cairo.cxx | 60 +- cairo/Makefile | 12 +- configh.cmake.in | 12 +- configh.in | 12 +- configure.ac | 1732 +++--- documentation/CMakeLists.txt | 74 +- documentation/Makefile | 12 +- documentation/README.txt | 10 +- documentation/make_pdf | 12 +- documentation/src/basics.dox | 28 +- documentation/src/blocks.man | 2 +- documentation/src/checkers.man | 2 +- documentation/src/common.dox | 60 +- documentation/src/development.dox | 24 +- documentation/src/drawing.dox | 82 +- documentation/src/editor.dox | 2 +- documentation/src/enumerations.dox | 16 +- documentation/src/events.dox | 54 +- documentation/src/examples.dox | 2 +- documentation/src/faq.dox | 8 +- documentation/src/fltk-config.man | 2 +- documentation/src/fltk.man | 6 +- documentation/src/fluid.dox | 6 +- documentation/src/fluid.man | 6 +- documentation/src/forms.dox | 68 +- documentation/src/glut.dox | 72 +- documentation/src/html_footer | 4 +- documentation/src/index.dox | 40 +- documentation/src/intro.dox | 4 +- documentation/src/license.dox | 74 +- documentation/src/migration_1_4.dox | 2 +- documentation/src/opengl.dox | 28 +- documentation/src/osissues.dox | 178 +- documentation/src/preface.dox | 4 +- documentation/src/subclassing.dox | 76 +- documentation/src/sudoku.man | 2 +- documentation/src/unicode.dox | 2 +- examples/OpenGL3-glut-test.cxx | 62 +- examples/OpenGL3test.cxx | 30 +- examples/README.txt | 8 +- examples/browser-simple.cxx | 20 +- examples/clipboard.cxx | 18 +- examples/draggable-group.cxx | 118 +- examples/fltk-versions.cxx | 12 +- examples/howto-add_fd-and-popen.cxx | 32 +- examples/howto-browser-with-icons.cxx | 18 +- examples/howto-drag-and-drop.cxx | 110 +- examples/howto-draw-an-x.cxx | 18 +- examples/howto-menu-with-images.cxx | 12 +- examples/howto-parse-args.cxx | 16 +- examples/howto-remap-numpad-keyboard-keys.cxx | 10 +- examples/howto-simple-svg.cxx | 60 +- examples/howto-text-over-image-button.cxx | 40 +- examples/menubar-add.cxx | 66 +- examples/nativefilechooser-simple-app.cxx | 58 +- examples/nativefilechooser-simple.cxx | 42 +- examples/progress-simple.cxx | 12 +- examples/shapedwindow.cxx | 12 +- examples/simple-terminal.cxx | 16 +- examples/table-as-container.cxx | 114 +- examples/table-simple.cxx | 30 +- examples/table-sort.cxx | 50 +- .../table-spreadsheet-with-keyboard-nav.cxx | 204 +- examples/table-spreadsheet.cxx | 212 +- examples/table-with-keynav.cxx | 218 +- .../table-with-right-column-stretch-fit.cxx | 8 +- examples/tabs-simple.cxx | 42 +- examples/textdisplay-with-colors.cxx | 34 +- examples/texteditor-simple.cxx | 30 +- examples/texteditor-with-dynamic-colors.cxx | 12 +- examples/tree-as-container.cxx | 60 +- examples/tree-custom-draw-items.cxx | 46 +- examples/tree-custom-sort.cxx | 20 +- examples/tree-of-tables.cxx | 64 +- examples/tree-simple.cxx | 22 +- examples/wizard-simple.cxx | 16 +- fltk-config.in | 12 +- fltk.list.in | 12 +- fltk.spec.in | 16 +- fluid/CMakeLists.txt | 6 +- fluid/CodeEditor.cxx | 316 +- fluid/CodeEditor.h | 14 +- fluid/ExternalCodeEditor_UNIX.cxx | 42 +- fluid/ExternalCodeEditor_UNIX.h | 5 - fluid/ExternalCodeEditor_WIN32.cxx | 46 +- fluid/ExternalCodeEditor_WIN32.h | 7 +- fluid/Fl_Function_Type.cxx | 118 +- fluid/Fl_Group_Type.cxx | 42 +- fluid/Fl_Menu_Type.cxx | 86 +- fluid/Fl_Type.cxx | 233 +- fluid/Fl_Type.h | 55 +- fluid/Fl_Widget_Type.cxx | 554 +- fluid/Fl_Widget_Type.h | 12 +- fluid/Fl_Window_Type.cxx | 457 +- fluid/Fluid_Image.cxx | 17 +- fluid/Fluid_Image.h | 12 +- fluid/Makefile | 12 +- fluid/Shortcut_Button.h | 12 +- fluid/about_panel.cxx | 12 +- fluid/about_panel.fl | 12 +- fluid/about_panel.h | 12 +- fluid/align_widget.cxx | 642 +- fluid/alignment_panel.cxx | 36 +- fluid/alignment_panel.fl | 26 +- fluid/alignment_panel.h | 12 +- fluid/code.cxx | 216 +- fluid/comments.h | 18 +- fluid/factory.cxx | 256 +- fluid/file.cxx | 80 +- fluid/fluid.cxx | 140 +- fluid/function_panel.cxx | 12 +- fluid/function_panel.fl | 12 +- fluid/function_panel.h | 8 +- fluid/print_panel.cxx | 38 +- fluid/print_panel.fl | 14 +- fluid/print_panel.h | 12 +- fluid/template_panel.cxx | 48 +- fluid/template_panel.fl | 20 +- fluid/template_panel.h | 10 +- fluid/undo.cxx | 33 +- fluid/undo.h | 30 +- fluid/widget_panel.cxx | 10 +- fluid/widget_panel.fl | 12 +- fluid/widget_panel.h | 10 +- install-sh | 14 +- jpeg/Makefile | 12 +- mac_endianness.h | 14 +- makeinclude.in | 14 +- misc/MacRoman_utf-8.txt | 6 +- misc/README.txt | 34 +- misc/abi-compliance-checker.txt | 74 +- misc/cp1252.html | 6 +- misc/cp1252.txt | 4 +- misc/cp1252_utf-8.html | 6 +- misc/cp1252_utf-8.txt | 4 +- misc/doxystar.cxx | 20 +- misc/iso-8859-1.txt | 4 +- misc/iso-8859-1_utf-8.txt | 4 +- misc/lorem_ipsum.txt | 6 +- misc/update_config_scripts | 8 +- nanosvg/nanosvgrast.h | 5 - png/CMakeLists.txt | 4 +- png/Makefile | 11 +- src/CMakeLists.txt | 16 +- src/Fl.cxx | 86 +- src/Fl_Adjuster.cxx | 104 +- src/Fl_BMP_Image.cxx | 17 +- src/Fl_Bitmap.cxx | 52 +- src/Fl_Box.cxx | 17 +- src/Fl_Browser.cxx | 199 +- src/Fl_Browser_.cxx | 302 +- src/Fl_Browser_load.cxx | 28 +- src/Fl_Button.cxx | 37 +- src/Fl_Chart.cxx | 160 +- src/Fl_Check_Browser.cxx | 358 +- src/Fl_Check_Button.cxx | 8 +- src/Fl_Choice.cxx | 26 +- src/Fl_Clock.cxx | 13 +- src/Fl_Color_Chooser.cxx | 77 +- src/Fl_Copy_Surface.cxx | 12 +- src/Fl_Counter.cxx | 31 +- src/Fl_Device.cxx | 20 +- src/Fl_Dial.cxx | 13 +- src/Fl_Double_Window.cxx | 12 +- src/Fl_File_Browser.cxx | 193 +- src/Fl_File_Chooser.cxx | 12 +- src/Fl_File_Chooser.fl | 14 +- src/Fl_File_Chooser2.cxx | 430 +- src/Fl_File_Icon.cxx | 259 +- src/Fl_File_Icon2.cxx | 695 ++- src/Fl_File_Input.cxx | 87 +- src/Fl_GIF_Image.cxx | 25 +- src/Fl_Gl_Choice.H | 14 +- src/Fl_Gl_Choice.cxx | 48 +- src/Fl_Gl_Device_Plugin.cxx | 12 +- src/Fl_Gl_Overlay.cxx | 12 +- src/Fl_Gl_Window.cxx | 122 +- src/Fl_Gl_Window_Driver.H | 12 +- src/Fl_Graphics_Driver.cxx | 16 +- src/Fl_Group.cxx | 159 +- src/Fl_Help_Dialog.cxx | 20 +- src/Fl_Help_Dialog.fl | 14 +- src/Fl_Help_Dialog_Dox.cxx | 16 +- src/Fl_Help_View.cxx | 2521 ++++---- src/Fl_Image.cxx | 112 +- src/Fl_Image_Reader.cxx | 4 +- src/Fl_Image_Reader.h | 4 +- src/Fl_Image_Surface.cxx | 21 +- src/Fl_Input.cxx | 208 +- src/Fl_Input_.cxx | 196 +- src/Fl_Input_Choice.cxx | 24 +- src/Fl_JPEG_Image.cxx | 29 +- src/Fl_Light_Button.cxx | 137 +- src/Fl_MacOS_Sys_Menu_Bar.mm | 46 +- src/Fl_Menu.cxx | 362 +- src/Fl_Menu_.cxx | 134 +- src/Fl_Menu_Bar.cxx | 14 +- src/Fl_Menu_Button.cxx | 16 +- src/Fl_Menu_Window.cxx | 23 +- src/Fl_Menu_add.cxx | 126 +- src/Fl_Menu_global.cxx | 16 +- src/Fl_Multi_Label.cxx | 12 +- src/Fl_Native_File_Chooser.cxx | 25 +- src/Fl_Native_File_Chooser_FLTK.cxx | 81 +- src/Fl_Native_File_Chooser_GTK.cxx | 117 +- src/Fl_Native_File_Chooser_MAC.mm | 197 +- src/Fl_Native_File_Chooser_WIN32.cxx | 405 +- src/Fl_Overlay_Window.cxx | 12 +- src/Fl_PNG_Image.cxx | 35 +- src/Fl_PNM_Image.cxx | 49 +- src/Fl_Pack.cxx | 16 +- src/Fl_Paged_Device.cxx | 26 +- src/Fl_Pixmap.cxx | 136 +- src/Fl_Positioner.cxx | 14 +- src/Fl_Preferences.cxx | 82 +- src/Fl_Printer.cxx | 14 +- src/Fl_Progress.cxx | 25 +- src/Fl_Repeat_Button.cxx | 23 +- src/Fl_Return_Button.cxx | 15 +- src/Fl_Roller.cxx | 36 +- src/Fl_Round_Button.cxx | 13 +- src/Fl_SVG_Image.cxx | 20 +- src/Fl_Screen_Driver.H | 22 +- src/Fl_Screen_Driver.cxx | 114 +- src/Fl_Scroll.cxx | 106 +- src/Fl_Scrollbar.cxx | 91 +- src/Fl_Shared_Image.cxx | 85 +- src/Fl_Simple_Terminal.cxx | 26 +- src/Fl_Single_Window.cxx | 27 +- src/Fl_Slider.cxx | 173 +- src/Fl_Spinner.cxx | 31 +- src/Fl_Sys_Menu_Bar.cxx | 18 +- src/Fl_Sys_Menu_Bar_Driver.H | 12 +- src/Fl_System_Driver.H | 10 +- src/Fl_System_Driver.cxx | 48 +- src/Fl_Table.cxx | 356 +- src/Fl_Table_Row.cxx | 108 +- src/Fl_Tabs.cxx | 74 +- src/Fl_Text_Buffer.cxx | 406 +- src/Fl_Text_Display.cxx | 209 +- src/Fl_Text_Editor.cxx | 70 +- src/Fl_Tile.cxx | 45 +- src/Fl_Tiled_Image.cxx | 55 +- src/Fl_Tooltip.cxx | 42 +- src/Fl_Tree.cxx | 774 ++- src/Fl_Tree_Item.cxx | 416 +- src/Fl_Tree_Item_Array.cxx | 54 +- src/Fl_Tree_Prefs.cxx | 26 +- src/Fl_Valuator.cxx | 14 +- src/Fl_Value_Input.cxx | 14 +- src/Fl_Value_Output.cxx | 12 +- src/Fl_Value_Slider.cxx | 27 +- src/Fl_Widget.cxx | 56 +- src/Fl_Widget_Surface.cxx | 22 +- src/Fl_Window.cxx | 60 +- src/Fl_Window_Driver.H | 18 +- src/Fl_Window_Driver.cxx | 24 +- src/Fl_Window_fullscreen.cxx | 14 +- src/Fl_Window_hotspot.cxx | 12 +- src/Fl_Window_iconize.cxx | 12 +- src/Fl_Wizard.cxx | 44 +- src/Fl_XBM_Image.cxx | 23 +- src/Fl_XColor.H | 18 +- src/Fl_XPM_Image.cxx | 63 +- src/Fl_abort.cxx | 12 +- src/Fl_add_idle.cxx | 18 +- src/Fl_arg.cxx | 82 +- src/Fl_cocoa.mm | 444 +- src/Fl_compose.cxx | 30 +- src/Fl_display.cxx | 20 +- src/Fl_get_key.cxx | 12 +- src/Fl_get_key_mac.cxx | 60 +- src/Fl_get_key_win32.cxx | 150 +- src/Fl_get_system_colors.cxx | 57 +- src/Fl_grab.cxx | 13 +- src/Fl_lock.cxx | 50 +- src/Fl_own_colormap.cxx | 18 +- src/Fl_visual.cxx | 21 +- src/Fl_win32.cxx | 1172 ++-- src/Fl_x.cxx | 464 +- src/Makefile | 12 +- src/Xutf8.h | 117 +- src/cgdebug.h | 38 +- src/cmap.cxx | 62 +- src/config_lib.h | 18 +- src/drivers/Android/Fl_Android_Application.H | 12 +- .../Android/Fl_Android_Application.cxx | 13 +- .../Android/Fl_Android_Graphics_Clipping.H | 12 +- .../Android/Fl_Android_Graphics_Clipping.cxx | 13 +- .../Android/Fl_Android_Graphics_Driver.H | 12 +- .../Android/Fl_Android_Graphics_Driver.cxx | 13 +- .../Android/Fl_Android_Graphics_Font.H | 12 +- .../Android/Fl_Android_Graphics_Font.cxx | 13 +- .../Fl_Android_Image_Surface_Driver.cxx | 12 +- .../Android/Fl_Android_Screen_Driver.H | 16 +- .../Android/Fl_Android_Screen_Driver.cxx | 13 +- .../Android/Fl_Android_Screen_Keyboard.cxx | 30 +- .../Android/Fl_Android_System_Driver.H | 10 +- .../Android/Fl_Android_System_Driver.cxx | 114 +- .../Android/Fl_Android_Window_Driver.H | 16 +- .../Android/Fl_Android_Window_Driver.cxx | 40 +- src/drivers/Android/README.txt | 2 +- src/drivers/Android/stb_truetype.h | 108 +- src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm | 34 +- src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H | 20 +- src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx | 120 +- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H | 20 +- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 12 +- .../Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H | 12 +- src/drivers/Darwin/Fl_Darwin_System_Driver.H | 12 +- .../Darwin/Fl_Darwin_System_Driver.cxx | 30 +- src/drivers/GDI/Fl_Font.H | 12 +- .../GDI/Fl_GDI_Copy_Surface_Driver.cxx | 14 +- src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 12 +- src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx | 12 +- .../GDI/Fl_GDI_Graphics_Driver_arci.cxx | 12 +- .../GDI/Fl_GDI_Graphics_Driver_color.cxx | 30 +- .../GDI/Fl_GDI_Graphics_Driver_font.cxx | 32 +- .../GDI/Fl_GDI_Graphics_Driver_image.cxx | 122 +- .../GDI/Fl_GDI_Graphics_Driver_line_style.cxx | 12 +- .../GDI/Fl_GDI_Graphics_Driver_rect.cxx | 14 +- .../GDI/Fl_GDI_Graphics_Driver_vertex.cxx | 16 +- .../GDI/Fl_GDI_Image_Surface_Driver.cxx | 13 +- src/drivers/OpenGL/Fl_OpenGL_Display_Device.H | 12 +- .../OpenGL/Fl_OpenGL_Display_Device.cxx | 13 +- .../OpenGL/Fl_OpenGL_Graphics_Driver.H | 12 +- .../OpenGL/Fl_OpenGL_Graphics_Driver.cxx | 24 +- .../OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx | 12 +- .../Fl_OpenGL_Graphics_Driver_color.cxx | 12 +- .../OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx | 15 +- .../Fl_OpenGL_Graphics_Driver_line_style.cxx | 12 +- .../OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx | 13 +- .../Fl_OpenGL_Graphics_Driver_vertex.cxx | 16 +- src/drivers/Pico/Fl_Pico_Graphics_Driver.H | 12 +- src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx | 18 +- src/drivers/Pico/Fl_Pico_Screen_Driver.H | 12 +- src/drivers/Pico/Fl_Pico_Screen_Driver.cxx | 13 +- src/drivers/Pico/Fl_Pico_System_Driver.H | 12 +- src/drivers/Pico/Fl_Pico_System_Driver.cxx | 13 +- src/drivers/Pico/Fl_Pico_Window_Driver.H | 12 +- src/drivers/Pico/Fl_Pico_Window_Driver.cxx | 12 +- .../Fl_PicoAndroid_Graphics_Driver.H | 12 +- .../Fl_PicoAndroid_Graphics_Driver.cxx | 14 +- .../Fl_PicoAndroid_Screen_Driver.H | 16 +- .../Fl_PicoAndroid_Screen_Driver.cxx | 19 +- .../Fl_PicoAndroid_Window_Driver.H | 12 +- .../Fl_PicoAndroid_Window_Driver.cxx | 12 +- .../PicoSDL/Fl_PicoSDL_Graphics_Driver.H | 12 +- .../PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx | 14 +- .../PicoSDL/Fl_PicoSDL_Screen_Driver.H | 12 +- .../PicoSDL/Fl_PicoSDL_Screen_Driver.cxx | 15 +- .../PicoSDL/Fl_PicoSDL_System_Driver.cxx | 12 +- .../PicoSDL/Fl_PicoSDL_Window_Driver.H | 14 +- .../PicoSDL/Fl_PicoSDL_Window_Driver.cxx | 13 +- src/drivers/Posix/Fl_Posix_Printer_Driver.cxx | 45 +- src/drivers/Posix/Fl_Posix_System_Driver.H | 10 +- src/drivers/Posix/Fl_Posix_System_Driver.cxx | 14 +- src/drivers/PostScript/Fl_PostScript.cxx | 152 +- .../PostScript/Fl_PostScript_image.cxx | 24 +- src/drivers/Quartz/Fl_Font.H | 12 +- .../Quartz/Fl_Quartz_Copy_Surface_Driver.H | 12 +- .../Quartz/Fl_Quartz_Copy_Surface_Driver.cxx | 14 +- .../Quartz/Fl_Quartz_Graphics_Driver.H | 14 +- .../Quartz/Fl_Quartz_Graphics_Driver.cxx | 14 +- .../Quartz/Fl_Quartz_Graphics_Driver_arci.cxx | 12 +- .../Fl_Quartz_Graphics_Driver_color.cxx | 12 +- .../Quartz/Fl_Quartz_Graphics_Driver_font.cxx | 52 +- .../Fl_Quartz_Graphics_Driver_image.cxx | 34 +- .../Fl_Quartz_Graphics_Driver_line_style.cxx | 18 +- .../Quartz/Fl_Quartz_Graphics_Driver_rect.cxx | 12 +- .../Fl_Quartz_Graphics_Driver_vertex.cxx | 16 +- .../Quartz/Fl_Quartz_Image_Surface_Driver.cxx | 14 +- src/drivers/SVG/Fl_SVG_File_Surface.cxx | 32 +- .../WinAPI/Fl_WinAPI_Printer_Driver.cxx | 30 +- src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H | 14 +- .../WinAPI/Fl_WinAPI_Screen_Driver.cxx | 102 +- src/drivers/WinAPI/Fl_WinAPI_System_Driver.H | 10 +- .../WinAPI/Fl_WinAPI_System_Driver.cxx | 114 +- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H | 16 +- .../WinAPI/Fl_WinAPI_Window_Driver.cxx | 40 +- src/drivers/X11/Fl_X11_Screen_Driver.H | 16 +- src/drivers/X11/Fl_X11_Screen_Driver.cxx | 222 +- src/drivers/X11/Fl_X11_System_Driver.H | 14 +- src/drivers/X11/Fl_X11_System_Driver.cxx | 124 +- src/drivers/X11/Fl_X11_Window_Driver.H | 20 +- src/drivers/X11/Fl_X11_Window_Driver.cxx | 43 +- src/drivers/Xlib/Fl_Font.H | 22 +- .../Xlib/Fl_Xlib_Copy_Surface_Driver.cxx | 12 +- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H | 12 +- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | 12 +- .../Xlib/Fl_Xlib_Graphics_Driver_arci.cxx | 12 +- .../Xlib/Fl_Xlib_Graphics_Driver_color.cxx | 26 +- .../Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx | 132 +- .../Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx | 66 +- .../Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 64 +- .../Fl_Xlib_Graphics_Driver_line_style.cxx | 22 +- .../Xlib/Fl_Xlib_Graphics_Driver_rect.cxx | 34 +- .../Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx | 12 +- .../Xlib/Fl_Xlib_Image_Surface_Driver.cxx | 12 +- src/dump_compose.c | 8 +- src/filename_absolute.cxx | 62 +- src/filename_expand.cxx | 14 +- src/filename_ext.cxx | 12 +- src/filename_isdir.cxx | 22 +- src/filename_list.cxx | 20 +- src/filename_match.cxx | 56 +- src/filename_setext.cxx | 13 +- src/fl_arc.cxx | 52 +- src/fl_ask.cxx | 52 +- src/fl_boxtype.cxx | 144 +- src/fl_call_main.c | 12 +- src/fl_cmap.h | 518 +- src/fl_color.cxx | 16 +- src/fl_cursor.cxx | 23 +- src/fl_curve.cxx | 18 +- src/fl_diamond_box.cxx | 12 +- src/fl_dnd_win32.cxx | 44 +- src/fl_dnd_x.cxx | 79 +- src/fl_draw.cxx | 56 +- src/fl_draw_pixmap.cxx | 36 +- src/fl_encoding_latin1.cxx | 48 +- src/fl_encoding_mac_roman.cxx | 42 +- src/fl_engraved_label.cxx | 12 +- src/fl_file_dir.cxx | 81 +- src/fl_font.cxx | 12 +- src/fl_gleam.cxx | 13 +- src/fl_gtk.cxx | 21 +- src/fl_images_core.cxx | 31 +- src/fl_labeltype.cxx | 28 +- src/fl_open_uri.cxx | 20 +- src/fl_oval_box.cxx | 12 +- src/fl_overlay.cxx | 12 +- src/fl_overlay_visual.cxx | 36 +- src/fl_plastic.cxx | 33 +- src/fl_read_image.cxx | 13 +- src/fl_rect.cxx | 13 +- src/fl_round_box.cxx | 20 +- src/fl_rounded_box.cxx | 22 +- src/fl_scroll_area.cxx | 12 +- src/fl_set_font.cxx | 16 +- src/fl_shadow_box.cxx | 12 +- src/fl_shortcut.cxx | 28 +- src/fl_show_colormap.cxx | 18 +- src/fl_symbols.cxx | 78 +- src/fl_utf8.cxx | 20 +- src/fl_vertex.cxx | 12 +- src/flstring.c | 40 +- src/flstring.h | 16 +- src/forms_bitmap.cxx | 12 +- src/forms_compatibility.cxx | 12 +- src/forms_free.cxx | 32 +- src/forms_fselect.cxx | 20 +- src/forms_pixmap.cxx | 12 +- src/forms_timer.cxx | 26 +- src/gl_draw.cxx | 36 +- src/gl_start.cxx | 14 +- src/glut_compatibility.cxx | 30 +- src/glut_font.cxx | 56 +- src/numericsort.c | 24 +- src/print_panel.cxx | 28 +- src/print_panel.h | 14 +- src/scandir_posix.c | 12 +- src/scandir_win32.c | 80 +- src/screen_xywh.cxx | 13 +- src/utf8_internal.h | 14 +- src/vsnprintf.c | 267 +- src/xutf8/COPYING | 8 +- src/xutf8/case.c | 14 +- src/xutf8/fl_wcwidth.c | 12 +- src/xutf8/headers/case_tbl.txt | 16 +- src/xutf8/headers/spacing_tbl.txt | 20 +- src/xutf8/headers/tbl.txt | 244 +- src/xutf8/imKStoUCS.c | 52 +- src/xutf8/is_right2left.c | 13 +- src/xutf8/is_spacing.c | 13 +- src/xutf8/keysym2Ucs.c | 13 +- src/xutf8/lcUniConv/cp936ext.h | 12 +- src/xutf8/lcUniConv/gbk_tab_to_h.c | 2 +- src/xutf8/lcUniConv/iso8859_9e.h | 2 +- src/xutf8/mk_wcwidth.c | 6 +- src/xutf8/test.c | 139 +- src/xutf8/test2.c | 95 +- src/xutf8/ucs2fontmap.c | 127 +- src/xutf8/ucs2fontmap.c.mini | 13 +- src/xutf8/utf8Input.c | 195 +- src/xutf8/utf8Utils.c | 227 +- src/xutf8/utf8Wrap.c | 379 +- src/xutf8/utils/Makefile | 4 +- src/xutf8/utils/case.sh | 14 +- src/xutf8/utils/conv_gen.c | 43 +- src/xutf8/utils/convert_map.c | 25 +- src/xutf8/utils/create_table.c | 59 +- src/xutf8/utils/euc_tw.c | 12 +- src/xutf8/utils/non_spacing.sh | 14 +- src/xutf8/utils/tbl_gen.sh | 16 +- test/CMakeLists.txt | 8 +- test/CubeMain.cxx | 19 +- test/CubeView.cxx | 18 +- test/CubeView.h | 18 +- test/Makefile | 8 +- test/README.txt | 18 +- test/adjuster.cxx | 12 +- test/animated.cxx | 12 +- test/arc.cxx | 13 +- test/ask.cxx | 24 +- test/bitmap.cxx | 12 +- test/blocks.cxx | 367 +- test/boxtype.cxx | 38 +- test/browser.cxx | 58 +- test/button.cxx | 12 +- test/buttons.cxx | 12 +- test/cairo_test.cxx | 14 +- test/checkers.cxx | 306 +- test/checkers_pieces.fl | 12 +- test/clock.cxx | 12 +- test/colbrowser.cxx | 92 +- test/color_chooser.cxx | 16 +- test/connect.cxx | 14 +- test/cube.cxx | 20 +- test/cursor.cxx | 12 +- test/curve.cxx | 12 +- test/demo.cxx | 86 +- test/device.cxx | 177 +- test/doublebuffer.cxx | 12 +- test/editor.cxx | 364 +- test/file_chooser.cxx | 125 +- test/fonts.cxx | 14 +- test/forms.cxx | 12 +- test/fractals.cxx | 72 +- test/fracviewer.cxx | 62 +- test/fracviewer.h | 12 +- test/fromdos.c | 8 +- test/fullscreen.cxx | 36 +- test/gl_overlay.cxx | 14 +- test/glpuzzle.cxx | 36 +- test/hello.cxx | 12 +- test/help_dialog.cxx | 24 +- test/help_dialog.html | 32 +- test/icon.cxx | 6 +- test/iconize.cxx | 12 +- test/image.cxx | 20 +- test/input.cxx | 14 +- test/input_choice.cxx | 13 +- test/keyboard.cxx | 26 +- test/keyboard.h | 15 +- test/label.cxx | 12 +- test/line_style.cxx | 40 +- test/list_visuals.cxx | 42 +- test/mandelbrot.cxx | 76 +- test/mandelbrot.h | 12 +- test/menubar.cxx | 152 +- test/message.cxx | 18 +- test/minimum.cxx | 12 +- test/native-filechooser.cxx | 68 +- test/navigation.cxx | 16 +- test/offscreen.cxx | 68 +- test/output.cxx | 12 +- test/overlay.cxx | 12 +- test/pack.cxx | 12 +- test/pixmap.cxx | 12 +- test/pixmap_browser.cxx | 16 +- test/resizebox.cxx | 12 +- test/rgb.txt | 1504 ++--- test/rotated_text.cxx | 14 +- test/scroll.cxx | 14 +- test/shape.cxx | 16 +- test/subwindow.cxx | 28 +- test/sudoku.cxx | 511 +- test/sudokurc.h | 2 +- test/symbols.cxx | 12 +- test/table.cxx | 130 +- test/threads.cxx | 25 +- test/threads.h | 12 +- test/tile.cxx | 12 +- test/tiled_image.cxx | 14 +- test/tree.fl | 142 +- test/twowin.cxx | 12 +- test/unittest_about.cxx | 12 +- test/unittest_circles.cxx | 16 +- test/unittest_images.cxx | 40 +- test/unittest_lines.cxx | 22 +- test/unittest_points.cxx | 18 +- test/unittest_rects.cxx | 22 +- test/unittest_schemes.cxx | 412 +- test/unittest_scrollbarsize.cxx | 136 +- test/unittest_simple_terminal.cxx | 16 +- test/unittest_symbol.cxx | 32 +- test/unittest_text.cxx | 26 +- test/unittest_viewport.cxx | 16 +- test/unittests.cxx | 34 +- test/utf8.cxx | 190 +- test/windowfocus.cxx | 16 +- zlib/Makefile | 13 +- 779 files changed, 25025 insertions(+), 29156 deletions(-) mode change 100755 => 100644 .clang-format diff --git a/.clang-format b/.clang-format old mode 100755 new mode 100644 index 5d59aa7be..5c95a2338 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,4 @@ # -# "$Id$" -# # clang-format control file for the FLTK project. # # Copyright 2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # # Important notes: @@ -46,11 +44,11 @@ # FLTK settings (currently experimental). -BasedOnStyle: LLVM +BasedOnStyle: LLVM # The Language tag marks C++ options -# Language: Cpp +# Language: Cpp # The following options override the LLVM style definitions, if set. @@ -65,61 +63,61 @@ BasedOnStyle: LLVM # UseTab can be set to 'Never' (default) or 'ForIndentation' to avoid # this annoying bug of clang-format. # -# UseTab: Always -UseTab: ForIndentation +# UseTab: Always +UseTab: ForIndentation # Should we extend code lines beyond 80 columns ? # Default: 80 -ColumnLimit: 120 +ColumnLimit: 120 # The FLTK CMP requires that case labels are indented (LLVM: false) -IndentCaseLabels: true +IndentCaseLabels: true # There are sometimes more than 1 empty lines; should we keep 2 or more ? # LLVM default is 1. -MaxEmptyLinesToKeep: 2 +MaxEmptyLinesToKeep: 2 # Present FLTK source code contains some short blocks and if statements # in one line, but we should better make it consistent and NOT use the # following "Allow..." statements (leave them commented out): # # LLVM default values: -# AllowShortBlocksOnASingleLine: false -# AllowShortFunctionsOnASingleLine: All -# AllowShortIfStatementsOnASingleLine: false -# AllowShortLoopsOnASingleLine: false +# AllowShortBlocksOnASingleLine: false +# AllowShortFunctionsOnASingleLine: All +# AllowShortIfStatementsOnASingleLine: false +# AllowShortLoopsOnASingleLine: false # # FLTK values: -# AllowShortBlocksOnASingleLine: true -# AllowShortIfStatementsOnASingleLine: true +# AllowShortBlocksOnASingleLine: true +# AllowShortIfStatementsOnASingleLine: true # Short inline functions in header files are an exception to the above "rule": -AllowShortFunctionsOnASingleLine: Inline +AllowShortFunctionsOnASingleLine: Inline # The following is particularly useful for macros with continuation lines. -# LLVM default: AlignEscapedNewlinesLeft: false +# LLVM default: AlignEscapedNewlinesLeft: false -AlignEscapedNewlinesLeft: true +AlignEscapedNewlinesLeft: true # Include files should be left as-is until we know we can sort them # without any bad side effects (LLVM: true) -SortIncludes: false +SortIncludes: false # Multiple constructor initializers must be on consecutive lines: -BreakConstructorInitializersBeforeComma: true +BreakConstructorInitializersBeforeComma: true # Constructor initializers will be indented by 2 spaces (LLVM: 4): -ConstructorInitializerIndentWidth: 2 +ConstructorInitializerIndentWidth: 2 # Continuation lines (if automatically wrapped) may be indented differently. # This does not apply to function call arguments which are aligned to the # opening bracket. LLVM (default): 4 -# ContinuationIndentWidth: 2 +# ContinuationIndentWidth: 2 # Most of FLTK's code uses 'void *p' as opposed to 'void* p'. # This is particularly useful in combined declarations like: @@ -131,9 +129,5 @@ ConstructorInitializerIndentWidth: 2 # Note: this also applies to references like 'int &w, int &h', for instance # in function parameter lists. -DerivePointerAlignment: false -PointerAlignment: Right - -# -# End of "$Id$". -# +DerivePointerAlignment: false +PointerAlignment: Right diff --git a/.gitattributes b/.gitattributes index 5b57eba56..9b909c85c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,50 +14,50 @@ # files that will not be exported in source tarballs -makesrcdist export-ignore eol=lf -.gitattributes export-ignore -.gitignore export-ignore -.gitlab-ci.yml export-ignore -.travis.yml export-ignore +makesrcdist export-ignore eol=lf +.gitattributes export-ignore +.gitignore export-ignore +.gitlab-ci.yml export-ignore +.travis.yml export-ignore # fluid files (eol=lf or text?) -*.fl eol=lf +*.fl eol=lf # shell scripts etc. with Unix line endings (lf) -*.ac eol=lf -*.in eol=lf -*.desktop eol=lf -*.sh eol=lf +*.ac eol=lf +*.in eol=lf +*.desktop eol=lf +*.sh eol=lf -fltk-config.in eol=lf +fltk-config.in eol=lf -documentation/make_pdf eol=lf -misc/config.guess eol=lf -misc/config.sub eol=lf -misc/update_config_scripts eol=lf +documentation/make_pdf eol=lf +misc/config.guess eol=lf +misc/config.sub eol=lf +misc/update_config_scripts eol=lf # files with Windows line endings (crlf) -*.rc eol=crlf -*.bat eol=crlf +*.rc eol=crlf +*.bat eol=crlf # Android Studio special support file (Windows .bat file) ide/AndroidStudio3/gradlew.rename_to_bat eol=crlf # binary files -*.ico binary -*.icns binary -*.jar binary -*.png binary -*.jpg binary -*.ttf binary -*.xcf binary -*.xcf_gz binary +*.ico binary +*.icns binary +*.jar binary +*.png binary +*.jpg binary +*.ttf binary +*.xcf binary +*.xcf_gz binary # image files that consist of ASCII text -# *.xbm text -# *.xpm text +# *.xbm text +# *.xpm text diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69b73e7f5..23794513d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,12 +31,12 @@ stages: build-autotools: stage: build # install the necessary build tools - before_script: + before_script: - apt update && apt -y install make autoconf man - apt -y install freeglut3-dev libfontconfig-dev libxft-dev - apt -y install libxcursor-dev libxinerama-dev libasound2-dev - apt -y install libpango1.0-dev libcairo2-dev - script: + script: - make clean - ./configure --enable-pango --enable-cairo - time make -j3 diff --git a/CHANGES.txt b/CHANGES.txt index 147aa7fff..b4f307032 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -Changes in FLTK 1.4.0 Released: ??? ?? 2020 +Changes in FLTK 1.4.0 Released: ??? ?? 2020 General Information about this Release diff --git a/CHANGES_1.0.txt b/CHANGES_1.0.txt index 739a921b9..87f246aab 100644 --- a/CHANGES_1.0.txt +++ b/CHANGES_1.0.txt @@ -2,798 +2,791 @@ Changes in FLTK 1.0, up to FLTK 1.0.11 (May 7, 2001) CHANGES IN FLTK 1.0.11 - - 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. + - 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 --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. + - 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 "var hides class::var" warnings. - - Eliminated all "string literal converted to char *" - warnings. + - Eliminated all "string literal converted to char *" + warnings. - - OS/2 updates from Alexander Mai. + - OS/2 updates from Alexander Mai. - - Tidied up the HTML documentation to be more standards - compliant. + - 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. + - 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. + - 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. + - Selection color on X changed to blue, to match what + happens on Windows now. - - Added support for AIX (static library only). + - Added support for AIX (static library only). - - Added support for SunOS 4.x + - Added support for SunOS 4.x - - Now process WIN32 WM_ACTIVATEAPP message to reset the - key and button states in Fl::e_state. + - 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. + - 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. + - 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... + - 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. + - Add -D_INCLUDE_POSIX_SOURCE option when compiling with + the HP compilers. - - Replaced remaining _WIN32 symbols with WIN32 + - Replaced remaining _WIN32 symbols with WIN32 - - Removed reference to unused GL/glu.h header file, which is missing on - some Linux systems. + - 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: + - 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; + 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. + 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. + 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. + - 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_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. + - 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. + - 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. + - "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. + - Fix to Fl_Valuator::step() by Guillermo Andrade. - - Fixed the FLUID write-menu bug introduced in 1.0.10 + - 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::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. + - 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. + - 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. + - Right-ctrl does not delete selected text in Fl_Input, + until you type a composed character. - - Added simple FLTK and FLUID manual pages. + - Added simple FLTK and FLUID manual pages. - - Fl_Gl_Window leaked memory under WIN32. + - Fl_Gl_Window leaked memory under WIN32. - - The colbrowser demo was missing an include file when - compiled under OS/2. + - The colbrowser demo was missing an include file when + compiled under OS/2. CHANGES IN FLTK 1.0.10 - - Added a strcasecmp() function to FLUID; AIX doesn't - have it. + - Added a strcasecmp() function to FLUID; AIX doesn't + have it. - - Bug #115509: Fl_Scroll not repainting background. + - Bug #115509: Fl_Scroll not repainting background. - - Updated the configure script and makeinclude.in file - to work with the Sun PRO compilers. + - 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... + - 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... + - 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 + - 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. + - 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. + - 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_Tabs now draws the background behind the tabs. - - Fl::set_fonts() on WIN32 fixed to work before the - first window is shown. + - Fl::set_fonts() on WIN32 fixed to work before the + first window is shown. - - CUA function keys, code submitted by George Yohng - <yohng@drivex.dosware.8m.com> + - CUA function keys, code submitted by George Yohng + <yohng@drivex.dosware.8m.com> - - Another attempt to get glut.h to work on WIN32. + - 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. + - 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 bit-flipping patterns in WIN32 bitmap code. - - Fixed size of data written by gif images to .C files + - 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) + - 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: + - 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 + *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_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(). + - 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 + - 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. + - 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. + - 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 + - Made Fl_Browser not hide the Fl_Widget::show() method - - Changes & additions for OS/2 from Alexander Mai + - Changes & additions for OS/2 from Alexander Mai - - Patch from Mike Lindner to make the turning on/off of - scrollbars on Fl_Scroll smarter. + - Patch from Mike Lindner to make the turning on/off of + scrollbars on Fl_Scroll smarter. - - Added missing FL_EXPORT for Fl_Valuator::format() + - Added missing FL_EXPORT for Fl_Valuator::format() - - Shortcuts for "buttons" in a Fl_Menu_Bar work again. + - Shortcuts for "buttons" in a Fl_Menu_Bar work again. - - Fix for cut/paste support and Xdnd. + - Fix for cut/paste support and Xdnd. - - Shortcuts for submenu titles in a menubar pop up the - submenu (rather than calling the callback) + - Shortcuts for submenu titles in a menubar pop up the + submenu (rather than calling the callback) - - Added documentation for GL_SWAP_TYPE + - 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) + - 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! + - 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) + - 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) + - 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: + - 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 + 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. + 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 + 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. + 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 assume that the back - buffer must be completely redrawn after a swap. + All other values for GL_SWAP_TYPE, and not setting + the variable, cause fltk to assume 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. + 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...) + - 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. + - 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...) + - 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. + - 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. + - 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... + - 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 IN FLTK 1.0.9 - - 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 - fltk-bugs@easysw.com now officially - fltk-bugs@fltk.org. - - 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 (assume 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. + - 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 - fltk-bugs@easysw.com now officially + fltk-bugs@fltk.org. + - 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 (assume 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 IN FLTK 1.0.8 - - 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() + - 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 IN FLTK 1.0.7 - - 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. + - 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 IN FLTK 1.0.6 - - 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. + - 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 IN FLTK 1.0.5 - - 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 + - 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 IN FLTK 1.0.4 - - 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). + - 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 IN FLTK 1.0.3 - - 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. + - 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 IN FLTK 1.0.2 - - 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. + - 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 IN FLTK 1.0.1 - - 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. + - 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. diff --git a/CHANGES_1.1.txt b/CHANGES_1.1.txt index 404132a66..5b8e0355e 100644 --- a/CHANGES_1.1.txt +++ b/CHANGES_1.1.txt @@ -1,2660 +1,2655 @@ Changes in FLTK 1.1, up to FLTK 1.1.10 (December 27, 2009) -CHANGES IN FLTK 1.1.10 Dec 27, 2009 - - - Widgets now remove stale entries from the default callback - queue when they are deleted (STR #2302) - - Fixed selection bug in Fl_Int_Input (STR #2292) - - Fixed character set conversion functions (STR #2268) - - Fixed image lib configure and fltk-config issues by backporting - the image lib and zlib configure code from FLTK 1.3 (STR #2203) - - Updated the bundled libpng to v1.2.40 (released Sep. 10, 2009) - - Fixed Fl_Choice contrast with light-on-dark settings (STR #2219) - - Added Xft2 font lookup table (STR #2215) - - Fixed X server "lock", if a modal dialog window is opened - while a menu is active (STR #1986) - - Updated mirror sites in documentation (STR #2220) - - Setting a default font for Xft (STR #2216) - - Temporarily limited builds to 32-bit on OX S to stay - compatible to Snow Leopard - - 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) - - Added cast to Fl_Color in all Fluid code (STR #2206) - - Fixed wrong identifier for special keys combined with - modifier (STR #2196) - - Fixed documentation for Fl_Progress (STR #2209) - - Fix for multiple popups, when dragging and calling fl_alert() - and friends from the callback (STR #2159) - - Avoiding crashes for recursive common dialogs (this does not - fix the issue at hand yet) (STR 2150) - - Fluid printing used wrong colors under Windows (STR #2195) - - Fixed bad system menu hadling in OS X (STR #2153) - - Fixed File Input mouse pointer dragging (STR #2181) - - Added Fl_Scroll::bbox() documentation (STR #1893) - - Fixed static linking of image libraries (STR #1962) - - Fixed callback 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 RGB colors for round box (STR #2097) - - Fixed documentation (added missing COMCTRL32.LIB dependency) - - Fl_Group::clip_children() is now public (STR #2017) - - Fixed first modifier key event (STR #1952) - - Fixed wrong default value of Fl_Spinner in Fluid (STR #1991) - - Fixed Fluid textcolor output (STR #1992) - - Added clarification to Fl_GL_Window mode function (STR #1945) - - Fl_Group and Fl_Scroll now resize themselves before - resizing their children (STR #2032) - - Fixed adding an idle handler during a draw() call (STR #1950) - - Improved stability of fl_read_image (STR #2021) - - Fixed menu position close to screen border (STR #2057) - - -CHANGES IN FLTK 1.1.9 RELEASED: Apr 27 2008 - - - 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 RELEASED: Mar 27 2008 - - - 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 RELEASED: Jan 17 2006 - - - 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 RELEASED: Nov 23 2004 - - - 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 RELEASED: Oct 19 2004 - - - 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.10 RELEASED: Dec 27, 2009 + + - Widgets now remove stale entries from the default callback + queue when they are deleted (STR #2302) + - Fixed selection bug in Fl_Int_Input (STR #2292) + - Fixed character set conversion functions (STR #2268) + - Fixed image lib configure and fltk-config issues by backporting + the image lib and zlib configure code from FLTK 1.3 (STR #2203) + - Updated the bundled libpng to v1.2.40 (released Sep. 10, 2009) + - Fixed Fl_Choice contrast with light-on-dark settings (STR #2219) + - Added Xft2 font lookup table (STR #2215) + - Fixed X server "lock", if a modal dialog window is opened + while a menu is active (STR #1986) + - Updated mirror sites in documentation (STR #2220) + - Setting a default font for Xft (STR #2216) + - Temporarily limited builds to 32-bit on OX S to stay + compatible to Snow Leopard + - 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) + - Added cast to Fl_Color in all Fluid code (STR #2206) + - Fixed wrong identifier for special keys combined with + modifier (STR #2196) + - Fixed documentation for Fl_Progress (STR #2209) + - Fix for multiple popups, when dragging and calling fl_alert() + and friends from the callback (STR #2159) + - Avoiding crashes for recursive common dialogs (this does not + fix the issue at hand yet) (STR 2150) + - Fluid printing used wrong colors under Windows (STR #2195) + - Fixed bad system menu hadling in OS X (STR #2153) + - Fixed File Input mouse pointer dragging (STR #2181) + - Added Fl_Scroll::bbox() documentation (STR #1893) + - Fixed static linking of image libraries (STR #1962) + - Fixed callback 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 RGB colors for round box (STR #2097) + - Fixed documentation (added missing COMCTRL32.LIB dependency) + - Fl_Group::clip_children() is now public (STR #2017) + - Fixed first modifier key event (STR #1952) + - Fixed wrong default value of Fl_Spinner in Fluid (STR #1991) + - Fixed Fluid textcolor output (STR #1992) + - Added clarification to Fl_GL_Window mode function (STR #1945) + - Fl_Group and Fl_Scroll now resize themselves before + resizing their children (STR #2032) + - Fixed adding an idle handler during a draw() call (STR #1950) + - Improved stability of fl_read_image (STR #2021) + - Fixed menu position close to screen border (STR #2057) + + +CHANGES IN FLTK 1.1.9 RELEASED: Apr 27 2008 + + - 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 RELEASED: Mar 27 2008 + + - 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 RELEASED: Jan 17 2006 + + - 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 RELEASED: Nov 23 2004 + + - 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 RELEASED: Oct 19 2004 + + - 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) + - 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) + - 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 RELEASED: Sep 08 2003 - - - 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. + - 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 RELEASED: Sep 08 2003 + + - 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) + - 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 RELEASED: Feb 13 2003 - - - 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 RELEASED: Nov 25 2002 - - - 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 RELEASED: ??? ?? 2002 - - - 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 RELEASED: ??? ?? 2002 - - - 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 CANDIDATE: ??? ?? 2002 - - - 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 CANDIDATE: ??? ?? 2002 - - - 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 CANDIDATE: ??? ?? 2002 - - - 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 CANDIDATE: Jul 02 2002 - - - 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 CANDIDATE: ??? ?? ???? - - - 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 CANDIDATE: ??? ?? ???? - - - 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 CANDIDATE: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - - Fixed the new WIN32 TrackMouseEvent code. - - Fixed the VC++ project files to link against - comctl32.lib. - - -CHANGES IN FLTK 1.1.0b9 BETA: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - - 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 BETA: ??? ?? ???? - - **** 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 BETA: ??? ?? ???? - - **** 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. + - 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 RELEASED: Feb 13 2003 + + - 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 RELEASED: Nov 25 2002 + + - 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 RELEASED: ??? ?? 2002 + + - 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 RELEASED: ??? ?? 2002 + + - 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 CANDIDATE: ??? ?? 2002 + + - 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 CANDIDATE: ??? ?? 2002 + + - 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 CANDIDATE: ??? ?? 2002 + + - 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 CANDIDATE: Jul 02 2002 + + - 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 CANDIDATE: ??? ?? ???? + + - 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 CANDIDATE: ??? ?? ???? + + - 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 CANDIDATE: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + - Fixed the new WIN32 TrackMouseEvent code. + - Fixed the VC++ project files to link against + comctl32.lib. + + +CHANGES IN FLTK 1.1.0b9 BETA: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + - 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 BETA: ??? ?? ???? + + **** 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 BETA: ??? ?? ???? + + **** 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. + - Fl_Help_View didn't support A elements with both a + NAME and HREF attribute - the HREF was ignored. - - Miscellaneous compile warning fixes. + - 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) + - 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 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 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... + - 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 BETA: ??? ?? ???? +CHANGES IN FLTK 1.1.0b3 BETA: ??? ?? ???? - - The top-level makefile did not include the makeinclude - file, causing the fltk-config installation commands to - fail. + - 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. + - 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. + - Now save and restore the GDI pen object when + responding to WIN32 paint messages. - - Documentation updates from A. Suatoni. + - Documentation updates from A. Suatoni. -CHANGES IN FLTK 1.1.0b2 BETA: ??? ?? ???? +CHANGES IN FLTK 1.1.0b2 BETA: ??? ?? ???? - - New fltk-config script. + - 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. + - 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. + - 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 the drawing of the focus box around + Fl_Return_Button. - - Fixed menu item measurement bug (wasn't initializing - image pointers to 0...) + - 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.) + - 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 appearance of Fl_Check_Button. - - Improved the Fl_HelpView table formatting code; now - dynamically sizes the table columns, and supports - COLSPAN. + - 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 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. + - 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 image labels in addition to text + labels + text over image alignment. - - FLUID now supports tooltips. + - FLUID now supports tooltips. - - The widget panel in FLUID is now tabbed, a la FLTK - 2.0. + - 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. + - The FLUID pixmap destructor tried to free 1 too many + lines of image data. - - FLUID now provides on-line help. + - FLUID now provides on-line help. - - Changed Fl_FileXYZ to Fl_File_XYZ. + - Changed Fl_FileXYZ to Fl_File_XYZ. - - Changed Fl_HelpXYZ to Fl_Help_XYZ. + - Changed Fl_HelpXYZ to Fl_Help_XYZ. - - Tooltip fixes for Fl_Browser_, Fl_Choice, and Fl_Input_. + - Tooltip fixes for Fl_Browser_, Fl_Choice, and Fl_Input_. - - Added tooltips to FLUID, help dialog, and file chooser. + - Added tooltips to FLUID, help dialog, and file chooser. - - Now load system icons in FLUID. + - 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 image() and deimage() methods to support + image + text labels more easily. - - Added new alignment bit FL_ALIGN_TEXT_OVER_IMAGE. + - Added new alignment bit FL_ALIGN_TEXT_OVER_IMAGE. - - Added tooltip support using Jacques Tremblay's tooltip - patch. + - Added tooltip support using Jacques Tremblay's tooltip + patch. - - Added keyboard navigation to all widgets. + - 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 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 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. + - 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. + - 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. + - 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. + - 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) + - Updated configure stuff to support shared libraries + under AIX (link to -lfltk_s) - - Symbol labels can now contain regular text. + - Symbol labels can now contain regular text. - - FLUID now supports relative filenames for the source - and header files you generate. + - 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. + - 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. + - 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. + - 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. + - 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 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 - assumed 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. + - Fl_Menu::add() of text starting with '/' to a menu is + assumed 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. + - 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. diff --git a/CHANGES_1.3.txt b/CHANGES_1.3.txt index 1dfccb0d5..8844aa027 100644 --- a/CHANGES_1.3.txt +++ b/CHANGES_1.3.txt @@ -1,761 +1,761 @@ -CHANGES IN FLTK 1.3.5 RELEASED: Mar 03 2019 - -Bug fixes and other improvements - - - Updated CHANGES for release, removed one wrong entry - +CHANGES IN FLTK 1.3.5 RELEASED: Mar 03 2019 + + Bug fixes and other improvements + + - Updated CHANGES for release, removed one wrong entry + -CHANGES IN FLTK 1.3.5rc2 RELEASED: Feb 17 2019 +CHANGES IN FLTK 1.3.5rc2 RELEASED: Feb 17 2019 -Bug fixes and other improvements + Bug fixes and other improvements - - Fix Xcode FLTK project for use under macOS 10.14 + - Fix Xcode FLTK project for use under macOS 10.14 -CHANGES IN FLTK 1.3.5rc1 RELEASED: Feb 11 2019 +CHANGES IN FLTK 1.3.5rc1 RELEASED: Feb 11 2019 -New features and enhancements (highlights) + New features and enhancements (highlights) - - Add support for macOS 10.13 "High Sierra" and 10.14 "Mojave". - - Add FL/platform.H for compatibility with FLTK 1.4 and higher. - - Improve OpenGL(3+) support. - - Improve Cairo support and (CMake) Cairo detection. + - Add support for macOS 10.13 "High Sierra" and 10.14 "Mojave". + - Add FL/platform.H for compatibility with FLTK 1.4 and higher. + - Improve OpenGL(3+) support. + - Improve Cairo support and (CMake) Cairo detection. -Bug fixes and other improvements + Bug fixes and other improvements - - Fix for STR 3473 (and its duplicate STR 3507) to restore configure-based - builds on recent Linux/Unix distributions where the freetype-config - command has been replaced by pkg-config. - - Fix Fl_Tree::insert() with pos out ouf range (issue #18). - - Fix Fl_GIF_Image Color Table handling (STR 3491). - - Make sure not to access Fl_Menu_ widgets if the widget gets - deleted while the menu (pulldown) is open (STR 3503). - - Fix CMake build (fluid) on case sensitive macOS file systems. - - Windows/OpenGL: improve pixel format detection (STR 3119). - - Add support for macOS 10.14 "Mojave": all drawing to windows is done - through "layer-backed views" when the app is linked to SDK 10.14. - - MacOS platform: fix regression in macOS 10.13 where an unbundled app - had its system menu bar unresponsive. - - MacOS 10.10 platform: Fl_Window::fullscreen() and fullscreen_off() - no longer call Fl_Window::hide() + Fl_Window::show(). - The new procedure essentially resizes the window, as done on - the X11+EWMH and Windows platforms. This improves in particular - the possibility to turn an Fl_Gl_Window fullscreen on and off. - - MacOS platform: Support \r\n as end of line used by recent - MS Office apps in clipboard. - - Fix Fl_Text_Editor overstrike mode (STR 3463). - - More consistent and optimized "gleam" scheme box drawing. - - Fix a MinGW build error with new MinGW versions as of Feb 2018 - (undefined S_OK and __FD_ISSET), see STR 3454. - - Windows/CMake: Add missing definition of WIN32 for Windows builds. - This seems to be necessary for VS2017 and other compilers that - don't #define WIN32, but FLTK relies on this preprocessor macro. - Autoconf/configure and bundled IDE files #define WIN32 as well. - - Fix illegal memory access after free when closing fluid (valgrind - reports "Invalid read of size 4"), see also STR 3427. - - Fix crash when closing fluid with Fl_Table (STR 3427). - - Fix ignored buffer pre-allocation (requestedSize) in Fl_Text_Buffer. - See fltk.general "Fl_Text_Buffer constructor bug" on Dec 5, 2016. - - Fix Fl_Browser background and text color parsing (STR 3376). - - Fix Windows CreateDC/DeleteDC mismatch (STR 3373). - - Update bundled configure scripts config.guess and config.sub. - - Fix configure --enable-cairo --enable-cairoext, - see report in fltk.general: - https://groups.google.com/forum/#!topic/fltkgeneral/x80qQ6wt0s4 - - Fix macOS timer implementation (STR 3387). - - Fix drop-to-FLTK-widget under MSWindows when the desktop is - rescaled (STR 3390). - - Add support for macOS 10.13 "High Sierra". Subwindows don't - move correctly under 10.13 without this fix. - - -CHANGES IN FLTK 1.3.4-1 RELEASED: Nov 15 2016 - -Bug fixes and other improvements - - - Fix Windows IDE solutions VisualC2008 and VisualC2010 to - build properly if the FLTK source directory is located - in a path that contains spaces. - - Note: this is a source tar file update that is only necessary - if you build one of the above mentioned Visual Studio IDE - solutions in a path with spaces. Nothing else changed, no - documentation updates. - - -CHANGES IN FLTK 1.3.4 RELEASED: Nov 11 2016 - -Bug fixes and other improvements - - - Fix test/native-filechooser help display artifact (STR #3349). - - MacOS: fix a crash when closing a fullscreen window. - - Accept empty Fl_Pixmap in Fl_RGB_Image c'tor (STR #3348). - - MacOS: fix drawing error when a window containing a hidden subwindow - is changed to fullscreen (error visible with the tabs test program). - - MacOS: fix possible crash when enabling fullscreen in test/scroll. - - Add a snapshot of known STR's and RFE's (KNOWN_BUGS.html). - -CHANGES IN FLTK 1.3.4rc3 RELEASED: Oct 31 2016 - - Bug fixes and other improvements - - - Fix string truncation in fluid (STR #2722 continued). - - MacOS: fix a small problem where the Command-Quit menu hotkey - may not work if Fl_Native_File_Chooser is used before any - window is shown. - - -CHANGES IN FLTK 1.3.4rc2 RELEASED: Oct 24 2016 - - Bug fixes and other improvements - - - Make sure the "File Systems" menu item of Fl_File_Chooser - lists "/" as the first mounted file system (Linux/Unix platform). - - Added line numbers to fluid Edit -> Show Source Code viewer. - - Improved fluid's template handling (STR #3335). - - -CHANGES IN FLTK 1.3.4rc1 RELEASED: Oct 17 2016 - - New features and extensions - - - Added support for Mac OS 10.11 "El Capitan" and 10.12 "Sierra". - - Added full support of true subwindows to the Mac OS X platform. - Window nesting to any depth is possible. An Fl_Gl_Window window or - subwindow can contain Fl_Window's as subwindows. - - Fluid now supports external editors (STR #3213) - See: Edit -> GUI Settings -> Use external editor - - Added method Fl_Widget::is_label_copied(). - - Added methods Fl_Copy_Surface::w(), Fl_Copy_Surface::h(), - and Fl_Copy_Surface::draw_decorated_window(). - - Added method Fl_Image_Surface::draw_decorated_window(). - - Added method Fl_Shared_Image *Fl_Image_Surface::highres_image() - to draw into a high-resolution bitmap image (Mac OS X only). - - Added support for OpenGL version 3 and later. - - Added method Fl_Mac_App_Menu::custom_application_menu_items() - allowing customization of the application menu (Mac OS X only). - - Added 'fluid -u' command-line switch to upgrade fluid files in - batch mode. This option opens a fluid ('.fl') file and saves it - overwriting the old file with the current syntax and library version - number. Use with care (input file is overwritten unconditionally). - - Added FL_ZOOM_GESTURE gesture for OS X (only). Needs implementation - on other platforms. - - Added FL_ABI_VERSION, FL_API_VERSION, Fl::abi_version(), and - Fl::api_version(). Constants can be used to determine the compiled - FLTK version. Functions can be used to find the linked library version. - - Added Fl::abi_check() method to test if the runtime (linked) - ABI version is correct. - - Added Fl_Image::fail() to test if an image was loaded successfully - to allow for easier error detection when loading images (STR #2873). - - Added line numbers to fluid's source code viewer for New -> Code - - New configuration options (ABI version) - - - FLTK's ABI version can now be configured with 'configure', CMake, or - by editing a supplied file when using the bundled IDE projects. - See documentation in README.abi-version.txt. - - 1.3.4 ABI FEATURES - - - Added deactivated user icon to Fl_Tree. - - Added Fl_Shared_Image::scale(width, height) which gives a shared - image its own drawing size, independently of the size of the - underlying image. This improves image drawing on high resolution - surfaces such as Laser printers, PDF files, and Apple retina displays. - - Other improvements - - - Configure now correctly sets HAVE_* variables only if both the - library and the header files were found. The configuration process - is aborted if Xft was requested explicitly with --enable-xft and - Xft was not found. The configuration summary now shows _found_ - options as opposed to requested options. - - Improved drawing of rounded box (STR #2943). - - Full support of Apple 'retina' displays for which one drawing unit - corresponds to two pixels. - - The Mac OS X platform no longer uses the deprecated AGL - (Apple GL library) to draw OpenGL data. Instead, it uses standard - Cocoa APIs. This allows FLTK to support drawing GL scenes at high - resolution when an Fl_Gl_Window is mapped to a 'retina' display. - - Added Fl_Gl_Window::pixel_w(), Fl_Gl_Window::pixel_h(), and - Fl_Gl_Window::pixels_per_unit() useful for high resolution OpenGL windows. - - fl_read_image() now captures all pixels within the rectangle - described by its arguments, whether they belong to a GL scene - or not (STR #3142). It also captures subwindows of GL windows. - - Fl::delete_widget() now hides the widget or window immediately - (i.e. when called) - only destruction is delayed as before. - - FLTK header files don't expose X11 definitions in user code any more - unless requested by including FL/x.H explicitly or implicitly. - - The PostScript code output when printing images under Linux/Unix - is now much smaller by using lossless compression techniques. - - The Linux/Unix printer dialog now uses BSD-style printing commands - (lpr/lpq) when SystemV-style commands (lp/lpstat) are not available. - - Drawing alpha-blended images under X11 is now accelerated with - Xrender. - - The font used for the FL_COURIER font family was changed on the Mac OS X - platform from 'Courier New' to 'Courier' because it was too thin. - - Text drawing on the Mac platform supports Unicode 'variation selectors' - in the range [0xFE00-0xFE0F]. - - Added a Mac OS implementation of Fl_Window::wait_for_expose() that - became necessary with Mac OS 10.10 "Yosemite". - - Added the libfltk target to the Xcode project producing a static - version of the FLTK library (Mac OS X). - - Restored the possibility to call Fl::set_font() before main() starts. - - Allow using the --enable-x11 configure option on the Mac OS platform - which produces an X11 version of the FLTK library (don't use unless - you know what you're doing). - - FLTK code and fluid-generated code can be used in static initializers. - - Added light gray separator line to fluid's widget browser (STR #2997). - - Improved tooltip behavior for huge tooltips: remove flicker, support - key/mouse dismiss (STR #2650). - - Modifier key names displayed in shortcut labels can now be localized. - See documentation of fl_shortcut_label(). You can set modifier key - names for Ctrl, Alt, Shift, and Meta by assigning global string - pointers to your translated modifier key names. - - Many documentation improvements and fixes. - - Fixed many compiler warnings (STR #2988). - - Fluid now generates code with less compiler warnings (STR #2813). - - Many CMake improvements and fixes. Note: CMake is mostly operating - now, but not yet recommended for production use. Please test and - report issues. - - Updated bundled zlib from 1.2.5 to 1.2.8. - - Updated bundled libjpeg from jpeg-8c to jpeg-9a. - - - Bug fixes - - - Fix potential crash when using keyboard navigation on Fl_Tabs - widget without children (STR #3333). - - Fix potential crash if Fl_Window::icon(NULL) was called to clear - (reset) a window icon. This is now legal and documented behavior. - The same applies to Fl_Window::default_icon(). - - Allow widget callback to be NULL, i.e. no callback (STR #2835). - - Fixed Fl_Help_View buffer overflow (STR #3275). - - Fl_Browser now correctly adjusts its scrollbars when the default - text size is changed with textsize(int) (STR #3057). - - Fixed Fl_Text_Display/Fl_Text_Editor slow scrolling, line number - display, wrap mode "hiding" text behind scrollbars, and more - scrollbar handling (alignment) (STR #3272). - - Fixed valgrind warning (uninitialized variable) in Fl_Window. - Visible only with FLTK_ABI_VERSION >= 10303, since FLTK 1.3.3. - - Fixed Windows drag'n'drop not showing insert position if the drop - target is inside the same window or process (STR #3209). - - Fixed undefined reference building shared cairo library (STR #3276). - - Fixed Fl_Browser if text argument to some methods is NULL (STR #3269). - - Fixed missing image release in fluid (STR #2840). - - Fixed out-of-bounds memory access in fluid (STR #3263). - - Fixed trailing white space in fluid .fl files (STR #3239). - - Several box types were not drawn correctly when deactivated. - The background color for deactivated widgets is now correct: - fl_inactive(color()) (STR #2907). - - Fix inconsistent interpretation of ld() in image handling - (STR #3308). This is a minor issue since ld() is usually 0 or - w()*d(). Documentation has been fixed, and ld() handling is now - consistent in Fl_(RGB_)Image and fl_draw_image() and friends. See - documentation of Fl_Image and Fl_RGB_Image for more information. - - Fixed Fl_Pixmap (background) drawing to respect the clip region - (STR #3206). - - Fixed reading .pbm image files: 1 is now interpreted as black, - and images whose width are a multiple of 8 are correctly read. - Note: if you relied on the faulty behavior you may need to fix - your image files. - - Restored window background drawing, particularly the 'plastic' - scheme's background (STR #3059). This was a regression since - FLTK 1.3.0. - - Prevent sending (FL_SHORTCUT) events to inactive widgets (STR #3216). - - Fixed button label clipping (STR #3237). - - Fixed Fl_Menu_::item_pathname() handling of descending submenu - pointers (STR #3177). - - Fl_Text_Display: style buffer colors are no longer manipulated by - fl_contrast() for normal text drawing (fltk.coredev thread started - 04/08/15, Subject: "RFC: Fl_Text_Display style buffer color weirdness") - - Fl_Tree::deactivate() now affects draw color of items (must have - ABI 1.3.3 or higher enabled). For icons to draw deactivated, - enable ABI 1.3.4. (test/tree has a 'deactivate tree' button) - - Fl_Tree::find_item() did not find items if the pathname contained - identical strings (STR #3234). - - Fixed possible bad border effect when a set of radio menu items - is located first in its menu (STR #3176): Fl_Menu_Item::set_only() - is deprecated and replaced by Fl_Menu_::set_only(Fl_Menu_item*). - - Restore the correct state of mouse buttons and keyboard modifier keys - after closing a file or printer dialog (STR #3221). - - Fix for deactivate colors issue with Fl_Text_Display/Editor (STR #3219). - - Fixed issue with MSWindows platform where the program kept running - after closing all its windows (STR #3165). - - Fix potential buffer overflow (MSWindows: BEX64 error) and problem with - MSWindows environment variables "HOME"(MinGW) vs. "UserProfile"(DOS) - - Fix issue with MSWindows platform where a window would decrease - in size after each close/open (STR #3167). - - Fix undefined reference XGetUtf8FontAndGlyph (STR #3191). - - Fix potential keyboard hangup (STR #3192). - - Fix for: .xbm images were not previewed (STR #3131). - - Fixed crash on Mac platform when resizing a not yet shown() Fl_Gl_Window. - - Fixed potential Windows GDI leak (STR #3254). - - Fixed Linux/Unix potential program hang when dialog pops up while - a menu is open (STR #3179). - - Fixed a crash when a Unix/Linux program calls take_focus() before any - window has been show()n. - - Fixed an error on the Mac platform when drawing to an Fl_Image_Surface - object without using the Fl_Image_Surface::draw() method. - - Fixed STR #3268 where a fullscreen window could become relocated - behind the menu bar and dock (Mac OS only). - - Fixed STR #3207: ^C not working when numlock or capslock is on. - - Fixed code editor in Fluid (STR #3184). - - Fixed a potential hangup of the Fl::awake() queue under Windows if - a window is resized or moved while the Fl::awake() message is sent - (STR #3143). - - Fixed a regression: restore the possibility to call - fl_draw_image(buf,X,Y,W,H,D,L) with negative D and/or L arguments. - - Fixed overflow in Fl_Valuator::precision(int) to 0...9 (STR #3280). - - -CHANGES IN FLTK 1.3.3 RELEASED: Nov 03 2014 - - New features and extensions - - - New class Fl_Copy_Surface allows copying graphical data to the - clipboard in a cross-platform way (STR #3058). - - Support for pasting graphical data from the clipboard to a widget. - - New class Fl_Image_Surface allows drawing into an Fl_Image object. - - Methods Fl::add_clipboard_notify() and Fl::remove_clipboard_notify() - to get notifications whenever the clipboard changes (STR #2636). - - New method Fl_Window::wait_for_expose() (STR #3124, STR #3129). - - New bilinear scaling method for RGB images (STR #2869, STR #3062). - - New method Fl_Widget::top_window() (STR #2948). - - New method Fl_Widget::top_window_offset() (part of STR #2944). - - New Fl_Tree_Item methods label_x(), label_y(), label_w(), label_h(). - - New methods Fl::enable_im() and Fl::disable_im() to enable/disable - system Input Methods (IM). - - New methods Fl::add_system_handler() and Fl::remove_system_handler() - to intercept low level system events. - - New FLTK scheme "gleam" (STR #2672). - - New method Fl::is_scheme() to compare the current scheme name. - - New method to set custom icons for windows (STR #2816), - see Fl_Window::icon() for more info. - - New method to set any custom cursor, based on a Fl_RGB_Image object. - Also changed fallback cursors to use this method, so that fallback - cursors are handled in a platform independent manner (STR #2660). - - New ability to convert Fl_Pixmap to Fl_RGB_Image (STR #2659). - - Support for full screen windows over multiple monitors. - - New optional line numbers in Fl_Text_Display and options to control - line numbers and word wrapping (on/off) in example test/editor.cxx. - - On Linux/Unix, class Fl_Native_File_Chooser uses file dialogs from - the Gnome environment (provided by the libgtk dynamic library) if - available, and falls back to Fl_File_Chooser if not (STR #3088). - Use option Fl::OPTION_FNFC_USES_GTK to enable/disable this feature. - - New 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. - - Other improvements - - - Many CMake improvements (e.g. STR #2962, 2977, 2994, 3045, 3055). - - Some autoconf, configure improvements. - - Removed 1024 bytes constraint in labels and browser lines (STR #2990). - - 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. - - Many Mac OS X improvements related to Fl_Sys_Menu_Bar. - - Improved Mac OS X keyboard handling of special keys or combinations. - - General Mac OS X improvements, incl. high resolution (Retina) - displays, and support up to Mac OS X 10.10. - - Documentation improvements and clarifications. - - Printing support improvements, including GL windows. - - Many improvements related to Fl_Tree (some of them only as ABI - breaking features, see below). - - Some static data has been made 'const' to improve memory usage - with shared libraries. - - Don't grab navkeys with modifiers (CTRL, ALT), as the application - may want them (STR #3104). - - Check compiler support of -fvisibility, -fvisibility-inlines-hidden, - and use it, if available. Reduces shared library size. - - Drag'n'drop behaves better now: if text is dropped in the widget it - comes from, then it works like cut and paste. - - Other improvements of DND handling when dragging text from other - applications, e.g. Firefox and Thunderbird. - - Windows message WM_QUIT is processed like SIGTERM, i.e. as a - request to terminate the program. - - Fluid no longer closes the code window when hitting ESC (STR #2997). - - Improved Fl_Widget::when() handling in Fl_Tabs (STR #2939). - - Improved support for more recent compilers (clang and gcc) that - issue more warnings, and fixed some 32-/64-bit compilation issues. - - Added method Fl_Window::clear_modal_states() to make it possible - to remove the modal or non-modal state from a window (STR #3123). - - Bug fixes - - - Fixed word selection dragging in text input (STR #3014). - - Fixed border padding for special cases (STR #3061, Windows only). - - Fixed crash if Fl_Window::flush() called while window not shown() - (STR #3028). - - Fixed segfault in fl_set_fonts_xft.cxx when loading fonts not named - as expected (STR #2976). - - Fixed a memory leak in font loading/allocation (STR #3069). - - Fixed minor memory leaks in handling/freeing of X11 objects. - - Fixed OS X fl_read_image() and Fl_Paged_Device::print_window_part() - when using a Retina display. - - Fixed MinGW build if configure didn't find strcasecmp() (STR #2994). - - Fixed access of protected member under Linux/Unix (STR #2903). - - Fixed various Mac specific OpenGL issues (STR #2944) - - Fixed PostScript printing with non-english locale (STR #3130). - - Fixed a regression in Fl_File_Chooser since FLTK 1.1.8: the - Enter key now selects the file again. - - Fixed a bug in Fl_Native_File_Chooser (Windows) for some file name - input filters (STR #3101). - - Fixed out-of-bounds memory access in Fl_Text_Display (STR #2730). - - 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. - - - Added Fl_Window::shape(const Fl_Image*) to create arbitrarily-shaped - windows - - 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. - - Made Fl_Scroll::recalc_scrollbars() protected so that it can be used - in derived widgets to calculate scrollbar visibility and positions. - - 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 - - - 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 - -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 that 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 RELEASED: Nov 06 2012 - - - 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 Windows - 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 RELEASED: Jun 16 2011 - - 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 + - Fix for STR 3473 (and its duplicate STR 3507) to restore configure-based + builds on recent Linux/Unix distributions where the freetype-config + command has been replaced by pkg-config. + - Fix Fl_Tree::insert() with pos out ouf range (issue #18). + - Fix Fl_GIF_Image Color Table handling (STR 3491). + - Make sure not to access Fl_Menu_ widgets if the widget gets + deleted while the menu (pulldown) is open (STR 3503). + - Fix CMake build (fluid) on case sensitive macOS file systems. + - Windows/OpenGL: improve pixel format detection (STR 3119). + - Add support for macOS 10.14 "Mojave": all drawing to windows is done + through "layer-backed views" when the app is linked to SDK 10.14. + - MacOS platform: fix regression in macOS 10.13 where an unbundled app + had its system menu bar unresponsive. + - MacOS 10.10 platform: Fl_Window::fullscreen() and fullscreen_off() + no longer call Fl_Window::hide() + Fl_Window::show(). + The new procedure essentially resizes the window, as done on + the X11+EWMH and Windows platforms. This improves in particular + the possibility to turn an Fl_Gl_Window fullscreen on and off. + - MacOS platform: Support \r\n as end of line used by recent + MS Office apps in clipboard. + - Fix Fl_Text_Editor overstrike mode (STR 3463). + - More consistent and optimized "gleam" scheme box drawing. + - Fix a MinGW build error with new MinGW versions as of Feb 2018 + (undefined S_OK and __FD_ISSET), see STR 3454. + - Windows/CMake: Add missing definition of WIN32 for Windows builds. + This seems to be necessary for VS2017 and other compilers that + don't #define WIN32, but FLTK relies on this preprocessor macro. + Autoconf/configure and bundled IDE files #define WIN32 as well. + - Fix illegal memory access after free when closing fluid (valgrind + reports "Invalid read of size 4"), see also STR 3427. + - Fix crash when closing fluid with Fl_Table (STR 3427). + - Fix ignored buffer pre-allocation (requestedSize) in Fl_Text_Buffer. + See fltk.general "Fl_Text_Buffer constructor bug" on Dec 5, 2016. + - Fix Fl_Browser background and text color parsing (STR 3376). + - Fix Windows CreateDC/DeleteDC mismatch (STR 3373). + - Update bundled configure scripts config.guess and config.sub. + - Fix configure --enable-cairo --enable-cairoext, + see report in fltk.general: + https://groups.google.com/forum/#!topic/fltkgeneral/x80qQ6wt0s4 + - Fix macOS timer implementation (STR 3387). + - Fix drop-to-FLTK-widget under MSWindows when the desktop is + rescaled (STR 3390). + - Add support for macOS 10.13 "High Sierra". Subwindows don't + move correctly under 10.13 without this fix. + + +CHANGES IN FLTK 1.3.4-1 RELEASED: Nov 15 2016 + + Bug fixes and other improvements + + - Fix Windows IDE solutions VisualC2008 and VisualC2010 to + build properly if the FLTK source directory is located + in a path that contains spaces. + + Note: this is a source tar file update that is only necessary + if you build one of the above mentioned Visual Studio IDE + solutions in a path with spaces. Nothing else changed, no + documentation updates. + + +CHANGES IN FLTK 1.3.4 RELEASED: Nov 11 2016 + + Bug fixes and other improvements + + - Fix test/native-filechooser help display artifact (STR #3349). + - MacOS: fix a crash when closing a fullscreen window. + - Accept empty Fl_Pixmap in Fl_RGB_Image c'tor (STR #3348). + - MacOS: fix drawing error when a window containing a hidden subwindow + is changed to fullscreen (error visible with the tabs test program). + - MacOS: fix possible crash when enabling fullscreen in test/scroll. + - Add a snapshot of known STR's and RFE's (KNOWN_BUGS.html). + +CHANGES IN FLTK 1.3.4rc3 RELEASED: Oct 31 2016 + + Bug fixes and other improvements + + - Fix string truncation in fluid (STR #2722 continued). + - MacOS: fix a small problem where the Command-Quit menu hotkey + may not work if Fl_Native_File_Chooser is used before any + window is shown. + + +CHANGES IN FLTK 1.3.4rc2 RELEASED: Oct 24 2016 + + Bug fixes and other improvements + + - Make sure the "File Systems" menu item of Fl_File_Chooser + lists "/" as the first mounted file system (Linux/Unix platform). + - Added line numbers to fluid Edit -> Show Source Code viewer. + - Improved fluid's template handling (STR #3335). + + +CHANGES IN FLTK 1.3.4rc1 RELEASED: Oct 17 2016 + + New features and extensions + + - Added support for Mac OS 10.11 "El Capitan" and 10.12 "Sierra". + - Added full support of true subwindows to the Mac OS X platform. + Window nesting to any depth is possible. An Fl_Gl_Window window or + subwindow can contain Fl_Window's as subwindows. + - Fluid now supports external editors (STR #3213) + See: Edit -> GUI Settings -> Use external editor + - Added method Fl_Widget::is_label_copied(). + - Added methods Fl_Copy_Surface::w(), Fl_Copy_Surface::h(), + and Fl_Copy_Surface::draw_decorated_window(). + - Added method Fl_Image_Surface::draw_decorated_window(). + - Added method Fl_Shared_Image *Fl_Image_Surface::highres_image() + to draw into a high-resolution bitmap image (Mac OS X only). + - Added support for OpenGL version 3 and later. + - Added method Fl_Mac_App_Menu::custom_application_menu_items() + allowing customization of the application menu (Mac OS X only). + - Added 'fluid -u' command-line switch to upgrade fluid files in + batch mode. This option opens a fluid ('.fl') file and saves it + overwriting the old file with the current syntax and library version + number. Use with care (input file is overwritten unconditionally). + - Added FL_ZOOM_GESTURE gesture for OS X (only). Needs implementation + on other platforms. + - Added FL_ABI_VERSION, FL_API_VERSION, Fl::abi_version(), and + Fl::api_version(). Constants can be used to determine the compiled + FLTK version. Functions can be used to find the linked library version. + - Added Fl::abi_check() method to test if the runtime (linked) + ABI version is correct. + - Added Fl_Image::fail() to test if an image was loaded successfully + to allow for easier error detection when loading images (STR #2873). + - Added line numbers to fluid's source code viewer for New -> Code + + New configuration options (ABI version) + + - FLTK's ABI version can now be configured with 'configure', CMake, or + by editing a supplied file when using the bundled IDE projects. + See documentation in README.abi-version.txt. + + 1.3.4 ABI FEATURES + + - Added deactivated user icon to Fl_Tree. + - Added Fl_Shared_Image::scale(width, height) which gives a shared + image its own drawing size, independently of the size of the + underlying image. This improves image drawing on high resolution + surfaces such as Laser printers, PDF files, and Apple retina displays. + + Other improvements + + - Configure now correctly sets HAVE_* variables only if both the + library and the header files were found. The configuration process + is aborted if Xft was requested explicitly with --enable-xft and + Xft was not found. The configuration summary now shows _found_ + options as opposed to requested options. + - Improved drawing of rounded box (STR #2943). + - Full support of Apple 'retina' displays for which one drawing unit + corresponds to two pixels. + - The Mac OS X platform no longer uses the deprecated AGL + (Apple GL library) to draw OpenGL data. Instead, it uses standard + Cocoa APIs. This allows FLTK to support drawing GL scenes at high + resolution when an Fl_Gl_Window is mapped to a 'retina' display. + - Added Fl_Gl_Window::pixel_w(), Fl_Gl_Window::pixel_h(), and + Fl_Gl_Window::pixels_per_unit() useful for high resolution OpenGL windows. + - fl_read_image() now captures all pixels within the rectangle + described by its arguments, whether they belong to a GL scene + or not (STR #3142). It also captures subwindows of GL windows. + - Fl::delete_widget() now hides the widget or window immediately + (i.e. when called) - only destruction is delayed as before. + - FLTK header files don't expose X11 definitions in user code any more + unless requested by including FL/x.H explicitly or implicitly. + - The PostScript code output when printing images under Linux/Unix + is now much smaller by using lossless compression techniques. + - The Linux/Unix printer dialog now uses BSD-style printing commands + (lpr/lpq) when SystemV-style commands (lp/lpstat) are not available. + - Drawing alpha-blended images under X11 is now accelerated with + Xrender. + - The font used for the FL_COURIER font family was changed on the Mac OS X + platform from 'Courier New' to 'Courier' because it was too thin. + - Text drawing on the Mac platform supports Unicode 'variation selectors' + in the range [0xFE00-0xFE0F]. + - Added a Mac OS implementation of Fl_Window::wait_for_expose() that + became necessary with Mac OS 10.10 "Yosemite". + - Added the libfltk target to the Xcode project producing a static + version of the FLTK library (Mac OS X). + - Restored the possibility to call Fl::set_font() before main() starts. + - Allow using the --enable-x11 configure option on the Mac OS platform + which produces an X11 version of the FLTK library (don't use unless + you know what you're doing). + - FLTK code and fluid-generated code can be used in static initializers. + - Added light gray separator line to fluid's widget browser (STR #2997). + - Improved tooltip behavior for huge tooltips: remove flicker, support + key/mouse dismiss (STR #2650). + - Modifier key names displayed in shortcut labels can now be localized. + See documentation of fl_shortcut_label(). You can set modifier key + names for Ctrl, Alt, Shift, and Meta by assigning global string + pointers to your translated modifier key names. + - Many documentation improvements and fixes. + - Fixed many compiler warnings (STR #2988). + - Fluid now generates code with less compiler warnings (STR #2813). + - Many CMake improvements and fixes. Note: CMake is mostly operating + now, but not yet recommended for production use. Please test and + report issues. + - Updated bundled zlib from 1.2.5 to 1.2.8. + - Updated bundled libjpeg from jpeg-8c to jpeg-9a. + + + Bug fixes + + - Fix potential crash when using keyboard navigation on Fl_Tabs + widget without children (STR #3333). + - Fix potential crash if Fl_Window::icon(NULL) was called to clear + (reset) a window icon. This is now legal and documented behavior. + The same applies to Fl_Window::default_icon(). + - Allow widget callback to be NULL, i.e. no callback (STR #2835). + - Fixed Fl_Help_View buffer overflow (STR #3275). + - Fl_Browser now correctly adjusts its scrollbars when the default + text size is changed with textsize(int) (STR #3057). + - Fixed Fl_Text_Display/Fl_Text_Editor slow scrolling, line number + display, wrap mode "hiding" text behind scrollbars, and more + scrollbar handling (alignment) (STR #3272). + - Fixed valgrind warning (uninitialized variable) in Fl_Window. + Visible only with FLTK_ABI_VERSION >= 10303, since FLTK 1.3.3. + - Fixed Windows drag'n'drop not showing insert position if the drop + target is inside the same window or process (STR #3209). + - Fixed undefined reference building shared cairo library (STR #3276). + - Fixed Fl_Browser if text argument to some methods is NULL (STR #3269). + - Fixed missing image release in fluid (STR #2840). + - Fixed out-of-bounds memory access in fluid (STR #3263). + - Fixed trailing white space in fluid .fl files (STR #3239). + - Several box types were not drawn correctly when deactivated. + The background color for deactivated widgets is now correct: + fl_inactive(color()) (STR #2907). + - Fix inconsistent interpretation of ld() in image handling + (STR #3308). This is a minor issue since ld() is usually 0 or + w()*d(). Documentation has been fixed, and ld() handling is now + consistent in Fl_(RGB_)Image and fl_draw_image() and friends. See + documentation of Fl_Image and Fl_RGB_Image for more information. + - Fixed Fl_Pixmap (background) drawing to respect the clip region + (STR #3206). + - Fixed reading .pbm image files: 1 is now interpreted as black, + and images whose width are a multiple of 8 are correctly read. + Note: if you relied on the faulty behavior you may need to fix + your image files. + - Restored window background drawing, particularly the 'plastic' + scheme's background (STR #3059). This was a regression since + FLTK 1.3.0. + - Prevent sending (FL_SHORTCUT) events to inactive widgets (STR #3216). + - Fixed button label clipping (STR #3237). + - Fixed Fl_Menu_::item_pathname() handling of descending submenu + pointers (STR #3177). + - Fl_Text_Display: style buffer colors are no longer manipulated by + fl_contrast() for normal text drawing (fltk.coredev thread started + 04/08/15, Subject: "RFC: Fl_Text_Display style buffer color weirdness") + - Fl_Tree::deactivate() now affects draw color of items (must have + ABI 1.3.3 or higher enabled). For icons to draw deactivated, + enable ABI 1.3.4. (test/tree has a 'deactivate tree' button) + - Fl_Tree::find_item() did not find items if the pathname contained + identical strings (STR #3234). + - Fixed possible bad border effect when a set of radio menu items + is located first in its menu (STR #3176): Fl_Menu_Item::set_only() + is deprecated and replaced by Fl_Menu_::set_only(Fl_Menu_item*). + - Restore the correct state of mouse buttons and keyboard modifier keys + after closing a file or printer dialog (STR #3221). + - Fix for deactivate colors issue with Fl_Text_Display/Editor (STR #3219). + - Fixed issue with MSWindows platform where the program kept running + after closing all its windows (STR #3165). + - Fix potential buffer overflow (MSWindows: BEX64 error) and problem with + MSWindows environment variables "HOME"(MinGW) vs. "UserProfile"(DOS) + - Fix issue with MSWindows platform where a window would decrease + in size after each close/open (STR #3167). + - Fix undefined reference XGetUtf8FontAndGlyph (STR #3191). + - Fix potential keyboard hangup (STR #3192). + - Fix for: .xbm images were not previewed (STR #3131). + - Fixed crash on Mac platform when resizing a not yet shown() Fl_Gl_Window. + - Fixed potential Windows GDI leak (STR #3254). + - Fixed Linux/Unix potential program hang when dialog pops up while + a menu is open (STR #3179). + - Fixed a crash when a Unix/Linux program calls take_focus() before any + window has been show()n. + - Fixed an error on the Mac platform when drawing to an Fl_Image_Surface + object without using the Fl_Image_Surface::draw() method. + - Fixed STR #3268 where a fullscreen window could become relocated + behind the menu bar and dock (Mac OS only). + - Fixed STR #3207: ^C not working when numlock or capslock is on. + - Fixed code editor in Fluid (STR #3184). + - Fixed a potential hangup of the Fl::awake() queue under Windows if + a window is resized or moved while the Fl::awake() message is sent + (STR #3143). + - Fixed a regression: restore the possibility to call + fl_draw_image(buf,X,Y,W,H,D,L) with negative D and/or L arguments. + - Fixed overflow in Fl_Valuator::precision(int) to 0...9 (STR #3280). + + +CHANGES IN FLTK 1.3.3 RELEASED: Nov 03 2014 + + New features and extensions + + - New class Fl_Copy_Surface allows copying graphical data to the + clipboard in a cross-platform way (STR #3058). + - Support for pasting graphical data from the clipboard to a widget. + - New class Fl_Image_Surface allows drawing into an Fl_Image object. + - Methods Fl::add_clipboard_notify() and Fl::remove_clipboard_notify() + to get notifications whenever the clipboard changes (STR #2636). + - New method Fl_Window::wait_for_expose() (STR #3124, STR #3129). + - New bilinear scaling method for RGB images (STR #2869, STR #3062). + - New method Fl_Widget::top_window() (STR #2948). + - New method Fl_Widget::top_window_offset() (part of STR #2944). + - New Fl_Tree_Item methods label_x(), label_y(), label_w(), label_h(). + - New methods Fl::enable_im() and Fl::disable_im() to enable/disable + system Input Methods (IM). + - New methods Fl::add_system_handler() and Fl::remove_system_handler() + to intercept low level system events. + - New FLTK scheme "gleam" (STR #2672). + - New method Fl::is_scheme() to compare the current scheme name. + - New method to set custom icons for windows (STR #2816), + see Fl_Window::icon() for more info. + - New method to set any custom cursor, based on a Fl_RGB_Image object. + Also changed fallback cursors to use this method, so that fallback + cursors are handled in a platform independent manner (STR #2660). + - New ability to convert Fl_Pixmap to Fl_RGB_Image (STR #2659). + - Support for full screen windows over multiple monitors. + - New optional line numbers in Fl_Text_Display and options to control + line numbers and word wrapping (on/off) in example test/editor.cxx. + - On Linux/Unix, class Fl_Native_File_Chooser uses file dialogs from + the Gnome environment (provided by the libgtk dynamic library) if + available, and falls back to Fl_File_Chooser if not (STR #3088). + Use option Fl::OPTION_FNFC_USES_GTK to enable/disable this feature. + - New 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. + + Other improvements + + - Many CMake improvements (e.g. STR #2962, 2977, 2994, 3045, 3055). + - Some autoconf, configure improvements. + - Removed 1024 bytes constraint in labels and browser lines (STR #2990). + - 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. + - Many Mac OS X improvements related to Fl_Sys_Menu_Bar. + - Improved Mac OS X keyboard handling of special keys or combinations. + - General Mac OS X improvements, incl. high resolution (Retina) + displays, and support up to Mac OS X 10.10. + - Documentation improvements and clarifications. + - Printing support improvements, including GL windows. + - Many improvements related to Fl_Tree (some of them only as ABI + breaking features, see below). + - Some static data has been made 'const' to improve memory usage + with shared libraries. + - Don't grab navkeys with modifiers (CTRL, ALT), as the application + may want them (STR #3104). + - Check compiler support of -fvisibility, -fvisibility-inlines-hidden, + and use it, if available. Reduces shared library size. + - Drag'n'drop behaves better now: if text is dropped in the widget it + comes from, then it works like cut and paste. + - Other improvements of DND handling when dragging text from other + applications, e.g. Firefox and Thunderbird. + - Windows message WM_QUIT is processed like SIGTERM, i.e. as a + request to terminate the program. + - Fluid no longer closes the code window when hitting ESC (STR #2997). + - Improved Fl_Widget::when() handling in Fl_Tabs (STR #2939). + - Improved support for more recent compilers (clang and gcc) that + issue more warnings, and fixed some 32-/64-bit compilation issues. + - Added method Fl_Window::clear_modal_states() to make it possible + to remove the modal or non-modal state from a window (STR #3123). + + Bug fixes + + - Fixed word selection dragging in text input (STR #3014). + - Fixed border padding for special cases (STR #3061, Windows only). + - Fixed crash if Fl_Window::flush() called while window not shown() + (STR #3028). + - Fixed segfault in fl_set_fonts_xft.cxx when loading fonts not named + as expected (STR #2976). + - Fixed a memory leak in font loading/allocation (STR #3069). + - Fixed minor memory leaks in handling/freeing of X11 objects. + - Fixed OS X fl_read_image() and Fl_Paged_Device::print_window_part() + when using a Retina display. + - Fixed MinGW build if configure didn't find strcasecmp() (STR #2994). + - Fixed access of protected member under Linux/Unix (STR #2903). + - Fixed various Mac specific OpenGL issues (STR #2944) + - Fixed PostScript printing with non-english locale (STR #3130). + - Fixed a regression in Fl_File_Chooser since FLTK 1.1.8: the + Enter key now selects the file again. + - Fixed a bug in Fl_Native_File_Chooser (Windows) for some file name + input filters (STR #3101). + - Fixed out-of-bounds memory access in Fl_Text_Display (STR #2730). + +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. + + - Added Fl_Window::shape(const Fl_Image*) to create arbitrarily-shaped + windows + - 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. + - Made Fl_Scroll::recalc_scrollbars() protected so that it can be used + in derived widgets to calculate scrollbar visibility and positions. + - 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 + + - 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 + +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 that 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 RELEASED: Nov 06 2012 + + - 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 Windows + 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 RELEASED: Jun 16 2011 + + 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 - See CHANGES_1.1.txt + See CHANGES_1.1.txt CHANGES IN FLTK 1.0 - See CHANGES_1.0.txt + See CHANGES_1.0.txt diff --git a/CMake/Android/abi-version.cmake.in b/CMake/Android/abi-version.cmake.in index d9fe5a341..5200197a9 100644 --- a/CMake/Android/abi-version.cmake.in +++ b/CMake/Android/abi-version.cmake.in @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Configuration file for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ * * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * https://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -25,7 +23,3 @@ /* define FL_ABI_VERSION as 10x0y for FLTK ABI version 1.x.y */ /* #undef FL_ABI_VERSION */ - -/* - * End of "$Id$". - */ diff --git a/CMake/FLTKConfig.cmake.in b/CMake/FLTKConfig.cmake.in index 2fafb4b7a..c93f5f004 100644 --- a/CMake/FLTKConfig.cmake.in +++ b/CMake/FLTKConfig.cmake.in @@ -36,7 +36,3 @@ if (CMAKE_CROSSCOMPILING) else () set (FLTK_FLUID_EXECUTABLE fluid) endif (CMAKE_CROSSCOMPILING) - -# -# End of file -# diff --git a/CMake/FindSDL2.cmake b/CMake/FindSDL2.cmake index 026dc34e7..28cb8c603 100644 --- a/CMake/FindSDL2.cmake +++ b/CMake/FindSDL2.cmake @@ -68,46 +68,46 @@ message("<FindSDL2.cmake>") SET(SDL2_SEARCH_PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt - ${SDL2_PATH} + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + ${SDL2_PATH} ) FIND_PATH(SDL2_INCLUDE_DIR SDL.h - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES include/SDL2 include - PATHS ${SDL2_SEARCH_PATHS} + HINTS + $ENV{SDL2DIR} + PATH_SUFFIXES include/SDL2 include + PATHS ${SDL2_SEARCH_PATHS} ) FIND_LIBRARY(SDL2_LIBRARY_TEMP - NAMES SDL2 - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES lib64 lib - PATHS ${SDL2_SEARCH_PATHS} + NAMES SDL2 + HINTS + $ENV{SDL2DIR} + PATH_SUFFIXES lib64 lib + PATHS ${SDL2_SEARCH_PATHS} ) IF(NOT SDL2_BUILDING_LIBRARY) - IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") - # Non-OS X framework versions expect you to also dynamically link to - # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms - # seem to provide SDL2main for compatibility even though they don't - # necessarily need it. - FIND_LIBRARY(SDL2MAIN_LIBRARY - NAMES SDL2main - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES lib64 lib - PATHS ${SDL2_SEARCH_PATHS} - ) - ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") + IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") + # Non-OS X framework versions expect you to also dynamically link to + # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms + # seem to provide SDL2main for compatibility even though they don't + # necessarily need it. + FIND_LIBRARY(SDL2MAIN_LIBRARY + NAMES SDL2main + HINTS + $ENV{SDL2DIR} + PATH_SUFFIXES lib64 lib + PATHS ${SDL2_SEARCH_PATHS} + ) + ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") ENDIF(NOT SDL2_BUILDING_LIBRARY) # SDL2 may require threads on your system. @@ -115,50 +115,50 @@ ENDIF(NOT SDL2_BUILDING_LIBRARY) # frameworks may already provide it. # But for non-OSX systems, I will use the CMake Threads package. IF(NOT APPLE) - FIND_PACKAGE(Threads) + FIND_PACKAGE(Threads) ENDIF(NOT APPLE) # MinGW needs an additional library, mwindows # It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows # (Actually on second look, I think it only needs one of the m* libraries.) IF(MINGW) - SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") + SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") ENDIF(MINGW) IF(SDL2_LIBRARY_TEMP) - # For SDL2main - IF(NOT SDL2_BUILDING_LIBRARY) - IF(SDL2MAIN_LIBRARY) - SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP}) - ENDIF(SDL2MAIN_LIBRARY) - ENDIF(NOT SDL2_BUILDING_LIBRARY) - - # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa. - # CMake doesn't display the -framework Cocoa string in the UI even - # though it actually is there if I modify a pre-used variable. - # I think it has something to do with the CACHE STRING. - # So I use a temporary variable until the end so I can set the - # "real" variable in one-shot. - IF(APPLE) - SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") - ENDIF(APPLE) - - # For threads, as mentioned Apple doesn't need this. - # In fact, there seems to be a problem if I used the Threads package - # and try using this line, so I'm just skipping it entirely for OS X. - IF(NOT APPLE) - SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) - ENDIF(NOT APPLE) - - # For MinGW library - IF(MINGW) - SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP}) - ENDIF(MINGW) - - # Set the final string here so the GUI reflects the final state. - SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found") - # Set the temp variable to INTERNAL so it is not seen in the CMake GUI - SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "") + # For SDL2main + IF(NOT SDL2_BUILDING_LIBRARY) + IF(SDL2MAIN_LIBRARY) + SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP}) + ENDIF(SDL2MAIN_LIBRARY) + ENDIF(NOT SDL2_BUILDING_LIBRARY) + + # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa. + # CMake doesn't display the -framework Cocoa string in the UI even + # though it actually is there if I modify a pre-used variable. + # I think it has something to do with the CACHE STRING. + # So I use a temporary variable until the end so I can set the + # "real" variable in one-shot. + IF(APPLE) + SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") + ENDIF(APPLE) + + # For threads, as mentioned Apple doesn't need this. + # In fact, there seems to be a problem if I used the Threads package + # and try using this line, so I'm just skipping it entirely for OS X. + IF(NOT APPLE) + SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) + ENDIF(NOT APPLE) + + # For MinGW library + IF(MINGW) + SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP}) + ENDIF(MINGW) + + # Set the final string here so the GUI reflects the final state. + SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found") + # Set the temp variable to INTERNAL so it is not seen in the CMake GUI + SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "") ENDIF(SDL2_LIBRARY_TEMP) message("</FindSDL2.cmake>") diff --git a/CMake/UseFLTK.cmake.in b/CMake/UseFLTK.cmake.in index 20ecb85d6..f9e9e0b6e 100644 --- a/CMake/UseFLTK.cmake.in +++ b/CMake/UseFLTK.cmake.in @@ -13,7 +13,3 @@ message(AUTHOR_WARNING * or later. Please use 'include_directories(\${FLTK_INCLUDE_DIRS})' or * 'target_include_directories(<target> PUBLIC|PRIVATE \${FLTK_INCLUDE_DIRS})' * instead of 'include(\${FLTK_USE_FILE})'.") - -# -# End of file -# diff --git a/CMake/android.cmake b/CMake/android.cmake index 7255af3fe..b5db954cf 100644 --- a/CMake/android.cmake +++ b/CMake/android.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # android.cmake to build the FLTK AndroidStudio project using CMake # Written by Matthias Melcher # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # all target modules will be added here later diff --git a/CMake/export.cmake b/CMake/export.cmake index fecd1bd22..d6c07564a 100644 --- a/CMake/export.cmake +++ b/CMake/export.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # ####################################################################### @@ -79,7 +77,7 @@ configure_file( if (UNIX) execute_process(COMMAND chmod 755 fltk-config - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) endif (UNIX) diff --git a/CMake/install.cmake b/CMake/install.cmake index cb4f8fe71..0ab8e6073 100644 --- a/CMake/install.cmake +++ b/CMake/install.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # ####################################################################### diff --git a/CMake/macros.cmake b/CMake/macros.cmake index 4d5d4581d..b91b80b89 100644 --- a/CMake/macros.cmake +++ b/CMake/macros.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # Macros used by the CMake build system for the Fast Light Tool Kit (FLTK). # Written by Michael Surette # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # ####################################################################### @@ -59,9 +57,9 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) endif (${LIBTYPE} STREQUAL "SHARED") if (MSVC) - set (DEBUG_OUTPUT_NAME "${LIBNAME}d") + set (DEBUG_OUTPUT_NAME "${LIBNAME}d") else () - set (DEBUG_OUTPUT_NAME "${LIBNAME}") + set (DEBUG_OUTPUT_NAME "${LIBNAME}") endif (MSVC) add_library(${TARGET_NAME} ${LIBTYPE} ${LIBFILES}) @@ -72,33 +70,33 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) DEBUG_OUTPUT_NAME ${DEBUG_OUTPUT_NAME} CLEAN_DIRECT_OUTPUT TRUE COMPILE_DEFINITIONS "FL_LIBRARY" - ) + ) if (${LIBTYPE} STREQUAL "SHARED") - set_target_properties(${TARGET_NAME} - PROPERTIES - OUTPUT_NAME ${LIBNAME} - DEBUG_OUTPUT_NAME ${DEBUG_OUTPUT_NAME} - VERSION ${FLTK_VERSION_FULL} - SOVERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR} - PREFIX "lib" # for MSVC static/shared coexistence - ) + set_target_properties(${TARGET_NAME} + PROPERTIES + OUTPUT_NAME ${LIBNAME} + DEBUG_OUTPUT_NAME ${DEBUG_OUTPUT_NAME} + VERSION ${FLTK_VERSION_FULL} + SOVERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR} + PREFIX "lib" # for MSVC static/shared coexistence + ) endif (${LIBTYPE} STREQUAL "SHARED") if (MSVC) - if (OPTION_LARGE_FILE) - set_target_properties(${TARGET_NAME} - PROPERTIES - LINK_FLAGS /LARGEADDRESSAWARE - ) - endif (OPTION_LARGE_FILE) - - if (${LIBTYPE} STREQUAL "SHARED") - set_target_properties(${TARGET_NAME} - PROPERTIES - COMPILE_DEFINITIONS "FL_DLL" - ) - endif (${LIBTYPE} STREQUAL "SHARED") + if (OPTION_LARGE_FILE) + set_target_properties(${TARGET_NAME} + PROPERTIES + LINK_FLAGS /LARGEADDRESSAWARE + ) + endif (OPTION_LARGE_FILE) + + if (${LIBTYPE} STREQUAL "SHARED") + set_target_properties(${TARGET_NAME} + PROPERTIES + COMPILE_DEFINITIONS "FL_DLL" + ) + endif (${LIBTYPE} STREQUAL "SHARED") endif (MSVC) install(TARGETS ${TARGET_NAME} @@ -106,7 +104,7 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) RUNTIME DESTINATION ${FLTK_BINDIR} LIBRARY DESTINATION ${FLTK_LIBDIR} ARCHIVE DESTINATION ${FLTK_LIBDIR} - ) + ) list(APPEND FLTK_LIBRARIES "${TARGET_NAME}") set (FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE) @@ -119,14 +117,14 @@ function(FLTK_RUN_FLUID TARGET SOURCES) set (CXX_FILES) foreach(src ${SOURCES}) if ("${src}" MATCHES "\\.fl$") - string(REGEX REPLACE "(.*).fl" \\1 basename ${src}) - add_custom_command( - OUTPUT "${basename}.cxx" "${basename}.h" - COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/${src} - DEPENDS ${src} - MAIN_DEPENDENCY ${src} - ) - list(APPEND CXX_FILES "${basename}.cxx") + string(REGEX REPLACE "(.*).fl" \\1 basename ${src}) + add_custom_command( + OUTPUT "${basename}.cxx" "${basename}.h" + COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/${src} + DEPENDS ${src} + MAIN_DEPENDENCY ${src} + ) + list(APPEND CXX_FILES "${basename}.cxx") endif ("${src}" MATCHES "\\.fl$") set (${TARGET} ${CXX_FILES} PARENT_SCOPE) endforeach(src) @@ -135,11 +133,11 @@ endfunction(FLTK_RUN_FLUID TARGET SOURCES) ####################################################################### macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) - set (srcs) # source files - set (flsrcs) # fluid source files + set (srcs) # source files + set (flsrcs) # fluid source files - set (tname ${NAME}) # target name - set (oname ${NAME}) # output (executable) name + set (tname ${NAME}) # target name + set (oname ${NAME}) # output (executable) name foreach(src ${SOURCES}) if ("${src}" MATCHES "\\.fl$") @@ -151,7 +149,7 @@ macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) set (FLUID_SOURCES) if (flsrcs) - FLTK_RUN_FLUID(FLUID_SOURCES "${flsrcs}") + FLTK_RUN_FLUID(FLUID_SOURCES "${flsrcs}") endif (flsrcs) if (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL)) diff --git a/CMake/options.cmake b/CMake/options.cmake index 701280806..63412ebc3 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # @@ -12,9 +10,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # set (DEBUG_OPTIONS_CMAKE 0) @@ -471,7 +469,7 @@ if(X11_Xft_FOUND AND OPTION_USE_PANGO) set(USE_PANGO TRUE) list(APPEND FLTK_LDLIBS -lpango-1.0 -lpangoxft-1.0 -lgobject-2.0) else(PANGOXFT_FOUND) - + #this covers Debian, Ubuntu, FreeBSD, NetBSD, Darwin if(APPLE AND OPTION_APPLE_X11) find_file(FINK_PREFIX NAMES /opt/sw /sw) diff --git a/CMake/resources.cmake b/CMake/resources.cmake index 3676d3bc0..4539f6f87 100644 --- a/CMake/resources.cmake +++ b/CMake/resources.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # ####################################################################### @@ -208,31 +206,31 @@ if(HAVE_DLFCN_H) endif(HAVE_DLFCN_H) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) -CHECK_FUNCTION_EXISTS(dlsym HAVE_DLSYM) +CHECK_FUNCTION_EXISTS(dlsym HAVE_DLSYM) set(CMAKE_REQUIRED_LIBRARIES) -CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV) +CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV) if(LIB_png) set(CMAKE_REQUIRED_LIBRARIES ${LIB_png}) - CHECK_FUNCTION_EXISTS(png_get_valid HAVE_PNG_GET_VALID) - CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA) + CHECK_FUNCTION_EXISTS(png_get_valid HAVE_PNG_GET_VALID) + CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA) set(CMAKE_REQUIRED_LIBRARIES) endif(LIB_png) -CHECK_FUNCTION_EXISTS(scandir HAVE_SCANDIR) -CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) +CHECK_FUNCTION_EXISTS(scandir HAVE_SCANDIR) +CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) # not really true but we convert strcasecmp calls to _stricmp calls in flstring.h if(MSVC) set(HAVE_STRCASECMP 1) endif(MSVC) -CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP) +CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP) -CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT) -CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY) -CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF) +CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT) +CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY) +CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF) if(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX) set(MSG "POSIX compatible scandir") @@ -285,7 +283,3 @@ endif (DOXYGEN_FOUND) # Cleanup: unset local variables unset (CMAKE_REQUIRED_QUIET) - -# -# End of "$Id$". -# diff --git a/CMake/setup.cmake b/CMake/setup.cmake index 8a261bc97..8935ed2bf 100644 --- a/CMake/setup.cmake +++ b/CMake/setup.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # ####################################################################### diff --git a/CMake/variables.cmake b/CMake/variables.cmake index 4edf8b749..ebafe7b10 100644 --- a/CMake/variables.cmake +++ b/CMake/variables.cmake @@ -1,6 +1,4 @@ # -# "$Id$" -# # This file sets variables for common use in export.cmake and install.cmake # Written by Michael Surette # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # ####################################################################### diff --git a/CMakeLists.txt b/CMakeLists.txt index e5a1e7fa1..172a949d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,4 @@ # -# "$Id$" -# # Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # Prevent annoying warning under Cygwin; this must be before project(). diff --git a/COPYING b/COPYING index 954207522..de7016947 100644 --- a/COPYING +++ b/COPYING @@ -13,8 +13,8 @@ exceptions: 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 + + https://www.fltk.org/bugs.php 2. Widgets that are subclassed from FLTK widgets do not constitute a derivative work. @@ -42,7 +42,7 @@ exceptions: documentation to satisfy this requirement: [program/widget] is based in part on the work of - the FLTK project (http://www.fltk.org). + the FLTK project (https://www.fltk.org). ----------------------------------------------------------------------- diff --git a/CREDITS.txt b/CREDITS.txt index 28af320b3..440be5d18 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -1,71 +1,71 @@ CREDITS.txt - 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: + 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: - https://www.fltk.org/str.php + https://www.fltk.org/bugs.php CORE DEVELOPERS - The following people do the day-to-day development of FLTK: + The following people do the day-to-day development of FLTK: - Greg Ercolano - Manolo Gouy - Lauri Kasanen - Ian MacArthur - Pierre Ossman - Albrecht Schlosser + Greg Ercolano + Manolo Gouy + Lauri Kasanen + Ian MacArthur + Pierre Ossman + Albrecht Schlosser - These people have previously been active developers of FLTK: + These people have previously been active developers of FLTK: - Fabien Costantini (fabien67@users.sf.net) - Craig P. Earls - Curtis Edwards (trilec@users.sourceforge.net) - Gustavo Hime (hime@users.sourceforge.net) - Talbot Hughes - Robert Kesterson (robertk@users.sourceforge.net) - Matthias Melcher (mm@robowerk.com) - James Dean Palmer (jamespalmer@users.sourceforge.net) - Vincent Penne (vincentp@users.sourceforge.net) - Bill Spitzak (spitzak@users.sourceforge.net) - Michael Sweet (easysw@users.sourceforge.net) - Carl Thompson (clip@users.sourceforge.net) - Nafees Bin Zafar (nafees@users.sourceforge.net) + Fabien Costantini (fabien67@users.sf.net) + Craig P. Earls + Curtis Edwards (trilec@users.sourceforge.net) + Gustavo Hime (hime@users.sourceforge.net) + Talbot Hughes + Robert Kesterson (robertk@users.sourceforge.net) + Matthias Melcher (mm@robowerk.com) + James Dean Palmer (jamespalmer@users.sourceforge.net) + Vincent Penne (vincentp@users.sourceforge.net) + Bill Spitzak (spitzak@users.sourceforge.net) + Michael Sweet (easysw@users.sourceforge.net) + Carl Thompson (clip@users.sourceforge.net) + Nafees Bin Zafar (nafees@users.sourceforge.net) OTHER CONTRIBUTORS - The following people have contributed fixes or enhancements - for FLTK: + 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 - Jean-Marc Lienher (OksiD) - 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 + 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 + Jean-Marc Lienher (OksiD) + 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 diff --git a/DartConfig.cmake b/DartConfig.cmake index 90e1ff663..cbf7adb0a 100644 --- a/DartConfig.cmake +++ b/DartConfig.cmake @@ -9,15 +9,15 @@ SET (DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi") SET (TRIGGER_SITE "http://${DROP_SITE}/cgi-bin/Submit-Fltk-TestingResults.pl") # Project Home Page -SET (PROJECT_URL "http://www.fltk.org") +SET (PROJECT_URL "https://www.fltk.org") -# Dart server configuration +# Dart server configuration SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/fltk-rollup-dashboard.sh") SET (CVS_WEB_URL "http://cvs.sourceforge.net/viewcvs.py/fltk/fltk/") SET (CVS_WEB_CVSROOT "fltk") SET (USE_GNATS "On") -SET (GNATS_WEB_URL "http://www.fltk.org/str.php") +SET (GNATS_WEB_URL "https://www.fltk.org/bugs.php") # Continuous email delivery variables SET (CONTINUOUS_FROM "fltk-dashboard@public.kitware.com") diff --git a/FL/Enumerations.H b/FL/Enumerations.H index cc718aa34..fad9dd964 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Enumerations for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -51,21 +49,21 @@ The major release version of this FLTK library. \see FL_VERSION */ -#define FL_MAJOR_VERSION 1 +#define FL_MAJOR_VERSION 1 /** The minor release version for this library. FLTK remains mostly source-code compatible between minor version changes. */ -#define FL_MINOR_VERSION 4 +#define FL_MINOR_VERSION 4 /** The patch version for this library. FLTK remains binary compatible between patches. */ -#define FL_PATCH_VERSION 0 +#define FL_PATCH_VERSION 0 /** The FLTK version number as a \em double. @@ -88,9 +86,9 @@ \see FL_API_VERSION \see Fl::api_version() */ -#define FL_VERSION ( (double)FL_MAJOR_VERSION + \ - (double)FL_MINOR_VERSION * 0.01 + \ - (double)FL_PATCH_VERSION * 0.0001 ) +#define FL_VERSION ( (double)FL_MAJOR_VERSION + \ + (double)FL_MINOR_VERSION * 0.01 + \ + (double)FL_PATCH_VERSION * 0.0001 ) /** The FLTK API version number as an \em int. @@ -127,7 +125,7 @@ \verbatim FLTK Version FL_API_VERSION FL_ABI_VERSION FL_VERSION (deprecated) 1.3.0 10300 10300 1.0300 - 1.3.4 10304 10300 1.0304 + 1.3.4 10304 10300 1.0304 \endverbatim Version 1.2.3 is actually stored as 10203 to allow for more than 9 @@ -152,7 +150,7 @@ This is done to prevent users from defining an illegal ABI version. Rule: FL_MAJOR_VERSION * 10000 + FL_MINOR_VERSION * 100 - <= FL_ABI_VERSION <= FL_API_VERSION. + <= FL_ABI_VERSION <= FL_API_VERSION. Example (FLTK 1.3.4): @@ -174,19 +172,19 @@ #endif -/*@}*/ // group: Version Numbers +/*@}*/ // group: Version Numbers /** Every time a user moves the mouse pointer, clicks a button, or presses a key, an event is generated and sent to your application. Events can also come from other programs like the window manager. - - Events are identified by the integer argument passed to the - Fl_Widget::handle() virtual method. Other information about the - most recent event is stored in static locations and acquired by - calling the Fl::event_*() methods. This static information remains - valid until the next event is read from the window system, so it + + Events are identified by the integer argument passed to the + Fl_Widget::handle() virtual method. Other information about the + most recent event is stored in static locations and acquired by + calling the Fl::event_*() methods. This static information remains + valid until the next event is read from the window system, so it is ok to look at it outside of the handle() method. Event numbers can be converted to their actual names using the @@ -195,203 +193,203 @@ \see Fl::event_text(), Fl::event_key(), class Fl:: */ // DEV NOTE: Keep this list in sync with FL/names.h -enum Fl_Event { // events +enum Fl_Event { // events /** No event. */ - FL_NO_EVENT = 0, + FL_NO_EVENT = 0, /** A mouse button has gone down with the mouse pointing at this - widget. You can find out what button by calling Fl::event_button(). + widget. You can find out what button by calling Fl::event_button(). You find out the mouse position by calling Fl::event_x() and Fl::event_y(). - A widget indicates that it "wants" the mouse click by returning non-zero - from its Fl_Widget::handle() method. It will then become the - Fl::pushed() widget and will get FL_DRAG and the matching FL_RELEASE events. - If Fl_Widget::handle() returns zero then FLTK will try sending the FL_PUSH - to another widget. + A widget indicates that it "wants" the mouse click by returning non-zero + from its Fl_Widget::handle() method. It will then become the + Fl::pushed() widget and will get FL_DRAG and the matching FL_RELEASE events. + If Fl_Widget::handle() returns zero then FLTK will try sending the FL_PUSH + to another widget. */ - FL_PUSH = 1, + FL_PUSH = 1, - /** A mouse button has been released. You can find out what button by + /** A mouse button has been released. You can find out what button by calling Fl::event_button(). - In order to receive the FL_RELEASE event, the widget must return + In order to receive the FL_RELEASE event, the widget must return non-zero when handling FL_PUSH. */ - FL_RELEASE = 2, + FL_RELEASE = 2, /** The mouse has been moved to point at this widget. This can be used for highlighting feedback. If a widget wants to highlight or otherwise track the mouse, it indicates this by returning non-zero from its handle() method. It then - becomes the Fl::belowmouse() widget and will receive + becomes the Fl::belowmouse() widget and will receive FL_MOVE and FL_LEAVE events. */ - FL_ENTER = 3, + FL_ENTER = 3, /** The mouse has moved out of the widget. - In order to receive the FL_LEAVE event, the widget must + In order to receive the FL_LEAVE event, the widget must return non-zero when handling FL_ENTER. */ - FL_LEAVE = 4, + FL_LEAVE = 4, - /** The mouse has moved with a button held down. The current button state - is in Fl::event_state(). The mouse position is in Fl::event_x() and + /** The mouse has moved with a button held down. The current button state + is in Fl::event_state(). The mouse position is in Fl::event_x() and Fl::event_y(). - In order to receive FL_DRAG events, the widget must return non-zero + In order to receive FL_DRAG events, the widget must return non-zero when handling FL_PUSH. */ - FL_DRAG = 5, + FL_DRAG = 5, /** This indicates an <I>attempt</I> to give a widget the keyboard focus. - If a widget wants the focus, it should change itself to display the + If a widget wants the focus, it should change itself to display the fact that it has the focus, and return non-zero from its handle() method. - It then becomes the Fl::focus() widget and gets FL_KEYDOWN, FL_KEYUP, + It then becomes the Fl::focus() widget and gets FL_KEYDOWN, FL_KEYUP, and FL_UNFOCUS events. - The focus will change either because the window manager changed which - window gets the focus, or because the user tried to navigate using tab, - arrows, or other keys. You can check Fl::event_key() to figure out why - it moved. For navigation it will be the key pressed and for interaction + The focus will change either because the window manager changed which + window gets the focus, or because the user tried to navigate using tab, + arrows, or other keys. You can check Fl::event_key() to figure out why + it moved. For navigation it will be the key pressed and for interaction with the window manager it will be zero. */ - FL_FOCUS = 6, - - /** This event is sent to the previous Fl::focus() widget when another + FL_FOCUS = 6, + + /** This event is sent to the previous Fl::focus() widget when another widget gets the focus or the window loses focus. */ - FL_UNFOCUS = 7, + FL_UNFOCUS = 7, - /** A key was pressed (FL_KEYDOWN) or released (FL_KEYUP). + /** A key was pressed (FL_KEYDOWN) or released (FL_KEYUP). Fl_KEYBOARD is a synonym for FL_KEYDOWN. The key can be found in Fl::event_key(). - The text that the key should insert can be found with Fl::event_text() + The text that the key should insert can be found with Fl::event_text() and its length is in Fl::event_length(). If you use the key handle() - should return 1. If you return zero then FLTK assumes you ignored the - key and will then attempt to send it to a parent widget. If none of + should return 1. If you return zero then FLTK assumes you ignored the + key and will then attempt to send it to a parent widget. If none of them want it, it will change the event into a FL_SHORTCUT event. To receive FL_KEYBOARD events you must also respond to the FL_FOCUS and FL_UNFOCUS events. - If you are writing a text-editing widget you may also want to call - the Fl::compose() function to translate individual keystrokes into + If you are writing a text-editing widget you may also want to call + the Fl::compose() function to translate individual keystrokes into non-ASCII characters. - FL_KEYUP events are sent to the widget that currently has focus. This - is not necessarily the same widget that received the corresponding + FL_KEYUP events are sent to the widget that currently has focus. This + is not necessarily the same widget that received the corresponding FL_KEYDOWN event because focus may have changed between events. */ - FL_KEYDOWN = 8, + FL_KEYDOWN = 8, /** Equivalent to FL_KEYDOWN. \see FL_KEYDOWN */ - FL_KEYBOARD = 8, - + FL_KEYBOARD = 8, + /** Key release event. \see FL_KEYDOWN */ - FL_KEYUP = 9, + FL_KEYUP = 9, /** The user clicked the close button of a window. This event is used internally only to trigger the callback of - Fl_Window derived classed. The default callback closes the + Fl_Window derived classed. The default callback closes the window calling Fl_Window::hide(). */ - FL_CLOSE = 10, + FL_CLOSE = 10, - /** The mouse has moved without any mouse buttons held down. + /** The mouse has moved without any mouse buttons held down. This event is sent to the Fl::belowmouse() widget. - In order to receive FL_MOVE events, the widget must return + In order to receive FL_MOVE events, the widget must return non-zero when handling FL_ENTER. */ - FL_MOVE = 11, + FL_MOVE = 11, /** If the Fl::focus() widget is zero or ignores an FL_KEYBOARD - event then FLTK tries sending this event to every widget it - can, until one of them returns non-zero. FL_SHORTCUT is first - sent to the Fl::belowmouse() widget, then its parents and siblings, - and eventually to every widget in the window, trying to find an - object that returns non-zero. FLTK tries really hard to not to ignore + event then FLTK tries sending this event to every widget it + can, until one of them returns non-zero. FL_SHORTCUT is first + sent to the Fl::belowmouse() widget, then its parents and siblings, + and eventually to every widget in the window, trying to find an + object that returns non-zero. FLTK tries really hard to not to ignore any keystrokes! - You can also make "global" shortcuts by using Fl::add_handler(). A - global shortcut will work no matter what windows are displayed or + You can also make "global" shortcuts by using Fl::add_handler(). A + global shortcut will work no matter what windows are displayed or which one has the focus. */ - FL_SHORTCUT = 12, + FL_SHORTCUT = 12, - /** This widget is no longer active, due to Fl_Widget::deactivate() - being called on it or one of its parents. Fl_Widget::active() may + /** This widget is no longer active, due to Fl_Widget::deactivate() + being called on it or one of its parents. Fl_Widget::active() may still be true after this, the widget is only active if Fl_Widget::active() is true on it and all its parents (use Fl_Widget::active_r() to check this). */ - FL_DEACTIVATE = 13, + FL_DEACTIVATE = 13, - /** This widget is now active, due to Fl_Widget::activate() being + /** This widget is now active, due to Fl_Widget::activate() being called on it or one of its parents. */ - FL_ACTIVATE = 14, + FL_ACTIVATE = 14, - /** This widget is no longer visible, due to Fl_Widget::hide() being - called on it or one of its parents, or due to a parent window being - minimized. Fl_Widget::visible() may still be true after this, but the - widget is visible only if visible() is true for it and all its + /** This widget is no longer visible, due to Fl_Widget::hide() being + called on it or one of its parents, or due to a parent window being + minimized. Fl_Widget::visible() may still be true after this, but the + widget is visible only if visible() is true for it and all its parents (use Fl_Widget::visible_r() to check this). */ - FL_HIDE = 15, + FL_HIDE = 15, - /** This widget is visible again, due to Fl_Widget::show() being called on - it or one of its parents, or due to a parent window being restored. - Child Fl_Windows respond to this by actually creating the window if not - done already, so if you subclass a window, be sure to pass FL_SHOW + /** This widget is visible again, due to Fl_Widget::show() being called on + it or one of its parents, or due to a parent window being restored. + Child Fl_Windows respond to this by actually creating the window if not + done already, so if you subclass a window, be sure to pass FL_SHOW to the base class Fl_Widget::handle() method! */ - FL_SHOW = 16, + FL_SHOW = 16, - /** You should get this event some time after you call Fl::paste(). - The contents of Fl::event_text() is the text to insert and the number + /** You should get this event some time after you call Fl::paste(). + The contents of Fl::event_text() is the text to insert and the number of characters is in Fl::event_length(). */ - FL_PASTE = 17, + FL_PASTE = 17, - /** The Fl::selection_owner() will get this event before the selection is - moved to another widget. This indicates that some other widget or program - has claimed the selection. Motif programs used this to clear the selection + /** The Fl::selection_owner() will get this event before the selection is + moved to another widget. This indicates that some other widget or program + has claimed the selection. Motif programs used this to clear the selection indication. Most modern programs ignore this. */ - FL_SELECTIONCLEAR = 18, + FL_SELECTIONCLEAR = 18, /** The user has moved the mouse wheel. The Fl::event_dx() and Fl::event_dy() methods can be used to find the amount to scroll horizontally and vertically. */ - FL_MOUSEWHEEL = 19, + FL_MOUSEWHEEL = 19, - /** The mouse has been moved to point at this widget. A widget that is - interested in receiving drag'n'drop data must return 1 to receive + /** The mouse has been moved to point at this widget. A widget that is + interested in receiving drag'n'drop data must return 1 to receive FL_DND_DRAG, FL_DND_LEAVE and FL_DND_RELEASE events. */ - FL_DND_ENTER = 20, + FL_DND_ENTER = 20, - /** The mouse has been moved inside a widget while dragging data. A - widget that is interested in receiving drag'n'drop data should + /** The mouse has been moved inside a widget while dragging data. A + widget that is interested in receiving drag'n'drop data should indicate the possible drop position. */ - FL_DND_DRAG = 21, + FL_DND_DRAG = 21, /** The mouse has moved out of the widget. */ - FL_DND_LEAVE = 22, + FL_DND_LEAVE = 22, - /** The user has released the mouse button dropping data into the widget. - If the widget returns 1, it will receive the data in the immediately + /** The user has released the mouse button dropping data into the widget. + If the widget returns 1, it will receive the data in the immediately following FL_PASTE event. */ - FL_DND_RELEASE = 23, + FL_DND_RELEASE = 23, /** The screen configuration (number, positions) was changed. Use Fl::add_handler() to be notified of this event. */ @@ -405,7 +403,7 @@ enum Fl_Event { // events Fl::event_x() and Fl::event_y() are set as well. This event is sent to the window's handle method. */ - FL_ZOOM_GESTURE = 26, + FL_ZOOM_GESTURE = 26, /** A zoom event (ctrl/+/-/0/ or cmd/+/-/0/) was processed. Use Fl::add_handler() to be notified of this event. */ @@ -421,17 +419,17 @@ enum Fl_Event { // events \todo doxygen comments for values are incomplete and maybe wrong or unclear */ enum Fl_When { // Fl_Widget::when(): - FL_WHEN_NEVER = 0, ///< Never call the callback - FL_WHEN_CHANGED = 1, ///< Do the callback only when the widget value changes - FL_WHEN_NOT_CHANGED = 2, ///< Do the callback whenever the user interacts with the widget - FL_WHEN_RELEASE = 4, ///< Do the callback when the button or key is released and the value changes - FL_WHEN_RELEASE_ALWAYS= 6, ///< Do the callback when the button or key is released, even if the value doesn't change - FL_WHEN_ENTER_KEY = 8, ///< Do the callback when the user presses the ENTER key and the value changes - FL_WHEN_ENTER_KEY_ALWAYS=10, ///< Do the callback when the user presses the ENTER key, even if the value doesn't change - FL_WHEN_ENTER_KEY_CHANGED=11 ///< ? + FL_WHEN_NEVER = 0, ///< Never call the callback + FL_WHEN_CHANGED = 1, ///< Do the callback only when the widget value changes + FL_WHEN_NOT_CHANGED = 2, ///< Do the callback whenever the user interacts with the widget + FL_WHEN_RELEASE = 4, ///< Do the callback when the button or key is released and the value changes + FL_WHEN_RELEASE_ALWAYS= 6, ///< Do the callback when the button or key is released, even if the value doesn't change + FL_WHEN_ENTER_KEY = 8, ///< Do the callback when the user presses the ENTER key and the value changes + FL_WHEN_ENTER_KEY_ALWAYS=10, ///< Do the callback when the user presses the ENTER key, even if the value doesn't change + FL_WHEN_ENTER_KEY_CHANGED=11 ///< ? }; -/*@}*/ // group: When Conditions +/*@}*/ // group: When Conditions /** \name Mouse and Keyboard Events @@ -441,53 +439,53 @@ enum Fl_When { // Fl_Widget::when(): \see Fl::event_key() and Fl::get_key(int) (use ASCII letters for all other keys): \todo FL_Button and FL_key... constants could be structured better - (use an enum or some doxygen grouping ?) + (use an enum or some doxygen grouping ?) */ /*@{*/ // FIXME: These codes collide with valid Unicode keys -#define FL_Button 0xfee8 ///< A mouse button; use Fl_Button + n for mouse button n. -#define FL_BackSpace 0xff08 ///< The backspace key. -#define FL_Tab 0xff09 ///< The tab key. -#define FL_Iso_Key 0xff0c ///< The additional key of ISO keyboards. -#define FL_Enter 0xff0d ///< The enter key. -#define FL_Pause 0xff13 ///< The pause key. -#define FL_Scroll_Lock 0xff14 ///< The scroll lock key. -#define FL_Escape 0xff1b ///< The escape key. +#define FL_Button 0xfee8 ///< A mouse button; use Fl_Button + n for mouse button n. +#define FL_BackSpace 0xff08 ///< The backspace key. +#define FL_Tab 0xff09 ///< The tab key. +#define FL_Iso_Key 0xff0c ///< The additional key of ISO keyboards. +#define FL_Enter 0xff0d ///< The enter key. +#define FL_Pause 0xff13 ///< The pause key. +#define FL_Scroll_Lock 0xff14 ///< The scroll lock key. +#define FL_Escape 0xff1b ///< The escape key. #define FL_Kana 0xff2e ///< The Kana key of JIS keyboards. #define FL_Eisu 0xff2f ///< The Eisu key of JIS keyboards. #define FL_Yen 0xff30 ///< The Yen key of JIS keyboards. #define FL_JIS_Underscore 0xff31 ///< The underscore key of JIS keyboards. -#define FL_Home 0xff50 ///< The home key. -#define FL_Left 0xff51 ///< The left arrow key. -#define FL_Up 0xff52 ///< The up arrow key. -#define FL_Right 0xff53 ///< The right arrow key. -#define FL_Down 0xff54 ///< The down arrow key. -#define FL_Page_Up 0xff55 ///< The page-up key. -#define FL_Page_Down 0xff56 ///< The page-down key. -#define FL_End 0xff57 ///< The end key. -#define FL_Print 0xff61 ///< The print (or print-screen) key. -#define FL_Insert 0xff63 ///< The insert key. -#define FL_Menu 0xff67 ///< The menu key. -#define FL_Help 0xff68 ///< The 'help' key on Mac keyboards -#define FL_Num_Lock 0xff7f ///< The num lock key. -#define FL_KP 0xff80 ///< One of the keypad numbers; use FL_KP + 'n' for digit n. -#define FL_KP_Enter 0xff8d ///< The enter key on the keypad, same as Fl_KP+'\\r'. -#define FL_KP_Last 0xffbd ///< The last keypad key; use to range-check keypad. -#define FL_F 0xffbd ///< One of the function keys; use FL_F + n for function key n. -#define FL_F_Last 0xffe0 ///< The last function key; use to range-check function keys. -#define FL_Shift_L 0xffe1 ///< The lefthand shift key. -#define FL_Shift_R 0xffe2 ///< The righthand shift key. -#define FL_Control_L 0xffe3 ///< The lefthand control key. -#define FL_Control_R 0xffe4 ///< The righthand control key. -#define FL_Caps_Lock 0xffe5 ///< The caps lock key. -#define FL_Meta_L 0xffe7 ///< The left meta/Windows key. -#define FL_Meta_R 0xffe8 ///< The right meta/Windows key. -#define FL_Alt_L 0xffe9 ///< The left alt key. -#define FL_Alt_R 0xffea ///< The right alt key. -#define FL_Delete 0xffff ///< The delete key. +#define FL_Home 0xff50 ///< The home key. +#define FL_Left 0xff51 ///< The left arrow key. +#define FL_Up 0xff52 ///< The up arrow key. +#define FL_Right 0xff53 ///< The right arrow key. +#define FL_Down 0xff54 ///< The down arrow key. +#define FL_Page_Up 0xff55 ///< The page-up key. +#define FL_Page_Down 0xff56 ///< The page-down key. +#define FL_End 0xff57 ///< The end key. +#define FL_Print 0xff61 ///< The print (or print-screen) key. +#define FL_Insert 0xff63 ///< The insert key. +#define FL_Menu 0xff67 ///< The menu key. +#define FL_Help 0xff68 ///< The 'help' key on Mac keyboards +#define FL_Num_Lock 0xff7f ///< The num lock key. +#define FL_KP 0xff80 ///< One of the keypad numbers; use FL_KP + 'n' for digit n. +#define FL_KP_Enter 0xff8d ///< The enter key on the keypad, same as Fl_KP+'\\r'. +#define FL_KP_Last 0xffbd ///< The last keypad key; use to range-check keypad. +#define FL_F 0xffbd ///< One of the function keys; use FL_F + n for function key n. +#define FL_F_Last 0xffe0 ///< The last function key; use to range-check function keys. +#define FL_Shift_L 0xffe1 ///< The lefthand shift key. +#define FL_Shift_R 0xffe2 ///< The righthand shift key. +#define FL_Control_L 0xffe3 ///< The lefthand control key. +#define FL_Control_R 0xffe4 ///< The righthand control key. +#define FL_Caps_Lock 0xffe5 ///< The caps lock key. +#define FL_Meta_L 0xffe7 ///< The left meta/Windows key. +#define FL_Meta_R 0xffe8 ///< The right meta/Windows key. +#define FL_Alt_L 0xffe9 ///< The left alt key. +#define FL_Alt_R 0xffea ///< The right alt key. +#define FL_Delete 0xffff ///< The delete key. // These use the Private Use Area (PUA) of the Basic Multilingual Plane // of Unicode. Guaranteed not to conflict with a proper Unicode character. @@ -510,7 +508,7 @@ enum Fl_When { // Fl_Widget::when(): #define FL_Sleep 0xEF2F /* Put system to sleep */ #define FL_Favorites 0xEF30 /* Show favorite locations */ -/*@}*/ // group: Mouse and Keyboard Events +/*@}*/ // group: Mouse and Keyboard Events /** \name Mouse Buttons @@ -521,43 +519,43 @@ enum Fl_When { // Fl_Widget::when(): /*@{*/ -#define FL_LEFT_MOUSE 1 ///< The left mouse button -#define FL_MIDDLE_MOUSE 2 ///< The middle mouse button -#define FL_RIGHT_MOUSE 3 ///< The right mouse button +#define FL_LEFT_MOUSE 1 ///< The left mouse button +#define FL_MIDDLE_MOUSE 2 ///< The middle mouse button +#define FL_RIGHT_MOUSE 3 ///< The right mouse button -/*@}*/ // group: Mouse Buttons +/*@}*/ // group: Mouse Buttons -/** \name Event States +/** \name Event States - The following constants define bits in the Fl::event_state() value. + The following constants define bits in the Fl::event_state() value. */ -/*@{*/ // group: Event States +/*@{*/ // group: Event States // FIXME: it would be nice to have the modifiers in the upper 8 bit so that // a unicode key (24bit) can be sent as an unsigned with the modifiers. -#define FL_SHIFT 0x00010000 ///< One of the shift keys is down -#define FL_CAPS_LOCK 0x00020000 ///< The caps lock is on -#define FL_CTRL 0x00040000 ///< One of the ctrl keys is down -#define FL_ALT 0x00080000 ///< One of the alt keys is down -#define FL_NUM_LOCK 0x00100000 ///< The num lock is on - // most X servers do this? -#define FL_META 0x00400000 ///< One of the meta/Windows keys is down - // correct for XFree86 -#define FL_SCROLL_LOCK 0x00800000 ///< The scroll lock is on - // correct for XFree86 -#define FL_BUTTON1 0x01000000 ///< Mouse button 1 is pushed -#define FL_BUTTON2 0x02000000 ///< Mouse button 2 is pushed -#define FL_BUTTON3 0x04000000 ///< Mouse button 3 is pushed -#define FL_BUTTONS 0x7f000000 ///< Any mouse button is pushed -#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n > 0) is pushed - -#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now - // FIXME: Unicode needs 24 bits! - -/*@}*/ // group: Event States +#define FL_SHIFT 0x00010000 ///< One of the shift keys is down +#define FL_CAPS_LOCK 0x00020000 ///< The caps lock is on +#define FL_CTRL 0x00040000 ///< One of the ctrl keys is down +#define FL_ALT 0x00080000 ///< One of the alt keys is down +#define FL_NUM_LOCK 0x00100000 ///< The num lock is on + // most X servers do this? +#define FL_META 0x00400000 ///< One of the meta/Windows keys is down + // correct for XFree86 +#define FL_SCROLL_LOCK 0x00800000 ///< The scroll lock is on + // correct for XFree86 +#define FL_BUTTON1 0x01000000 ///< Mouse button 1 is pushed +#define FL_BUTTON2 0x02000000 ///< Mouse button 2 is pushed +#define FL_BUTTON3 0x04000000 ///< Mouse button 3 is pushed +#define FL_BUTTONS 0x7f000000 ///< Any mouse button is pushed +#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n > 0) is pushed + +#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now + // FIXME: Unicode needs 24 bits! + +/*@}*/ // group: Event States /** \name Box Types \brief FLTK standard box types @@ -570,20 +568,20 @@ enum Fl_When { // Fl_Widget::when(): leading underscore in your code! Enum values with leading underscores are reserved for internal use and subject to change without notice! - FL_NO_BOX means nothing is drawn at all, so whatever is already - on the screen remains. The FL_..._FRAME types only draw their edges, - leaving the interior unchanged. The blue color in Figure 1 + FL_NO_BOX means nothing is drawn at all, so whatever is already + on the screen remains. The FL_..._FRAME types only draw their edges, + leaving the interior unchanged. The blue color in Figure 1 is the area that is not drawn by the frame types. \image html boxtypes.png "Figure 1: FLTK standard box types" \image latex boxtypes.png "FLTK standard box types" width=10cm - \todo Description of boxtypes is incomplete. - See below for the defined enum Fl_Boxtype. - \see src/Fl_get_system_colors.cxx + \todo Description of boxtypes is incomplete. + See below for the defined enum Fl_Boxtype. + \see src/Fl_get_system_colors.cxx */ -/*@{*/ // group: Box Types +/*@{*/ // group: Box Types /** \brief FLTK standard box types @@ -599,63 +597,63 @@ enum Fl_When { // Fl_Widget::when(): */ enum Fl_Boxtype { // boxtypes (if you change these you must also change fl_boxtype.cxx): - FL_NO_BOX = 0, ///< nothing is drawn at all, this box is invisible - FL_FLAT_BOX, ///< a flat box - FL_UP_BOX, ///< see figure 1 - FL_DOWN_BOX, ///< see figure 1 - FL_UP_FRAME, ///< see figure 1 - FL_DOWN_FRAME, ///< see figure 1 - FL_THIN_UP_BOX, ///< see figure 1 - FL_THIN_DOWN_BOX, ///< see figure 1 - FL_THIN_UP_FRAME, ///< see figure 1 - FL_THIN_DOWN_FRAME, ///< see figure 1 - FL_ENGRAVED_BOX, ///< see figure 1 - FL_EMBOSSED_BOX, ///< see figure 1 - FL_ENGRAVED_FRAME, ///< see figure 1 - FL_EMBOSSED_FRAME, ///< see figure 1 - FL_BORDER_BOX, ///< see figure 1 - _FL_SHADOW_BOX, ///< see figure 1, use FL_SHADOW_BOX - FL_BORDER_FRAME, ///< see figure 1 - _FL_SHADOW_FRAME, ///< see figure 1, use FL_SHADOW_FRAME - _FL_ROUNDED_BOX, ///< see figure 1, use FL_ROUNDED_BOX - _FL_RSHADOW_BOX, ///< see figure 1, use FL_RSHADOW_BOX - _FL_ROUNDED_FRAME, ///< see figure 1, use FL_ROUNDED_FRAME - _FL_RFLAT_BOX, ///< see figure 1, use FL_RFLAT_BOX - _FL_ROUND_UP_BOX, ///< see figure 1, use FL_ROUND_UP_BOX - _FL_ROUND_DOWN_BOX, ///< see figure 1, use FL_ROUND_DOWN_BOX - _FL_DIAMOND_UP_BOX, ///< see figure 1, use FL_DIAMOND_UP_BOX - _FL_DIAMOND_DOWN_BOX, ///< see figure 1, use FL_DIAMOND_DOWN_BOX - _FL_OVAL_BOX, ///< see figure 1, use FL_OVAL_BOX - _FL_OSHADOW_BOX, ///< see figure 1, use FL_OSHADOW_BOX - _FL_OVAL_FRAME, ///< see figure 1, use FL_OVAL_FRAME - _FL_OFLAT_BOX, ///< see figure 1, use FL_OFLAT_BOX - _FL_PLASTIC_UP_BOX, ///< plastic version of FL_UP_BOX, use FL_PLASTIC_UP_BOX - _FL_PLASTIC_DOWN_BOX, ///< plastic version of FL_DOWN_BOX, use FL_PLASTIC_DOWN_BOX - _FL_PLASTIC_UP_FRAME, ///< plastic version of FL_UP_FRAME, use FL_PLASTIC_UP_FRAME - _FL_PLASTIC_DOWN_FRAME, ///< plastic version of FL_DOWN_FRAME, use FL_PLASTIC_DOWN_FRAME - _FL_PLASTIC_THIN_UP_BOX, ///< plastic version of FL_THIN_UP_BOX, use FL_PLASTIC_THIN_UP_BOX - _FL_PLASTIC_THIN_DOWN_BOX, ///< plastic version of FL_THIN_DOWN_BOX, use FL_PLASTIC_THIN_DOWN_BOX - _FL_PLASTIC_ROUND_UP_BOX, ///< plastic version of FL_ROUND_UP_BOX, use FL_PLASTIC_ROUND_UP_BOX - _FL_PLASTIC_ROUND_DOWN_BOX, ///< plastic version of FL_ROUND_DOWN_BOX, use FL_PLASTIC_ROUND_DOWN_BOX - _FL_GTK_UP_BOX, ///< gtk+ version of FL_UP_BOX, use FL_GTK_UP_BOX - _FL_GTK_DOWN_BOX, ///< gtk+ version of FL_DOWN_BOX, use FL_GTK_DOWN_BOX - _FL_GTK_UP_FRAME, ///< gtk+ version of FL_UP_FRAME, use FL_GTK_UP_FRAME - _FL_GTK_DOWN_FRAME, ///< gtk+ version of FL_DOWN_FRAME, use FL_GTK_DOWN_FRAME - _FL_GTK_THIN_UP_BOX, ///< gtk+ version of FL_THIN_UP_BOX, use FL_GTK_THIN_UP_BOX - _FL_GTK_THIN_DOWN_BOX, ///< gtk+ version of FL_THIN_DOWN_BOX, use FL_GTK_THIN_DOWN_BOX - _FL_GTK_THIN_UP_FRAME, ///< gtk+ version of FL_THIN_UP_FRAME, use FL_GTK_THIN_UP_FRAME - _FL_GTK_THIN_DOWN_FRAME, ///< gtk+ version of FL_THIN_DOWN_FRAME, use FL_GTK_THIN_DOWN_FRAME - _FL_GTK_ROUND_UP_BOX, ///< gtk+ version of FL_ROUND_UP_BOX, use FL_GTK_ROUND_UP_BOX - _FL_GTK_ROUND_DOWN_BOX, ///< gtk+ version of FL_ROUND_DOWN_BOX, use FL_GTK_ROUND_DOWN_BOX - _FL_GLEAM_UP_BOX, ///< gleam version of FL_UP_BOX, use FL_GLEAM_UP_BOX - _FL_GLEAM_DOWN_BOX, ///< gleam version of FL_DOWN_BOX, use FL_GLEAM_DOWN_BOX - _FL_GLEAM_UP_FRAME, ///< gleam version of FL_UP_FRAME, use FL_GLEAM_UP_FRAME - _FL_GLEAM_DOWN_FRAME, ///< gleam version of FL_DOWN_FRAME, use FL_GLEAM_DOWN_FRAME - _FL_GLEAM_THIN_UP_BOX, ///< gleam version of FL_THIN_UP_BOX, use FL_GLEAM_THIN_UP_BOX - _FL_GLEAM_THIN_DOWN_BOX, ///< gleam version of FL_THIN_DOWN_BOX, use FL_GLEAM_THIN_DOWN_BOX - _FL_GLEAM_ROUND_UP_BOX, ///< gleam version of FL_ROUND_UP_BOX, use FL_GLEAM_ROUND_UP_BOX - _FL_GLEAM_ROUND_DOWN_BOX, ///< gleam version of FL_ROUND_DOWN_BOX, use FL_GLEAM_ROUND_DOWN_BOX - FL_FREE_BOXTYPE ///< the first free box type for creation of new box types + FL_NO_BOX = 0, ///< nothing is drawn at all, this box is invisible + FL_FLAT_BOX, ///< a flat box + FL_UP_BOX, ///< see figure 1 + FL_DOWN_BOX, ///< see figure 1 + FL_UP_FRAME, ///< see figure 1 + FL_DOWN_FRAME, ///< see figure 1 + FL_THIN_UP_BOX, ///< see figure 1 + FL_THIN_DOWN_BOX, ///< see figure 1 + FL_THIN_UP_FRAME, ///< see figure 1 + FL_THIN_DOWN_FRAME, ///< see figure 1 + FL_ENGRAVED_BOX, ///< see figure 1 + FL_EMBOSSED_BOX, ///< see figure 1 + FL_ENGRAVED_FRAME, ///< see figure 1 + FL_EMBOSSED_FRAME, ///< see figure 1 + FL_BORDER_BOX, ///< see figure 1 + _FL_SHADOW_BOX, ///< see figure 1, use FL_SHADOW_BOX + FL_BORDER_FRAME, ///< see figure 1 + _FL_SHADOW_FRAME, ///< see figure 1, use FL_SHADOW_FRAME + _FL_ROUNDED_BOX, ///< see figure 1, use FL_ROUNDED_BOX + _FL_RSHADOW_BOX, ///< see figure 1, use FL_RSHADOW_BOX + _FL_ROUNDED_FRAME, ///< see figure 1, use FL_ROUNDED_FRAME + _FL_RFLAT_BOX, ///< see figure 1, use FL_RFLAT_BOX + _FL_ROUND_UP_BOX, ///< see figure 1, use FL_ROUND_UP_BOX + _FL_ROUND_DOWN_BOX, ///< see figure 1, use FL_ROUND_DOWN_BOX + _FL_DIAMOND_UP_BOX, ///< see figure 1, use FL_DIAMOND_UP_BOX + _FL_DIAMOND_DOWN_BOX, ///< see figure 1, use FL_DIAMOND_DOWN_BOX + _FL_OVAL_BOX, ///< see figure 1, use FL_OVAL_BOX + _FL_OSHADOW_BOX, ///< see figure 1, use FL_OSHADOW_BOX + _FL_OVAL_FRAME, ///< see figure 1, use FL_OVAL_FRAME + _FL_OFLAT_BOX, ///< see figure 1, use FL_OFLAT_BOX + _FL_PLASTIC_UP_BOX, ///< plastic version of FL_UP_BOX, use FL_PLASTIC_UP_BOX + _FL_PLASTIC_DOWN_BOX, ///< plastic version of FL_DOWN_BOX, use FL_PLASTIC_DOWN_BOX + _FL_PLASTIC_UP_FRAME, ///< plastic version of FL_UP_FRAME, use FL_PLASTIC_UP_FRAME + _FL_PLASTIC_DOWN_FRAME, ///< plastic version of FL_DOWN_FRAME, use FL_PLASTIC_DOWN_FRAME + _FL_PLASTIC_THIN_UP_BOX, ///< plastic version of FL_THIN_UP_BOX, use FL_PLASTIC_THIN_UP_BOX + _FL_PLASTIC_THIN_DOWN_BOX, ///< plastic version of FL_THIN_DOWN_BOX, use FL_PLASTIC_THIN_DOWN_BOX + _FL_PLASTIC_ROUND_UP_BOX, ///< plastic version of FL_ROUND_UP_BOX, use FL_PLASTIC_ROUND_UP_BOX + _FL_PLASTIC_ROUND_DOWN_BOX, ///< plastic version of FL_ROUND_DOWN_BOX, use FL_PLASTIC_ROUND_DOWN_BOX + _FL_GTK_UP_BOX, ///< gtk+ version of FL_UP_BOX, use FL_GTK_UP_BOX + _FL_GTK_DOWN_BOX, ///< gtk+ version of FL_DOWN_BOX, use FL_GTK_DOWN_BOX + _FL_GTK_UP_FRAME, ///< gtk+ version of FL_UP_FRAME, use FL_GTK_UP_FRAME + _FL_GTK_DOWN_FRAME, ///< gtk+ version of FL_DOWN_FRAME, use FL_GTK_DOWN_FRAME + _FL_GTK_THIN_UP_BOX, ///< gtk+ version of FL_THIN_UP_BOX, use FL_GTK_THIN_UP_BOX + _FL_GTK_THIN_DOWN_BOX, ///< gtk+ version of FL_THIN_DOWN_BOX, use FL_GTK_THIN_DOWN_BOX + _FL_GTK_THIN_UP_FRAME, ///< gtk+ version of FL_THIN_UP_FRAME, use FL_GTK_THIN_UP_FRAME + _FL_GTK_THIN_DOWN_FRAME, ///< gtk+ version of FL_THIN_DOWN_FRAME, use FL_GTK_THIN_DOWN_FRAME + _FL_GTK_ROUND_UP_BOX, ///< gtk+ version of FL_ROUND_UP_BOX, use FL_GTK_ROUND_UP_BOX + _FL_GTK_ROUND_DOWN_BOX, ///< gtk+ version of FL_ROUND_DOWN_BOX, use FL_GTK_ROUND_DOWN_BOX + _FL_GLEAM_UP_BOX, ///< gleam version of FL_UP_BOX, use FL_GLEAM_UP_BOX + _FL_GLEAM_DOWN_BOX, ///< gleam version of FL_DOWN_BOX, use FL_GLEAM_DOWN_BOX + _FL_GLEAM_UP_FRAME, ///< gleam version of FL_UP_FRAME, use FL_GLEAM_UP_FRAME + _FL_GLEAM_DOWN_FRAME, ///< gleam version of FL_DOWN_FRAME, use FL_GLEAM_DOWN_FRAME + _FL_GLEAM_THIN_UP_BOX, ///< gleam version of FL_THIN_UP_BOX, use FL_GLEAM_THIN_UP_BOX + _FL_GLEAM_THIN_DOWN_BOX, ///< gleam version of FL_THIN_DOWN_BOX, use FL_GLEAM_THIN_DOWN_BOX + _FL_GLEAM_ROUND_UP_BOX, ///< gleam version of FL_ROUND_UP_BOX, use FL_GLEAM_ROUND_UP_BOX + _FL_GLEAM_ROUND_DOWN_BOX, ///< gleam version of FL_ROUND_DOWN_BOX, use FL_GLEAM_ROUND_DOWN_BOX + FL_FREE_BOXTYPE ///< the first free box type for creation of new box types }; extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX(); #define FL_ROUND_UP_BOX fl_define_FL_ROUND_UP_BOX() @@ -743,7 +741,7 @@ inline Fl_Boxtype fl_frame(Fl_Boxtype b) { #define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX #define FL_DIAMOND_BOX FL_DIAMOND_DOWN_BOX -/*@}*/ // group: Box Types +/*@}*/ // group: Box Types /** The labeltype() method sets the type of the label. @@ -896,9 +894,9 @@ extern Fl_Labeltype FL_EXPORT fl_define_FL_IMAGE_LABEL(); -# Although bits can be or'd together there are some unused/illegal combinations, for instance: - setting both FL_ALIGN_TOP and FL_ALIGN_BOTTOM in combinations other - than those given in the \p Fl_Align constants below (magic values) + than those given in the \p Fl_Align constants below (magic values) - setting both FL_ALIGN_LEFT and FL_ALIGN_RIGHT in combinations other - than those given in the \p Fl_Align constants below (magic values) + than those given in the \p Fl_Align constants below (magic values) - using one of the "magic values" (2) together with FL_ALIGN_INSIDE \note Using illegal bit combinations or undefined bits may yield unexpected @@ -910,37 +908,37 @@ extern Fl_Labeltype FL_EXPORT fl_define_FL_IMAGE_LABEL(); typedef unsigned Fl_Align; /** Align the label horizontally in the middle. */ -const Fl_Align FL_ALIGN_CENTER = 0x0000; +const Fl_Align FL_ALIGN_CENTER = 0x0000; /** Align the label at the top of the widget. Inside labels appear below the top, outside labels are drawn on top of the widget. */ -const Fl_Align FL_ALIGN_TOP = 0x0001; +const Fl_Align FL_ALIGN_TOP = 0x0001; /** Align the label at the bottom of the widget. */ -const Fl_Align FL_ALIGN_BOTTOM = 0x0002; +const Fl_Align FL_ALIGN_BOTTOM = 0x0002; /** Align the label at the left of the widget. Inside labels appear left-justified starting at the left side of the widget, outside labels are right-justified and drawn to the left of the widget. */ -const Fl_Align FL_ALIGN_LEFT = 0x0004; +const Fl_Align FL_ALIGN_LEFT = 0x0004; /** Align the label to the right of the widget. */ -const Fl_Align FL_ALIGN_RIGHT = 0x0008; +const Fl_Align FL_ALIGN_RIGHT = 0x0008; /** Draw the label inside of the widget. */ -const Fl_Align FL_ALIGN_INSIDE = 0x0010; +const Fl_Align FL_ALIGN_INSIDE = 0x0010; /** If the label contains an image, draw the text on top of the image. */ -const Fl_Align FL_ALIGN_TEXT_OVER_IMAGE = 0x0020; +const Fl_Align FL_ALIGN_TEXT_OVER_IMAGE = 0x0020; /** If the label contains an image, draw the text below the image. */ -const Fl_Align FL_ALIGN_IMAGE_OVER_TEXT = 0x0000; +const Fl_Align FL_ALIGN_IMAGE_OVER_TEXT = 0x0000; /** All parts of the label that are larger than the widget will not be drawn. */ -const Fl_Align FL_ALIGN_CLIP = 0x0040; +const Fl_Align FL_ALIGN_CLIP = 0x0040; /** Wrap text that does not fit the width of the widget. */ -const Fl_Align FL_ALIGN_WRAP = 0x0080; +const Fl_Align FL_ALIGN_WRAP = 0x0080; /** If the label contains an image, draw the text to the right of the image. */ const Fl_Align FL_ALIGN_IMAGE_NEXT_TO_TEXT = 0x0100; @@ -951,25 +949,25 @@ const Fl_Align FL_ALIGN_TEXT_NEXT_TO_IMAGE = 0x0120; /** If the label contains an image, draw the image or deimage in the background. */ const Fl_Align FL_ALIGN_IMAGE_BACKDROP = 0x0200; -const Fl_Align FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT; -const Fl_Align FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT; -const Fl_Align FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT; -const Fl_Align FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT; +const Fl_Align FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT; +const Fl_Align FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT; +const Fl_Align FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT; +const Fl_Align FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT; /** Outside only, left of widget, top position, magic value: TOP | BOTTOM | LEFT. */ -const Fl_Align FL_ALIGN_LEFT_TOP = 0x0007; +const Fl_Align FL_ALIGN_LEFT_TOP = 0x0007; /** Outside only, right of widget, top position, magic value: TOP | BOTTOM | RIGHT. */ -const Fl_Align FL_ALIGN_RIGHT_TOP = 0x000b; +const Fl_Align FL_ALIGN_RIGHT_TOP = 0x000b; /** Outside only, left of widget, bottom position, magic value: TOP | LEFT | RIGHT. */ -const Fl_Align FL_ALIGN_LEFT_BOTTOM = 0x000d; +const Fl_Align FL_ALIGN_LEFT_BOTTOM = 0x000d; /** Outside only, right of widget, bottom position, magic value: BOTTOM | LEFT | RIGHT. */ -const Fl_Align FL_ALIGN_RIGHT_BOTTOM = 0x000e; +const Fl_Align FL_ALIGN_RIGHT_BOTTOM = 0x000e; /** Nothing, same as FL_ALIGN_CENTER, for back compatibility. */ -const Fl_Align FL_ALIGN_NOWRAP = 0x0000; +const Fl_Align FL_ALIGN_NOWRAP = 0x0000; /** Mask value to test for TOP, BOTTOM, LEFT, and RIGHT flags. */ const Fl_Align FL_ALIGN_POSITION_MASK = 0x000f; @@ -986,27 +984,27 @@ const Fl_Align FL_ALIGN_IMAGE_MASK = 0x0320; /** A font number is an index into the internal font table. */ typedef int Fl_Font; -const Fl_Font FL_HELVETICA = 0; ///< Helvetica (or Arial) normal (0) -const Fl_Font FL_HELVETICA_BOLD = 1; ///< Helvetica (or Arial) bold -const Fl_Font FL_HELVETICA_ITALIC = 2; ///< Helvetica (or Arial) oblique -const Fl_Font FL_HELVETICA_BOLD_ITALIC = 3; ///< Helvetica (or Arial) bold-oblique -const Fl_Font FL_COURIER = 4; ///< Courier normal -const Fl_Font FL_COURIER_BOLD = 5; ///< Courier bold -const Fl_Font FL_COURIER_ITALIC = 6; ///< Courier italic -const Fl_Font FL_COURIER_BOLD_ITALIC = 7; ///< Courier bold-italic -const Fl_Font FL_TIMES = 8; ///< Times roman -const Fl_Font FL_TIMES_BOLD = 9; ///< Times roman bold -const Fl_Font FL_TIMES_ITALIC = 10; ///< Times roman italic -const Fl_Font FL_TIMES_BOLD_ITALIC = 11; ///< Times roman bold-italic -const Fl_Font FL_SYMBOL = 12; ///< Standard symbol font -const Fl_Font FL_SCREEN = 13; ///< Default monospaced screen font -const Fl_Font FL_SCREEN_BOLD = 14; ///< Default monospaced bold screen font -const Fl_Font FL_ZAPF_DINGBATS = 15; ///< Zapf-dingbats font - -const Fl_Font FL_FREE_FONT = 16; ///< first one to allocate -const Fl_Font FL_BOLD = 1; ///< add this to helvetica, courier, or times -const Fl_Font FL_ITALIC = 2; ///< add this to helvetica, courier, or times -const Fl_Font FL_BOLD_ITALIC = 3; ///< add this to helvetica, courier, or times +const Fl_Font FL_HELVETICA = 0; ///< Helvetica (or Arial) normal (0) +const Fl_Font FL_HELVETICA_BOLD = 1; ///< Helvetica (or Arial) bold +const Fl_Font FL_HELVETICA_ITALIC = 2; ///< Helvetica (or Arial) oblique +const Fl_Font FL_HELVETICA_BOLD_ITALIC = 3; ///< Helvetica (or Arial) bold-oblique +const Fl_Font FL_COURIER = 4; ///< Courier normal +const Fl_Font FL_COURIER_BOLD = 5; ///< Courier bold +const Fl_Font FL_COURIER_ITALIC = 6; ///< Courier italic +const Fl_Font FL_COURIER_BOLD_ITALIC = 7; ///< Courier bold-italic +const Fl_Font FL_TIMES = 8; ///< Times roman +const Fl_Font FL_TIMES_BOLD = 9; ///< Times roman bold +const Fl_Font FL_TIMES_ITALIC = 10; ///< Times roman italic +const Fl_Font FL_TIMES_BOLD_ITALIC = 11; ///< Times roman bold-italic +const Fl_Font FL_SYMBOL = 12; ///< Standard symbol font +const Fl_Font FL_SCREEN = 13; ///< Default monospaced screen font +const Fl_Font FL_SCREEN_BOLD = 14; ///< Default monospaced bold screen font +const Fl_Font FL_ZAPF_DINGBATS = 15; ///< Zapf-dingbats font + +const Fl_Font FL_FREE_FONT = 16; ///< first one to allocate +const Fl_Font FL_BOLD = 1; ///< add this to helvetica, courier, or times +const Fl_Font FL_ITALIC = 2; ///< add this to helvetica, courier, or times +const Fl_Font FL_BOLD_ITALIC = 3; ///< add this to helvetica, courier, or times /*@}*/ @@ -1015,9 +1013,9 @@ const Fl_Font FL_BOLD_ITALIC = 3; ///< add this to helvetica, courier */ typedef int Fl_Fontsize; -extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size +extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size -/** \name Colors +/** \name Colors The Fl_Color type holds an FLTK color value. Colors are either 8-bit indexes into a <a href="fltk-colormap.png">virtual colormap</a> @@ -1035,7 +1033,7 @@ extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size +--------- red component (8 bit) </pre> - A color can have either an index or an rgb value. Colors with rgb set + A color can have either an index or an rgb value. Colors with rgb set and an index >0 are reserved for special use. */ @@ -1044,22 +1042,22 @@ extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size typedef unsigned int Fl_Color; // Standard colors. These are used as default colors in widgets and altered as necessary -const Fl_Color FL_FOREGROUND_COLOR = 0; ///< the default foreground color (0) used for labels and text -const Fl_Color FL_BACKGROUND2_COLOR = 7; ///< the default background color for text, list, and valuator widgets -const Fl_Color FL_INACTIVE_COLOR = 8; ///< the inactive foreground color -const Fl_Color FL_SELECTION_COLOR = 15; ///< the default selection/highlight color +const Fl_Color FL_FOREGROUND_COLOR = 0; ///< the default foreground color (0) used for labels and text +const Fl_Color FL_BACKGROUND2_COLOR = 7; ///< the default background color for text, list, and valuator widgets +const Fl_Color FL_INACTIVE_COLOR = 8; ///< the inactive foreground color +const Fl_Color FL_SELECTION_COLOR = 15; ///< the default selection/highlight color // boxtypes generally limit themselves to these colors so // the whole ramp is not allocated: -const Fl_Color FL_GRAY0 = 32; // 'A' -const Fl_Color FL_DARK3 = 39; // 'H' -const Fl_Color FL_DARK2 = 45; // 'N' -const Fl_Color FL_DARK1 = 47; // 'P' -const Fl_Color FL_BACKGROUND_COLOR = 49; // 'R' default background color -const Fl_Color FL_LIGHT1 = 50; // 'S' -const Fl_Color FL_LIGHT2 = 52; // 'U' -const Fl_Color FL_LIGHT3 = 54; // 'W' +const Fl_Color FL_GRAY0 = 32; // 'A' +const Fl_Color FL_DARK3 = 39; // 'H' +const Fl_Color FL_DARK2 = 45; // 'N' +const Fl_Color FL_DARK1 = 47; // 'P' +const Fl_Color FL_BACKGROUND_COLOR = 49; // 'R' default background color +const Fl_Color FL_LIGHT1 = 50; // 'S' +const Fl_Color FL_LIGHT2 = 52; // 'U' +const Fl_Color FL_LIGHT3 = 54; // 'W' // FLTK provides a 5x8x5 color cube that is used with colormap visuals @@ -1142,7 +1140,7 @@ inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);} inline Fl_Color fl_color_cube(int r, int g, int b) { return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);} -/*@}*/ // group: Colors +/*@}*/ // group: Colors /** \name Cursors */ /*@{*/ @@ -1181,7 +1179,7 @@ enum Fl_Cursor { FL_CURSOR_NONE =255 /**< invisible. */ }; -/*@}*/ // group: Cursors +/*@}*/ // group: Cursors /** FD "when" conditions */ enum { // values for "when" passed to Fl::add_fd() @@ -1191,19 +1189,19 @@ enum { // values for "when" passed to Fl::add_fd() }; /** visual types and Fl_Gl_Window::mode() (values match Glut) */ -enum Fl_Mode { - FL_RGB = 0, - FL_INDEX = 1, - FL_SINGLE = 0, - FL_DOUBLE = 2, - FL_ACCUM = 4, - FL_ALPHA = 8, - FL_DEPTH = 16, - FL_STENCIL = 32, - FL_RGB8 = 64, +enum Fl_Mode { + FL_RGB = 0, + FL_INDEX = 1, + FL_SINGLE = 0, + FL_DOUBLE = 2, + FL_ACCUM = 4, + FL_ALPHA = 8, + FL_DEPTH = 16, + FL_STENCIL = 32, + FL_RGB8 = 64, FL_MULTISAMPLE= 128, FL_STEREO = 256, - FL_FAKE_SINGLE = 512, // Fake single buffered windows using double-buffer + FL_FAKE_SINGLE = 512, // Fake single buffered windows using double-buffer FL_OPENGL3 = 1024 }; @@ -1225,7 +1223,3 @@ enum Fl_Damage { // FLTK 1.0.x compatibility definitions (FLTK_1_0_COMPAT) dropped in 1.4.0 #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl.H b/FL/Fl.H index 3c4a0f011..4221d9588 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Main header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -33,7 +31,7 @@ # include "fl_utf8.h" # include "Enumerations.H" # ifndef Fl_Object -# define Fl_Object Fl_Widget /**< for back compatibility - use Fl_Widget! */ +# define Fl_Object Fl_Widget /**< for back compatibility - use Fl_Widget! */ # endif # ifdef check @@ -72,7 +70,7 @@ extern FL_EXPORT const char* fl_local_shift; ///< string pointer used in shortcu callback function to handle such events in the user's code. \see Fl::add_handler(), Fl::add_timeout(), Fl::repeat_timeout(), - Fl::remove_timeout() and others + Fl::remove_timeout() and others @{ */ /** Signature of some label drawing functions passed as parameters */ @@ -206,7 +204,7 @@ public: // should be private! If true then flush() will do something. */ static void damage(int d) {damage_ = d;} - + public: /** Enumerator for global FLTK options. These options can be set system wide, per user, or for the running @@ -225,7 +223,7 @@ public: /// See also: Fl_Input_::tab_nav() /// OPTION_ARROW_FOCUS = 0, - // When switched on, FLTK will use the file chooser dialog that comes + // When switched on, FLTK will use the file chooser dialog that comes // with your operating system whenever possible. When switched off, FLTK // will present its own file chooser. // \todo implement me @@ -235,7 +233,7 @@ public: // decides to choose the file. // \todo implement me //OPTION_FILECHOOSER_PREVIEW, - /// If visible focus is switched on (default), FLTK will draw a dotted rectangle + /// If visible focus is switched on (default), FLTK will draw a dotted rectangle /// inside the widget that will receive the next keystroke. If switched /// off, no such indicator will be drawn and keyboard navigation /// is disabled. @@ -244,7 +242,7 @@ public: /// from any text widget. If disabled, no dragging is possible, however /// dropping text from other applications still works. OPTION_DND_TEXT, - /// If tooltips are enabled (default), hovering the mouse over a widget with a + /// If tooltips are enabled (default), hovering the mouse over a widget with a /// tooltip text will open a little tooltip window until the mouse leaves /// the widget. If disabled, no tooltip is shown. OPTION_SHOW_TOOLTIPS, @@ -265,26 +263,26 @@ public: OPTION_LAST } Fl_Option; -private: +private: static unsigned char options_[OPTION_LAST]; static unsigned char options_read_; static int program_should_quit_; // non-zero means the program was asked to cleanly terminate -public: +public: /* Return a global setting for all FLTK applications, possibly overridden by a setting specifically for this application. */ static bool option(Fl_Option opt); - + /* Override an option while the application is running. */ static void option(Fl_Option opt, bool val); - + /** The currently executing idle callback function: DO NOT USE THIS DIRECTLY! - + This is now used as part of a higher level system allowing multiple idle callback functions to be called. \see add_idle(), remove_idle() @@ -302,7 +300,7 @@ public: static int e_original_keysym; // late addition static int scrollbar_size_; - static int menu_linespacing_; // STR #2927 + static int menu_linespacing_; // STR #2927 #endif @@ -409,9 +407,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(); @@ -444,16 +442,16 @@ 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 #include <stdio.h> #include <FL/Fl.H> @@ -520,7 +518,7 @@ int main() { @{ */ /** 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. @@ -539,7 +537,7 @@ int main() { 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. @@ -554,11 +552,11 @@ int main() { 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. @@ -589,14 +587,14 @@ int main() { */ static Fl_Window* modal() {return modal_;} /** Returns the window that currently receives all events. - + \return The window that currently receives all events, or NULL if event grabbing is currently OFF. */ static Fl_Window* grab() {return grab_;} - /** Selects the window to grab. + /** Selects the window to grab. This is used when pop-up menu systems are active. - + Send all events to the passed window no matter where the pointer or focus is (including in other programs). The window <I>does not have to be shown()</I> , this lets the handle() method of a @@ -604,26 +602,26 @@ int main() { map and unmap a complex set of windows (under both X and Windows <I>some</I> window must be mapped because the system interface needs a window id). - + If grab() is on it will also affect show() of windows by doing system-specific operations (on X it turns on override-redirect). These are designed to make menus popup reliably and faster on the system. - + To turn off grabbing do Fl::grab(0). - + <I>Be careful that your program does not enter an infinite loop while grab() is on. On X this will lock up your screen!</I> - To avoid this potential lockup, all newer operating systems seem to - limit mouse pointer grabbing to the time during which a mouse button + To avoid this potential lockup, all newer operating systems seem to + limit mouse pointer grabbing to the time during which a mouse button is held down. Some OS's may not support grabbing at all. */ static void grab(Fl_Window*); // platform dependent /** @} */ /** \defgroup fl_events Events handling functions - Fl class events handling API declared in <FL/Fl.H> - @{ + Fl class events handling API declared in <FL/Fl.H> + @{ */ // event information: /** @@ -631,44 +629,44 @@ int main() { to determine if a callback is being done in response to a keypress, mouse click, etc. */ - static int event() {return e_number;} + static int event() {return e_number;} /** Returns the mouse position of the event relative to the Fl_Window it was passed to. */ - static int event_x() {return e_x;} + static int event_x() {return e_x;} /** Returns the mouse position of the event relative to the Fl_Window it was passed to. */ - static int event_y() {return e_y;} + static int event_y() {return e_y;} /** 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;} + 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;} + static int event_y_root() {return e_y_root;} /** Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event. Right is positive. */ - static int event_dx() {return e_dx;} + static int event_dx() {return e_dx;} /** Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event. Down is positive. */ - static int event_dy() {return e_dy;} + 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 @@ -677,15 +675,15 @@ int main() { 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;} + 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 @@ -694,17 +692,17 @@ int main() { static void event_clicks(int i) {e_clicks = i;} /** Returns non-zero if the mouse has not moved far enough - and not enough time has passed since the last FL_PUSH or + and not enough time has passed since the last FL_PUSH or FL_KEYBOARD event for it to be considered a "drag" rather than a "click". You can test this on FL_DRAG, FL_RELEASE, - and FL_MOVE events. + and FL_MOVE events. */ - static int event_is_click() {return e_is_click;} + static int event_is_click() {return e_is_click;} /** - Clears the value returned by Fl::event_is_click(). + Clears the value returned by Fl::event_is_click(). Useful to prevent the <I>next</I> click from being counted as a double-click or to make a popup menu - pick an item with a single click. Don't pass non-zero to this. + pick an item with a single click. Don't pass non-zero to this. */ static void event_is_click(int i) {e_is_click = i;} /** @@ -716,7 +714,7 @@ int main() { \retval FL_RIGHT_MOUSE. \see Fl::event_buttons() */ - static int event_button() {return e_keysym-FL_Button;} + static int event_button() {return e_keysym-FL_Button;} /** Returns the keyboard and mouse button states of the last event. @@ -735,14 +733,14 @@ int main() { - 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 so that the shift state is not correctly reported until the first event <I>after</I> the shift key is pressed or released. */ - static int event_state() {return e_state;} + static int event_state() {return e_state;} /** Returns non-zero if any of the passed event state bits are turned on. @@ -754,74 +752,74 @@ int main() { 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;} + 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. + character use the value of that ASCII character (as though shift, + ctrl, and caps lock were not on). The space bar is 32. \li All keys on the numeric keypad producing a printable ASCII - 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 - FL_F. The highest possible number is FL_F_Last, so you - can range-check a value. + 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 + 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 - number (where the left button is 1) plus FL_Button. + number (where the left button is 1) plus FL_Button. \li All other keys on the keypad have a symbol: FL_Escape, - FL_BackSpace, FL_Tab, FL_Enter, FL_Print, FL_Scroll_Lock, FL_Pause, - FL_Insert, FL_Home, FL_Page_Up, FL_Delete, FL_End, FL_Page_Down, - FL_Left, FL_Up, FL_Right, FL_Down, FL_Iso_Key, FL_Shift_L, FL_Shift_R, - FL_Control_L, FL_Control_R, FL_Caps_Lock, FL_Alt_L, FL_Alt_R, - FL_Meta_L, FL_Meta_R, FL_Menu, FL_Num_Lock, FL_KP_Enter. Be - careful not to confuse these with the very similar, but all-caps, - symbols used by Fl::event_state(). + FL_BackSpace, FL_Tab, FL_Enter, FL_Print, FL_Scroll_Lock, FL_Pause, + FL_Insert, FL_Home, FL_Page_Up, FL_Delete, FL_End, FL_Page_Down, + FL_Left, FL_Up, FL_Right, FL_Down, FL_Iso_Key, FL_Shift_L, FL_Shift_R, + FL_Control_L, FL_Control_R, FL_Caps_Lock, FL_Alt_L, FL_Alt_R, + FL_Meta_L, FL_Meta_R, FL_Menu, FL_Num_Lock, FL_KP_Enter. Be + careful not to confuse these with the very similar, but all-caps, + symbols used by Fl::event_state(). On X Fl::get_key(FL_Button+n) does not work. - + On Windows 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. @@ -838,7 +836,7 @@ int main() { you paste a nul character. */ 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_RGB_Image * when the result of Fl::event_clipboard_type() is Fl::clipboard_image. */ @@ -861,16 +859,16 @@ int main() { // event destinations: static int handle(int, Fl_Window*); static int handle_(int, Fl_Window*); - /** Gets the widget that is below the mouse. + /** Gets the widget that is below the mouse. \see belowmouse(Fl_Widget*) */ static Fl_Widget* belowmouse() {return belowmouse_;} static void belowmouse(Fl_Widget*); /** Gets the widget that is being pushed. \see void pushed(Fl_Widget*) */ - static Fl_Widget* pushed() {return pushed_;} + static Fl_Widget* pushed() {return pushed_;} static void pushed(Fl_Widget*); /** Gets the current Fl::focus() widget. \sa Fl::focus(Fl_Widget*) */ - static Fl_Widget* focus() {return focus_;} + static Fl_Widget* focus() {return focus_;} static void focus(Fl_Widget*); static void add_handler(Fl_Event_Handler h); static void remove_handler(Fl_Event_Handler h); @@ -881,20 +879,20 @@ int main() { /** @} */ /** \defgroup fl_clipboard Selection & Clipboard functions - FLTK global copy/cut/paste functions declared in <FL/Fl.H> + FLTK global copy/cut/paste functions declared in <FL/Fl.H> @{ */ // cut/paste: /** - Copies the data pointed to by \p stuff to the selection buffer + 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. @@ -904,17 +902,17 @@ int main() { /** 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. - + The handle function of \p receiver can process the FL_PASTE event as follows: \li If the \p receiver widget is known to only receive text data, the text string from the specified \p source is in Fl::event_text() with UTF-8 encoding, and the @@ -929,13 +927,13 @@ int main() { 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: Clipboard images in PNG or BMP formats are recognized. Requires linking with the fltk_images library. \li Windows platform: Both bitmap and vectorial (Enhanced metafile) data from clipboard @@ -944,7 +942,7 @@ int main() { can be pasted as image data. */ 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 @@ -954,13 +952,13 @@ int main() { \code void clip_callback(int source, void *data) { if ( source == 0 ) printf("CLIP CALLBACK: selection buffer changed\n"); - if ( source == 1 ) printf("CLIP CALLBACK: clipboard changed\n"); + if ( source == 1 ) printf("CLIP CALLBACK: clipboard changed\n"); } [..] int main() { [..] - Fl::add_clipboard_notify(clip_callback); - [..] + Fl::add_clipboard_notify(clip_callback); + [..] } \endcode \note Some systems require polling to monitor the clipboard and may @@ -988,14 +986,14 @@ int main() { 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*); @@ -1006,7 +1004,7 @@ int main() { /** \defgroup fl_screen Screen functions Fl global screen functions declared in <FL/Fl.H>. - + FLTK supports high-DPI screens using a screen scaling factor. The scaling factor is initialized by the library to a value based on information obtained from the OS. If this initial value @@ -1046,25 +1044,25 @@ int main() { /** \defgroup fl_attributes Color & Font functions - fl global color, font functions. - These functions are declared in <FL/Fl.H> or <FL/fl_draw.H>. + fl global color, font functions. + These functions are declared in <FL/Fl.H> or <FL/fl_draw.H>. @{ */ - + // color map: - static void set_color(Fl_Color, uchar, uchar, uchar); + static void set_color(Fl_Color, uchar, uchar, uchar); /** Sets an entry in the fl_color index table. You can set it to any 8-bit RGB color. The color is not allocated until fl_color(i) is used. */ - static void set_color(Fl_Color i, unsigned c); // platform dependent + static void set_color(Fl_Color i, unsigned c); // platform dependent static unsigned get_color(Fl_Color i); - static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue); + static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue); /** Frees the specified color from the colormap, if applicable. If overlay is non-zero then the color is freed from the overlay colormap. */ - static void free_color(Fl_Color i, int overlay = 0); // platform dependent + static void free_color(Fl_Color i, int overlay = 0); // platform dependent // fonts: static const char* get_font(Fl_Font); @@ -1073,9 +1071,9 @@ int main() { 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. @@ -1100,7 +1098,7 @@ int main() { 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 @@ -1110,7 +1108,7 @@ int main() { values may be useful but are system dependent. With Windows 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 @@ -1118,7 +1116,7 @@ int main() { /** @} */ /** \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/platform.H> for offscreen buffer-related ones. @{ */ // <Hack to re-order the 'Drawing functions' group> @@ -1143,7 +1141,7 @@ int main() { 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;} @@ -1155,7 +1153,7 @@ int main() { 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;} @@ -1167,9 +1165,9 @@ int main() { 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] } */ @@ -1234,7 +1232,7 @@ int main() { */ static int dnd_text_ops() { return option(OPTION_DND_TEXT); } /** \defgroup fl_multithread Multithreading support functions - fl multithreading support functions declared in <FL/Fl.H> + fl multithreading support functions declared in <FL/Fl.H> @{ */ // Multithreading support: @@ -1246,7 +1244,7 @@ int main() { /** The thread_message() method returns the last message that was sent from a child by the awake() method. - + See also: \ref advanced_multithreading */ static void* thread_message(); // platform dependent @@ -1268,17 +1266,17 @@ int main() { There are three groups of related methods: -# scheduled widget deletion - - Fl::delete_widget() schedules widgets for deletion - - Fl::do_widget_deletion() deletes all scheduled widgets + - Fl::delete_widget() schedules widgets for deletion + - Fl::do_widget_deletion() deletes all scheduled widgets -# widget watch list ("smart pointers") - - Fl::watch_widget_pointer() adds a widget pointer to the watch list - - Fl::release_widget_pointer() removes a widget pointer from the watch list - - Fl::clear_widget_pointer() clears a widget pointer \e in the watch list + - Fl::watch_widget_pointer() adds a widget pointer to the watch list + - Fl::release_widget_pointer() removes a widget pointer from the watch list + - Fl::clear_widget_pointer() clears a widget pointer \e in the watch list -# the class Fl_Widget_Tracker: - - the constructor calls Fl::watch_widget_pointer() - - the destructor calls Fl::release_widget_pointer() - - the access methods can be used to test, if a widget has been deleted - \see Fl_Widget_Tracker. + - the constructor calls Fl::watch_widget_pointer() + - the destructor calls Fl::release_widget_pointer() + - the access methods can be used to test, if a widget has been deleted + \see Fl_Widget_Tracker. @{ */ // Widget deletion: @@ -1288,7 +1286,7 @@ int main() { 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 @@ -1300,7 +1298,7 @@ int main() { \version 1.3.4 */ static int use_high_res_GL() { return use_high_res_GL_; } - + /** sets whether OpenGL uses textures to draw all text. By default, FLTK draws OpenGL text using textures, if the necessary hardware support is available. Call \p Fl::draw_GL_text_with_textures(0) @@ -1313,7 +1311,7 @@ int main() { \version 1.4.0 */ static void draw_GL_text_with_textures(int val) { draw_GL_text_with_textures_ = val; } - + /** returns whether whether OpenGL uses textures to draw all text. Default is yes. \see draw_GL_text_with_textures(int val) @@ -1324,7 +1322,7 @@ int main() { #ifdef FLTK_HAVE_CAIRO /** \defgroup group_cairo Cairo Support Functions and Classes - @{ + @{ */ public: // Cairo support API @@ -1336,19 +1334,19 @@ public: 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 + 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();} @@ -1358,14 +1356,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 @@ -1386,7 +1384,7 @@ public: 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 no longer needed. @@ -1454,12 +1452,8 @@ public: }; /** \defgroup fl_unicode Unicode and UTF-8 functions - fl global Unicode and UTF-8 handling functions declared in <FL/fl_utf8.h> + fl global Unicode and UTF-8 handling functions declared in <FL/fl_utf8.h> @{ */ /** @} */ #endif // !Fl_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Adjuster.H b/FL/Fl_Adjuster.H index fb20f7d52..c2e308128 100644 --- a/FL/Fl_Adjuster.H +++ b/FL/Fl_Adjuster.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Adjuster widget header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -31,7 +29,7 @@ /** 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 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 @@ -67,7 +65,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_BMP_Image.H b/FL/Fl_BMP_Image.H index 0d60d7114..c779d6525 100644 --- a/FL/Fl_BMP_Image.H +++ b/FL/Fl_BMP_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // BMP image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -41,7 +39,3 @@ class FL_EXPORT Fl_BMP_Image : public Fl_RGB_Image { }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Bitmap.H b/FL/Fl_Bitmap.H index 47818e7f9..e0fc2244d 100644 --- a/FL/Fl_Bitmap.H +++ b/FL/Fl_Bitmap.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Bitmap header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -38,7 +36,7 @@ public: const uchar *array; /** Non-zero if array points to bitmap data allocated internally */ int alloc_array; - + private: /** for internal use */ fl_uintptr_t id_; @@ -62,7 +60,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Box.H b/FL/Fl_Box.H index e1007a7f7..c168566aa 100644 --- a/FL/Fl_Box.H +++ b/FL/Fl_Box.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Box header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -45,7 +43,7 @@ public: <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); @@ -53,7 +51,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Browser.H b/FL/Fl_Browser.H index 323076362..707b3acc1 100644 --- a/FL/Fl_Browser.H +++ b/FL/Fl_Browser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Browser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -36,7 +34,7 @@ struct FL_BLINE; 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. - + \image html fl_hold_browser.png "Fl_Hold_Browser" \image latex fl_hold_browser.png "Fl_Hold_Browser" width=4cm @@ -57,9 +55,9 @@ struct FL_BLINE; describes. The base class does nothing when the user clicks on it. The - subclasses - Fl_Select_Browser, - Fl_Hold_Browser, and + subclasses + Fl_Select_Browser, + Fl_Hold_Browser, and Fl_Multi_Browser react to user clicks to select lines in the browser and do callbacks. @@ -76,7 +74,7 @@ struct FL_BLINE; \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)); + printf("item #%d, label='%s'\n", t, browser->text(t)); } \endcode @@ -87,15 +85,15 @@ struct FL_BLINE; */ class FL_EXPORT Fl_Browser : public Fl_Browser_ { - FL_BLINE *first; // the array of lines + 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 cacheline; // line number of cache + int lines; // Number of lines int full_height_; const int* column_widths_; - char format_char_; // alternative to @-sign - char column_char_; // alternative to tab + char format_char_; // alternative to @-sign + char column_char_; // alternative to tab protected: @@ -218,7 +216,7 @@ public: 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> Doubling the format character prints the format character once, followed by the rest of line @@ -241,7 +239,7 @@ public: \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 + 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. */ @@ -330,7 +328,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Browser_.H b/FL/Fl_Browser_.H index 308f47ce6..af86bc2c7 100644 --- a/FL/Fl_Browser_.H +++ b/FL/Fl_Browser_.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Common browser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -28,15 +26,15 @@ #include "Fl_Group.H" #endif #include "Fl_Scrollbar.H" -#include <FL/Fl.H> // Fl::scrollbar_size() +#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_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 */ +#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 @@ -44,7 +42,7 @@ 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 + 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. @@ -76,21 +74,21 @@ Keyboard navigation of browser items 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 + 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* 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* max_width_item; // which item has max_width_ + int scrollbar_size_; // size of scrollbar trough void update_top(); @@ -98,7 +96,7 @@ protected: // All of the following must be supplied by the subclass: /** - This method must be provided 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() */ @@ -121,8 +119,8 @@ protected: \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 + /** + 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. @@ -145,28 +143,28 @@ protected: */ 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. + 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 + 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. + 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 + 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 ; @@ -178,9 +176,9 @@ protected: 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 + 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_; } @@ -197,9 +195,9 @@ protected: */ 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 + 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); @@ -223,7 +221,7 @@ public: /** 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 + 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() */ @@ -250,13 +248,13 @@ public: - 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. + 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) @@ -265,9 +263,9 @@ public: /** 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. + 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. @@ -317,9 +315,9 @@ public: /** Gets the current size of the scrollbars' troughs, in pixels. - If this value is zero (default), this widget will use the + 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) */ @@ -330,24 +328,24 @@ public: 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 + 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; - } + } /** Returns the global value Fl::scrollbar_size(). \deprecated Use scrollbar_size() instead. @@ -379,7 +377,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Button.H b/FL/Fl_Button.H index 49f5dfa4b..e9ad92df8 100644 --- a/FL/Fl_Button.H +++ b/FL/Fl_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,13 +25,13 @@ #endif // values for type() -#define FL_NORMAL_BUTTON 0 /**< value() will be set to 1 during the press of the button and +#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 +#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*); @@ -59,7 +57,7 @@ class Fl_Widget_Tracker; \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. + are set to zero. \todo Refactor the doxygen comments for Fl_Button when() documentation. @@ -70,7 +68,7 @@ class Fl_Widget_Tracker; 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). + dragged around in and out of the button). */ class FL_EXPORT Fl_Button : public Fl_Widget { @@ -170,7 +168,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Cairo.H b/FL/Fl_Cairo.H index 1994f0e5e..3a32647a4 100644 --- a/FL/Fl_Cairo.H +++ b/FL/Fl_Cairo.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Main header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,15 +7,15 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file - Handling transparently platform dependent cairo include files + Handling transparently platform dependent cairo include files */ #ifndef FL_CAIRO_H @@ -31,12 +29,12 @@ # 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. @@ -48,33 +46,33 @@ 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) + 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 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. + \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; + 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 + 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. + 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 }; @@ -82,7 +80,3 @@ private: # endif // FLTK_HAVE_CAIRO #endif // FL_CAIRO_H - -// -// End of "$Id$" . -// diff --git a/FL/Fl_Cairo_Window.H b/FL/Fl_Cairo_Window.H index dcec92f48..8d98cd5bd 100644 --- a/FL/Fl_Cairo_Window.H +++ b/FL/Fl_Cairo_Window.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Main header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -29,7 +27,7 @@ # include <FL/Fl.H> # include <FL/Fl_Double_Window.H> -/** +/** \addtogroup group_cairo @{ */ @@ -44,7 +42,7 @@ \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 + 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 { @@ -62,7 +60,7 @@ protected: if (draw_cb_) { // call the Cairo draw callback // manual method ? if yes explicitly get a cairo_context here if (!Fl::cairo_autolink_context()) - Fl::cairo_make_current(this); + Fl::cairo_make_current(this); draw_cb_(this, Fl::cairo_cc()); // flush cairo drawings: necessary at least for Windows cairo_surface_t *s = cairo_get_target(Fl::cairo_cc()); @@ -73,7 +71,7 @@ protected: 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. */ @@ -87,7 +85,3 @@ private: # endif // FLTK_HAVE_CAIRO #endif // FL_CAIRO_WINDOW_H - -// -// End of "$Id$" . -// diff --git a/FL/Fl_Chart.H b/FL/Fl_Chart.H index 8664d9742..a19b68cd6 100644 --- a/FL/Fl_Chart.H +++ b/FL/Fl_Chart.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms chart header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,24 +25,24 @@ #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_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_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 */ +#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. */ + float val; /**< For internal use only. */ + unsigned col; /**< For internal use only. */ + char str[FL_CHART_LABEL_MAX+1]; /**< For internal use only. */ }; /** @@ -52,7 +50,7 @@ struct FL_CHART_ENTRY { \brief Fl_Chart displays simple charts. It is provided for Forms compatibility. - \image html charts.png + \image html charts.png \image latex charts.png "Fl_Chart" width=10cm \todo Refactor Fl_Chart::type() information. @@ -145,7 +143,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Check_Browser.H b/FL/Fl_Check_Browser.H index 2184c721b..1031a64a3 100644 --- a/FL/Fl_Check_Browser.H +++ b/FL/Fl_Check_Browser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -55,11 +53,11 @@ public: #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. */ + 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 @@ -81,7 +79,7 @@ public: ~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() + // both return the new nitems() int remove(int item); // delete an item. Returns nitems() // inline const char * methods to avoid breaking binary compatibility... @@ -114,7 +112,3 @@ public: #endif // Fl_Check_Browser_H -// -// End of "$Id$". -// - diff --git a/FL/Fl_Check_Button.H b/FL/Fl_Check_Button.H index 9c67c73bb..29a0a4aa6 100644 --- a/FL/Fl_Check_Button.H +++ b/FL/Fl_Check_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Check button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Check_Button_H @@ -33,7 +31,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Choice.H b/FL/Fl_Choice.H index 676ec658e..31da14524 100644 --- a/FL/Fl_Choice.H +++ b/FL/Fl_Choice.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Choice header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -45,7 +43,7 @@ and then: - The item's callback is done if one has been set; the - Fl_Choice is passed as the Fl_Widget* argument, + 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 @@ -100,7 +98,7 @@ return Fl::run(); } \endcode - + */ class FL_EXPORT Fl_Choice : public Fl_Menu_ { protected: @@ -122,7 +120,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Clock.H b/FL/Fl_Clock.H index 74c1ede63..aa29ec04a 100644 --- a/FL/Fl_Clock.H +++ b/FL/Fl_Clock.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Clock header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,12 +28,12 @@ // 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_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, +// fabien: Please keep the horizontal formatting of both images in class desc, // don't lose vertical space for nothing! /** @@ -45,11 +43,11 @@ 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 > + \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 + \image html clock.png \htmlonly </TD> <TD> \endhtmlonly - \image html round_clock.png + \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 @@ -57,10 +55,10 @@ 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 + #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 */ @@ -76,8 +74,8 @@ 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(ulong v); // set to this Unix time + void value(int H, int m, int s); /** @@ -108,9 +106,9 @@ public: /** 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) + \returns shadow drawing mode of the hands + \retval 0 no shadows + \retval 1 draw shadows of hands (default) */ int shadow() const {return shadow_;} @@ -124,7 +122,7 @@ public: The default is to draw the shadows (1). - \param[in] mode 1 = shadows (default), 0 = no shadows + \param[in] mode 1 = shadows (default), 0 = no shadows */ void shadow(int mode) { shadow_ = mode ? 1 : 0; } }; @@ -135,18 +133,18 @@ public: \class Fl_Clock \brief This widget provides a round analog clock display. - Fl_Clock is provided for Forms compatibility. + 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 > + \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 + \image html clock.png \htmlonly </TD> <TD> \endhtmlonly - \image html round_clock.png + \image html round_clock.png \htmlonly </TD> </TR> </table> \endhtmlonly - \image latex clock.png "FL_SQUARE_CLOCK type" width=4cm + \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 @@ -156,14 +154,10 @@ 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(); }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Color_Chooser.H b/FL/Fl_Color_Chooser.H index db4fae37a..8ba252035 100644 --- a/FL/Fl_Color_Chooser.H +++ b/FL/Fl_Color_Chooser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Color chooser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -67,7 +65,7 @@ public: #endif // !FL_DOXYGEN -/** \addtogroup group_comdlg +/** \addtogroup group_comdlg @{ */ /** @@ -122,21 +120,21 @@ class FL_EXPORT Fl_Color_Chooser : public Fl_Group { static void rgb_cb(Fl_Widget*, void*); static void mode_cb(Fl_Widget*, void*); public: - + int handle(int e); - /** - Returns which Fl_Color_Chooser variant is currently active - \return color modes are rgb(0), byte(1), hex(2), or hsv(3) + /** + 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) + + /** + 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. @@ -190,7 +188,3 @@ FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b, int m=-1); #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Copy_Surface.H b/FL/Fl_Copy_Surface.H index 65c169492..03faa14cc 100644 --- a/FL/Fl_Copy_Surface.H +++ b/FL/Fl_Copy_Surface.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Copy_Surface_H @@ -22,12 +20,12 @@ #include <FL/Fl_Widget_Surface.H> /** Supports copying of graphical data to the clipboard. - + <br> After creation of an Fl_Copy_Surface object, make it the current drawing surface calling Fl_Surface_Device::push_current(), and all subsequent graphics requests will be recorded in the clipboard. It's possible to draw widgets (using Fl_Copy_Surface::draw() ) or to use any of the \ref fl_drawings or the \ref fl_attributes. Finally, delete the Fl_Copy_Surface object to load the clipboard with the graphical data. - <br> Fl_Gl_Window 's can be copied to the clipboard as well. + <br> Fl_Gl_Window 's can be copied to the clipboard as well. <br> Usage example: \code Fl_Widget *g = ...; // a widget you want to copy to the clipboard @@ -44,7 +42,7 @@ 2) as a color bitmap. Applications to which the clipboard content is pasted can use the format that suits them best. \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. + 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 are copied to the clipboard as an image in BMP format. */ @@ -78,7 +76,7 @@ public: /** 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 @@ -108,7 +106,3 @@ protected: */ #endif // Fl_Copy_Surface_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Counter.H b/FL/Fl_Counter.H index 62ef38864..eaa71f5b4 100644 --- a/FL/Fl_Counter.H +++ b/FL/Fl_Counter.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Counter header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -29,8 +27,8 @@ #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 */ +#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. @@ -109,7 +107,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Device.H b/FL/Fl_Device.H index f88602aa4..c03219b70 100644 --- a/FL/Fl_Device.H +++ b/FL/Fl_Device.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of classes Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // @@ -10,14 +8,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -/** \file Fl_Device.H +/** \file Fl_Device.H \brief declaration of classes Fl_Surface_Device, Fl_Display_Device, Fl_Device_Plugin. */ @@ -36,7 +34,7 @@ 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, + 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: @@ -53,7 +51,7 @@ class Fl_Widget; </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_Surface_Device can also be derived to define new kinds of graphical output usable with FLTK drawing functions. An example would be to draw to a PDF file. This would require to create a new class, @@ -105,7 +103,7 @@ public: /** This plugin socket allows the integration of new device drivers for special - window or screen types. + 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. @@ -130,7 +128,3 @@ public: }; #endif // Fl_Device_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Dial.H b/FL/Fl_Dial.H index bf0de19ca..d88416164 100644 --- a/FL/Fl_Dial.H +++ b/FL/Fl_Dial.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Dial header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,14 +25,14 @@ #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 */ +#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 + <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> @@ -63,7 +61,7 @@ public: 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 @@ -82,7 +80,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Double_Window.H b/FL/Fl_Double_Window.H index fe3396a52..7ba197f8b 100644 --- a/FL/Fl_Double_Window.H +++ b/FL/Fl_Double_Window.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Double-buffered window header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -50,13 +48,13 @@ public: 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); - + /** See Fl_Double_Window::Fl_Double_Window(int w, int h, const char *label = 0) */ @@ -65,7 +63,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Export.H b/FL/Fl_Export.H index 1b51c2584..6dee15a4c 100644 --- a/FL/Fl_Export.H +++ b/FL/Fl_Export.H @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Windows DLL export . * * Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #ifndef Fl_Export_H @@ -25,9 +23,9 @@ # if defined(FL_DLL) # ifdef FL_LIBRARY -# define FL_EXPORT __declspec(dllexport) +# define FL_EXPORT __declspec(dllexport) # else -# define FL_EXPORT __declspec(dllimport) +# define FL_EXPORT __declspec(dllimport) # endif /* FL_LIBRARY */ # elif __GNUC__ >= 4 # define FL_EXPORT __attribute__ ((visibility ("default"))) @@ -36,7 +34,3 @@ # endif /* FL_DLL */ #endif /* !Fl_Export_H */ - -/* - * End of "$Id$". - */ diff --git a/FL/Fl_File_Browser.H b/FL/Fl_File_Browser.H index 7e41e5e25..67b0a9d81 100644 --- a/FL/Fl_File_Browser.H +++ b/FL/Fl_File_Browser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // FileBrowser definitions. // // Copyright 1999-2010 by Michael Sweet. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -37,17 +35,17 @@ /** 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)); } + + 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 }; @@ -59,34 +57,34 @@ public: 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_); }; + 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(); }; + 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); + 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_); }; + 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); + 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); }; + void textsize(Fl_Fontsize s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); }; /** Sets or gets the file browser type, FILES or @@ -94,18 +92,14 @@ public: files and directories are shown. Otherwise only directories are shown. */ - int filetype() const { return (filetype_); }; + 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; }; + void filetype(int t) { filetype_ = t; }; }; #endif // !_Fl_File_Browser_H_ - -// -// End of "$Id$". -// diff --git a/FL/Fl_File_Chooser.H b/FL/Fl_File_Chooser.H index 4ce459ebf..702c4ff9f 100644 --- a/FL/Fl_File_Chooser.H +++ b/FL/Fl_File_Chooser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // ======================================================================= // DO NOT EDIT FL/Fl_File_Chooser.H and src/Fl_File_Chooser.cxx !!! @@ -47,24 +45,24 @@ class FL_EXPORT Fl_File_Chooser { public: - enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 }; + 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(); + 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: @@ -131,10 +129,10 @@ public: 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); + int count(); + void directory(const char *d); char * directory(); - void filter(const char *p); + void filter(const char *p); const char * filter(); int filter_value(); void filter_value(int f); @@ -145,15 +143,15 @@ public: const char * label(); void ok_label(const char *l); const char * ok_label(); - void preview(int e); - int preview() const { return previewButton->value(); }; + void preview(int e); + int preview() const { return previewButton->value(); }; private: - void showHidden(int e); - void remove_hidden_files(); + void showHidden(int e); + void remove_hidden_files(); public: - void rescan(); - void rescan_keep_filename(); - void show(); + void rescan(); + void rescan_keep_filename(); + void show(); int shown(); void textcolor(Fl_Color c); Fl_Color textcolor(); @@ -165,72 +163,72 @@ public: int type(); void * user_data() const; void user_data(void *d); - const char *value(int f = 1); - void value(const char *filename); + 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; + static const char *add_favorites_label; /** [standard text may be customized at run-time] */ - static const char *all_files_label; + static const char *all_files_label; /** [standard text may be customized at run-time] */ - static const char *custom_filter_label; + static const char *custom_filter_label; /** [standard text may be customized at run-time] */ - static const char *existing_file_label; + static const char *existing_file_label; /** [standard text may be customized at run-time] */ - static const char *favorites_label; + static const char *favorites_label; /** [standard text may be customized at run-time] */ - static const char *filename_label; + static const char *filename_label; /** [standard text may be customized at run-time] */ - static const char *filesystems_label; + static const char *filesystems_label; /** [standard text may be customized at run-time] */ - static const char *manage_favorites_label; + static const char *manage_favorites_label; /** [standard text may be customized at run-time] */ - static const char *new_directory_label; + static const char *new_directory_label; /** [standard text may be customized at run-time] */ - static const char *new_directory_tooltip; + static const char *new_directory_tooltip; /** [standard text may be customized at run-time] */ - static const char *preview_label; + static const char *preview_label; /** [standard text may be customized at run-time] */ - static const char *save_label; + static const char *save_label; /** [standard text may be customized at run-time] */ - static const char *show_label; + static const char *show_label; /** [standard text may be customized at run-time] */ - static const char *hidden_label; + static const char *hidden_label; /** the sort function that is used when loading the contents of a directory. */ - static Fl_File_Sort_F *sort; + static Fl_File_Sort_F *sort; private: - Fl_Widget* ext_group; + Fl_Widget* ext_group; public: Fl_Widget* add_extra(Fl_Widget* gr); }; @@ -239,7 +237,3 @@ FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char * 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$". -// diff --git a/FL/Fl_File_Icon.H b/FL/Fl_File_Icon.H index 6ca93d28e..c63358689 100644 --- a/FL/Fl_File_Icon.H +++ b/FL/Fl_File_Icon.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_File_Icon definitions. // // Copyright 1999-2010 by Michael Sweet. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -33,61 +31,61 @@ // Special color value for the icon color. // -# define FL_ICON_COLOR (Fl_Color)0xffffffff /**< icon color [background?]*/ +# 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 +/** + 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 +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 + 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 + 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 + 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 + 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 + 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); + 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); } + 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. @@ -95,8 +93,8 @@ class FL_EXPORT Fl_File_Icon { //// Icon data 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); } + 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. @@ -104,35 +102,35 @@ class FL_EXPORT Fl_File_Icon { //// Icon data 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); } + 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 clear() { num_data_ = 0; } - void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1); + void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1); - void label(Fl_Widget *w); + 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); + 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_); } + Fl_File_Icon *next() { return (next_); } /** Returns the filename matching pattern for the icon.*/ - const char *pattern() { return (pattern_); } + const char *pattern() { return (pattern_); } /** Returns the number of words of data used by the icon.*/ - int size() { return (num_data_); } + 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. @@ -140,20 +138,16 @@ class FL_EXPORT Fl_File_Icon { //// Icon data \li Fl_File_Icon::LINK, symbolic links. \li Fl_File_Icon::DIRECTORY, directories. */ - int type() { return (type_); } + int type() { return (type_); } /** Returns the data array for the icon.*/ - short *value() { return (data_); } + 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); + static void load_system_icons(void); }; #endif // !_Fl_Fl_File_Icon_H_ - -// -// End of "$Id$". -// diff --git a/FL/Fl_File_Input.H b/FL/Fl_File_Input.H index 23de89b68..2c8ce4c2a 100644 --- a/FL/Fl_File_Input.H +++ b/FL/Fl_File_Input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // File_Input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -36,7 +34,7 @@ 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> + <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 @@ -45,15 +43,15 @@ 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 { - - char ok_entry_; - uchar down_box_; - short buttons_[200]; - short pressed_; - void draw_buttons(); - int handle_button(int event); - void update_buttons(); + char ok_entry_; + uchar down_box_; + short buttons_[200]; + short pressed_; + + void draw_buttons(); + int handle_button(int event); + void update_buttons(); public: @@ -66,9 +64,9 @@ protected: public: /** Gets the box type used for the navigation bar. */ - Fl_Boxtype down_box() const { return (Fl_Boxtype)down_box_; } + 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; } + void down_box(Fl_Boxtype b) { down_box_ = b; } /** Gets the current error color. @@ -79,7 +77,7 @@ public: \deprecated Will be removed in FLTK 1.5.0 or higher. \todo Remove Fl_File_Input::errorcolor() in FLTK 1.5.0 or higher. */ - Fl_Color errorcolor() const { return FL_RED; } + Fl_Color errorcolor() const { return FL_RED; } /** Sets the current error color to \p c. @@ -89,21 +87,16 @@ public: \deprecated Will be removed in FLTK 1.5.0 or higher. \todo Remove Fl_File_Input::errorcolor(Fl_Color) in FLTK 1.5.0 or higher. */ - void errorcolor(Fl_Color c) {} + void errorcolor(Fl_Color c) {} - int value(const char *str); - int value(const char *str, int len); + 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(); } + const char *value() { return Fl_Input_::value(); } }; #endif // !Fl_File_Input_H - - -// -// End of "$Id$". -// diff --git a/FL/Fl_Fill_Dial.H b/FL/Fl_Fill_Dial.H index dbf2df05c..fc66cea62 100644 --- a/FL/Fl_Fill_Dial.H +++ b/FL/Fl_Fill_Dial.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Filled dial header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -32,7 +30,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Fill_Slider.H b/FL/Fl_Fill_Slider.H index 299c38e61..9290ed0c2 100644 --- a/FL/Fl_Fill_Slider.H +++ b/FL/Fl_Fill_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Filled slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -31,7 +29,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Float_Input.H b/FL/Fl_Float_Input.H index f60d4a284..7524e8dc2 100644 --- a/FL/Fl_Float_Input.H +++ b/FL/Fl_Float_Input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Floating point input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -41,7 +39,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_FormsBitmap.H b/FL/Fl_FormsBitmap.H index a0095fe6e..e5d6fb1db 100644 --- a/FL/Fl_FormsBitmap.H +++ b/FL/Fl_FormsBitmap.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms bitmap header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -24,7 +22,7 @@ #include "Fl_Bitmap.H" -/** +/** Forms compatibility Bitmap Image Widget */ class FL_EXPORT Fl_FormsBitmap : public Fl_Widget { @@ -41,7 +39,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_FormsPixmap.H b/FL/Fl_FormsPixmap.H index 6700addae..43cccd966 100644 --- a/FL/Fl_FormsPixmap.H +++ b/FL/Fl_FormsPixmap.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms pixmap header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -48,7 +46,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Free.H b/FL/Fl_Free.H index 2c6e4328a..1424a5956 100644 --- a/FL/Fl_Free.H +++ b/FL/Fl_Free.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms free header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -26,33 +24,33 @@ #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 */ +#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. + 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; @@ -66,15 +64,11 @@ public: }; // 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]*/ +#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$". -// diff --git a/FL/Fl_GIF_Image.H b/FL/Fl_GIF_Image.H index ff781acd8..673e9c0a7 100644 --- a/FL/Fl_GIF_Image.H +++ b/FL/Fl_GIF_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // GIF image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -42,7 +40,3 @@ protected: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H index 1369b58e8..218cf676e 100644 --- a/FL/Fl_Gl_Window.H +++ b/FL/Fl_Gl_Window.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -28,7 +26,7 @@ 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. @@ -42,7 +40,7 @@ class Fl_Gl_Window_Driver; 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. - + \see \ref opengl_highdpi \note FLTK 1.4 introduces a driver system for graphic calls. It is now possible @@ -81,9 +79,9 @@ public: 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 + 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: @@ -100,28 +98,28 @@ public: ... 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 + 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 + 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 + 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 + See char Fl_Gl_Window::context_valid() const */ void context_valid(char v) {if (v) valid_f_ |= 2; else valid_f_ &= 0xfd;} @@ -139,7 +137,7 @@ public: /** 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 @@ -151,14 +149,14 @@ public: - \c FL_STENCIL - stencil buffer - \c FL_MULTISAMPLE - multisample antialiasing - \c FL_OPENGL3 - use OpenGL version 3.0 or more. - + 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 @@ -166,14 +164,14 @@ public: 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. - + The FL_OPENGL3 flag is required to access OpenGL version 3 or more under the X11 and MacOS platforms; it's optional under Windows. See more details in \ref opengl3. - + \version the <tt>FL_OPENGL3</tt> flag appeared in version 1.3.4 */ int mode(int a) {return mode(a,0);} @@ -204,7 +202,7 @@ public: // 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. When an Fl_Gl_Window is mapped to a HighDPI display, the value given by Fl_Gl_Window::w() @@ -226,10 +224,10 @@ public: \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. + 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();} @@ -244,7 +242,3 @@ public: }; #endif // Fl_Gl_Window_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index b49e71185..88c70b3fd 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -64,9 +62,9 @@ struct Fl_Fontdesc; 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. - + <tt>Fl_Surface_Device::surface()->driver()</tt> - gives at any time the graphics driver used by all drawing operations. + 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() / @@ -130,7 +128,7 @@ and draw_fixed(Fl_RGB_Image *,....) because scale-and-draw may require function Alphablend() from MSIMG32.DLL. In the absence of that, the draw_rgb() implementation calls Fl_Graphics_Driver::draw_rgb() which runs Fl_GDI_Graphics_Driver::draw_fixed(Fl_RGB_Image*,...). - + Graphics drivers also implement cache(Fl_Pixmap*), cache(Fl_Bitmap*) and cache(Fl_RGB_Image*) to compute the cached form of all image types, and uncache(Fl_RGB_Image *,...), uncache_pixmap(fl_uintptr_t) and delete_bitmask(Fl_Bitmask) to destroy cached image forms. @@ -235,7 +233,7 @@ protected: static Fl_Offscreen get_offscreen_and_delete_image_surface(Fl_Image_Surface*); /** For internal library use only */ static void draw_empty(Fl_Image* img, int X, int Y) {img->draw_empty(X, Y);} - + Fl_Graphics_Driver(); void cache_size(Fl_Image *img, int &width, int &height); static unsigned need_pixmap_bg_color; @@ -402,10 +400,10 @@ struct Fl_Fontdesc { - 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 + 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 by the X11 and Windows platforms to support HiDPI displays. In the future, it may also be used by other platforms. */ @@ -492,7 +490,3 @@ protected: \} \endcond */ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Group.H b/FL/Fl_Group.H index e782b5219..26baf9726 100644 --- a/FL/Fl_Group.H +++ b/FL/Fl_Group.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Group header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -52,7 +50,7 @@ class FL_EXPORT Fl_Group : public Fl_Widget { int navigation(int); static Fl_Group *current_; - + // unimplemented copy ctor and assignment operator Fl_Group(const Fl_Group&); Fl_Group& operator=(const Fl_Group&); @@ -84,7 +82,7 @@ public: 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 + 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; @@ -98,7 +96,7 @@ public: virtual ~Fl_Group(); void add(Fl_Widget&); /** - See void Fl_Group::add(Fl_Widget &w) + See void Fl_Group::add(Fl_Widget &w) */ void add(Fl_Widget* o) {add(*o);} void insert(Fl_Widget&, int i); @@ -117,7 +115,7 @@ public: void clear(); /** - See void Fl_Group::resizable(Fl_Widget *box) + See void Fl_Group::resizable(Fl_Widget *box) */ void resizable(Fl_Widget& o) {resizable_ = &o;} /** @@ -132,11 +130,11 @@ public: \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 @@ -152,7 +150,7 @@ public: */ void resizable(Fl_Widget* o) {resizable_ = o;} /** - See void Fl_Group::resizable(Fl_Widget *box) + See void Fl_Group::resizable(Fl_Widget *box) */ Fl_Widget* resizable() const {return resizable_;} /** @@ -164,7 +162,7 @@ public: /** 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. @@ -204,7 +202,7 @@ public: /** This is a dummy class that allows you to end a Fl_Group in a constructor list of a class: - \code + \code class MyClass { Fl_Group group; Fl_Button button_in_group; @@ -218,7 +216,7 @@ public: end(), button_outside_group(10,120,60,30) { [..ctor code..] - } + } \endcode */ class FL_EXPORT Fl_End { @@ -228,7 +226,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Help_Dialog.H b/FL/Fl_Help_Dialog.H index 67c3e9f87..ef5f31028 100644 --- a/FL/Fl_Help_Dialog.H +++ b/FL/Fl_Help_Dialog.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // ======================================================================== // DO NOT EDIT FL/Fl_Help_Dialog.H and src/Fl_Help_Dialog.cxx !!! @@ -36,11 +34,11 @@ #include <FL/Fl_Help_View.H> class FL_EXPORT Fl_Help_Dialog { - int index_; - int max_; + 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_; + int find_pos_; public: Fl_Help_Dialog(); private: @@ -84,7 +82,3 @@ public: int y(); }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Help_View.H b/FL/Fl_Help_View.H index 19932cb2e..4df878bf3 100644 --- a/FL/Fl_Help_View.H +++ b/FL/Fl_Help_View.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Help Viewer widget definitions. // // Copyright 1997-2010 by Easy Software Products. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -45,15 +43,15 @@ typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *); // struct Fl_Help_Block { - const char *start, // Start of text - *end; // End of text - uchar border; // Draw border? - Fl_Color bgcolor; // Background color - int x, // Indentation/starting X coordinate - y, // Starting Y coordinate - w, // Width - h; // Height - int line[32]; // Left starting position for each line + const char *start, // Start of text + *end; // End of text + uchar border; // Draw border? + Fl_Color bgcolor; // Background color + int x, // Indentation/starting X coordinate + y, // Starting Y coordinate + w, // Width + h; // Height + int line[32]; // Left starting position for each line }; // @@ -61,12 +59,12 @@ struct Fl_Help_Block { // /** Definition of a link for the html viewer. */ struct Fl_Help_Link { - char filename[192], ///< Reference filename - name[32]; ///< Link target (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 + char filename[192], ///< Reference filename + name[32]; ///< Link target (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 }; /* @@ -93,22 +91,22 @@ struct FL_EXPORT Fl_Help_Font_Stack { nfonts_ = 0; } - void init(Fl_Font f, Fl_Fontsize s, Fl_Color c) { + void init(Fl_Font f, Fl_Fontsize s, Fl_Color c) { nfonts_ = 0; elts_[nfonts_].set(f, s, c); - fl_font(f, s); + fl_font(f, s); fl_color(c); } /** Gets the top (current) element on the stack. */ void top(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) { elts_[nfonts_].get(f, s, c); } /** Pushes the font style triplet on the stack, also calls fl_font() & fl_color() adequately */ - void push(Fl_Font f, Fl_Fontsize s, Fl_Color c) { + void push(Fl_Font f, Fl_Fontsize s, Fl_Color c) { if (nfonts_ < MAX_FL_HELP_FS_ELTS-1) nfonts_ ++; elts_[nfonts_].set(f, s, c); - fl_font(f, s); fl_color(c); + fl_font(f, s); fl_color(c); } /** Pops from the stack the font style triplet and calls fl_font() & fl_color() adequately */ - void pop(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) { + void pop(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) { if (nfonts_ > 0) nfonts_ --; top(f, s, c); fl_font(f, s); fl_color(c); @@ -117,15 +115,15 @@ struct FL_EXPORT Fl_Help_Font_Stack { size_t count() const {return nfonts_;} // Gets the current number of fonts in the stack protected: - size_t nfonts_; ///< current number of fonts in stack + size_t nfonts_; ///< current number of fonts in stack Fl_Help_Font_Style elts_[MAX_FL_HELP_FS_ELTS]; ///< font elements }; /** Fl_Help_Target structure */ struct Fl_Help_Target { - char name[32]; ///< Target name - int y; ///< Y offset of target + char name[32]; ///< Target name + int y; ///< Y offset of target }; /** @@ -193,42 +191,42 @@ struct Fl_Help_Target { - yen Yuml yuml */ -class FL_EXPORT Fl_Help_View : public Fl_Group { // Help viewer widget - - 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 - Fl_Font textfont_; ///< Default font for text - Fl_Fontsize textsize_; ///< Default font size - const char *value_; ///< HTML text value - Fl_Help_Font_Stack fstack_; ///< font stack management - int nblocks_, ///< Number of blocks/paragraphs - 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 *targets_; ///< Targets - - char directory_[FL_PATH_MAX];///< Directory for current file - char filename_[FL_PATH_MAX]; ///< Current filename - int topline_, ///< Top line in document - leftline_, ///< Lefthand 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 +class FL_EXPORT Fl_Help_View : public Fl_Group { // Help viewer widget + + 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 + Fl_Font textfont_; ///< Default font for text + Fl_Fontsize textsize_; ///< Default font size + const char *value_; ///< HTML text value + Fl_Help_Font_Stack fstack_; ///< font stack management + int nblocks_, ///< Number of blocks/paragraphs + 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 *targets_; ///< Targets + + char directory_[FL_PATH_MAX];///< Directory for current file + char filename_[FL_PATH_MAX]; ///< Current filename + int topline_, ///< Top line in document + leftline_, ///< Lefthand 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 static int selection_first; static int selection_last; @@ -251,24 +249,24 @@ class FL_EXPORT Fl_Help_View : public Fl_Group { // Help viewer widget void pushfont(Fl_Font f, Fl_Fontsize s, Fl_Color c) {fstack_.push(f, s, c);} void popfont(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) {fstack_.pop(f, s, c);} - Fl_Help_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0); - void add_link(const char *n, int xx, int yy, int ww, int hh); - void add_target(const char *n, int yy); - static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1); - int do_align(Fl_Help_Block *block, int line, int xx, int a, int &l); + Fl_Help_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0); + void add_link(const char *n, int xx, int yy, int ww, int hh); + void add_target(const char *n, int yy); + static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1); + int do_align(Fl_Help_Block *block, int line, int xx, int a, int &l); protected: - void draw(); + void draw(); private: - void format(); - void format_table(int *table_width, int *columns, const char *table); - void free_data(); - int get_align(const char *p, int a); - const char *get_attr(const char *p, const char *n, char *buf, int bufsize); - Fl_Color get_color(const char *n, Fl_Color c); + void format(); + void format_table(int *table_width, int *columns, const char *table); + void free_data(); + int get_align(const char *p, int a); + const char *get_attr(const char *p, const char *n, char *buf, int bufsize); + Fl_Color get_color(const char *n, Fl_Color c); Fl_Shared_Image *get_image(const char *name, int W, int H); - int get_length(const char *l); + int get_length(const char *l); public: - int handle(int); + int handle(int); private: void hv_draw(const char *t, int x, int y, int entity_extra_length = 0); @@ -284,72 +282,72 @@ public: Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0); ~Fl_Help_View(); /** Returns the current directory for the text in the buffer. */ - const char *directory() const { if (directory_[0]) return (directory_); - else return ((const char *)0); } + const char *directory() const { if (directory_[0]) return (directory_); + else return ((const char *)0); } /** Returns the current filename for the text in the buffer. */ - const char *filename() const { if (filename_[0]) return (filename_); - else return ((const char *)0); } - int find(const char *s, int p = 0); + const char *filename() const { if (filename_[0]) return (filename_); + else return ((const char *)0); } + int find(const char *s, int p = 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) { link_ = fn; } - int load(const char *f); - void resize(int,int,int,int); + void link(Fl_Help_Func *fn) { link_ = fn; } + int load(const char *f); + void resize(int,int,int,int); /** Gets the size of the help view. */ - int size() const { return (size_); } - void size(int W, int H) { Fl_Widget::size(W, H); } + int size() const { return (size_); } + void size(int W, int H) { Fl_Widget::size(W, H); } /** Sets the default text color. */ - void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; } + void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; } /** Returns the current default text color. */ - Fl_Color textcolor() const { return (defcolor_); } + Fl_Color textcolor() const { return (defcolor_); } /** Sets the default text font. */ - void textfont(Fl_Font f) { textfont_ = f; format(); } + void textfont(Fl_Font f) { textfont_ = f; format(); } /** Returns the current default text font. */ Fl_Font textfont() const { return (textfont_); } /** Sets the default text size. */ - void textsize(Fl_Fontsize s) { textsize_ = s; format(); } + void textsize(Fl_Fontsize s) { textsize_ = s; format(); } /** Gets the default text size. */ Fl_Fontsize textsize() const { return (textsize_); } /** Returns the current document title, or NULL if there is no title. */ - const char *title() { return (title_); } - void topline(const char *n); - void topline(int); + const char *title() { return (title_); } + void topline(const char *n); + void topline(int); /** Returns the current top line in pixels. */ - int topline() const { return (topline_); } - void leftline(int); + int topline() const { return (topline_); } + void leftline(int); /** Gets the left position in pixels. */ - int leftline() const { return (leftline_); } - void value(const char *val); + int leftline() const { return (leftline_); } + void value(const char *val); /** Returns the current buffer contents. */ - const char *value() const { return (value_); } + const char *value() const { 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 + 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) */ @@ -360,28 +358,24 @@ public: 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 + 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; - } + } }; #endif // !Fl_Help_View_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Hold_Browser.H b/FL/Fl_Hold_Browser.H index 79113b496..cc0192c39 100644 --- a/FL/Fl_Hold_Browser.H +++ b/FL/Fl_Hold_Browser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Hold browser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -25,7 +23,7 @@ #include "Fl_Browser.H" /** - The Fl_Hold_Browser is a subclass of Fl_Browser which lets the user + 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. \image html fl_hold_browser.png "Fl_Hold_Browser" @@ -49,7 +47,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Hor_Fill_Slider.H b/FL/Fl_Hor_Fill_Slider.H index 934bc059c..c8890dbf4 100644 --- a/FL/Fl_Hor_Fill_Slider.H +++ b/FL/Fl_Hor_Fill_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Horizontal fill slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Hor_Nice_Slider.H b/FL/Fl_Hor_Nice_Slider.H index c862f8bf1..e9393d449 100644 --- a/FL/Fl_Hor_Nice_Slider.H +++ b/FL/Fl_Hor_Nice_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Horizontal "nice" slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Hor_Slider.H b/FL/Fl_Hor_Slider.H index 415cdb763..cfd2426f5 100644 --- a/FL/Fl_Hor_Slider.H +++ b/FL/Fl_Hor_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Horizontal slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -39,7 +37,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Hor_Value_Slider.H b/FL/Fl_Hor_Value_Slider.H index 183a1cfcb..88c6efe95 100644 --- a/FL/Fl_Hor_Value_Slider.H +++ b/FL/Fl_Hor_Value_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Horizontal value slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H index decc5bdeb..dc09ed7a4 100644 --- a/FL/Fl_Image.H +++ b/FL/Fl_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -44,19 +42,19 @@ enum Fl_RGB_Scaling { /** \brief Base class for image caching, scaling and drawing. - + Fl_Image is the base class used for caching, scaling 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 + 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. - + Each image possesses two (width, height) pairs. 1) The width and height of the image raw data are returned by data_w() and data_h(). These values are set when the image is created and remain unchanged. 2) The width and height of the area filled by the image when it gets drawn are returned by w() and h(). The values are equal to data_w() and data_h() when the image is created, and can be changed by the scale() member function. - + 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. @@ -67,7 +65,7 @@ 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_; int data_w_, data_h_; @@ -108,7 +106,7 @@ protected: 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;} @@ -120,7 +118,7 @@ protected: public: - /** + /** Returns the current image drawing width in FLTK units. The values of w() and data_w() are identical unless scale() has been called after which they may differ. @@ -233,10 +231,10 @@ public: /** 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 + 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. @@ -256,7 +254,7 @@ public: static void RGB_scaling(Fl_RGB_Scaling); // get RGB image scaling method static Fl_RGB_Scaling RGB_scaling(); - + // set the image drawing size virtual void scale(int width, int height, int proportional = 1, int can_expand = 0); /** Sets what algorithm is used when resizing a source image to draw it. @@ -320,17 +318,17 @@ public: 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 + 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 + 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. + 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_;} @@ -343,7 +341,3 @@ public: }; #endif // !Fl_Image_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Image_Surface.H b/FL/Fl_Image_Surface.H index 9c78f3d43..68596e930 100644 --- a/FL/Fl_Image_Surface.H +++ b/FL/Fl_Image_Surface.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Image_Surface_H @@ -25,17 +23,17 @@ #include <FL/platform_types.h> // for Fl_Offscreen -/** +/** \brief Directs all graphics requests to an Fl_Image. - + After creation of an Fl_Image_Surface object, make it the current drawing surface calling Fl_Surface_Device::push_current(), 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 + 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. - + Usage example: \code // this is the widget that you want to draw into an image @@ -43,12 +41,12 @@ // 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 Fl_Surface_Device::push_current(image_surface); // draw a white background - fl_color(FL_WHITE); + fl_color(FL_WHITE); fl_rectf(0, 0, g->w(), g->h()); // draw the g widget in the image @@ -59,7 +57,7 @@ // direct graphics requests back to their previous destination Fl_Surface_Device::pop_current(); - + // delete the image_surface object, but not the image itself delete image_surface; \endcode @@ -125,7 +123,3 @@ protected: */ #endif // Fl_Image_Surface_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Input.H b/FL/Fl_Input.H index 9257ff29b..f165ddc6e 100644 --- a/FL/Fl_Input.H +++ b/FL/Fl_Input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -40,16 +38,16 @@ <TABLE WIDTH="90%" BORDER="1" SUMMARY="Fl_Input keyboard and mouse bindings."> <CAPTION ALIGN="TOP">Keyboard and mouse bindings.</CAPTION> <TR><TD NOWRAP="NOWRAP" WIDTH="1%"> - <B>Mouse button 1</B> + <B>Mouse button 1</B> </TD><TD> - Moves the cursor to this point. - Drag selects characters. - Double click selects words. + 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> + <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 @@ -124,7 +122,7 @@ <TD NOWRAP="NOWRAP"><B> Command-V </B></TD> <TD> <B>Paste the clipboard.</B> <BR> - (Macs keyboards don't have "Insert" keys, + (Macs keyboards don't have "Insert" keys, but if they did, Shift-Insert would work) </TD></TR><TR> @@ -140,16 +138,16 @@ <TD NOWRAP="NOWRAP"><B> Command-Z </B></TD> <TD> <B>Undo.</B> <BR> - This is a single-level undo mechanism, but all adjacent + 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. + 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. + Currently same behavior as ^Z. Reserved for future multilevel undo/redo. </TD></TR><TR> @@ -264,8 +262,4 @@ public: Fl_Input(int,int,int,int,const char * = 0); }; -#endif - -// -// End of "$Id$". -// +#endif diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H index a07a70282..315f24a68 100644 --- a/FL/Fl_Input_.H +++ b/FL/Fl_Input_.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Input base class header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -26,18 +24,18 @@ #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_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) /** @@ -54,16 +52,16 @@ 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_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 @@ -113,8 +111,8 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget { 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 + /** \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_; @@ -180,7 +178,7 @@ protected: /* Find the start of a line. */ int line_start(int i) const; - + /* Find the end of a line. */ int line_end(int i) const; @@ -238,8 +236,8 @@ public: 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 + + \return pointer to an internal buffer - do not free() this \see Fl_Input_::value(const char*) */ const char* value() const {return value_;} @@ -248,9 +246,9 @@ public: 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 + 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 @@ -283,7 +281,7 @@ public: */ int position() const {return position_;} - /** Gets the current selection mark. + /** Gets the current selection mark. \return index into the text */ int mark() const {return mark_;} @@ -298,9 +296,9 @@ public: */ int position(int p) {return position(p, p);} - /** Sets the current selection mark. + /** Sets the current selection mark. mark(n) is the same as <tt>position(position(),n)</tt>. - \param m new index of the mark + \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);} @@ -377,11 +375,11 @@ public: \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() + \param [in] s new shortcut keystroke + \see Fl_Button::shortcut() */ void shortcut(int s) {shortcut_ = s;} @@ -414,52 +412,52 @@ public: \see textcolor() */ void textcolor(Fl_Color n) {textcolor_ = n;} - /** Gets the color of the cursor. + /** 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. + /** 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. + /** Gets the input field type. \return the current input type */ int input_type() const {return type() & FL_INPUT_TYPE; } - /** Sets the input field 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. + /** 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. + /** 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. + 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. + 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, + 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. + 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. @@ -468,8 +466,8 @@ public: 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. + 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> @@ -496,8 +494,4 @@ public: } }; -#endif - -// -// End of "$Id$". -// +#endif diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H index 80cee90b4..9f29ce968 100644 --- a/FL/Fl_Input_Choice.H +++ b/FL/Fl_Input_Choice.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // An input/chooser widget. // ______________ ____ // | || __ | @@ -14,11 +12,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -184,7 +182,3 @@ public: }; #endif // !Fl_Input_Choice_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Int_Input.H b/FL/Fl_Int_Input.H index cb6e8141e..508a2f8ee 100644 --- a/FL/Fl_Int_Input.H +++ b/FL/Fl_Int_Input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Integer input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -40,7 +38,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_JPEG_Image.H b/FL/Fl_JPEG_Image.H index 50553823c..f4eeb42cf 100644 --- a/FL/Fl_JPEG_Image.H +++ b/FL/Fl_JPEG_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // JPEG image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -43,7 +41,3 @@ protected: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Light_Button.H b/FL/Fl_Light_Button.H index 8735f3dcb..2a3ca1007 100644 --- a/FL/Fl_Light_Button.H +++ b/FL/Fl_Light_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Lighted button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -25,14 +23,14 @@ #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" + 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> + <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 { @@ -44,7 +42,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Line_Dial.H b/FL/Fl_Line_Dial.H index 150a05df5..873e82b48 100644 --- a/FL/Fl_Line_Dial.H +++ b/FL/Fl_Line_Dial.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line dial header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Menu.H b/FL/Fl_Menu.H index a0f2545dd..eb6caf740 100644 --- a/FL/Fl_Menu.H +++ b/FL/Fl_Menu.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Old menu header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,16 +7,12 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // this include file is for back compatibility only #include "Fl_Menu_Item.H" - -// -// End of "$Id$". -// diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H index 4ebfc5852..1bd10d4d7 100644 --- a/FL/Fl_Menu_.H +++ b/FL/Fl_Menu_.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu base class header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -59,7 +57,7 @@ class FL_EXPORT Fl_Menu_ : public Fl_Widget { protected: - uchar alloc; // flag indicates if menu_ is a dynamic copy (=1) or not (=0) + uchar alloc; // flag indicates if menu_ is a dynamic copy (=1) or not (=0) uchar down_box_; Fl_Font textfont_; Fl_Fontsize textsize_; @@ -204,7 +202,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Menu_Bar.H b/FL/Fl_Menu_Bar.H index 11a895430..a97ccf45a 100644 --- a/FL/Fl_Menu_Bar.H +++ b/FL/Fl_Menu_Bar.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu bar header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -96,7 +94,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Menu_Button.H b/FL/Fl_Menu_Button.H index 7f18eab66..b592dbb19 100644 --- a/FL/Fl_Menu_Button.H +++ b/FL/Fl_Menu_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -26,15 +24,15 @@ /** This is a button that when pushed pops up a menu (or hierarchy of - menus) defined by an array 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 + 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> @@ -47,7 +45,7 @@ and then: - The item's callback is done if one has been set; the - Fl_Menu_Button is passed as the Fl_Widget* argument, + 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 @@ -61,10 +59,10 @@ protected: public: /** \brief indicate what mouse buttons pop up the menu. - - Values for type() used to 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. */ @@ -79,7 +77,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H index dbe1a80fb..65be443cd 100644 --- a/FL/Fl_Menu_Item.H +++ b/FL/Fl_Menu_Item.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu item header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Menu_Item_H @@ -27,15 +25,15 @@ /// @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 + 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*); @@ -44,7 +42,7 @@ class Fl_Menu_; /** The Fl_Menu_Item structure defines a single menu item that - is used by the Fl_Menu_ class. + is used by the Fl_Menu_ class. \code struct Fl_Menu_Item { const char* text; // label() @@ -57,7 +55,7 @@ class Fl_Menu_; 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) @@ -96,7 +94,7 @@ class Fl_Menu_; \image html menu.png \image latex menu.png "menu" width=10cm - A submenu title is identified by the bit FL_SUBMENU in the + 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 @@ -107,15 +105,15 @@ class Fl_Menu_; releases of FLTK. */ struct FL_EXPORT Fl_Menu_Item { - const char *text; ///< menu item text, returned by label() - int shortcut_; ///< menu item shortcut + 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 + 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 + Fl_Color labelcolor_; ///< menu item text color // advance N items, skipping submenus: const Fl_Menu_Item *next(int=1) const; @@ -271,17 +269,17 @@ struct FL_EXPORT Fl_Menu_Item { /** 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 + 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 + 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 + 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;} @@ -420,7 +418,7 @@ struct FL_EXPORT Fl_Menu_Item { /** 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) { + void* d = 0, int e = 0) { return add(a,fl_old_shortcut(b),c,d,e);} int size() const ; @@ -428,21 +426,17 @@ struct FL_EXPORT Fl_Menu_Item { 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, +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$". -// diff --git a/FL/Fl_Menu_Window.H b/FL/Fl_Menu_Window.H index 90e6426b9..deae888af 100644 --- a/FL/Fl_Menu_Window.H +++ b/FL/Fl_Menu_Window.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu window header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -51,7 +49,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Multi_Browser.H b/FL/Fl_Multi_Browser.H index 39bd446b3..69a6395dc 100644 --- a/FL/Fl_Multi_Browser.H +++ b/FL/Fl_Multi_Browser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Multi browser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -26,16 +24,16 @@ /** The Fl_Multi_Browser class is a subclass of Fl_Browser - which lets the user select any set of the lines. + which lets the user select any set of the lines. \image html fl_multi_browser.png "Fl_Multi_Browser" \image latex fl_multi_browser.png "Fl_Multi_Browser" width=4cm 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. + 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. + 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. @@ -52,7 +50,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Multi_Label.H b/FL/Fl_Multi_Label.H index 1500964b3..ff46e32df 100644 --- a/FL/Fl_Multi_Label.H +++ b/FL/Fl_Multi_Label.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Multi-label header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Multi_Label_H @@ -45,8 +43,8 @@ struct Fl_Menu_Item; 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..) + 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", ..); @@ -96,7 +94,3 @@ struct FL_EXPORT Fl_Multi_Label { }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Multiline_Input.H b/FL/Fl_Multiline_Input.H index 4ac3441e9..552721005 100644 --- a/FL/Fl_Multiline_Input.H +++ b/FL/Fl_Multiline_Input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Multiline input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,15 +7,15 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file - Fl_Multiline_Input widget . */ + Fl_Multiline_Input widget . */ #ifndef Fl_Multiline_Input_H #define Fl_Multiline_Input_H @@ -54,7 +52,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Multiline_Output.H b/FL/Fl_Multiline_Output.H index d5ffdc5d6..a8bd088bc 100644 --- a/FL/Fl_Multiline_Output.H +++ b/FL/Fl_Multiline_Output.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Multi line output header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -32,7 +30,7 @@ Note that this widget does not support scrollbars, or per-character color control. - If you are presenting large amounts of read-only text + 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. @@ -50,7 +48,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H index 4f0cbc3e0..423560ccc 100644 --- a/FL/Fl_Native_File_Chooser.H +++ b/FL/Fl_Native_File_Chooser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLTK native OS file chooser widget // // Copyright 1998-2016 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -38,15 +36,15 @@ 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. + + 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; @@ -63,19 +61,19 @@ 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). - + 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 @@ -94,15 +92,15 @@ class Fl_Native_File_Chooser_Driver; 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 Windows platform to open files with a non-ASCII name). - + <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. @@ -111,34 +109,34 @@ class Fl_Native_File_Chooser_Driver; 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 + - 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 + 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) - PREVIEW = 0x0004, ///< enable preview mode (if supported) - USE_FILTER_EXT = 0x0008 ///< Chooser filter pilots the output file extension (if supported) + 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) + PREVIEW = 0x0004, ///< enable preview mode (if supported) + USE_FILTER_EXT = 0x0008 ///< Chooser filter pilots the output file extension (if supported) }; static const char *file_exists_message; - + /** The constructor. Internally allocates the native widgets. Optional \p val presets the type of browser this will be, @@ -213,7 +211,7 @@ public: /** 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 @@ -229,16 +227,16 @@ private: int exist_dialog(); void parse_filter(); protected: - int _btype; // kind-of browser to show() - int _options; // general options + 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 *_filter; // user supplied filter + char *_parsedfilt; // parsed filter + int _filtvalue; // selected filter char *_preset_file; - char *_prevvalue; // Returned filename + char *_prevvalue; // Returned filename char *_directory; - char *_errmsg; // error message + char *_errmsg; // error message Fl_File_Chooser *_file_chooser; public: Fl_Native_File_Chooser_FLTK_Driver(int val); @@ -272,7 +270,3 @@ public: #endif /*FL_NATIVE_FILE_CHOOSER_H*/ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Nice_Slider.H b/FL/Fl_Nice_Slider.H index febeb940a..1887eacc4 100644 --- a/FL/Fl_Nice_Slider.H +++ b/FL/Fl_Nice_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // "Nice" slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Object.H b/FL/Fl_Object.H index 9cbbcca3b..8098dd2d9 100644 --- a/FL/Fl_Object.H +++ b/FL/Fl_Object.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Old Fl_Object header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // This file is provided for back compatibility only. Please use Fl_Widget @@ -21,7 +19,3 @@ #define Fl_Object Fl_Widget #endif #include "Fl_Widget.H" - -// -// End of "$Id$". -// diff --git a/FL/Fl_Output.H b/FL/Fl_Output.H index 5d1827164..06dfeb650 100644 --- a/FL/Fl_Output.H +++ b/FL/Fl_Output.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Output header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -25,7 +23,7 @@ #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 @@ -56,8 +54,4 @@ public: Fl_Output(int X,int Y,int W,int H, const char *l = 0); }; -#endif - -// -// End of "$Id$". -// +#endif diff --git a/FL/Fl_Overlay_Window.H b/FL/Fl_Overlay_Window.H index 4d600a47f..d19bc3dc1 100644 --- a/FL/Fl_Overlay_Window.H +++ b/FL/Fl_Overlay_Window.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Overlay window header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -66,7 +64,7 @@ protected: 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 + position, size, and label (title) string. If the positions (x,y) are not given, then the window manager will choose them. */ @@ -77,7 +75,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_PNG_Image.H b/FL/Fl_PNG_Image.H index 84c246926..b0bd92ffa 100644 --- a/FL/Fl_PNG_Image.H +++ b/FL/Fl_PNG_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // PNG image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -40,7 +38,3 @@ private: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_PNM_Image.H b/FL/Fl_PNM_Image.H index e5b05885f..ff0b63744 100644 --- a/FL/Fl_PNM_Image.H +++ b/FL/Fl_PNM_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // PNM image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -37,7 +35,3 @@ class FL_EXPORT Fl_PNM_Image : public Fl_RGB_Image { }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Pack.H b/FL/Fl_Pack.H index 26c5a33a7..cb2d7bb95 100644 --- a/FL/Fl_Pack.H +++ b/FL/Fl_Pack.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pack header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -93,7 +91,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Paged_Device.H b/FL/Fl_Paged_Device.H index 154fb5d7a..3229de8a4 100644 --- a/FL/Fl_Paged_Device.H +++ b/FL/Fl_Paged_Device.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Printing support for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -9,14 +7,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -/** \file Fl_Paged_Device.H +/** \file Fl_Paged_Device.H \brief declaration of class Fl_Paged_Device. */ @@ -32,7 +30,7 @@ /** \brief Represents page-structured drawing surfaces. - This class has no public constructor: don't instantiate it; use Fl_Printer + 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 { @@ -42,7 +40,7 @@ protected: public: /** \brief Possible page formats. - + All paper formats with pre-defined width and height. */ enum Page_Format { @@ -92,15 +90,15 @@ public: */ typedef struct { /** \brief width in points */ - int width; + int width; /** \brief height in points */ - int height; + int height; /** \brief format name */ - const char *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]; + static const page_format page_formats[NO_PAGE_FORMATS]; /** \brief The destructor */ virtual ~Fl_Paged_Device() {}; virtual int begin_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message = NULL); @@ -128,7 +126,3 @@ public: #endif // Fl_Paged_Device_H -// -// End of "$Id$" -// - diff --git a/FL/Fl_Pixmap.H b/FL/Fl_Pixmap.H index 384a25b22..c446a92be 100644 --- a/FL/Fl_Pixmap.H +++ b/FL/Fl_Pixmap.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pixmap header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -47,7 +45,7 @@ protected: public: int alloc_data; // Non-zero if data was allocated - + private: // for internal use fl_uintptr_t id_; @@ -77,7 +75,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Plugin.H b/FL/Fl_Plugin.H index 6cbd840ad..aca8d4b8b 100644 --- a/FL/Fl_Plugin.H +++ b/FL/Fl_Plugin.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // A Plugin system for FLTK, implemented in Fl_Preferences.cxx. // // Copyright 2002-2010 by Matthias Melcher. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,7 +25,7 @@ /** \brief Fl_Plugin allows link-time and run-time integration of binary modules. - + Fl_Plugin and Fl_Plugin_Manager provide a small and simple solution for linking C++ classes at run-time, or optionally linking modules at compile time without the need to change the main application. @@ -35,7 +33,7 @@ Fl_Plugin_Manager uses static initialisation to create the plugin interface early during startup. Plugins are stored in a temporary database, organized in classes. - + Plugins should derive a new class from Fl_Plugin as a base: \code class My_Plugin : public Fl_Plugin { @@ -45,9 +43,9 @@ }; My_Plugin blur_plugin(); \endcode - + Plugins can be put into modules and either linked before distribution, or loaded - from dynamically linkable files. An Fl_Plugin_Manager is used to list and + from dynamically linkable files. An Fl_Plugin_Manager is used to list and access all currently loaded plugins. \code Fl_Plugin_Manager mgr("effects"); @@ -74,14 +72,14 @@ class FL_EXPORT Fl_Plugin_Manager : public Fl_Preferences { public: Fl_Plugin_Manager(const char *klass); ~Fl_Plugin_Manager(); - + /** \brief Return the number of plugins in the klass. */ int plugins() { return groups(); } Fl_Plugin *plugin(int index); Fl_Plugin *plugin(const char *name); Fl_Preferences::ID addPlugin(const char *name, Fl_Plugin *plugin); - + static void removePlugin(Fl_Preferences::ID id); static int load(const char *filename); static int loadAll(const char *filepath, const char *pattern=0); @@ -89,7 +87,3 @@ public: #endif // !Fl_Preferences_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Positioner.H b/FL/Fl_Positioner.H index a47e64cd9..02d872e03 100644 --- a/FL/Fl_Positioner.H +++ b/FL/Fl_Positioner.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Positioner header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -31,7 +29,7 @@ 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> + <P ALIGN=CENTER>\image html positioner.png </P> \image latex positioner.png " Fl_Positioner" width=4cm */ class FL_EXPORT Fl_Positioner : public Fl_Widget { @@ -88,7 +86,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_PostScript.H b/FL/Fl_PostScript.H index ad6a6cd4a..f5f55f4fd 100644 --- a/FL/Fl_PostScript.H +++ b/FL/Fl_PostScript.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Support for graphics output to PostScript file for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,12 +9,12 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -/** \file Fl_PostScript.H +/** \file Fl_PostScript.H \brief declaration of classes Fl_PostScript_Graphics_Driver, Fl_PostScript_File_Device. */ @@ -57,21 +55,21 @@ 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_;// @@ -82,7 +80,7 @@ public: 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 @@ -91,16 +89,16 @@ public: 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); @@ -108,10 +106,10 @@ public: 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;}; @@ -121,43 +119,43 @@ public: //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 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(); @@ -176,12 +174,12 @@ public: 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); @@ -206,7 +204,7 @@ public: // --- Fl_Bitmask create_bitmask(int w, int h, const uchar *array) { return 0L; } virtual int has_feature(driver_feature feature_mask) { return feature_mask & PRINTER; } - + int start_eps(int width, int height); void ps_origin(int x, int y); void ps_translate(int, int); @@ -222,7 +220,7 @@ public: To send graphical output to a PostScript file. This class is used exactly as the Fl_Printer class except for the begin_job() call, two variants of which are usable and allow to specify what page format and layout are desired. - + 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, @@ -274,7 +272,7 @@ public: @return 0 if OK, 1 if user cancelled the file dialog, 2 if fopen failed on user-selected output file. */ int begin_job(int pagecount = 0, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, - enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT); + enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT); /** Synonym of begin_job(). For API compatibility with FLTK 1.3.x */ int start_job(int pagecount = 0, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, @@ -292,7 +290,7 @@ public: @return always 0. */ int begin_job(FILE *ps_output, int pagecount = 0, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, - enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT); + enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT); /** Synonym of begin_job(). For API compatibility with FLTK 1.3.x */ int start_job(FILE *ps_output, int pagecount = 0, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, @@ -309,8 +307,8 @@ public: void rotate(float angle); void translate(int x, int y); void untranslate(void); - int end_page (void); - void end_job(void); + int end_page (void); + void end_job(void); /** \brief Label of the PostScript file chooser window */ static const char *file_chooser_title; }; @@ -368,7 +366,3 @@ public: }; #endif // Fl_PostScript_H - -// -// End of "$Id$" -// diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H index 9690e456f..9378ec408 100644 --- a/FL/Fl_Preferences.H +++ b/FL/Fl_Preferences.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Preferences implementation for the Fast Light Tool Kit (FLTK). // // Copyright 2002-2010 by Matthias Melcher. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -23,7 +21,7 @@ # define Fl_Preferences_H # include <stdio.h> -# include "Fl_Export.H" +# include "Fl_Export.H" /** \brief Fl_Preferences provides methods to store user @@ -51,7 +49,7 @@ reasons. One application can have multiple preferences files. Extensive binary data however should be stored in separate files: see \a Fl_Preferences::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 @@ -64,11 +62,11 @@ */ class FL_EXPORT Fl_Preferences { -public: +public: /** Define the scope of the preferences. */ - enum Root { + enum Root { SYSTEM = 0, ///< Preferences are used system-wide USER, ///< Preferences apply only to the current user ROOT_MASK = 0xFF, ///< masks for the values above @@ -76,16 +74,16 @@ public: CORE_SYSTEM = CORE|SYSTEM, CORE_USER = CORE|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 + 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(); /** Set this, if no call to Fl_Preferences shall access the file sytem @@ -132,11 +130,11 @@ public: 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(); } @@ -144,11 +142,11 @@ public: /** 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 ); @@ -160,7 +158,7 @@ public: char entryExists( const char *key ); char deleteEntry( const char *entry ); char deleteAllEntries(); - + char clear(); char set( const char *entry, int value ); @@ -169,8 +167,8 @@ public: 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 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 ); @@ -187,13 +185,13 @@ public: // 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. - + 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 @@ -204,7 +202,7 @@ public: char *data_; - public: + public: Name( unsigned int n ); Name( const char *format, ... ); @@ -221,7 +219,7 @@ public: char *name, *value; }; -private: +private: Fl_Preferences() : node(0), rootNode(0) { } Fl_Preferences &operator=(const Fl_Preferences&); @@ -232,13 +230,13 @@ private: 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 + + 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 + union { // these two are mutually exclusive + Node *parent_; // top_ bit clear + RootNode *root_; // top_ bit set }; char *path_; Entry *entry_; @@ -288,7 +286,7 @@ public: // older Sun compilers need this (public definition of the following cl }; friend class Node; - class FL_EXPORT RootNode { // the root node manages file paths and basic reading and writing + class FL_EXPORT RootNode { // the root node manages file paths and basic reading and writing Fl_Preferences *prefs_; char *filename_; char *vendor_, *application_; @@ -310,7 +308,3 @@ protected: }; #endif // !Fl_Preferences_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index 43b05c1be..320ec12f6 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Printing support for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -9,14 +7,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -/** \file Fl_Printer.H +/** \file Fl_Printer.H \brief declaration of class Fl_Printer. */ @@ -29,11 +27,11 @@ \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(), + <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. + compose a page appropriately shaped for printing. </ul> In both cases, begin by begin_job(), begin_page(), printable_rect() and origin() calls and finish by end_page() and end_job() calls. @@ -111,12 +109,12 @@ public: /** \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_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; @@ -131,13 +129,9 @@ public: static const char *property_use; static const char *property_save; static const char *property_cancel; - /** \} */ + /** \} */ /** The destructor */ ~Fl_Printer(void); }; #endif // Fl_Printer_H - -// -// End of "$Id$" -// diff --git a/FL/Fl_Progress.H b/FL/Fl_Progress.H index 769028f22..e0b5d8911 100644 --- a/FL/Fl_Progress.H +++ b/FL/Fl_Progress.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Progress bar widget definitions. // // Copyright 2000-2010 by Michael Sweet. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -36,10 +34,10 @@ Displays a progress bar for the user. */ class FL_EXPORT Fl_Progress : public Fl_Widget { - - float value_, - minimum_, - maximum_; + + float value_, + minimum_, + maximum_; protected: @@ -50,23 +48,19 @@ class FL_EXPORT Fl_Progress : public Fl_Widget { 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(); } + void maximum(float v) { maximum_ = v; redraw(); } /** Gets the maximum value in the progress widget. */ - float maximum() const { return (maximum_); } + float maximum() const { return (maximum_); } /** Sets the minimum value in the progress widget. */ - void minimum(float v) { minimum_ = v; redraw(); } + void minimum(float v) { minimum_ = v; redraw(); } /** Gets the minimum value in the progress widget. */ - float minimum() const { return (minimum_); } + float minimum() const { return (minimum_); } /** Sets the current value in the progress widget. */ - void value(float v) { value_ = v; redraw(); } + void value(float v) { value_ = v; redraw(); } /** Gets the current value in the progress widget. */ - float value() const { return (value_); } + float value() const { return (value_); } }; #endif // !_Fl_Progress_H_ - -// -// End of "$Id$". -// diff --git a/FL/Fl_RGB_Image.H b/FL/Fl_RGB_Image.H index 056d4145b..1584c2fcb 100644 --- a/FL/Fl_RGB_Image.H +++ b/FL/Fl_RGB_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // RGB Image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,18 +7,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_RGB_Image_H # define Fl_RGB_Image_H # include "Fl_Image.H" #endif // !Fl_RGB_Image_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Radio_Button.H b/FL/Fl_Radio_Button.H index 5dafe42a8..9cfc31621 100644 --- a/FL/Fl_Radio_Button.H +++ b/FL/Fl_Radio_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Radio button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Radio_Light_Button.H b/FL/Fl_Radio_Light_Button.H index 5945be11f..0877377db 100644 --- a/FL/Fl_Radio_Light_Button.H +++ b/FL/Fl_Radio_Light_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Radio light button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Radio_Round_Button.H b/FL/Fl_Radio_Round_Button.H index 91f53481a..ab0dc55d2 100644 --- a/FL/Fl_Radio_Round_Button.H +++ b/FL/Fl_Radio_Round_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Radio round button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,7 +28,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Rect.H b/FL/Fl_Rect.H index 00e570a82..32ce01ffb 100644 --- a/FL/Fl_Rect.H +++ b/FL/Fl_Rect.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Rect header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,17 +7,17 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Rect_H #define Fl_Rect_H -#include <FL/Fl_Widget.H> // for c'tor based on Fl_Widget +#include <FL/Fl_Widget.H> // for c'tor based on Fl_Widget /** Rectangle with standard FLTK coordinates (X, Y, W, H). @@ -60,10 +58,10 @@ public: 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 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 /** gets the right edge (x + w). \note r() and b() are coordinates \b outside the area of the rectangle. @@ -74,15 +72,11 @@ public: */ int b() const { return 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 + 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$". -// diff --git a/FL/Fl_Repeat_Button.H b/FL/Fl_Repeat_Button.H index f22df8899..08ac61a33 100644 --- a/FL/Fl_Repeat_Button.H +++ b/FL/Fl_Repeat_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Repeat button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -48,7 +46,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Return_Button.H b/FL/Fl_Return_Button.H index 54b4ab5ef..845b15f7d 100644 --- a/FL/Fl_Return_Button.H +++ b/FL/Fl_Return_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Return button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,7 +25,7 @@ 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 + <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 { @@ -44,7 +42,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Roller.H b/FL/Fl_Roller.H index c416c136a..4eeabd300 100644 --- a/FL/Fl_Roller.H +++ b/FL/Fl_Roller.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Roller header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -33,8 +31,8 @@ The roller can be controlled by clicking and dragging the mouse, by the corresponding arrow keys when the roller has the keyboard focus, or by the mousewheels when the mouse pointer is positioned over the roller widget. - - <P ALIGN=CENTER>\image html Fl_Roller.png + + <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 { @@ -46,7 +44,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Round_Button.H b/FL/Fl_Round_Button.H index f5cb03325..8c84e44cf 100644 --- a/FL/Fl_Round_Button.H +++ b/FL/Fl_Round_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Round button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Round_Button_H @@ -39,7 +37,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Round_Clock.H b/FL/Fl_Round_Clock.H index 3ae748256..5d9bf90ea 100644 --- a/FL/Fl_Round_Clock.H +++ b/FL/Fl_Round_Clock.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Round clock header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -32,7 +30,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_SVG_File_Surface.H b/FL/Fl_SVG_File_Surface.H index 9f5c7ace6..74437326f 100644 --- a/FL/Fl_SVG_File_Surface.H +++ b/FL/Fl_SVG_File_Surface.H @@ -9,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_SVG_File_Surface_H diff --git a/FL/Fl_SVG_Image.H b/FL/Fl_SVG_Image.H index 4940ffb8c..9a2504c02 100644 --- a/FL/Fl_SVG_Image.H +++ b/FL/Fl_SVG_Image.H @@ -9,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FL_SVG_IMAGE_H @@ -22,28 +22,28 @@ 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 + The FLTK library performs parsing and rasterization of SVG data using a modified version of the \c nanosvg software (https://github.com/memononen/nanosvg). 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. + 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() or normalize() is called. Therefore, + Rasterization is not done until the image is first drawn or resize() or normalize() is called. Therefore, \ref array is NULL until then. The delayed rasterization ensures an Fl_SVG_Image is always rasterized to the exact screen resolution at which it is drawn. The Fl_SVG_Image class draws images computed by \c nanosvg with the following known limitations - + - text between \c <text\> and </text\> marks, - \c image elements, and - <use\> statements are not rendered. - The FLTK library can optionally be built without SVG support; in that case, + 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: @@ -117,7 +117,7 @@ struct NSVGimage; Fl_Box::resize(x, y, w, h); } }; - + int main(int argc, char **argv) { Fl_Window *win = new Fl_Window(130, 130); resizable_box *box = new resizable_box(win->w(), win->h()); @@ -166,7 +166,3 @@ public: }; #endif // FL_SVG_IMAGE_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H index 9da8a2d32..bc51fe11c 100644 --- a/FL/Fl_Scroll.H +++ b/FL/Fl_Scroll.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Scroll header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -94,7 +92,7 @@ class FL_EXPORT Fl_Scroll : public Fl_Group { void fix_scrollbar_order(); static void draw_clip(void*,int,int,int,int); -protected: // (STR#1895) +protected: // (STR#1895) /** Structure to manage scrollbar and widget interior sizes. This is filled out by recalc_scrollbars() for use in calculations @@ -106,27 +104,27 @@ protected: // (STR#1895) 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 + 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" + 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 + 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); @@ -199,7 +197,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Scrollbar.H b/FL/Fl_Scrollbar.H index 5563dcce1..f4542cfdc 100644 --- a/FL/Fl_Scrollbar.H +++ b/FL/Fl_Scrollbar.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Scroll bar header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -37,7 +35,7 @@ have to use casts to get at the floating-point versions of value() from Fl_Slider. - \image html scrollbar.png + \image html scrollbar.png \image latex scrollbar.png "Fl_Scrollbar" width=4cm */ class FL_EXPORT Fl_Scrollbar : public Fl_Slider { @@ -105,7 +103,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Secret_Input.H b/FL/Fl_Secret_Input.H index de9621c73..0c7eb1666 100644 --- a/FL/Fl_Secret_Input.H +++ b/FL/Fl_Secret_Input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Secret input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -45,7 +43,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Select_Browser.H b/FL/Fl_Select_Browser.H index 123e24cf8..b4651a0bd 100644 --- a/FL/Fl_Select_Browser.H +++ b/FL/Fl_Select_Browser.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Select browser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -44,7 +42,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Shared_Image.H b/FL/Fl_Shared_Image.H index f68ec7af0..bc0575340 100644 --- a/FL/Fl_Shared_Image.H +++ b/FL/Fl_Shared_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Shared image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -56,20 +54,20 @@ class FL_EXPORT Fl_Shared_Image : public Fl_Image { protected: - static Fl_Shared_Image **images_; // Shared images - static int num_images_; // Number of shared images - static int alloc_images_; // Allocated shared images - static Fl_Shared_Handler *handlers_; // Additional format handlers - static int num_handlers_; // Number of format handlers - static int alloc_handlers_; // Allocated format handlers + static Fl_Shared_Image **images_; // Shared images + static int num_images_; // Number of shared images + static int alloc_images_; // Allocated shared images + static Fl_Shared_Handler *handlers_; // Additional format handlers + static int num_handlers_; // Number of format handlers + static int alloc_handlers_; // Allocated format handlers - const char *name_; // Name of image file - int original_; // Original image? - int refcount_; // Number of times this image has been used - Fl_Image *image_; // The image that is shared - int alloc_image_; // Was the image allocated? + const char *name_; // Name of image file + int original_; // Original image? + int refcount_; // Number of times this image has been used + Fl_Image *image_; // The image that is shared + int alloc_image_; // Was the image allocated? - static int compare(Fl_Shared_Image **i0, Fl_Shared_Image **i1); + static int compare(Fl_Shared_Image **i0, Fl_Shared_Image **i1); // Use get() and release() to load/delete images in memory... Fl_Shared_Image(); @@ -80,12 +78,12 @@ protected: public: /** Returns the filename of the shared image */ - const char *name() { return name_; } + const char *name() { return name_; } /** Returns the number of references of this shared image. When reference is below 1, the image is deleted. */ - int refcount() { return refcount_; } + int refcount() { return refcount_; } /** Returns whether this is an original image. Images loaded from a file or from memory are marked \p original as @@ -96,8 +94,8 @@ public: */ int original() { return original_; } - void release(); - void reload(); + void release(); + void reload(); virtual Fl_Shared_Image *as_shared_image() { return this; @@ -115,9 +113,9 @@ public: static Fl_Shared_Image *get(const char *name, int W = 0, int H = 0); static Fl_Shared_Image *get(Fl_RGB_Image *rgb, int own_it = 1); static Fl_Shared_Image **images(); - static int num_images(); - static void add_handler(Fl_Shared_Handler f); - static void remove_handler(Fl_Shared_Handler f); + static int num_images(); + static void add_handler(Fl_Shared_Handler f); + static void remove_handler(Fl_Shared_Handler f); }; // @@ -129,7 +127,3 @@ public: FL_EXPORT extern void fl_register_images(); #endif // !Fl_Shared_Image_H - -// -// End of "$Id$" -// diff --git a/FL/Fl_Simple_Counter.H b/FL/Fl_Simple_Counter.H index 8edc907af..1ec214740 100644 --- a/FL/Fl_Simple_Counter.H +++ b/FL/Fl_Simple_Counter.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Simple counter header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -23,9 +21,9 @@ #define Fl_Simple_Counter_H #include "Fl_Counter.H" -/** - This widget creates a counter with only 2 arrow buttons - <P align=center>\image html counter.png</P> +/** + This widget creates a counter with only 2 arrow buttons + <P align=center>\image html counter.png</P> \image latex counter.png "Fl_Simple_Counter" width=4cm */ class FL_EXPORT Fl_Simple_Counter : public Fl_Counter { @@ -34,7 +32,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Simple_Terminal.H b/FL/Fl_Simple_Terminal.H index 5f4d5e6dc..158bf7d48 100644 --- a/FL/Fl_Simple_Terminal.H +++ b/FL/Fl_Simple_Terminal.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // A simple terminal widget for Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -192,7 +190,3 @@ protected: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Single_Window.H b/FL/Fl_Single_Window.H index a5f2cdc0a..01878db5c 100644 --- a/FL/Fl_Single_Window.H +++ b/FL/Fl_Single_Window.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Single-buffered window header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -35,7 +33,7 @@ class FL_EXPORT Fl_Single_Window : public Fl_Window { public: void show(); void show(int a, char **b) {Fl_Window::show(a,b);} - + /** Creates a new Fl_Single_Window widget using the given size, and label (title) string. @@ -47,12 +45,8 @@ public: position, size, and label (title) string. */ Fl_Single_Window(int X, int Y, int W, int H, const char *l=0); - + int make_current(); }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Slider.H b/FL/Fl_Slider.H index aceb62d5a..4761c6f11 100644 --- a/FL/Fl_Slider.H +++ b/FL/Fl_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,12 +25,12 @@ #endif // values for type(), lowest bit indicate horizontal: -#define FL_VERT_SLIDER 0 -#define FL_HOR_SLIDER 1 -#define FL_VERT_FILL_SLIDER 2 -#define FL_HOR_FILL_SLIDER 3 -#define FL_VERT_NICE_SLIDER 4 -#define FL_HOR_NICE_SLIDER 5 +#define FL_VERT_SLIDER 0 +#define FL_HOR_SLIDER 1 +#define FL_VERT_FILL_SLIDER 2 +#define FL_HOR_FILL_SLIDER 3 +#define FL_VERT_NICE_SLIDER 4 +#define FL_HOR_NICE_SLIDER 5 /** The Fl_Slider widget contains a sliding knob inside a box. It is @@ -41,9 +39,9 @@ maximum(). The minimum() may be greater than the maximum() to reverse the slider direction. - Use void Fl_Widget::type(int) to set how the slider is drawn, + Use void Fl_Widget::type(int) to set how the slider is drawn, which can be one of the following: - + \li FL_VERTICAL - Draws a vertical slider (this is the default). \li FL_HORIZONTAL - Draws a horizontal slider. \li FL_VERT_FILL_SLIDER - Draws a filled vertical slider, @@ -55,7 +53,7 @@ \li FL_HOR_NICE_SLIDER - Draws a horizontal slider with a nice looking control knob. - \image html slider.png + \image html slider.png \image latex slider.png "Fl_Slider" width=4cm */ class FL_EXPORT Fl_Slider : public Fl_Valuator { @@ -105,7 +103,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H index 48fdaebfd..541078a8f 100644 --- a/FL/Fl_Spinner.H +++ b/FL/Fl_Spinner.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Spinner widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -38,17 +36,17 @@ */ class FL_EXPORT Fl_Spinner : public Fl_Group { - double value_; // Current value - double minimum_; // Minimum value - double maximum_; // Maximum value - double step_; // Amount to add/subtract for up/down - const char *format_; // Format string for input field - int wrap_; // wrap around at bounds (1/0) + double value_; // Current value + double minimum_; // Minimum value + double maximum_; // Maximum value + double step_; // Amount to add/subtract for up/down + const char *format_; // Format string for input field + int wrap_; // wrap around at bounds (1/0) private: static void sb_cb(Fl_Widget *w, Fl_Spinner *sb); // internal callback - void update(); // update input field + void update(); // update input field protected: @@ -60,13 +58,13 @@ protected: public: Fl_Spinner_Input(int X, int Y, int W, int H) : Fl_Input(X, Y, W, H) {} - int handle(int event); // implemented in src/Fl_Spinner.cxx + int handle(int event); // implemented in src/Fl_Spinner.cxx }; - Fl_Spinner_Input input_; // Input field for the value + Fl_Spinner_Input input_; // Input field for the value Fl_Repeat_Button - up_button_, // Up button - down_button_; // Down button + up_button_, // Up button + down_button_; // Down button public: @@ -120,9 +118,9 @@ public: FLTK 1.3.x and older versions. \note Wrap mode does not apply to the input field if the input value - is edited directly as a number. The input value is always - clipped to the allowed range as if wrap mode was off when the - input field is left (i.e. loses focus). + is edited directly as a number. The input value is always + clipped to the allowed range as if wrap mode was off when the + input field is left (i.e. loses focus). \see minimum(), maximum() @@ -207,8 +205,3 @@ public: }; #endif // !Fl_Spinner_H - - -// -// End of "$Id$". -// diff --git a/FL/Fl_Sys_Menu_Bar.H b/FL/Fl_Sys_Menu_Bar.H index c586625ac..beb4425a9 100644 --- a/FL/Fl_Sys_Menu_Bar.H +++ b/FL/Fl_Sys_Menu_Bar.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS system menu bar header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -30,9 +28,9 @@ class Fl_Sys_Menu_Bar_Driver; /** A class to create and modify menus that appear on macOS in the menu bar at the top of the screen. - + On other than macOS platforms, Fl_Sys_Menu_Bar is a synonym of class Fl_Menu_Bar. - + On the macOS platform, replace Fl_Menu_Bar with Fl_Sys_Menu_Bar, and a system menu at the top of the screen will be available. This menu will match an array of Fl_Menu_Item's exactly as in all other FLTK menus (except for the submenu with the @@ -41,7 +39,7 @@ class Fl_Sys_Menu_Bar_Driver; from this class can be created, because macOS uses a single system menu bar. Therefore, porting to macOS an app that creates, on other platforms, several Fl_Menu_Bar objects, one for each of several windows, is more complex that just replacing Fl_Menu_Bar by Fl_Sys_Menu_Bar. - + On the macOS platform, the system menu bar of any FLTK app begins with the Application menu which the FLTK library automatically constructs. Functions Fl_Mac_App_Menu::custom_application_menu_items() and Fl_Sys_Menu_Bar::about() can be used to further customize @@ -51,13 +49,13 @@ class Fl_Sys_Menu_Bar_Driver; Other member functions of this class allow the app to generate the rest of the system menu bar. It is recommended to localize the system menu bar using the standard Mac OS X localization procedure (see \ref osissues_localize). - + Changes to the menu state are immediately visible in the menubar when they are made using member functions of the Fl_Sys_Menu_Bar class. Other changes (e.g., by a call to Fl_Menu_Item::set()) should be followed by a call to update() to be visible in the menubar across all platforms. macOS global variable \ref fl_sys_menu_bar points to the unique, current system menu bar. - + A few FLTK menu features are not supported by the Mac System menu: \li no symbolic labels \li no embossed labels @@ -66,11 +64,11 @@ class Fl_Sys_Menu_Bar_Driver; As described above, the submenu with the application's own name (usually the second submenu from the left, immediately following the "Apple" submenu) is a special case, and can be managed with - Fl_Mac_App_Menu::custom_application_menu_items(). + Fl_Mac_App_Menu::custom_application_menu_items(). For example, to make your own "Appname -> Preferences" dialog, you might use: \code - #include <FL/platform.H> // for Fl_Mac_App_Menu class + #include <FL/platform.H> // for Fl_Mac_App_Menu class #include <FL/Fl_Sys_Menu_Bar.H> // for Fl_Menu_Item : void prefs_cb(Fl_Widget *w, void *data) { @@ -84,7 +82,7 @@ class Fl_Sys_Menu_Bar_Driver; { "Preferences", 0, prefs_cb, 0, 0 }, { 0 }, { 0 } }; - Fl_Mac_App_Menu::custom_application_menu_items(appitems); // adds it + Fl_Mac_App_Menu::custom_application_menu_items(appitems); // adds it } \endcode @@ -114,7 +112,7 @@ public: void menu(const Fl_Menu_Item *m); virtual void update(); int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0); - /** Adds a new menu item. + /** Adds a new menu item. \see Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0) */ int add(const char* label, const char* shortcut, Fl_Callback* cb, void *user_data=0, int flags=0) { @@ -122,7 +120,7 @@ public: } int add(const char* str); int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0); - /** Insert a new menu item. + /** Insert a new menu item. \see Fl_Menu_::insert(int index, const char* label, const char* shortcut, Fl_Callback *cb, void *user_data=0, int flags=0) */ int insert(int index, const char* label, const char* shortcut, Fl_Callback *cb, void *user_data=0, int flags=0) { @@ -132,14 +130,14 @@ public: void replace(int index, const char *name); void clear(); int clear_submenu(int index); - void mode (int i, int fl); + void mode (int i, int fl); /** Gets the flags of item i. */ int mode(int i) const { return Fl_Menu_::mode(i); } void shortcut (int i, int s); void setonly (Fl_Menu_Item *item); static void about(Fl_Callback *cb, void *data); - + static window_menu_style_enum window_menu_style(); static void window_menu_style(window_menu_style_enum style); static void create_window_menu(); @@ -150,7 +148,3 @@ public: extern Fl_Sys_Menu_Bar *fl_sys_menu_bar; #endif // Fl_Sys_Menu_Bar_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H index ad91d62a6..ecc68efa7 100644 --- a/FL/Fl_Table.H +++ b/FL/Fl_Table.H @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Fl_Table -- A table widget +// Fl_Table -- A table widget for the Fast Light Tool Kit (FLTK). // // Copyright 2002 by Greg Ercolano. // Copyright (c) 2004 O'ksi'D @@ -12,9 +10,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef _FL_TABLE_H @@ -25,20 +23,20 @@ /** A table of widgets or other content. - + This is the base class for table widgets. - + To be useful it must be subclassed and several virtual functions defined. - Normally applications use widgets derived from this widget, and do not use this - widget directly; this widget is usually too low level to be used directly by + Normally applications use widgets derived from this widget, and do not use this + widget directly; this widget is usually too low level to be used directly by applications. - + This widget does \em not handle the data in the table. The draw_cell() - method must be overridden by a subclass to manage drawing the contents of + method must be overridden by a subclass to manage drawing the contents of the cells. - + This widget can be used in several ways: - + - As a custom widget; see examples/table-simple.cxx and test/table.cxx. Very optimal for even extremely large tables. - As a table made up of a single FLTK widget instanced all over the table, @@ -46,63 +44,63 @@ examples/table-spreadsheet-with-keyboard-nav.cxx. Optimal for large tables. - As a regular container of FLTK widgets, one widget per cell. See examples/table-as-container.cxx. \em Not recommended for large tables. - + \image html table-simple.png \image latex table-simple.png "table-simple example" width=6cm \image html table-as-container.png \image latex table-as-container.png "table-as-container example" width=6cm - + When acting as part of a custom widget, events on the cells and/or headings - generate callbacks when they are clicked by the user. You control when events + generate callbacks when they are clicked by the user. You control when events are generated based on the setting for Fl_Table::when(). - - When acting as a container for FLTK widgets, the FLTK widgets maintain - themselves. Although the draw_cell() method must be overridden, its contents + + When acting as a container for FLTK widgets, the FLTK widgets maintain + themselves. Although the draw_cell() method must be overridden, its contents can be very simple. See the draw_cell() code in examples/table-simple.cxx. - + The following variables are available to classes deriving from Fl_Table: - - \anchor table_dimensions_diagram + + \anchor table_dimensions_diagram \image html table-dimensions.png \image latex table-dimensions.png "Fl_Table Dimensions" width=6cm - + <table border=0> <tr><td>x()/y()/w()/h()</td> - <td>Fl_Table widget's outer dimension. The outer edge of the border of the + <td>Fl_Table widget's outer dimension. The outer edge of the border of the Fl_Table. (Red in the diagram above)</td></tr> - + <tr><td>wix/wiy/wiw/wih</td> - <td>Fl_Table widget's inner dimension. The inner edge of the border of the - Fl_Table. eg. if the Fl_Table's box() is FL_NO_BOX, these values are the same + <td>Fl_Table widget's inner dimension. The inner edge of the border of the + Fl_Table. eg. if the Fl_Table's box() is FL_NO_BOX, these values are the same as x()/y()/w()/h(). (Yellow in the diagram above)</td></tr> - + <tr><td>tox/toy/tow/toh</td> <td>The table's outer dimension. The outer edge of the border around the cells, but inside the row/col headings and scrollbars. (Green in the diagram above) </td></tr> - + <tr><td>tix/tiy/tiw/tih</td> <td>The table's inner dimension. The inner edge of the border around the cells, - but inside the row/col headings and scrollbars. AKA the table's clip region. + but inside the row/col headings and scrollbars. AKA the table's clip region. eg. if the table_box() is FL_NO_BOX, these values are the same as tox/toy/tow/toh. (Blue in the diagram above) </td></tr></table> - + CORE DEVELOPERS - + - Greg Ercolano : 12/16/2002 - initial implementation 12/16/02. Fl_Table, Fl_Table_Row, docs. - Jean-Marc Lienher : 02/22/2004 - added keyboard nav + mouse selection, and ported Fl_Table into fltk-utf8-1.1.4 - + OTHER CONTRIBUTORS - + - Inspired by the Feb 2000 version of FLVW's Flvw_Table widget. Mucho thanks to those folks. - Mister Satan : 04/07/2003 - MinGW porting mods, and singleinput.cxx; a cool Fl_Input oriented spreadsheet example - Marek Paliwoda : 01/08/2003 - Porting mods for Borland - Ori Berger : 03/16/2006 - Optimizations for >500k rows/cols - + LICENSE - + Greg kindly gave his permission to integrate Fl_Table and Fl_Table_Row into FLTK, allowing FLTK license to apply while his widgets are part of the library. [updated by Greg, 04/26/17] @@ -116,30 +114,30 @@ public: or in a callback() to determine where a recent event occurred. */ enum TableContext { - CONTEXT_NONE = 0, ///< no known context - CONTEXT_STARTPAGE = 0x01, ///< before the table is redrawn - CONTEXT_ENDPAGE = 0x02, ///< after the table is redrawn - CONTEXT_ROW_HEADER = 0x04, ///< drawing or event occurred in the row header - CONTEXT_COL_HEADER = 0x08, ///< drawing or event occurred in the col header - CONTEXT_CELL = 0x10, ///< drawing or event occurred in a cell - CONTEXT_TABLE = 0x20, ///< drawing or event occurred in a dead zone of table - CONTEXT_RC_RESIZE = 0x40 ///< column or row is being resized + CONTEXT_NONE = 0, ///< no known context + CONTEXT_STARTPAGE = 0x01, ///< before the table is redrawn + CONTEXT_ENDPAGE = 0x02, ///< after the table is redrawn + CONTEXT_ROW_HEADER = 0x04, ///< drawing or event occurred in the row header + CONTEXT_COL_HEADER = 0x08, ///< drawing or event occurred in the col header + CONTEXT_CELL = 0x10, ///< drawing or event occurred in a cell + CONTEXT_TABLE = 0x20, ///< drawing or event occurred in a dead zone of table + CONTEXT_RC_RESIZE = 0x40 ///< column or row is being resized }; - + private: - int _rows, _cols; // total rows/cols - int _row_header_w; // width of row header - int _col_header_h; // height of column header - int _row_position; // last row_position set (not necessarily == toprow!) - int _col_position; // last col_position set (not necessarily == leftcol!) - - char _row_header; // row header enabled? - char _col_header; // col header enabled? - char _row_resize; // row resizing enabled? - char _col_resize; // col resizing enabled? - int _row_resize_min; // row minimum resizing height (default=1) - int _col_resize_min; // col minimum resizing width (default=1) - + int _rows, _cols; // total rows/cols + int _row_header_w; // width of row header + int _col_header_h; // height of column header + int _row_position; // last row_position set (not necessarily == toprow!) + int _col_position; // last col_position set (not necessarily == leftcol!) + + char _row_header; // row header enabled? + char _col_header; // col header enabled? + char _row_resize; // row resizing enabled? + char _col_resize; // col resizing enabled? + int _row_resize_min; // row minimum resizing height (default=1) + int _col_resize_min; // col minimum resizing width (default=1) + // OPTIMIZATION: partial row/column redraw variables int _redraw_toprow; int _redraw_botrow; @@ -147,15 +145,15 @@ private: int _redraw_rightcol; Fl_Color _row_header_color; Fl_Color _col_header_color; - + int _auto_drag; int _selecting; int _scrollbar_size; enum { - TABCELLNAV = 1<<0, ///> tab cell navigation flag + TABCELLNAV = 1<<0, ///> tab cell navigation flag }; unsigned int flags_; - + // An STL-ish vector without templates class FL_EXPORT IntVector { int *arr; @@ -166,10 +164,10 @@ private: } void copy(int *newarr, unsigned int newsize); public: - IntVector() { init(); } // CTOR - ~IntVector(); // DTOR - IntVector(IntVector&o) { init(); copy(o.arr, o._size); } // COPY CTOR - IntVector& operator=(IntVector&o) { // ASSIGN + IntVector() { init(); } // CTOR + ~IntVector(); // DTOR + IntVector(IntVector&o) { init(); copy(o.arr, o._size); } // COPY CTOR + IntVector& operator=(IntVector&o) { // ASSIGN init(); copy(o.arr, o._size); return(*this); @@ -182,34 +180,34 @@ private: void push_back(int val) { unsigned int x = _size; size(_size+1); arr[x] = val; } int back() { return(arr[_size-1]); } }; - - IntVector _colwidths; // column widths in pixels - IntVector _rowheights; // row heights in pixels - - Fl_Cursor _last_cursor; // last mouse cursor before changed to 'resize' cursor - + + IntVector _colwidths; // column widths in pixels + IntVector _rowheights; // row heights in pixels + + Fl_Cursor _last_cursor; // last mouse cursor before changed to 'resize' cursor + // EVENT CALLBACK DATA - TableContext _callback_context; // event context - int _callback_row, _callback_col; // event row/col - + TableContext _callback_context; // event context + int _callback_row, _callback_col; // event row/col + // handle() state variables. // Put here instead of local statics in handle(), so more // than one Fl_Table can exist without crosstalk between them. // - int _resizing_col; // column being dragged - int _resizing_row; // row being dragged - int _dragging_x; // starting x position for horiz drag - int _dragging_y; // starting y position for vert drag - int _last_row; // last row we FL_PUSH'ed - + int _resizing_col; // column being dragged + int _resizing_row; // row being dragged + int _dragging_x; // starting x position for horiz drag + int _dragging_y; // starting y position for vert drag + int _last_row; // last row we FL_PUSH'ed + // Redraw single cell void _redraw_cell(TableContext context, int R, int C); - + void _start_auto_drag(); void _stop_auto_drag(); void _auto_drag_cb(); static void _auto_drag_cb2(void *d); - + protected: enum ResizeFlag { RESIZE_NONE = 0, @@ -219,70 +217,70 @@ protected: RESIZE_ROW_BELOW = 4 }; - int table_w; ///< table's virtual width (in pixels) - int table_h; ///< table's virtual height (in pixels) - int toprow; ///< top row# of currently visible table on screen - int botrow; ///< bottom row# of currently visible table on screen - int leftcol; ///< left column# of currently visible table on screen - int rightcol; ///< right column# of currently visible table on screen - + int table_w; ///< table's virtual width (in pixels) + int table_h; ///< table's virtual height (in pixels) + int toprow; ///< top row# of currently visible table on screen + int botrow; ///< bottom row# of currently visible table on screen + int leftcol; ///< left column# of currently visible table on screen + int rightcol; ///< right column# of currently visible table on screen + // selection - int current_row; ///< selection cursor's current row (-1 if none) - int current_col; ///< selection cursor's current column (-1 if none) - int select_row; ///< extended selection row (-1 if none) - int select_col; ///< extended selection column (-1 if none) - + int current_row; ///< selection cursor's current row (-1 if none) + int current_col; ///< selection cursor's current column (-1 if none) + int select_row; ///< extended selection row (-1 if none) + int select_col; ///< extended selection column (-1 if none) + // OPTIMIZATION: Precomputed scroll positions for the toprow/leftcol - int toprow_scrollpos; ///< precomputed scroll position for top row - int leftcol_scrollpos; ///< precomputed scroll position for left column - + int toprow_scrollpos; ///< precomputed scroll position for top row + int leftcol_scrollpos; ///< precomputed scroll position for left column + // Data table's inner dimension - int tix; ///< Data table's inner x dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int tiy; ///< Data table's inner y dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int tiw; ///< Data table's inner w dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int tih; ///< Data table's inner h dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int tix; ///< Data table's inner x dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int tiy; ///< Data table's inner y dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int tiw; ///< Data table's inner w dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int tih; ///< Data table's inner h dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" // Data table's outer dimension - int tox; ///< Data table's outer x dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int toy; ///< Data table's outer y dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int tow; ///< Data table's outer w dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int toh; ///< Data table's outer h dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int tox; ///< Data table's outer x dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int toy; ///< Data table's outer y dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int tow; ///< Data table's outer w dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int toh; ///< Data table's outer h dimension, outside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" // Table widget's inner dimension - int wix; ///< Table widget's inner x dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int wiy; ///< Table widget's inner y dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int wiw; ///< Table widget's inner w dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - int wih; ///< Table widget's inner h dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" - - Fl_Scroll *table; ///< child Fl_Scroll widget container for child fltk widgets (if any) - Fl_Scrollbar *vscrollbar; ///< child vertical scrollbar widget - Fl_Scrollbar *hscrollbar; ///< child horizontal scrollbar widget - + int wix; ///< Table widget's inner x dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int wiy; ///< Table widget's inner y dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int wiw; ///< Table widget's inner w dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + int wih; ///< Table widget's inner h dimension, inside bounding box. See \ref table_dimensions_diagram "Table Dimension Diagram" + + Fl_Scroll *table; ///< child Fl_Scroll widget container for child fltk widgets (if any) + Fl_Scrollbar *vscrollbar; ///< child vertical scrollbar widget + Fl_Scrollbar *hscrollbar; ///< child horizontal scrollbar widget + // Fltk - int handle(int e); // fltk handle() override - + int handle(int e); // fltk handle() override + // Class maintenance void recalc_dimensions(); - void table_resized(); // table resized; recalc - void table_scrolled(); // table scrolled; recalc - void get_bounds(TableContext context, // return x/y/w/h bounds for context + void table_resized(); // table resized; recalc + void table_scrolled(); // table scrolled; recalc + void get_bounds(TableContext context, // return x/y/w/h bounds for context int &X, int &Y, int &W, int &H); - void change_cursor(Fl_Cursor newcursor); // change mouse cursor to some other shape + void change_cursor(Fl_Cursor newcursor); // change mouse cursor to some other shape TableContext cursor2rowcol(int &R, int &C, ResizeFlag &resizeflag); - int find_cell(TableContext context, // find cell's x/y/w/h given r/c + int find_cell(TableContext context, // find cell's x/y/w/h given r/c int R, int C, int &X, int &Y, int &W, int &H); int row_col_clamp(TableContext context, int &R, int &C); // clamp r/c to known universe - + /** Subclass should override this method to handle drawing the cells. - + This method will be called whenever the table is redrawn, once per cell. - + Only cells that are completely (or partially) visible will be told to draw. - + \p context will be one of the following: - + <table border=1> <tr> <td>\p Fl_Table::CONTEXT_STARTPAGE</td> @@ -319,25 +317,25 @@ protected: <td>Whenever table or row/column is resized or scrolled, either interactively or via col_width() or row_height().<br> R/C/X/Y/W/H will all be zero. - <p> + <p> Useful for fltk containers that need to resize or move the child fltk widgets.</td> </tr> </table> - + \p row and \p col will be set to the row and column number of the cell being drawn. In the case of row headers, \p col will be \a 0. In the case of column headers, \p row will be \a 0. - + <tt>x/y/w/h</tt> will be the position and dimensions of where the cell should be drawn. - + In the case of custom widgets, a minimal draw_cell() override might look like the following. With custom widgets it is up to the caller to handle drawing everything within the dimensions of the cell, including handling the selection color. Note all clipping must be handled as well; this allows drawing outside the dimensions of the cell if so desired for 'custom effects'. - + \code // This is called whenever Fl_Table wants you to draw a cell void MyTable::draw_cell(TableContext context, int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0) { @@ -347,7 +345,7 @@ protected: case CONTEXT_STARTPAGE: // Fl_Table telling us it's starting to draw page fl_font(FL_HELVETICA, 16); return; - + case CONTEXT_ROW_HEADER: // Fl_Table telling us to draw row/col headers case CONTEXT_COL_HEADER: fl_push_clip(X, Y, W, H); @@ -358,25 +356,25 @@ protected: } fl_pop_clip(); return; - + case CONTEXT_CELL: // Fl_Table telling us to draw cells fl_push_clip(X, Y, W, H); { // BG COLOR fl_color( row_selected(R) ? selection_color() : FL_WHITE); fl_rectf(X, Y, W, H); - + // TEXT fl_color(FL_BLACK); fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - + // BORDER fl_color(FL_LIGHT2); fl_rect(X, Y, W, H); } fl_pop_clip(); return; - + default: return; } @@ -384,24 +382,24 @@ protected: } \endcode */ - virtual void draw_cell(TableContext context, int R=0, int C=0, + virtual void draw_cell(TableContext context, int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0) - { } // overridden by deriving class - - long row_scroll_position(int row); // find scroll position of row (in pixels) - long col_scroll_position(int col); // find scroll position of col (in pixels) - + { } // overridden by deriving class + + long row_scroll_position(int row); // find scroll position of row (in pixels) + long col_scroll_position(int col); // find scroll position of col (in pixels) + /** Does the table contain any child fltk widgets? */ - int is_fltk_container() { // does table contain fltk widgets? - return( Fl_Group::children() > 3 ); // (ie. more than box and 2 scrollbars?) + int is_fltk_container() { // does table contain fltk widgets? + return( Fl_Group::children() > 3 ); // (ie. more than box and 2 scrollbars?) } - - static void scroll_cb(Fl_Widget*,void*); // h/v scrollbar callback - + + static void scroll_cb(Fl_Widget*,void*); // h/v scrollbar callback + void damage_zone(int r1, int c1, int r2, int c2, int r3 = 0, int c3 = 0); - + /** Define region of cells to be redrawn by specified range of rows/cols, and then sets damage(DAMAGE_CHILD). Extends any previously defined range to redraw. @@ -430,7 +428,7 @@ protected: public: Fl_Table(int X, int Y, int W, int H, const char *l=0); ~Fl_Table(); - + /** Clears the table to zero rows (rows(0)), zero columns (cols(0)), and clears any widgets (table->clear()) that were added with begin()/end() or add()/insert()/etc. @@ -441,9 +439,9 @@ public: cols(0); table->clear(); } - + // \todo: add topline(), middleline(), bottomline() - + /** Sets the kind of box drawn around the data table, the default being FL_NO_BOX. Changing this value will cause the table @@ -453,40 +451,40 @@ public: table->box(val); table_resized(); } - + /** Returns the current box type used for the data table. */ inline Fl_Boxtype table_box( void ) { return(table->box()); } - - virtual void rows(int val); // set/get number of rows - + + virtual void rows(int val); // set/get number of rows + /** Returns the number of rows in the table. */ inline int rows() { return(_rows); } - - virtual void cols(int val); // set/get number of columns - - /** + + virtual void cols(int val); // set/get number of columns + + /** Get the number of columns in the table. */ inline int cols() { return(_cols); } - + /** - Returns the range of row and column numbers for all visible + Returns the range of row and column numbers for all visible and partially visible cells in the table. - + These values can be used e.g. by your draw_cell() routine during CONTEXT_STARTPAGE to figure out what cells are about to be redrawn for the purposes of locking the data from a database before it's drawn. - + \code leftcol rightcol : : @@ -498,10 +496,10 @@ public: | | botrow .. '-------------------` \endcode - + e.g. in a table where the visible rows are 5-20, and the visible columns are 100-120, then those variables would be: - + - toprow = 5 - botrow = 20 - leftcol = 100 @@ -512,33 +510,33 @@ public: r2 = botrow; c1 = leftcol; c2 = rightcol; - } - + } + /** Returns 1 if someone is interactively resizing a row or column. You can currently call this only from within your callback(). */ int is_interactive_resize() { return(_resizing_row != -1 || _resizing_col != -1); - } - + } + /** Returns if row resizing by the user is allowed. */ inline int row_resize() { return(_row_resize); } - + /** Allows/disallows row resizing by the user. 1=allow interactive resizing, 0=disallow interactive resizing. Since interactive resizing is done via the row headers, row_header() must also be enabled to allow resizing. - */ - void row_resize(int flag) { // enable row resizing + */ + void row_resize(int flag) { // enable row resizing _row_resize = flag; } - + /** Returns if column resizing by the user is allowed. */ @@ -552,17 +550,17 @@ public: Since interactive resizing is done via the column headers, \p col_header() must also be enabled to allow resizing. */ - void col_resize(int flag) { // enable col resizing + void col_resize(int flag) { // enable col resizing _col_resize = flag; } - + /** Returns the current column minimum resize value. */ - inline int col_resize_min() { // column minimum resizing width + inline int col_resize_min() { // column minimum resizing width return(_col_resize_min); } - + /** Sets the current column minimum resize value. This is used to prevent the user from interactively resizing @@ -570,15 +568,15 @@ public: */ void col_resize_min(int val) { _col_resize_min = ( val < 1 ) ? 1 : val; - } - + } + /** Returns the current row minimum resize value. */ - inline int row_resize_min() { // column minimum resizing width + inline int row_resize_min() { // column minimum resizing width return(_row_resize_min); } - + /** Sets the current row minimum resize value. This is used to prevent the user from interactively resizing @@ -587,14 +585,14 @@ public: void row_resize_min(int val) { _row_resize_min = ( val < 1 ) ? 1 : val; } - + /** Returns if row headers are enabled or not. */ - inline int row_header() { // set/get row header enable flag + inline int row_header() { // set/get row header enable flag return(_row_header); } - + /** Enables/disables showing the row headers. 1=enabled, 0=disabled. If changed, the table is redrawn. @@ -604,14 +602,14 @@ public: table_resized(); redraw(); } - + /** Returns if column headers are enabled or not. */ - inline int col_header() { // set/get col header enable flag + inline int col_header() { // set/get col header enable flag return(_col_header); } - + /** Enable or disable column headers. If changed, the table is redrawn. @@ -621,97 +619,97 @@ public: table_resized(); redraw(); } - + /** Sets the height in pixels for column headers and redraws the table. */ - inline void col_header_height(int height) { // set/get col header height + inline void col_header_height(int height) { // set/get col header height _col_header_h = height; table_resized(); redraw(); } - + /** Gets the column header height. */ inline int col_header_height() { return(_col_header_h); } - + /** Sets the row header width to n and causes the screen to redraw. */ - inline void row_header_width(int width) { // set/get row header width + inline void row_header_width(int width) { // set/get row header width _row_header_w = width; table_resized(); redraw(); } - + /** Returns the current row header width (in pixels). */ inline int row_header_width() { return(_row_header_w); } - + /** Sets the row header color and causes the screen to redraw. */ - inline void row_header_color(Fl_Color val) { // set/get row header color + inline void row_header_color(Fl_Color val) { // set/get row header color _row_header_color = val; redraw(); } - + /** Returns the current row header color. */ inline Fl_Color row_header_color() { return(_row_header_color); - } - + } + /** Sets the color for column headers and redraws the table. */ - inline void col_header_color(Fl_Color val) { // set/get col header color + inline void col_header_color(Fl_Color val) { // set/get col header color _col_header_color = val; redraw(); } - + /** Gets the color for column headers. */ inline Fl_Color col_header_color() { return(_col_header_color); } - - void row_height(int row, int height); // set/get row height - + + void row_height(int row, int height); // set/get row height + /** Returns the current height of the specified row as a value in pixels. */ inline int row_height(int row) { return((row<0 || row>=(int)_rowheights.size()) ? 0 : _rowheights[row]); } - - void col_width(int col, int width); // set/get a column's width - + + void col_width(int col, int width); // set/get a column's width + /** Returns the current width of the specified column in pixels. */ inline int col_width(int col) { return((col<0 || col>=(int)_colwidths.size()) ? 0 : _colwidths[col]); } - + /** Convenience method to set the height of all rows to the same value, in pixels. The screen is redrawn. */ - void row_height_all(int height) { // set all row/col heights + void row_height_all(int height) { // set all row/col heights for ( int r=0; r<rows(); r++ ) { row_height(r, height); } } - + /** Convenience method to set the width of all columns to the same value, in pixels. The screen is redrawn. @@ -721,33 +719,33 @@ public: col_width(c, width); } } - - void row_position(int row); // set/get table's current scroll position + + void row_position(int row); // set/get table's current scroll position void col_position(int col); - + /** Returns the current row scroll position as a row number. */ int row_position() { return(_row_position); } - + /** Returns the current column scroll position as a column number. */ int col_position() { return(_col_position); } - + /** Sets which row should be at the top of the table, scrolling as necessary, and the table is redrawn. If the table cannot be scrolled that far, it is scrolled as far as possible. */ - inline void top_row(int row) { // set/get top row (deprecated) + inline void top_row(int row) { // set/get top row (deprecated) row_position(row); } - + /** Returns the current top row shown in the table. This row may be partially obscured. @@ -755,13 +753,13 @@ public: inline int top_row() { return(row_position()); } - int is_selected(int r, int c); // selected cell + int is_selected(int r, int c); // selected cell void get_selection(int &row_top, int &col_left, int &row_bot, int &col_right); void set_selection(int row_top, int col_left, int row_bot, int col_right); int move_cursor(int R, int C, int shiftselect); int move_cursor(int R, int C); - void resize(int X, int Y, int W, int H); // fltk resize() override - + void resize(int X, int Y, int W, int H); // fltk resize() override + // This crashes sortapp() during init. // void box(Fl_Boxtype val) { // Fl_Group::box(val); @@ -772,7 +770,7 @@ public: // Fl_Boxtype box(void) const { // return(Fl_Group::box()); // } - + // Child group management /** @@ -794,7 +792,7 @@ public: table->show(); } else { table->hide(); - } + } } /** @@ -844,7 +842,7 @@ public: table->show(); } else { table->hide(); - } + } Fl_Group::current(Fl_Group::parent()); } @@ -855,11 +853,11 @@ public: Fl_Widget*const* array() { return(table->array()); } - + /** Returns the child widget by an index. - When using the Fl_Table as a container for FLTK widgets, this method returns + When using the Fl_Table as a container for FLTK widgets, this method returns the widget pointer from the internal array of widgets in the container. Typically used in loops, eg: @@ -873,11 +871,11 @@ public: Fl_Widget *child(int n) const { return(table->child(n)); } - + /** Returns the number of children in the table. - When using the Fl_Table as a container for FLTK widgets, this method returns + When using the Fl_Table as a container for FLTK widgets, this method returns how many child widgets the table has. \see child(int) @@ -894,10 +892,10 @@ public: // (doxygen will substitute Fl_Group's docs here) int find(const Fl_Widget &wgt) const { return(table->find(wgt)); - } + } // CALLBACKS - + /** Returns the current row the event occurred on. @@ -906,7 +904,7 @@ public: int callback_row() { return(_callback_row); } - + /** Returns the current column the event occurred on. @@ -915,7 +913,7 @@ public: int callback_col() { return(_callback_col); } - + /** Returns the current 'table context'. @@ -924,7 +922,7 @@ public: TableContext callback_context() { return(_callback_context); } - + /** Calls the widget callback. @@ -938,24 +936,24 @@ public: _callback_col = col; Fl_Widget::do_callback(); } - + #ifdef FL_DOXYGEN /** The Fl_Widget::when() function is used to set a group of flags, determining when the widget callback is called: - + <table border=1> <tr> <td>\p FL_WHEN_CHANGED</td> <td> - callback() will be called when rows or columns are resized (interactively or - via col_width() or row_height()), passing CONTEXT_RC_RESIZE via + callback() will be called when rows or columns are resized (interactively or + via col_width() or row_height()), passing CONTEXT_RC_RESIZE via callback_context(). </td> </tr><tr> <td>\p FL_WHEN_RELEASE</td> <td> - callback() will be called during FL_RELEASE events, such as when someone + callback() will be called during FL_RELEASE events, such as when someone releases a mouse button somewhere on the table. </td> </tr> @@ -970,24 +968,24 @@ public: */ void when(Fl_When flags); #endif - + #ifdef FL_DOXYGEN /** Callbacks will be called depending on the setting of Fl_Widget::when(). - - Callback functions should use the following functions to determine the + + Callback functions should use the following functions to determine the context/row/column: - Fl_Table::callback_row() returns current row - Fl_Table::callback_col() returns current column - Fl_Table::callback_context() returns current table context - callback_row() and callback_col() will be set to the row and column number the - event occurred on. If someone clicked on a row header, \p col will be \a 0. + callback_row() and callback_col() will be set to the row and column number the + event occurred on. If someone clicked on a row header, \p col will be \a 0. If someone clicked on a column header, \p row will be \a 0. - + callback_context() will return one of the following: - + <table border=1> <tr><td><tt>Fl_Table::CONTEXT_ROW_HEADER</tt></td> <td>Someone clicked on a row header. Excludes resizing.</td> @@ -998,7 +996,7 @@ public: <td><tt>Fl_Table::CONTEXT_CELL</tt></td> <td> Someone clicked on a cell. - + To receive callbacks for FL_RELEASE events, you must set when(FL_WHEN_RELEASE). </td> @@ -1007,19 +1005,19 @@ public: <td> Someone is resizing rows/columns either interactively, or via the col_width() or row_height() API. - + Use is_interactive_resize() to determine interactive resizing. - + If resizing a column, R=0 and C=column being resized. - + If resizing a row, C=0 and R=row being resized. - + NOTE: To receive resize events, you must set when(FL_WHEN_CHANGED). </td> </tr> </table> - + \code class MyTable : public Fl_Table { [..] @@ -1032,13 +1030,13 @@ public: fprintf(stderr, "callback: Row=%d Col=%d Context=%d Event=%d\n", R, C, (int)context, (int)Fl::event()); } - + // Actual static callback static void event_callback(Fl_Widget*, void* data) { MyTable *o = (MyTable*)data; o->event_callback2(); } - + public: // Constructor MyTable() { @@ -1055,9 +1053,9 @@ public: /** Gets the current size of the scrollbars' troughs, in pixels. - If this value is zero (default), this widget will use the + 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) */ @@ -1078,7 +1076,7 @@ public: 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() @@ -1119,7 +1117,3 @@ public: }; #endif /*_FL_TABLE_H*/ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Table_Row.H b/FL/Fl_Table_Row.H index 0a8fcca8f..655efab81 100644 --- a/FL/Fl_Table_Row.H +++ b/FL/Fl_Table_Row.H @@ -1,12 +1,10 @@ // -// "$Id$" -// #ifndef _FL_TABLE_ROW_H #define _FL_TABLE_ROW_H // -// Fl_Table_Row -- A row oriented table widget +// Fl_Table_Row -- A row oriented table widget for the Fast Light Tool Kit (FLTK). // // A class specializing in a table of rows. // Handles row-specific selection behavior. @@ -17,37 +15,39 @@ // 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 +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: // -// Please report all bugs and problems to "erco at seriss dot com". +// https://www.fltk.org/bugs.php // #include <FL/Fl_Table.H> /** A table with row selection capabilities. - + This class implements a simple table with the ability to select rows. This widget is similar to an Fl_Browser with columns. Most methods of importance will be found in the Fl_Table widget, such as Fl_Table::rows() and Fl_Table::cols(). - + To be useful it must be subclassed and at minimum the draw_cell() method must be overridden to provide the content of the cells. This widget does \em not manage the cell's data content; it is up to the parent class's draw_cell() method override to provide this. - - Events on the cells and/or headings generate callbacks when they are + + Events on the cells and/or headings generate callbacks when they are clicked by the user. You control when events are generated based on the values you supply for Fl_Table::when(). */ class FL_EXPORT Fl_Table_Row : public Fl_Table { public: enum TableRowSelectMode { - SELECT_NONE, // no selection allowed - SELECT_SINGLE, // single row selection - SELECT_MULTI // multiple row selection (default) - }; + SELECT_NONE, // no selection allowed + SELECT_SINGLE, // single row selection + SELECT_MULTI // multiple row selection (default) + }; private: // An STL-ish vector without templates class FL_EXPORT CharVector { @@ -59,15 +59,15 @@ private: } void copy(char *newarr, int newsize); public: - CharVector() { // CTOR + CharVector() { // CTOR init(); } - ~CharVector(); // DTOR - CharVector(CharVector&o) { // COPY CTOR + ~CharVector(); // DTOR + CharVector(CharVector&o) { // COPY CTOR init(); copy(o.arr, o._size); } - CharVector& operator=(CharVector&o) { // ASSIGN + CharVector& operator=(CharVector&o) { // ASSIGN init(); copy(o.arr, o._size); return(*this); @@ -97,33 +97,33 @@ private: } }; - CharVector _rowselect; // selection flag for each row - + CharVector _rowselect; // selection flag for each row + // handle() state variables. // Put here instead of local statics in handle(), so more // than one instance can exist without crosstalk between. // - int _dragging_select; // dragging out a selection? + int _dragging_select; // dragging out a selection? int _last_row; - int _last_y; // last event's Y position - int _last_push_x; // last PUSH event's X position - int _last_push_y; // last PUSH event's Y position - + int _last_y; // last event's Y position + int _last_push_x; // last PUSH event's X position + int _last_push_y; // last PUSH event's Y position + TableRowSelectMode _selectmode; - + protected: int handle(int event); - int find_cell(TableContext context, // find cell's x/y/w/h given r/c + int find_cell(TableContext context, // find cell's x/y/w/h given r/c int R, int C, int &X, int &Y, int &W, int &H) { return(Fl_Table::find_cell(context, R, C, X, Y, W, H)); } - + public: /** The constructor for the Fl_Table_Row. This creates an empty table with no rows or columns, with headers and row/column resize behavior disabled. - */ + */ Fl_Table_Row(int X, int Y, int W, int H, const char *l=0) : Fl_Table(X,Y,W,H,l) { _dragging_select = 0; _last_row = -1; @@ -132,60 +132,56 @@ public: _last_push_y = -1; _selectmode = SELECT_MULTI; } - + /** The destructor for the Fl_Table_Row. Destroys the table and its associated widgets. */ ~Fl_Table_Row() { } - - void rows(int val); // set number of rows - int rows() { // get number of rows + + void rows(int val); // set number of rows + int rows() { // get number of rows return(Fl_Table::rows()); } - + /** Sets the table selection mode. - + - \p Fl_Table_Row::SELECT_NONE - No selection allowed - \p Fl_Table_Row::SELECT_SINGLE - Only single rows can be selected - \p Fl_Table_Row::SELECT_MULTI - Multiple rows can be selected */ - void type(TableRowSelectMode val); // set selection mode - - TableRowSelectMode type() const { // get selection mode + void type(TableRowSelectMode val); // set selection mode + + TableRowSelectMode type() const { // get selection mode return(_selectmode); } - + /** Checks to see if 'row' is selected. Returns 1 if selected, 0 if not. You can change the selection of a row by clicking on it, or by using select_row(row, flag) */ - int row_selected(int row); // is row selected? (0=no, 1=yes, -1=range err) - + int row_selected(int row); // is row selected? (0=no, 1=yes, -1=range err) + /** Changes the selection state for 'row', depending on the value of 'flag'. 0=deselected, 1=select, 2=toggle existing state. */ - int select_row(int row, int flag=1); // select state for row: flag:0=off, 1=on, 2=toggle + int select_row(int row, int flag=1); // select state for row: flag:0=off, 1=on, 2=toggle // returns: 0=no change, 1=changed, -1=range err - + /** - This convenience function changes the selection state + This convenience function changes the selection state for \em all rows based on 'flag'. 0=deselect, 1=select, 2=toggle existing state. */ - void select_all_rows(int flag=1); // all rows to a known state - + void select_all_rows(int flag=1); // all rows to a known state + void clear() { - rows(0); // implies clearing selection + rows(0); // implies clearing selection cols(0); - Fl_Table::clear(); // clear the table + Fl_Table::clear(); // clear the table } }; #endif /*_FL_TABLE_ROW_H*/ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Tabs.H b/FL/Fl_Tabs.H index dd0820418..eadeb8999 100644 --- a/FL/Fl_Tabs.H +++ b/FL/Fl_Tabs.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tab header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -28,22 +26,22 @@ The Fl_Tabs widget is the "file card tabs" interface that allows you to put lots and lots of buttons and switches in a panel, as popularized by many toolkits. - + \image html tabs.png \image latex tabs.png "Fl_Tabs" width=8cm - + Clicking the tab makes a child visible() by calling show() on it, and all other children are made invisible by calling hide() on them. Usually the children are Fl_Group widgets containing several widgets themselves. - + Each child makes a card, and its label() is printed on the card tab, including the label font and style. The selection color of that child is used to color the tab, while the color of the child determines the background color of the pane. '&' in labels are used to prefix a shortcut that is drawn underlined and that activates the corresponding tab; repeated '&&' avoids that. - + The size of the tabs is controlled by the bounding box of the children (there should be some space between the children and the edge of the Fl_Tabs), and the tabs may be placed @@ -51,7 +49,7 @@ gap is larger. It is easiest to lay this out in fluid, using the fluid browser to select each child group and resize them until the tabs look the way you want them to. - + The background area behind and to the right of the tabs is "transparent", exposing the background detail of the parent. The value of Fl_Tabs::box() does not affect this area. So if Fl_Tabs is @@ -70,15 +68,15 @@ Fl_Tabs *tabs = new Fl_Tabs(10,10,300,200); { Fl_Group *grp1 = new Fl_Group(20,30,280,170,"Tab1"); - { - ..widgets that go in tab#1.. + { + ..widgets that go in tab#1.. } - grp1->end(); + grp1->end(); Fl_Group *grp2 = new Fl_Group(20,30,280,170,"Tab2"); - { - ..widgets that go in tab#2.. - } - grp2->end(); + { + ..widgets that go in tab#2.. + } + grp2->end(); } tabs->end(); \endcode @@ -115,7 +113,7 @@ \b Uniform \b Tab \b and \b Panel \b Appearance In order to have uniform tab and panel appearance, not only must the color() - and selection_color() for each child group be set, but also the + and selection_color() for each child group be set, but also the selection_color() of the Fl_Tab itself any time a new "tab" is selected. This can be achieved within the Fl_Tab callback, e.g. @@ -174,7 +172,7 @@ grp2 = new Fl_Group(..); .. tabs->end(); - tabs->resizable(grp1); // keeps tab height constant + tabs->resizable(grp1); // keeps tab height constant \endcode \par Callback's Use Of when() @@ -190,15 +188,15 @@ -# The above flags can be logically OR-ed (|) or added (+) to combine behaviors. -# The default value for when() is \ref FL_WHEN_RELEASE (inherited from Fl_Widget). - -# If \ref FL_WHEN_RELEASE is the \em only flag specified, + -# If \ref FL_WHEN_RELEASE is the \em only flag specified, the behavior will be as if (\ref FL_WHEN_RELEASE|\ref FL_WHEN_CHANGED) was specified. -# The value of changed() will be valid during the callback. - -# If both \ref FL_WHEN_CHANGED and \ref FL_WHEN_NOT_CHANGED are specified, + -# If both \ref FL_WHEN_CHANGED and \ref FL_WHEN_NOT_CHANGED are specified, the callback is invoked whether the tab has been changed or not. - The changed() method can be used to determine the cause. + The changed() method can be used to determine the cause. -# \ref FL_WHEN_NOT_CHANGED can happen if someone clicks on an already selected tab, or if a keyboard navigation attempt results in no change to the tabs, - such as using the arrow keys while at the left or right end of the tabs. + such as using the arrow keys while at the left or right end of the tabs. */ class FL_EXPORT Fl_Tabs : public Fl_Group { @@ -206,13 +204,13 @@ class FL_EXPORT Fl_Tabs : public Fl_Group { protected: - int *tab_pos; // array of x-offsets of tabs per child + 1 - int *tab_width; // array of widths of tabs per child + 1 - int tab_count; // array size - Fl_Align tab_align_; // tab label alignment + int *tab_pos; // array of x-offsets of tabs per child + 1 + int *tab_width; // array of widths of tabs per child + 1 + int tab_count; // array size + Fl_Align tab_align_; // tab label alignment virtual void redraw_tabs(); - virtual int tab_positions(); // allocate and calculate tab positions + virtual int tab_positions(); // allocate and calculate tab positions virtual void clear_tab_positions(); virtual void draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int sel=0); virtual int tab_height(); @@ -267,7 +265,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H index c8e749c1e..473e61c77 100644 --- a/FL/Fl_Text_Buffer.H +++ b/FL/Fl_Text_Buffer.H @@ -1,19 +1,19 @@ // -// "$Id$" -// // Header file for Fl_Text_Buffer class. // // Copyright 2001-2017 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under // the LGPL for the FLTK library granted by Mark Edel. // -// Please report all bugs and problems on the following page: +// 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/str.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -22,7 +22,7 @@ #ifndef FL_TEXT_BUFFER_H #define FL_TEXT_BUFFER_H -#include <stdarg.h> /* va_start/end */ +#include <stdarg.h> /* va_start/end */ #undef ASSERT_UTF8 @@ -134,7 +134,7 @@ public: /** \brief Returns true if any text is selected. \return \p true if any text has been selected, or \p false - if no text is selected. + if no text is selected. */ bool selected() const { return mSelected; } @@ -839,7 +839,3 @@ protected: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H index 6d077fbb7..59dc24bee 100644 --- a/FL/Fl_Text_Display.H +++ b/FL/Fl_Text_Display.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Header file for Fl_Text_Display class. // // Copyright 2001-2020 by Bill Spitzak and others. @@ -13,9 +11,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -24,7 +22,7 @@ #ifndef FL_TEXT_DISPLAY_H #define FL_TEXT_DISPLAY_H -#include <FL/Fl.H> // Fl::scrollbar_size() +#include <FL/Fl.H> // Fl::scrollbar_size() #include "fl_draw.H" #include "Fl_Group.H" #include "Fl_Widget.H" @@ -33,7 +31,7 @@ /** \brief Rich text display widget. - + This is the FLTK text display widget. It allows the user to view multiple lines of text and supports highlighting, word wrap, mixes of font faces and colors, line numbers and scrolling. The buffer @@ -57,7 +55,7 @@ Fl_Text_Display *disp = new Fl_Text_Display(10, 10, 640, 480); disp->buffer(buff); // attach text buffer to display widget buff->text("line one\nline two"); // add some text to buffer - .. + .. } \endcode @@ -80,9 +78,9 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group { public: - - /** - text display cursor shapes enumeration + + /** + text display cursor shapes enumeration */ enum { NORMAL_CURSOR, /**< I-beam */ @@ -92,18 +90,18 @@ public: HEAVY_CURSOR, /**< thick I-beam */ SIMPLE_CURSOR /**< as cursor as Fl_Input cursor */ }; - + /** - the character position is the left edge of a character, whereas + the character position is the left edge of a character, whereas the cursor is thought to be between the centers of two consecutive characters. */ enum { - CURSOR_POS, + CURSOR_POS, CHARACTER_POS }; - - /** + + /** drag types - they match Fl::event_clicks() so that single clicking to start a collection selects by character, double clicking selects by word and triple clicking selects by line. @@ -111,11 +109,11 @@ public: enum { DRAG_NONE = -2, DRAG_START_DND = -1, - DRAG_CHAR = 0, - DRAG_WORD = 1, + DRAG_CHAR = 0, + DRAG_WORD = 1, DRAG_LINE = 2 }; - + /** wrap types - used in wrap_mode() */ @@ -124,13 +122,13 @@ public: WRAP_AT_COLUMN, /**< wrap text at the given text column */ WRAP_AT_PIXEL, /**< wrap text at a pixel position */ WRAP_AT_BOUNDS /**< wrap text so that it fits into the widget width */ - }; - + }; + friend void fl_text_drag_me(int pos, Fl_Text_Display* d); - + typedef void (*Unfinished_Style_Cb)(int, void *); - - /** + + /** This structure associates the color, font, and font size of a string to draw with an attribute mask matching attr. @@ -144,19 +142,19 @@ public: \see Fl_Text_Display::highlight_data() */ struct Style_Table_Entry { - Fl_Color color; ///< text color - Fl_Font font; ///< text font - Fl_Fontsize size; ///< text font size - unsigned attr; ///< currently unused (this may be changed in the future) + Fl_Color color; ///< text color + Fl_Font font; ///< text font + Fl_Fontsize size; ///< text font size + unsigned attr; ///< currently unused (this may be changed in the future) }; - + Fl_Text_Display(int X, int Y, int W, int H, const char *l = 0); ~Fl_Text_Display(); - + virtual int handle(int e); - + void buffer(Fl_Text_Buffer* buf); - + /** Sets the current text buffer associated with the text widget. Multiple text widgets can be associated with the same text buffer. @@ -164,7 +162,7 @@ public: \see Fl_Text_Display::buffer(Fl_Text_Buffer* buf) */ void buffer(Fl_Text_Buffer& buf) { buffer(&buf); } - + /** Gets the current text buffer associated with the text widget. Multiple text widgets can be associated with the same text buffer. @@ -173,7 +171,7 @@ public: \see Fl_Text_Display::buffer(Fl_Text_Buffer& buf) */ Fl_Text_Buffer* buffer() const { return mBuffer; } - + void redisplay_range(int start, int end); void scroll(int topLineNum, int horizOffset); void insert(const char* text); @@ -196,10 +194,10 @@ public: int in_selection(int x, int y) const; void show_insert_position(); - + int move_right(); int move_left(); - int move_up(); + int move_up(); int move_down(); int count_lines(int start, int end, bool start_pos_is_line_start) const; int line_start(int pos) const; @@ -208,29 +206,29 @@ public: int rewind_lines(int startPos, int nLines); void next_word(void); void previous_word(void); - + void show_cursor(int b = 1); - + /** Hides the text cursor. */ void hide_cursor() { show_cursor(0); } - + void cursor_style(int style); int cursor_style() const { return mCursorStyle; } - + /** - Gets the text cursor color. + Gets the text cursor color. \return cursor color */ Fl_Color cursor_color() const {return mCursor_color;} - - /** + + /** Sets the text cursor color. \param n new cursor color */ void cursor_color(Fl_Color n) {mCursor_color = n;} - + /** Returns the global value Fl::scrollbar_size() unless a specific scrollbar_width_ has been set. \deprecated Use scrollbar_size() instead. @@ -249,13 +247,13 @@ public: Fl::scrollbar_size(width); scrollbar_width_ = 0; } - + /** Gets the current size of the scrollbars' troughs, in pixels. - If this value is zero (default), this widget will use the + 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) */ @@ -267,114 +265,114 @@ public: 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 + 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_width_ = newSize; - } + } /** Gets the scrollbar alignment type. \return scrollbar alignment */ Fl_Align scrollbar_align() const { return scrollbar_align_; } - + /** Sets the scrollbar alignment type. \param a new scrollbar alignment */ void scrollbar_align(Fl_Align a) { scrollbar_align_ = a; } - + /** Moves the insert position to the beginning of the current word. \param pos start calculation at this index \return beginning of the words */ int word_start(int pos) const { return buffer()->word_start(pos); } - - /** + + /** Moves the insert position to the end of the current word. \param pos start calculation at this index \return index of first character after the end of the word */ int word_end(int pos) const { return buffer()->word_end(pos); } - - + + void highlight_data(Fl_Text_Buffer *styleBuffer, const Style_Table_Entry *styleTable, int nStyles, char unfinishedStyle, Unfinished_Style_Cb unfinishedHighlightCB, void *cbArg); - + int position_style(int lineStartPos, int lineLen, int lineIndex) const; - - /** - \todo FIXME : get set methods pointing on shortcut_ - have no effects as shortcut_ is unused in this class and derived! + + /** + \todo FIXME : get set methods pointing on shortcut_ + have no effects as shortcut_ is unused in this class and derived! \return the current shortcut key */ int shortcut() const {return shortcut_;} - + /** - \todo FIXME : get set methods pointing on shortcut_ - have no effects as shortcut_ is unused in this class and derived! + \todo FIXME : get set methods pointing on shortcut_ + have no effects as shortcut_ is unused in this class and derived! \param s the new shortcut key */ void shortcut(int s) {shortcut_ = s;} - + /** Gets the default font used when drawing text in the widget. \return current text font face unless overridden by a style */ Fl_Font textfont() const {return textfont_;} - + /** Sets the default font used when drawing text in the widget. \param s default text font face */ void textfont(Fl_Font s) {textfont_ = s; mColumnScale = 0; } - + /** Gets the default size of text in the widget. \return current text height unless overridden by a style */ Fl_Fontsize textsize() const {return textsize_;} - + /** Sets the default size of text in the widget. \param s new text size */ void textsize(Fl_Fontsize s) {textsize_ = s; mColumnScale = 0; } - + /** Gets the default color of text in the widget. \return text color unless overridden by a style */ Fl_Color textcolor() const {return textcolor_;} - + /** Sets the default color of text in the widget. \param n new text color */ void textcolor(Fl_Color n) {textcolor_ = n;} - + int wrapped_column(int row, int column) const; int wrapped_row(int row) const; void wrap_mode(int wrap, int wrap_margin); - + virtual void recalc_display(); virtual void resize(int X, int Y, int W, int H); @@ -384,15 +382,15 @@ public: \return an approximate column number based on the main font */ double x_to_col(double x) const; - + /** Convert a column number into an x pixel position. \param col an approximate column number based on the main font \return number of pixels from the left margin to the left of an - average sized character + average sized character */ double col_to_x(double col) const; - + void linenumber_width(int width); int linenumber_width() const; void linenumber_font(Fl_Font val); @@ -413,57 +411,57 @@ protected: // draw(). // Anything with "vline" indicates thats it deals with currently // visible lines. - + virtual void draw(); void draw_text(int X, int Y, int W, int H); void draw_range(int start, int end); void draw_cursor(int, int); - + void draw_string(int style, int x, int y, int toX, const char *string, int nChars) const; - + void draw_vline(int visLineNum, int leftClip, int rightClip, int leftCharIndex, int rightCharIndex); - + int find_x(const char *s, int len, int style, int x) const; - - enum { - DRAW_LINE, + + enum { + DRAW_LINE, FIND_INDEX, FIND_INDEX_FROM_ZERO, GET_WIDTH, - FIND_CURSOR_INDEX // STR #2788 + FIND_CURSOR_INDEX // STR #2788 }; - - int handle_vline(int mode, + + int handle_vline(int mode, int lineStart, int lineLen, int leftChar, int rightChar, int topClip, int bottomClip, int leftClip, int rightClip) const; - + void draw_line_numbers(bool clearAll); - + void clear_rect(int style, int x, int y, int width, int height) const; void display_insert(); - + void offset_line_starts(int newTopLineNum); - + void calc_line_starts(int startLine, int endLine); - + void update_line_starts(int pos, int charsInserted, int charsDeleted, int linesInserted, int linesDeleted, int *scrolled); - + void calc_last_char(); - + int position_to_line( int pos, int* lineNum ) const; double string_width(const char* string, int length, int style) const; - + static void scroll_timer_cb(void*); - + static void buffer_predelete_cb(int pos, int nDeleted, void* cbArg); static void buffer_modified_cb(int pos, int nInserted, int nDeleted, int nRestyled, const char* deletedText, void* cbArg); - + static void h_scrollbar_cb(Fl_Scrollbar* w, Fl_Text_Display* d); static void v_scrollbar_cb( Fl_Scrollbar* w, Fl_Text_Display* d); void update_v_scrollbar(); @@ -473,7 +471,7 @@ protected: int empty_vlines() const; int vline_length(int visLineNum) const; int xy_to_position(int x, int y, int PosType = CHARACTER_POS) const; - + void xy_to_rowcol(int x, int y, int* row, int* column, int PosType = CHARACTER_POS) const; void maintain_absolute_top_line_number(int state); @@ -483,9 +481,9 @@ protected: void reset_absolute_top_line_number(); int position_to_linecol(int pos, int* lineNum, int* column) const; int scroll_(int topLineNum, int horizOffset); - + void extend_range_for_styles(int* start, int* end); - + void find_wrap_range(const char *deletedText, int pos, int nInserted, int nDeleted, int *modRangeStart, int *modRangeEnd, int *linesInserted, int *linesDeleted); @@ -499,7 +497,7 @@ protected: int *nextLineStart) const; double measure_proportional_character(const char *s, int colNum, int pos) const; int wrap_uses_character(int lineEndPos) const; - + int damage_range1_start, damage_range1_end; int damage_range2_start, damage_range2_end; int mCursorPos; @@ -521,7 +519,7 @@ protected: either to a newline or one character beyond the end of the buffer) */ int mContinuousWrap; /* Wrap long lines when displaying */ - int mWrapMarginPix; /* Margin in # of pixels for + int mWrapMarginPix; /* Margin in # of pixels for wrapping in continuousWrap mode */ int* mLineStarts; /* Array of the size mNVisibleLines. This array only keeps track of lines @@ -554,9 +552,9 @@ protected: Unfinished_Style_Cb mUnfinishedHighlightCB; /* Callback to parse "unfinished" */ /* regions */ void* mHighlightCBArg; /* Arg to unfinishedHighlightCB */ - + int mMaxsize; - + int mSuppressResync; /* Suppress resynchronization of line starts during buffer updates */ int mNLinesDeleted; /* Number of lines deleted during @@ -565,26 +563,26 @@ protected: int mModifyingTabDistance; /* Whether tab distance is being modified XXX: UNUSED */ mutable double mColumnScale; /* Width in pixels of an average character. This - value is calculated as needed (lazy eval); it + value is calculated as needed (lazy eval); it needs to be mutable so that it can be calculated within a method marked as "const" */ - + Fl_Color mCursor_color; - + Fl_Scrollbar* mHScrollBar; Fl_Scrollbar* mVScrollBar; - int scrollbar_width_; // size of scrollbar trough (behavior changed in 1.4) + int scrollbar_width_; // size of scrollbar trough (behavior changed in 1.4) Fl_Align scrollbar_align_; int dragPos, dragType, dragging; int display_insert_position_hint; struct { int x, y, w, h; } text_area; - + int shortcut_; - + Fl_Font textfont_; Fl_Fontsize textsize_; Fl_Color textcolor_; - + // Line number margin and width int mLineNumLeft, mLineNumWidth; @@ -598,7 +596,3 @@ protected: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Text_Editor.H b/FL/Fl_Text_Editor.H index b4e245164..48f8a1ac0 100644 --- a/FL/Fl_Text_Editor.H +++ b/FL/Fl_Text_Editor.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Header file for Fl_Text_Editor class. // // Copyright 2001-2010 by Bill Spitzak and others. @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -44,25 +42,25 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display { /** Simple linked list item associating a key/state to a function. */ struct Key_Binding { - int key; ///< the key pressed - int state; ///< the state of key modifiers - Key_Func function; ///< associated function - Key_Binding* next; ///< next key binding in the list + int key; ///< the key pressed + int state; ///< the state of key modifiers + Key_Func function; ///< associated function + Key_Binding* next; ///< next key binding in the list }; Fl_Text_Editor(int X, int Y, int W, int H, const char* l = 0); ~Fl_Text_Editor() { remove_all_key_bindings(); } virtual int handle(int e); /** - Sets the current insert mode; if non-zero, new text - is inserted before the current cursor position. Otherwise, new - text replaces text at the current cursor position. + Sets the current insert mode; if non-zero, new text + is inserted before the current cursor position. Otherwise, new + text replaces text at the current cursor position. */ void insert_mode(int b) { insert_mode_ = b; } /** - Gets the current insert mode; if non-zero, new text - is inserted before the current cursor position. Otherwise, new - text replaces text at the current cursor position. + Gets the current insert mode; if non-zero, new text + is inserted before the current cursor position. Otherwise, new + text replaces text at the current cursor position. */ int insert_mode() { return insert_mode_; } void tab_nav(int val); @@ -138,7 +136,3 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display { #endif -// -// End of "$Id$". -// - diff --git a/FL/Fl_Tile.H b/FL/Fl_Tile.H index c5a8e1703..5b818fe89 100644 --- a/FL/Fl_Tile.H +++ b/FL/Fl_Tile.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tile header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Tile_H @@ -35,7 +33,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Tiled_Image.H b/FL/Fl_Tiled_Image.H index 0eb17e2e2..66814a8fd 100644 --- a/FL/Fl_Tiled_Image.H +++ b/FL/Fl_Tiled_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tiled image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -34,8 +32,8 @@ class FL_EXPORT Fl_Tiled_Image : public Fl_Image { protected: - Fl_Image *image_; // The image that is tiled - int alloc_image_; // Did we allocate this image? + Fl_Image *image_; // The image that is tiled + int alloc_image_; // Did we allocate this image? public: @@ -53,7 +51,3 @@ class FL_EXPORT Fl_Tiled_Image : public Fl_Image { }; #endif // !Fl_Tiled_Image_H - -// -// End of "$Id$" -// diff --git a/FL/Fl_Timer.H b/FL/Fl_Timer.H index 3000615dd..6c9db28a1 100644 --- a/FL/Fl_Timer.H +++ b/FL/Fl_Timer.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Timer header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,15 +25,15 @@ #endif // values for type(): -#define FL_NORMAL_TIMER 0 -#define FL_VALUE_TIMER 1 -#define FL_HIDDEN_TIMER 2 +#define FL_NORMAL_TIMER 0 +#define FL_VALUE_TIMER 1 +#define FL_HIDDEN_TIMER 2 /** This is provided only to emulate the Forms Timer widget. It works by making a timeout callback every 1/5 second. This is wasteful and inaccurate if you just want something to happen a fixed time in the - future. You should directly call + future. You should directly call Fl::add_timeout() instead. */ class FL_EXPORT Fl_Timer : public Fl_Widget { @@ -72,7 +70,3 @@ public: #endif -// -// End of "$Id$". -// - diff --git a/FL/Fl_Toggle_Button.H b/FL/Fl_Toggle_Button.H index 008565563..b2e0eda3c 100644 --- a/FL/Fl_Toggle_Button.H +++ b/FL/Fl_Toggle_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Toggle button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -25,7 +23,7 @@ #include "Fl_Button.H" /** - The toggle button is a push button that needs to be clicked once + The toggle button is a push button that needs to be clicked once to toggle on, and one more time to toggle off. The Fl_Toggle_Button subclass displays the "on" state by drawing a pushed-in button.</P> @@ -44,7 +42,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Toggle_Light_Button.H b/FL/Fl_Toggle_Light_Button.H index 8dd6e39f0..60dacd8de 100644 --- a/FL/Fl_Toggle_Light_Button.H +++ b/FL/Fl_Toggle_Light_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Toggle light button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // provided for back-compatibility only @@ -22,7 +20,3 @@ #include "Fl_Light_Button.H" #define Fl_Toggle_Light_Button Fl_Light_Button #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Toggle_Round_Button.H b/FL/Fl_Toggle_Round_Button.H index ab87d1679..7fe5e1924 100644 --- a/FL/Fl_Toggle_Round_Button.H +++ b/FL/Fl_Toggle_Round_Button.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Toggle round button header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // provided for back-compatibility only @@ -22,7 +20,3 @@ #include "Fl_Round_Button.H" #define Fl_Toggle_Round_Button Fl_Round_Button #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H index aa8fd880b..b79d93149 100644 --- a/FL/Fl_Tooltip.H +++ b/FL/Fl_Tooltip.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tooltip header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -116,14 +114,10 @@ private: static Fl_Font font_; static Fl_Fontsize size_; static Fl_Widget* widget_; //!< Keeps track of the current target widget - static int margin_width_; //!< distance around tooltip text left+right - static int margin_height_; //!< distance around tooltip text top+bottom - static int wrap_width_; //!< maximum width of tooltip text before it word wraps + static int margin_width_; //!< distance around tooltip text left+right + static int margin_height_; //!< distance around tooltip text top+bottom + static int wrap_width_; //!< maximum width of tooltip text before it word wraps static const int draw_symbols_; // 1 = draw @-symbols in tooltips, 0 = no }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H index fc827ba9e..44509e978 100644 --- a/FL/Fl_Tree.H +++ b/FL/Fl_Tree.H @@ -1,6 +1,4 @@ // -// "$Id$" -// #ifndef FL_TREE_H #define FL_TREE_H @@ -26,9 +24,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /// @@ -80,7 +78,7 @@ tree.add("Simpsons/Lisa"); tree.end(); \endcode - + \par FEATURES Items can be added with add(),<BR> removed with remove(),<BR> @@ -124,7 +122,7 @@ widget() to be shown in place of the item's label (if it has one). Only the widget()'s width will be used; the widget()'s x() and y() position will be managed by the tree, and the h() will track the item's height. - This default behavior can be altered (ABI 1.3.1): + This default behavior can be altered (ABI 1.3.1): Setting Fl_Tree::item_draw_mode()'s FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET flag causes the label + widget to be displayed together in that order, and adding the FL_TREE_ITEM_HEIGHT_FROM_WIDGET flag causes widget's height @@ -136,8 +134,8 @@ can either be changed globally with Fl_Tree::usericon(), or on a per-item basis with Fl_Tree_Item::usericon(). \par - Various default preferences can be globally manipulated via Fl_Tree_Prefs, - including colors, margins, icons, connection lines, etc. + Various default preferences can be globally manipulated via Fl_Tree_Prefs, + including colors, margins, icons, connection lines, etc. \par FONTS AND COLORS When adding new items to the tree, the new items get the @@ -165,7 +163,7 @@ \code void MyTreeCallback(Fl_Widget *w, void *data) { Fl_Tree *tree = (Fl_Tree*)w; - Fl_Tree_Item *item = (Fl_Tree_Item*)tree->callback_item(); // get selected item + Fl_Tree_Item *item = (Fl_Tree_Item*)tree->callback_item(); // get selected item switch ( tree->callback_reason() ) { case FL_TREE_REASON_SELECTED: [..] case FL_TREE_REASON_DESELECTED: [..] @@ -190,7 +188,7 @@ \code [..] char pathname[256] = "???"; - tree->item_pathname(pathname, sizeof(pathname), item); // eg. "Parent/Child/Item" + tree->item_pathname(pathname, sizeof(pathname), item); // eg. "Parent/Child/Item" [..] \endcode \par @@ -203,7 +201,7 @@ } \endcode \par - To recursively walk all the children of a particular item, + To recursively walk all the children of a particular item, define a function that uses recursion: \par \code @@ -220,8 +218,8 @@ \par \code tree = new Fl_Tree(..); - tree->item_labelfont(FL_COURIER); // Use Courier font for all new items - tree->item_labelfgcolor(FL_RED); // Use red color for labels of all new items + tree->item_labelfont(FL_COURIER); // Use Courier font for all new items + tree->item_labelfgcolor(FL_RED); // Use red color for labels of all new items [..] // Now create the items in the tree using the above defaults. tree->add("Aaa"); @@ -275,33 +273,33 @@ /// The reason the callback was invoked. /// enum Fl_Tree_Reason { - FL_TREE_REASON_NONE=0, ///< unknown reason - FL_TREE_REASON_SELECTED, ///< an item was selected - FL_TREE_REASON_DESELECTED, ///< an item was de-selected - FL_TREE_REASON_RESELECTED, ///< an item was re-selected (double-clicked). - ///< See ::Fl_Tree_Item_Reselect_Mode to enable this. - FL_TREE_REASON_OPENED, ///< an item was opened - FL_TREE_REASON_CLOSED, ///< an item was closed - FL_TREE_REASON_DRAGGED ///< an item was dragged into a new place + FL_TREE_REASON_NONE=0, ///< unknown reason + FL_TREE_REASON_SELECTED, ///< an item was selected + FL_TREE_REASON_DESELECTED, ///< an item was de-selected + FL_TREE_REASON_RESELECTED, ///< an item was re-selected (double-clicked). + ///< See ::Fl_Tree_Item_Reselect_Mode to enable this. + FL_TREE_REASON_OPENED, ///< an item was opened + FL_TREE_REASON_CLOSED, ///< an item was closed + FL_TREE_REASON_DRAGGED ///< an item was dragged into a new place }; class FL_EXPORT Fl_Tree : public Fl_Group { friend class Fl_Tree_Item; - Fl_Tree_Item *_root; // can be null! - Fl_Tree_Item *_item_focus; // item that has focus box - Fl_Tree_Item *_callback_item; // item invoked during callback (can be NULL) - Fl_Tree_Reason _callback_reason; // reason for the callback - Fl_Tree_Prefs _prefs; // all the tree's settings - int _scrollbar_size; // size of scrollbar trough + Fl_Tree_Item *_root; // can be null! + Fl_Tree_Item *_item_focus; // item that has focus box + Fl_Tree_Item *_callback_item; // item invoked during callback (can be NULL) + Fl_Tree_Reason _callback_reason; // reason for the callback + Fl_Tree_Prefs _prefs; // all the tree's settings + int _scrollbar_size; // size of scrollbar trough Fl_Tree_Item *_lastselect; // last selected item char _lastpushed; // FL_PUSH occurred on: 0=nothing, 1=open/close, 2=usericon, 3=label void fix_scrollbar_order(); protected: - Fl_Scrollbar *_vscroll; ///< Vertical scrollbar - Fl_Scrollbar *_hscroll; ///< Horizontal scrollbar - int _tox,_toy,_tow,_toh; ///< Tree widget outer xywh dimension: outside scrollbars, inside widget border - int _tix,_tiy,_tiw,_tih; ///< Tree widget inner xywh dimension: inside borders + scrollbars + Fl_Scrollbar *_vscroll; ///< Vertical scrollbar + Fl_Scrollbar *_hscroll; ///< Horizontal scrollbar + int _tox,_toy,_tow,_toh; ///< Tree widget outer xywh dimension: outside scrollbars, inside widget border + int _tix,_tiy,_tiw,_tih; ///< Tree widget inner xywh dimension: inside borders + scrollbars /// the calculated width of the entire tree hierarchy. See calc_tree() int _tree_w; @@ -352,14 +350,14 @@ public: Fl_Tree_Item* find_clicked(int yonly=0); Fl_Tree_Item *item_clicked(); Fl_Tree_Item *first(); - Fl_Tree_Item *first_visible(); // deprecated in ABI 10303 + Fl_Tree_Item *first_visible(); // deprecated in ABI 10303 Fl_Tree_Item *first_visible_item(); Fl_Tree_Item *next(Fl_Tree_Item *item=0); Fl_Tree_Item *prev(Fl_Tree_Item *item=0); Fl_Tree_Item *last(); - Fl_Tree_Item *last_visible(); // deprecated in ABI 10303 + Fl_Tree_Item *last_visible(); // deprecated in ABI 10303 Fl_Tree_Item *last_visible_item(); - Fl_Tree_Item *next_visible_item(Fl_Tree_Item *start, int dir); // made public in 1.3.3 ABI + Fl_Tree_Item *next_visible_item(Fl_Tree_Item *start, int dir); // made public in 1.3.3 ABI Fl_Tree_Item *first_selected_item(); Fl_Tree_Item *last_selected_item(); Fl_Tree_Item *next_item(Fl_Tree_Item *item, int dir=FL_Down, bool visible=false); @@ -392,13 +390,13 @@ public: int select_all(Fl_Tree_Item *item=0, int docallback=1); int extend_selection_dir(Fl_Tree_Item *from, Fl_Tree_Item *to, - int dir, - int val, - bool visible); + int dir, + int val, + bool visible); int extend_selection(Fl_Tree_Item *from, - Fl_Tree_Item *to, - int val=1, - bool visible=false); + Fl_Tree_Item *to, + int val=1, + bool visible=false); void set_item_focus(Fl_Tree_Item *item); Fl_Tree_Item *get_item_focus() const; int is_selected(Fl_Tree_Item *item) const; @@ -492,7 +490,3 @@ public: }; #endif /*FL_TREE_H*/ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Tree_Item.H b/FL/Fl_Tree_Item.H index 99d52a4b9..d0e68d4e7 100644 --- a/FL/Fl_Tree_Item.H +++ b/FL/Fl_Tree_Item.H @@ -1,6 +1,4 @@ // -// "$Id$" -// #ifndef FL_TREE_ITEM_H #define FL_TREE_ITEM_H @@ -24,11 +22,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /// @@ -65,31 +63,31 @@ /// class Fl_Tree; class FL_EXPORT Fl_Tree_Item { - Fl_Tree *_tree; // parent tree - const char *_label; // label (memory managed) - Fl_Font _labelfont; // label's font face - Fl_Fontsize _labelsize; // label's font size - Fl_Color _labelfgcolor; // label's fg color - Fl_Color _labelbgcolor; // label's bg color (0xffffffff is 'transparent') + Fl_Tree *_tree; // parent tree + const char *_label; // label (memory managed) + Fl_Font _labelfont; // label's font face + Fl_Fontsize _labelsize; // label's font size + Fl_Color _labelfgcolor; // label's fg color + Fl_Color _labelbgcolor; // label's bg color (0xffffffff is 'transparent') /// \enum Fl_Tree_Item_Flags enum Fl_Tree_Item_Flags { - OPEN = 1<<0, ///> item is open - VISIBLE = 1<<1, ///> item is visible - ACTIVE = 1<<2, ///> item is active - SELECTED = 1<<3 ///> item is selected + OPEN = 1<<0, ///> item is open + VISIBLE = 1<<1, ///> item is visible + ACTIVE = 1<<2, ///> item is active + SELECTED = 1<<3 ///> item is selected }; - unsigned short _flags; // misc flags - int _xywh[4]; // xywh of this widget (if visible) - int _collapse_xywh[4]; // xywh of collapse icon (if visible) - int _label_xywh[4]; // xywh of label - Fl_Widget *_widget; // item's label widget (optional) - Fl_Image *_usericon; // item's user-specific icon (optional) - Fl_Image *_userdeicon; // deactivated usericon - Fl_Tree_Item_Array _children; // array of child items - Fl_Tree_Item *_parent; // parent item (=0 if root) - void *_userdata; // user data that can be associated with an item - Fl_Tree_Item *_prev_sibling; // previous sibling (same level) - Fl_Tree_Item *_next_sibling; // next sibling (same level) + unsigned short _flags; // misc flags + int _xywh[4]; // xywh of this widget (if visible) + int _collapse_xywh[4]; // xywh of collapse icon (if visible) + int _label_xywh[4]; // xywh of label + Fl_Widget *_widget; // item's label widget (optional) + Fl_Image *_usericon; // item's user-specific icon (optional) + Fl_Image *_userdeicon; // deactivated usericon + Fl_Tree_Item_Array _children; // array of child items + Fl_Tree_Item *_parent; // parent item (=0 if root) + void *_userdata; // user data that can be associated with an item + Fl_Tree_Item *_prev_sibling; // previous sibling (same level) + Fl_Tree_Item *_next_sibling; // next sibling (same level) // Protected methods protected: void _Init(const Fl_Tree_Prefs &prefs, Fl_Tree *tree); @@ -103,10 +101,10 @@ protected: Fl_Color drawbgcolor() const; public: - Fl_Tree_Item(const Fl_Tree_Prefs &prefs); // CTOR -- backwards compatible - Fl_Tree_Item(Fl_Tree *tree); // CTOR -- ABI 1.3.3+ - virtual ~Fl_Tree_Item(); // DTOR -- ABI 1.3.3+ - Fl_Tree_Item(const Fl_Tree_Item *o); // COPY CTOR + Fl_Tree_Item(const Fl_Tree_Prefs &prefs); // CTOR -- backwards compatible + Fl_Tree_Item(Fl_Tree *tree); // CTOR -- ABI 1.3.3+ + virtual ~Fl_Tree_Item(); // DTOR -- ABI 1.3.3+ + Fl_Tree_Item(const Fl_Tree_Item *o); // COPY CTOR /// The item's x position relative to the window int x() const { return(_xywh[0]); } /// The item's y position relative to the window @@ -130,8 +128,8 @@ public: /// \version 1.3.3 int label_h() const { return(_label_xywh[3]); } virtual int draw_item_content(int render); - void draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, - int &tree_item_xmax, int lastchild=1, int render=1); + void draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, + int &tree_item_xmax, int lastchild=1, int render=1); void show_self(const char *indent = "") const; void label(const char *val); const char *label() const; @@ -141,11 +139,11 @@ public: /// Retrieve the user-data value that has been assigned to the item. inline void* user_data() const { return _userdata; } - + /// Set item's label font face. void labelfont(Fl_Font val) { - _labelfont = val; - recalc_tree(); // may change tree geometry + _labelfont = val; + recalc_tree(); // may change tree geometry } /// Get item's label font face. Fl_Font labelfont() const { @@ -153,8 +151,8 @@ public: } /// Set item's label font size. void labelsize(Fl_Fontsize val) { - _labelsize = val; - recalc_tree(); // may change tree geometry + _labelsize = val; + recalc_tree(); // may change tree geometry } /// Get item's label font size. Fl_Fontsize labelsize() const { @@ -162,11 +160,11 @@ public: } /// Set item's label foreground text color. void labelfgcolor(Fl_Color val) { - _labelfgcolor = val; + _labelfgcolor = val; } /// Return item's label foreground text color. Fl_Color labelfgcolor() const { - return(_labelfgcolor); + return(_labelfgcolor); } /// Set item's label text color. Alias for labelfgcolor(Fl_Color)). void labelcolor(Fl_Color val) { @@ -174,42 +172,42 @@ public: } /// Return item's label text color. Alias for labelfgcolor() const). Fl_Color labelcolor() const { - return labelfgcolor(); + return labelfgcolor(); } /// Set item's label background color. /// A special case is made for color 0xffffffff which uses the parent tree's bg color. void labelbgcolor(Fl_Color val) { - _labelbgcolor = val; + _labelbgcolor = val; } /// Return item's label background text color. /// If the color is 0xffffffff, the default behavior is the parent tree's /// bg color will be used. (An overloaded draw_item_content() can override /// this behavior.) Fl_Color labelbgcolor() const { - return(_labelbgcolor); + return(_labelbgcolor); } /// Assign an FLTK widget to this item. void widget(Fl_Widget *val) { - _widget = val; - recalc_tree(); // may change tree geometry + _widget = val; + recalc_tree(); // may change tree geometry } /// Return FLTK widget assigned to this item. Fl_Widget *widget() const { - return(_widget); + return(_widget); } /// Return the number of children this item has. int children() const { - return(_children.total()); + return(_children.total()); } /// Return the child item for the given 'index'. Fl_Tree_Item *child(int index) { - return(_children[index]); + return(_children[index]); } /// Return the const child item for the given 'index'. const Fl_Tree_Item *child(int t) const; /// See if this item has children. int has_children() const { - return(children()); + return(children()); } int find_child(const char *name); int find_child(Fl_Tree_Item *item); @@ -228,15 +226,15 @@ public: // Adding items ////////////////// Fl_Tree_Item *add(const Fl_Tree_Prefs &prefs, - const char *new_label, - Fl_Tree_Item *newitem); + const char *new_label, + Fl_Tree_Item *newitem); Fl_Tree_Item *add(const Fl_Tree_Prefs &prefs, - const char *new_label); + const char *new_label); Fl_Tree_Item *add(const Fl_Tree_Prefs &prefs, - char **arr, - Fl_Tree_Item *newitem); + char **arr, + Fl_Tree_Item *newitem); Fl_Tree_Item *add(const Fl_Tree_Prefs &prefs, - char **arr); + char **arr); Fl_Tree_Item *replace(Fl_Tree_Item *new_item); Fl_Tree_Item *replace_child(Fl_Tree_Item *olditem, Fl_Tree_Item *newitem); Fl_Tree_Item *insert(const Fl_Tree_Prefs &prefs, const char *new_label, int pos=0); @@ -254,11 +252,11 @@ public: Fl_Tree_Item *next_sibling(); Fl_Tree_Item *prev_sibling(); void update_prev_next(int index); - Fl_Tree_Item *next_displayed(Fl_Tree_Prefs &prefs); // deprecated - Fl_Tree_Item *prev_displayed(Fl_Tree_Prefs &prefs); // deprecated + Fl_Tree_Item *next_displayed(Fl_Tree_Prefs &prefs); // deprecated + Fl_Tree_Item *prev_displayed(Fl_Tree_Prefs &prefs); // deprecated Fl_Tree_Item *next_visible(Fl_Tree_Prefs &prefs); Fl_Tree_Item *prev_visible(Fl_Tree_Prefs &prefs); - + /// Return the parent for this item. Returns NULL if we are the root. Fl_Tree_Item *parent() { return(_parent); @@ -299,7 +297,7 @@ public: } /// Toggle the item's open/closed state. void open_toggle() { - is_open()?close():open(); // handles calling recalc_tree() + is_open()?close():open(); // handles calling recalc_tree() } /// Change the item's selection state to the optionally specified 'val'. /// If 'val' is not specified, the item will be selected. @@ -310,9 +308,9 @@ public: /// Toggle the item's selection state. void select_toggle() { if ( is_selected() ) { - deselect(); // deselect if selected + deselect(); // deselect if selected } else { - select(); // select if deselected + select(); // select if deselected } } /// Select item and all its children. @@ -355,7 +353,7 @@ public: } /// Change the item's activation state to the optionally specified 'val'. /// - /// When deactivated, the item will be 'grayed out'; the callback() + /// When deactivated, the item will be 'grayed out'; the callback() /// won't be invoked if the user clicks on the label. If a widget() /// is associated with the item, its activation state will be changed as well. /// @@ -365,9 +363,9 @@ public: set_flag(ACTIVE,val); if ( _widget && val != (int)_widget->active() ) { if ( val ) { - _widget->activate(); + _widget->activate(); } else { - _widget->deactivate(); + _widget->deactivate(); } _widget->redraw(); } @@ -407,7 +405,7 @@ public: /// void usericon(Fl_Image *val) { _usericon = val; - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry } /// Get the item's user icon as an Fl_Image. Returns '0' if disabled. Fl_Image *usericon() const { @@ -467,7 +465,7 @@ protected: /// Set a flag to an on or off value. val is 0 or 1. inline void set_flag(unsigned short flag,int val) { if ( flag==OPEN || flag==VISIBLE ) { - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry } if ( val ) _flags |= flag; else _flags &= ~flag; } @@ -479,7 +477,3 @@ protected: }; #endif /*FL_TREE_ITEM_H*/ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Tree_Item_Array.H b/FL/Fl_Tree_Item_Array.H index 05b3562c3..dc4da5ff3 100644 --- a/FL/Fl_Tree_Item_Array.H +++ b/FL/Fl_Tree_Item_Array.H @@ -1,6 +1,4 @@ // -// "$Id$" -// #ifndef _FL_TREE_ITEM_ARRAY_H #define _FL_TREE_ITEM_ARRAY_H @@ -8,8 +6,8 @@ #include <FL/Fl.H> #include "Fl_Export.H" -class FL_EXPORT Fl_Tree_Item; // forward decl must *precede* first doxygen comment block - // or doxygen will not document our class.. +class FL_EXPORT Fl_Tree_Item; // forward decl must *precede* first doxygen comment block + // or doxygen will not document our class.. ////////////////////////// // FL/Fl_Tree_Item_Array.H @@ -22,11 +20,11 @@ class FL_EXPORT Fl_Tree_Item; // forward decl must *precede* first doxygen comme // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /// @@ -45,19 +43,19 @@ class FL_EXPORT Fl_Tree_Item; // forward decl must *precede* first doxygen comme /// class FL_EXPORT Fl_Tree_Item_Array { - Fl_Tree_Item **_items; // items array - int _total; // #items in array - int _size; // #items *allocated* for array - int _chunksize; // #items to enlarge mem allocation + Fl_Tree_Item **_items; // items array + int _total; // #items in array + int _size; // #items *allocated* for array + int _chunksize; // #items to enlarge mem allocation enum { - MANAGE_ITEM = 1, ///> manage the Fl_Tree_Item's internals (internal use only) + MANAGE_ITEM = 1, ///> manage the Fl_Tree_Item's internals (internal use only) }; - char _flags; // flags to control behavior + char _flags; // flags to control behavior void enlarge(int count); public: - Fl_Tree_Item_Array(int new_chunksize = 10); // CTOR - ~Fl_Tree_Item_Array(); // DTOR - Fl_Tree_Item_Array(const Fl_Tree_Item_Array *o); // COPY CTOR + Fl_Tree_Item_Array(int new_chunksize = 10); // CTOR + ~Fl_Tree_Item_Array(); // DTOR + Fl_Tree_Item_Array(const Fl_Tree_Item_Array *o); // COPY CTOR /// Return the item and index \p i. Fl_Tree_Item *operator[](int i) { return(_items[i]); @@ -82,7 +80,7 @@ public: void remove(int index); int remove(Fl_Tree_Item *item); /// Option to control if Fl_Tree_Item_Array's destructor will also destroy the Fl_Tree_Item's. - /// If set: items and item array is destroyed. + /// If set: items and item array is destroyed. /// If clear: only the item array is destroyed, not items themselves. void manage_item_destroy(int val) { if ( val ) _flags |= MANAGE_ITEM; else _flags &= ~MANAGE_ITEM; @@ -93,7 +91,3 @@ public: }; #endif /*_FL_TREE_ITEM_ARRAY_H*/ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Tree_Prefs.H b/FL/Fl_Tree_Prefs.H index a7a8bee30..e6e010734 100644 --- a/FL/Fl_Tree_Prefs.H +++ b/FL/Fl_Tree_Prefs.H @@ -1,11 +1,9 @@ // -// "$Id$" -// #ifndef FL_TREE_PREFS_H #define FL_TREE_PREFS_H -#include <FL/Fl.H> // needed for ABI version features (via Enumerations.H) +#include <FL/Fl.H> // needed for ABI version features (via Enumerations.H) ////////////////////// // FL/Fl_Tree_Prefs.H @@ -18,11 +16,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /// @@ -47,18 +45,18 @@ /// Sort order options for items added to the tree /// enum Fl_Tree_Sort { - FL_TREE_SORT_NONE=0, ///< No sorting; items are added in the order defined (default). - FL_TREE_SORT_ASCENDING=1, ///< Add items in ascending sort order. - FL_TREE_SORT_DESCENDING=2 ///< Add items in descending sort order. + FL_TREE_SORT_NONE=0, ///< No sorting; items are added in the order defined (default). + FL_TREE_SORT_ASCENDING=1, ///< Add items in ascending sort order. + FL_TREE_SORT_DESCENDING=2 ///< Add items in descending sort order. }; /// \enum Fl_Tree_Connector /// Defines the style of connection lines between items. /// enum Fl_Tree_Connector { - FL_TREE_CONNECTOR_NONE=0, ///< Use no lines connecting items - FL_TREE_CONNECTOR_DOTTED=1, ///< Use dotted lines connecting items (default) - FL_TREE_CONNECTOR_SOLID=2 ///< Use solid lines connecting items + FL_TREE_CONNECTOR_NONE=0, ///< Use no lines connecting items + FL_TREE_CONNECTOR_DOTTED=1, ///< Use dotted lines connecting items (default) + FL_TREE_CONNECTOR_SOLID=2 ///< Use solid lines connecting items }; /// \enum Fl_Tree_Select @@ -78,8 +76,8 @@ enum Fl_Tree_Select { /// via item_reselect_mode(). /// enum Fl_Tree_Item_Reselect_Mode { - FL_TREE_SELECTABLE_ONCE=0, ///< Item can only be selected once (default) - FL_TREE_SELECTABLE_ALWAYS, ///< Enables FL_TREE_REASON_RESELECTED events for callbacks + FL_TREE_SELECTABLE_ONCE=0, ///< Item can only be selected once (default) + FL_TREE_SELECTABLE_ALWAYS, ///< Enables FL_TREE_REASON_RESELECTED events for callbacks }; /// \enum Fl_Tree_Item_Draw_Mode @@ -87,10 +85,10 @@ enum Fl_Tree_Item_Reselect_Mode { /// via item_draw_mode(). /// enum Fl_Tree_Item_Draw_Mode { - FL_TREE_ITEM_DRAW_DEFAULT=0, ///< If widget() defined, draw in place of label, + FL_TREE_ITEM_DRAW_DEFAULT=0, ///< If widget() defined, draw in place of label, ///< and widget() tracks item height (default) - FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET=1, ///< If widget() defined, include label to the left of the widget - FL_TREE_ITEM_HEIGHT_FROM_WIDGET=2 ///< If widget() defined, widget()'s height controls item's height + FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET=1, ///< If widget() defined, include label to the left of the widget + FL_TREE_ITEM_HEIGHT_FROM_WIDGET=2 ///< If widget() defined, widget()'s height controls item's height }; class Fl_Tree_Item; @@ -105,41 +103,41 @@ typedef void (Fl_Tree_Item_Draw_Callback)(Fl_Tree_Item*, void*); /// instead of trying to accessing tree's preferences settings directly. /// class FL_EXPORT Fl_Tree_Prefs { - Fl_Font _labelfont; // label's font face - Fl_Fontsize _labelsize; // label's font size - int _margintop; // -- - int _marginleft; // |- tree's controllable margins - int _marginbottom; // -- - int _openchild_marginbottom; // extra space below an open child tree - int _usericonmarginleft; // space to left of user icon (if any) - int _labelmarginleft; // space to left of label - int _widgetmarginleft; // space to left of widget - int _connectorwidth; // connector width (right of open/close icon) - int _linespacing; // vertical space between lines + Fl_Font _labelfont; // label's font face + Fl_Fontsize _labelsize; // label's font size + int _margintop; // -- + int _marginleft; // |- tree's controllable margins + int _marginbottom; // -- + int _openchild_marginbottom; // extra space below an open child tree + int _usericonmarginleft; // space to left of user icon (if any) + int _labelmarginleft; // space to left of label + int _widgetmarginleft; // space to left of widget + int _connectorwidth; // connector width (right of open/close icon) + int _linespacing; // vertical space between lines // Colors - Fl_Color _labelfgcolor; // label's foreground color - Fl_Color _labelbgcolor; // label's background color - Fl_Color _connectorcolor; // connector dotted line color - Fl_Tree_Connector _connectorstyle; // connector line style - Fl_Image *_openimage; // the 'open' icon [+] - Fl_Image *_closeimage; // the 'close' icon [-] - Fl_Image *_userimage; // user's own icon - Fl_Image *_opendeimage; // deactivated 'open' icon - Fl_Image *_closedeimage; // deactivated 'close' icon - Fl_Image *_userdeimage; // deactivated user icon - char _showcollapse; // 1=show collapse icons, 0=don't - char _showroot; // show the root item as part of the tree - Fl_Tree_Sort _sortorder; // none, ascening, descending, etc. - Fl_Boxtype _selectbox; // selection box type - Fl_Tree_Select _selectmode; // selection mode - Fl_Tree_Item_Reselect_Mode _itemreselectmode; // controls item selection callback() behavior - Fl_Tree_Item_Draw_Mode _itemdrawmode; // controls how items draw label + widget() - Fl_Tree_Item_Draw_Callback *_itemdrawcallback; // callback to handle drawing items (0=none) - void *_itemdrawuserdata; // data for drawing items (0=none) + Fl_Color _labelfgcolor; // label's foreground color + Fl_Color _labelbgcolor; // label's background color + Fl_Color _connectorcolor; // connector dotted line color + Fl_Tree_Connector _connectorstyle; // connector line style + Fl_Image *_openimage; // the 'open' icon [+] + Fl_Image *_closeimage; // the 'close' icon [-] + Fl_Image *_userimage; // user's own icon + Fl_Image *_opendeimage; // deactivated 'open' icon + Fl_Image *_closedeimage; // deactivated 'close' icon + Fl_Image *_userdeimage; // deactivated user icon + char _showcollapse; // 1=show collapse icons, 0=don't + char _showroot; // show the root item as part of the tree + Fl_Tree_Sort _sortorder; // none, ascening, descending, etc. + Fl_Boxtype _selectbox; // selection box type + Fl_Tree_Select _selectmode; // selection mode + Fl_Tree_Item_Reselect_Mode _itemreselectmode; // controls item selection callback() behavior + Fl_Tree_Item_Draw_Mode _itemdrawmode; // controls how items draw label + widget() + Fl_Tree_Item_Draw_Callback *_itemdrawcallback; // callback to handle drawing items (0=none) + void *_itemdrawuserdata; // data for drawing items (0=none) public: Fl_Tree_Prefs(); ~Fl_Tree_Prefs(); - + //////////////////////////// // Labels //////////////////////////// @@ -188,7 +186,7 @@ public: inline Fl_Color labelbgcolor() const { return(item_labelbgcolor()); } /// Obsolete: Set the default label background color. Please use item_labelbgcolor(Fl_Color) instead. inline void labelbgcolor(Fl_Color val) { item_labelbgcolor(val); } - + //////////////////////////// // Margins //////////////////////////// @@ -258,7 +256,7 @@ public: inline void linespacing(int val) { _linespacing = val; } - + //////////////////////////// // Colors and Styles //////////////////////////// @@ -290,7 +288,7 @@ public: inline void connectorwidth(int val) { _connectorwidth = val; } - + //////////////////////////// // Icons //////////////////////////// @@ -342,7 +340,7 @@ public: inline Fl_Image *userdeicon() const { return _userdeimage; } - + //////////////////////////// // Options //////////////////////////// @@ -417,7 +415,7 @@ public: } /// Set the 'item draw mode' used for the tree to \p val. /// This affects how items in the tree are drawn, - /// such as when a widget() is defined. + /// such as when a widget() is defined. /// See Fl_Tree_Item_Draw_Mode for possible values. /// inline void item_draw_mode(Fl_Tree_Item_Draw_Mode val) { @@ -439,7 +437,3 @@ public: }; #endif /*FL_TREE_PREFS_H*/ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Valuator.H b/FL/Fl_Valuator.H index 9fc36f7bf..d8288b7ed 100644 --- a/FL/Fl_Valuator.H +++ b/FL/Fl_Valuator.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Valuator header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,8 +25,8 @@ #endif // shared type() values for classes that work in both directions: -#define FL_VERTICAL 0 ///< The valuator can work vertically -#define FL_HORIZONTAL 1 ///< The valuator can work horizontally +#define FL_VERTICAL 0 ///< The valuator can work vertically +#define FL_HORIZONTAL 1 ///< The valuator can work horizontally /** The Fl_Valuator class controls a single floating-point value @@ -132,7 +130,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Value_Input.H b/FL/Fl_Value_Input.H index 1aabe8ed7..995b36a00 100644 --- a/FL/Fl_Value_Input.H +++ b/FL/Fl_Value_Input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Value input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -32,31 +30,31 @@ type(FL_FLOAT_INPUT) or type(FL_INT_INPUT) in there - and when they hit return or tab the value updates to what they typed and the callback is done. - + <P>If step() is non-zero and integral, then the range of numbers is limited to integers instead of floating point numbers. As well as displaying the value as an integer, typed input is also limited to integer values, even if the hidden Fl_Input widget is of type(FL_FLOAT_INPUT).</P> - + <P>If step() is non-zero, the user can also drag the mouse across the object and thus slide the value. The left button moves one step() per pixel, the middle by 10 * step(), and the right button by 100 * step(). It is therefore impossible to select text by dragging across it, although clicking can still move the insertion cursor.</P> - + <P>If step() is non-zero and integral, then the range of numbers are limited to integers instead of floating point values. - - <P ALIGN="CENTER">\image html Fl_Value_Input.png + + <P ALIGN="CENTER">\image html Fl_Value_Input.png \image latex Fl_Value_Input.png "Fl_Value_Input" width=4cm \see Fl_Widget::shortcut_label(int) */ class FL_EXPORT Fl_Value_Input : public Fl_Valuator { public: - /* This is the encapsulated Fl_input attribute to which + /* This is the encapsulated Fl_input attribute to which this class delegates the value font, color and shortcut */ Fl_Input input; private: @@ -83,21 +81,21 @@ public: char soft() const {return soft_;} /** Returns the current shortcut key for the Input. - \see Fl_Value_Input::shortcut(int) + \see Fl_Value_Input::shortcut(int) */ int shortcut() const {return input.shortcut();} - /** + /** Sets the shortcut key to \p 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 FL_ALT | 'a' , FL_ALT | (FL_F + 10), or just 'a'. A value of 0 disables the shortcut. - - The key can be any value returned by + + 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 + + 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" @@ -125,7 +123,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Value_Output.H b/FL/Fl_Value_Output.H index 2d817f579..6a2e7e900 100644 --- a/FL/Fl_Value_Output.H +++ b/FL/Fl_Value_Output.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Value output header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -30,12 +28,12 @@ The Fl_Value_Output widget displays a floating point value. If step() is not zero, the user can adjust the value by dragging the mouse left and right. The left button moves one step() - per pixel, the middle by 10 * step(), and the right button by + per pixel, the middle by 10 * step(), and the right button by 100 * step(). - <P>This is much lighter-weight than + <P>This is much lighter-weight than Fl_Value_Input because it contains no text editing code or character buffer. </P> - <P ALIGN=CENTER>\image html Fl_Value_Output.png + <P ALIGN=CENTER>\image html Fl_Value_Output.png \image latex Fl_Value_Output.png "Fl_Value_Output" width=4cm */ class FL_EXPORT Fl_Value_Output : public Fl_Valuator { @@ -80,7 +78,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Value_Slider.H b/FL/Fl_Value_Slider.H index 462cdb424..b139de71b 100644 --- a/FL/Fl_Value_Slider.H +++ b/FL/Fl_Value_Slider.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Value slider header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -27,7 +25,7 @@ /** The Fl_Value_Slider widget is a Fl_Slider widget with a box displaying the current value. - <P ALIGN=CENTER>\image html value_slider.png + <P ALIGN=CENTER>\image html value_slider.png \image latex value_slider.png "Fl_Value_Slider" width=4cm */ class FL_EXPORT Fl_Value_Slider : public Fl_Slider { @@ -54,7 +52,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index 6ca0787cd..0745b9063 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -72,16 +70,16 @@ struct FL_EXPORT Fl_Label { -/** Fl_Widget is the base class for all widgets in FLTK. - +/** Fl_Widget is the base class for all widgets in FLTK. + You can't create one of these because the constructor is not public. - However you can subclass it. + However you can subclass it. - All "property" accessing methods, such as color(), parent(), or argument() - are implemented as trivial inline functions and thus are as fast and small - as accessing fields in a structure. Unless otherwise noted, the property - setting methods such as color(n) or label(s) are also trivial inline - functions, even if they change the widget's appearance. It is up to the + All "property" accessing methods, such as color(), parent(), or argument() + are implemented as trivial inline functions and thus are as fast and small + as accessing fields in a structure. Unless otherwise noted, the property + setting methods such as color(n) or label(s) are also trivial inline + functions, even if they change the widget's appearance. It is up to the user code to call redraw() after these. */ class FL_EXPORT Fl_Widget { @@ -112,10 +110,10 @@ protected: /** Creates a widget at the given position and size. - The Fl_Widget is a protected constructor, but all derived widgets have a - matching public constructor. It takes a value for x(), y(), w(), h(), and + The Fl_Widget is a protected constructor, but all derived widgets have a + matching public constructor. It takes a value for x(), y(), w(), h(), and an optional value for label(). - + \param[in] x, y the position of the widget relative to the enclosing window \param[in] w, h size of the widget in pixels \param[in] label optional text for the widget label @@ -180,10 +178,10 @@ protected: public: /** Destroys the widget. - Destroying single widgets is not very common. You almost always want to - destroy the parent group instead, which will destroy all of the child widgets + Destroying single widgets is not very common. You almost always want to + destroy the parent group instead, which will destroy all of the child widgets and groups in that group. - + \since FLTK 1.3, the widget's destructor removes the widget from its parent group, if it is member of a group. */ @@ -207,17 +205,17 @@ public: */ virtual void draw() = 0; - /** Handles the specified event. - You normally don't call this method directly, but instead let FLTK do + /** Handles the specified event. + You normally don't call this method directly, but instead let FLTK do it when the user interacts with the widget. - - When implemented in a widget, this function must return 0 if the + + When implemented in a widget, this function must return 0 if the widget does not use the event or 1 otherwise. - Most of the time, you want to call the inherited handle() method in - your overridden method so that you don't short-circuit events that you + Most of the time, you want to call the inherited handle() method in + your overridden method so that you don't short-circuit events that you don't handle. In this last case you should return the callee retval. - + \param[in] event the kind of event received \retval 0 if the event was not used or understood \retval 1 if the event was used and can be deleted @@ -235,15 +233,15 @@ public: */ int is_label_copied() const {return ((flags_ & COPIED_LABEL) ? 1 : 0);} - /** Returns a pointer to the parent widget. - Usually this is a Fl_Group or Fl_Window. + /** Returns a pointer to the parent widget. + Usually this is a Fl_Group or Fl_Window. \retval NULL if the widget has no parent \see Fl_Group::add(Fl_Widget*) */ Fl_Group* parent() const {return parent_;} /** Internal use only - "for hacks only". - + It is \em \b STRONGLY recommended not to use this method, because it short-circuits Fl_Group's normal widget adding and removing methods, if the widget is already a child widget of another Fl_Group. @@ -255,7 +253,7 @@ public: /** Gets the widget type. Returns the widget type value, which is used for Forms compatibility and to simulate RTTI. - + \todo Explain "simulate RTTI" (currently only used to decide if a widget is a window, i.e. type()>=FL_WINDOW ?). Is type() really used in a way that ensures "Forms compatibility" ? @@ -289,20 +287,20 @@ public: /** Changes the size or position of the widget. - This is a virtual function so that the widget may implement its + This is a virtual function so that the widget may implement its own handling of resizing. The default version does \e not - call the redraw() method, but instead relies on the parent widget - to do so because the parent may know a faster way to update the - display, such as scrolling from the old position. + call the redraw() method, but instead relies on the parent widget + to do so because the parent may know a faster way to update the + display, such as scrolling from the old position. - Some window managers under X11 call resize() a lot more often - than needed. Please verify that the position or size of a widget + Some window managers under X11 call resize() a lot more often + than needed. Please verify that the position or size of a widget did actually change before doing any extensive calculations. - position(X, Y) is a shortcut for resize(X, Y, w(), h()), + position(X, Y) is a shortcut for resize(X, Y, w(), h()), and size(W, H) is a shortcut for resize(x(), y(), W, H). - - \param[in] x, y new position relative to the parent window + + \param[in] x, y new position relative to the parent window \param[in] w, h new size \see position(int,int), size(int,int) */ @@ -314,8 +312,8 @@ public: /** Repositions the window or widget. position(X, Y) is a shortcut for resize(X, Y, w(), h()). - - \param[in] X, Y new position relative to the parent window + + \param[in] X, Y new position relative to the parent window \see resize(int,int,int,int), size(int,int) */ void position(int X,int Y) {resize(X,Y,w_,h_);} @@ -323,7 +321,7 @@ public: /** Changes the size of the widget. size(W, H) is a shortcut for resize(x(), y(), W, H). - + \param[in] W, H new size \see position(int,int), resize(int,int,int,int) */ @@ -337,8 +335,8 @@ public: Fl_Align align() const {return label_.align_;} /** Sets the label alignment. - This controls how the label is displayed next to or inside the widget. - The default value is FL_ALIGN_CENTER, which centers the label inside + This controls how the label is displayed next to or inside the widget. + The default value is FL_ALIGN_CENTER, which centers the label inside the widget. \param[in] alignment new label alignment \see align(), Fl_Align @@ -350,10 +348,10 @@ public: \see box(Fl_Boxtype), Fl_Boxtype */ Fl_Boxtype box() const {return (Fl_Boxtype)box_;} - - /** Sets the box type for the widget. + + /** Sets the box type for the widget. This identifies a routine that draws the background of the widget. - See Fl_Boxtype for the available types. The default depends on the + See Fl_Boxtype for the available types. The default depends on the widget, but is usually FL_NO_BOX or FL_UP_BOX. \param[in] new_box the new box type \see box(), Fl_Boxtype @@ -366,11 +364,11 @@ public: */ Fl_Color color() const {return color_;} - /** Sets the background color of the widget. - The color is passed to the box routine. The color is either an index into - an internal table of RGB colors or an RGB color value generated using + /** Sets the background color of the widget. + The color is passed to the box routine. The color is either an index into + an internal table of RGB colors or an RGB color value generated using fl_rgb_color(). - + The default for most widgets is FL_BACKGROUND_COLOR. Use Fl::set_color() to redefine colors in the color map. \param[in] bg background color @@ -385,18 +383,18 @@ public: Fl_Color selection_color() const {return color2_;} /** Sets the selection color. - The selection color is defined for Forms compatibility and is usually - used to color the widget when it is selected, although some widgets - use this color for other purposes. You can set both colors at once + The selection color is defined for Forms compatibility and is usually + used to color the widget when it is selected, although some widgets + use this color for other purposes. You can set both colors at once with color(Fl_Color bg, Fl_Color sel). \param[in] a the new selection color \see selection_color(), color(Fl_Color, Fl_Color) */ void selection_color(Fl_Color a) {color2_ = a;} - /** Sets the background and selection color of the widget. + /** Sets the background and selection color of the widget. - The two color form sets both the background and selection colors. + The two color form sets both the background and selection colors. \param[in] bg background color \param[in] sel selection color \see color(unsigned), selection_color(unsigned) @@ -413,17 +411,17 @@ public: The label is shown somewhere on or next to the widget. See \ref common_labels for details about what can be put in a label. - The passed pointer is stored unchanged in the widget (the string is \em not copied), so if - you need to set the label to a formatted value, make sure the buffer is - static, global, or allocated. The copy_label() method can be used + The passed pointer is stored unchanged in the widget (the string is \em not copied), so if + you need to set the label to a formatted value, make sure the buffer is + static, global, or allocated. The copy_label() method can be used to make a copy of the label string automatically. \param[in] text pointer to new label text \see copy_label() */ void label(const char* text); - /** Sets the current label. - Unlike label(), this method allocates a copy of the label + /** Sets the current label. + Unlike label(), this method allocates a copy of the label string instead of using the original string pointer. The internal copy will automatically be freed whenever you assign @@ -445,29 +443,29 @@ public: */ Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;} - /** Sets the label type. - The label type identifies the function that draws the label of the widget. - This is generally used for special effects such as embossing or for using - the label() pointer as another form of data such as an icon. The value + /** Sets the label type. + The label type identifies the function that draws the label of the widget. + This is generally used for special effects such as embossing or for using + the label() pointer as another form of data such as an icon. The value FL_NORMAL_LABEL prints the label as plain text. \param[in] a new label type \see Fl_Labeltype */ void labeltype(Fl_Labeltype a) {label_.type = a;} - /** Gets the label color. - The default color is FL_FOREGROUND_COLOR. + /** Gets the label color. + The default color is FL_FOREGROUND_COLOR. \return the current label color */ Fl_Color labelcolor() const {return label_.color;} - /** Sets the label color. - The default color is FL_FOREGROUND_COLOR. + /** Sets the label color. + The default color is FL_FOREGROUND_COLOR. \param[in] c the new label color */ void labelcolor(Fl_Color c) {label_.color=c;} - /** Gets the font to use. + /** Gets the font to use. Fonts are identified by indexes into a table. The default value uses a Helvetica typeface (Arial for Microsoft® Windows®). The function Fl::set_font() can define new typefaces. @@ -476,7 +474,7 @@ public: */ Fl_Font labelfont() const {return label_.font;} - /** Sets the font to use. + /** Sets the font to use. Fonts are identified by indexes into a table. The default value uses a Helvetica typeface (Arial for Microsoft® Windows®). The function Fl::set_font() can define new typefaces. @@ -485,7 +483,7 @@ public: */ void labelfont(Fl_Font f) {label_.font=f;} - /** Gets the font size in pixels. + /** Gets the font size in pixels. The default size is 14 pixels. \return the current font size */ @@ -547,8 +545,8 @@ public: */ const char *tooltip() const {return tooltip_;} - void tooltip(const char *text); // see Fl_Tooltip - void copy_tooltip(const char *text); // see Fl_Tooltip + void tooltip(const char *text); // see Fl_Tooltip + void copy_tooltip(const char *text); // see Fl_Tooltip /** Gets the current callback function for the widget. Each widget has a single callback. @@ -600,16 +598,16 @@ public: /** Gets the current user data (long) argument that is passed to the callback function. \note On platforms with <tt>sizeof(long) \< sizeof(void*)</tt>, particularly - on Windows 64-bit platforms, this method can truncate stored addresses - \p (void*) to the size of a \p long value. Use with care and only - if you are sure that the stored user_data value fits in a \p long - value because it was stored with argument(long) or another method - using only \p long values. You may want to use user_data() instead. + on Windows 64-bit platforms, this method can truncate stored addresses + \p (void*) to the size of a \p long value. Use with care and only + if you are sure that the stored user_data value fits in a \p long + value because it was stored with argument(long) or another method + using only \p long values. You may want to use user_data() instead. \see user_data() \todo [Internal] The user_data value must be implemented using - \p fl_intptr_t or similar to avoid 64-bit platform incompatibilities. + \p fl_intptr_t or similar to avoid 64-bit platform incompatibilities. */ long argument() const {return (long)(fl_intptr_t)user_data_;} @@ -633,29 +631,29 @@ public: This controls when callbacks are done. The following values are useful, the default value is FL_WHEN_RELEASE: - + \li 0: The callback is not done, but changed() is turned on. \li FL_WHEN_CHANGED: The callback is done each time the text is changed by the user. - \li FL_WHEN_RELEASE: The callback will be done when this widget loses - the focus, including when the window is unmapped. This is a useful - value for text fields in a panel where doing the callback on every - change is wasteful. However the callback will also happen if the - mouse is moved out of the window, which means it should not do - anything visible (like pop up an error message). - You might do better setting this to zero, and scanning all the - items for changed() when the OK button on a panel is pressed. - \li FL_WHEN_ENTER_KEY: If the user types the Enter key, the entire - text is selected, and the callback is done if the text has changed. - Normally the Enter key will navigate to the next field (or insert - a newline for a Fl_Multiline_Input) - this changes the behavior. + \li FL_WHEN_RELEASE: The callback will be done when this widget loses + the focus, including when the window is unmapped. This is a useful + value for text fields in a panel where doing the callback on every + change is wasteful. However the callback will also happen if the + mouse is moved out of the window, which means it should not do + anything visible (like pop up an error message). + You might do better setting this to zero, and scanning all the + items for changed() when the OK button on a panel is pressed. + \li FL_WHEN_ENTER_KEY: If the user types the Enter key, the entire + text is selected, and the callback is done if the text has changed. + Normally the Enter key will navigate to the next field (or insert + a newline for a Fl_Multiline_Input) - this changes the behavior. \li FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED: The Enter key will do the callback even if the text has not changed. Useful for command fields. - Fl_Widget::when() is a set of bitflags used by subclasses of + Fl_Widget::when() is a set of bitflags used by subclasses of Fl_Widget to decide when to do the callback. - If the value is zero then the callback is never done. Other values - are described in the individual widgets. This field is in the base + If the value is zero then the callback is never done. Other values + are described in the individual widgets. This field is in the base class so that you can scan a panel and do_callback() on all the ones that don't do their own callbacks in response to an "OK" button. \param[in] i set of flags @@ -692,20 +690,20 @@ public: \see hide(), visible(), visible_r() */ virtual void show(); - + /** Makes a widget invisible. \see show(), visible(), visible_r() */ virtual void hide(); - /** Makes the widget visible. - You must still redraw the parent widget to see a change in the + /** Makes the widget visible. + You must still redraw the parent widget to see a change in the window. Normally you want to use the show() method instead. */ void set_visible() {flags_ &= ~INVISIBLE;} - /** Hides the widget. - You must still redraw the parent to see a change in the window. + /** Hides the widget. + You must still redraw the parent to see a change in the window. Normally you want to use the hide() method instead. */ void clear_visible() {flags_ |= INVISIBLE;} @@ -716,27 +714,27 @@ public: */ unsigned int active() const {return !(flags_&INACTIVE);} - /** Returns whether the widget and all of its parents are active. + /** Returns whether the widget and all of its parents are active. \retval 0 if this or any of the parent widgets are inactive \see active(), activate(), deactivate() */ int active_r() const; /** Activates the widget. - Changing this value will send FL_ACTIVATE to the widget if + Changing this value will send FL_ACTIVATE to the widget if active_r() is true. \see active(), active_r(), deactivate() */ void activate(); /** Deactivates the widget. - Inactive widgets will be drawn "grayed out", e.g. with less contrast - than the active widget. Inactive widgets will not receive any keyboard - or mouse button events. Other events (including FL_ENTER, FL_MOVE, - FL_LEAVE, FL_SHORTCUT, and others) will still be sent. A widget is - only active if active() is true on it <I>and all of its parents</I>. + Inactive widgets will be drawn "grayed out", e.g. with less contrast + than the active widget. Inactive widgets will not receive any keyboard + or mouse button events. Other events (including FL_ENTER, FL_MOVE, + FL_LEAVE, FL_SHORTCUT, and others) will still be sent. A widget is + only active if active() is true on it <I>and all of its parents</I>. - Changing this value will send FL_DEACTIVATE to the widget if + Changing this value will send FL_DEACTIVATE to the widget if active_r() is true. Currently you cannot deactivate Fl_Window widgets. @@ -746,22 +744,22 @@ public: void deactivate(); /** Returns if a widget is used for output only. - output() means the same as !active() except it does not change how the - widget is drawn. The widget will not receive any events. This is useful - for making scrollbars or buttons that work as displays rather than input + output() means the same as !active() except it does not change how the + widget is drawn. The widget will not receive any events. This is useful + for making scrollbars or buttons that work as displays rather than input devices. \retval 0 if the widget is used for input and output - \see set_output(), clear_output() + \see set_output(), clear_output() */ unsigned int output() const {return (flags_&OUTPUT);} /** Sets a widget to output only. - \see output(), clear_output() + \see output(), clear_output() */ void set_output() {flags_ |= OUTPUT;} /** Sets a widget to accept input. - \see set_output(), output() + \see set_output(), output() */ void clear_output() {flags_ &= ~OUTPUT;} @@ -815,31 +813,31 @@ public: void set_active() {flags_ &= ~INACTIVE;} /** Gives the widget the keyboard focus. - Tries to make this widget be the Fl::focus() widget, by first sending - it an FL_FOCUS event, and if it returns non-zero, setting - Fl::focus() to this widget. You should use this method to - assign the focus to a widget. + Tries to make this widget be the Fl::focus() widget, by first sending + it an FL_FOCUS event, and if it returns non-zero, setting + Fl::focus() to this widget. You should use this method to + assign the focus to a widget. \return true if the widget accepted the focus. */ int take_focus(); - /** Enables keyboard focus navigation with this widget. + /** Enables keyboard focus navigation with this widget. Note, however, that this will not necessarily mean that the widget will accept focus, but for widgets that can accept focus, this method enables it if it has been disabled. - \see visible_focus(), clear_visible_focus(), visible_focus(int) + \see visible_focus(), clear_visible_focus(), visible_focus(int) */ void set_visible_focus() { flags_ |= VISIBLE_FOCUS; } - /** Disables keyboard focus navigation with this widget. + /** Disables keyboard focus navigation with this widget. Normally, all widgets participate in keyboard focus navigation. - \see set_visible_focus(), visible_focus(), visible_focus(int) + \see set_visible_focus(), visible_focus(), visible_focus(int) */ void clear_visible_focus() { flags_ &= ~VISIBLE_FOCUS; } - /** Modifies keyboard focus navigation. + /** Modifies keyboard focus navigation. \param[in] v set or clear visible focus - \see set_visible_focus(), clear_visible_focus(), visible_focus() + \see set_visible_focus(), clear_visible_focus(), visible_focus() */ void visible_focus(int v) { if (v) set_visible_focus(); else clear_visible_focus(); } @@ -927,13 +925,13 @@ public: void redraw(); /** Schedules the drawing of the label. - Marks the widget or the parent as needing a redraw for the label area + Marks the widget or the parent as needing a redraw for the label area of a widget. */ void redraw_label(); - /** Returns non-zero if draw() needs to be called. - The damage value is actually a bit field that the widget + /** Returns non-zero if draw() needs to be called. + The damage value is actually a bit field that the widget subclass can use to figure out what parts to draw. \return a bitmap of flags describing the kind of damage to the widget \see damage(uchar), clear_damage(uchar) @@ -948,7 +946,7 @@ public: \note Therefore it is possible to set damage bits with this method, but this should be avoided. Use damage(uchar) instead. - + \param[in] c new bitmask of damage flags (default: 0) \see damage(uchar), damage() */ @@ -973,7 +971,7 @@ public: /** Sets width ww and height hh accordingly with the label size. Labels with images will return w() and h() of the image. - + This calls fl_measure() internally. For more information about the arguments \p ww and \p hh and word wrapping \see fl_measure(const char*, int&, int&, int) @@ -991,15 +989,15 @@ public: non-NULL, then the widget in question is derived from Fl_Group, and you can use the returned pointer to access its children or other Fl_Group-specific methods. - + Example: \code void my_callback (Fl_Widget *w, void *) { Fl_Group *g = w->as_group(); - if (g) - printf ("This group has %d children\n", g->children()); - else - printf ("This widget is not a group!\n"); + if (g) + printf ("This group has %d children\n", g->children()); + else + printf ("This widget is not a group!\n"); } \endcode @@ -1038,7 +1036,7 @@ public: /** Returns non zero if MAC_USE_ACCENTS_MENU flag is set, 0 otherwise. */ int use_accents_menu() { return flags() & MAC_USE_ACCENTS_MENU; } - + /** For back compatibility only. \deprecated Use selection_color() instead. */ @@ -1080,7 +1078,3 @@ public: #define FL_RESERVED_TYPE 100 #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Widget_Surface.H b/FL/Fl_Widget_Surface.H index 94b8dbb2c..2faa2c8d8 100644 --- a/FL/Fl_Widget_Surface.H +++ b/FL/Fl_Widget_Surface.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Drivers code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Widget_Surface_h @@ -45,7 +43,3 @@ public: }; #endif /* Fl_Widget_Surface_h */ - -// -// End of "$Id$". -// diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H index e7125d633..1db612b72 100644 --- a/FL/Fl_Window.H +++ b/FL/Fl_Window.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Window header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -27,7 +25,7 @@ #include <FL/Fl_Bitmap.H> #include <stdlib.h> -#define FL_WINDOW 0xF0 ///< window type id all subclasses have type() >= this +#define FL_WINDOW 0xF0 ///< window type id all subclasses have type() >= this #define FL_DOUBLE_WINDOW 0xF1 ///< double window type id class Fl_X; @@ -83,7 +81,7 @@ private: uchar size_range_set; // cursor stuff Fl_Cursor cursor_default; - + void _Fl_Window(); // constructor innards // unimplemented copy ctor and assignment operator @@ -125,10 +123,10 @@ protected: public: /** - Creates a window from the given size and title. - If Fl_Group::current() is not NULL, the window is created as a + Creates a window from the given size and title. + If Fl_Group::current() is not NULL, the window is created as a subwindow of the parent window. - + The (w,h) form of the constructor creates a top-level window and asks the window manager to position the window. The (x,y,w,h) form of the constructor either creates a subwindow or a @@ -137,14 +135,14 @@ public: window, the window manager will pick a place to show the window or allow the user to pick a location. Use position(x,y) or hotspot() before calling show() to request a - position on the screen. See Fl_Window::resize() + position on the screen. See Fl_Window::resize() for some more details on positioning windows. - + Top-level windows initially have visible() set to 0 and parent() set to NULL. Subwindows initially have visible() set to 1 and parent() set to the parent window pointer. - + Fl_Widget::box() defaults to FL_FLAT_BOX. If you plan to completely fill the window with children widgets you should change this to FL_NO_BOX. If you turn the window border off @@ -161,7 +159,7 @@ public: /** The destructor <I>also deletes all the children</I>. This allows a whole tree to be deleted at once, without having to keep a pointer to - all the children in the user code. A kludge has been done so the + all the children in the user code. A kludge has been done so the Fl_Window and all of its children can be automatic (local) variables, but you must declare the Fl_Window <I>first</I> so that it is destroyed last. @@ -180,10 +178,10 @@ public: You can also call the Fl_Widget methods size(x,y) and position(w,h), which are inline wrappers for this virtual function. - A top-level window can not force, but merely suggest a position and - size to the operating system. The window manager may not be willing or - able to display a window at the desired position or with the given - dimensions. It is up to the application developer to verify window + A top-level window can not force, but merely suggest a position and + size to the operating system. The window manager may not be willing or + able to display a window at the desired position or with the given + dimensions. It is up to the application developer to verify window parameters after the resize request. */ virtual void resize(int X,int Y,int W,int H); @@ -196,11 +194,11 @@ public: Fast inline function to turn the window manager border off. It only works before show() is called. */ - void clear_border() {set_flag(NOBORDER);} + void clear_border() {set_flag(NOBORDER);} /** Returns whether the window possesses a border */ - unsigned int border() const {return !(flags() & NOBORDER);} + unsigned int border() const {return !(flags() & NOBORDER);} /** Activates the flags NOBORDER|FL_OVERRIDE */ - void set_override() {set_flag(NOBORDER|OVERRIDE);} + void set_override() {set_flag(NOBORDER|OVERRIDE);} /** Returns non zero if FL_OVERRIDE flag is set, 0 otherwise. */ unsigned int override() const { return flags()&OVERRIDE; } /** @@ -211,16 +209,16 @@ public: once, in which case only the last one shown gets events. You can see which window (if any) is modal by calling Fl::modal(). */ - void set_modal() {set_flag(MODAL);} + void set_modal() {set_flag(MODAL);} /** Returns true if this window is modal. */ - unsigned int modal() const {return flags() & MODAL;} + unsigned int modal() const {return flags() & MODAL;} /** A "non-modal" window (terminology borrowed from Microsoft Windows) acts like a modal() one in that it remains on top, but it has no effect on event delivery. There are <I>three</I> states for a window: modal, non-modal, and normal. */ - void set_non_modal() {set_flag(NON_MODAL);} + void set_non_modal() {set_flag(NON_MODAL);} /** Returns true if this window is modal or non-modal. */ unsigned int non_modal() const {return flags() & (NON_MODAL|MODAL);} @@ -276,11 +274,11 @@ public: This must be called before the window is shown and cannot be changed later. */ - void set_menu_window() {set_flag(MENU_WINDOW);} + void set_menu_window() {set_flag(MENU_WINDOW);} /** Returns true if this window is a menu window. */ unsigned int menu_window() const {return flags() & MENU_WINDOW;} - + /** Marks the window as a tooltip window. @@ -297,8 +295,8 @@ public: \note Since Fl_Tooltip_Window is derived from Fl_Menu_Window, this also \b clears the menu_window() state. */ - void set_tooltip_window() { set_flag(TOOLTIP_WINDOW); - clear_flag(MENU_WINDOW); } + void set_tooltip_window() { set_flag(TOOLTIP_WINDOW); + clear_flag(MENU_WINDOW); } /** Returns true if this window is a tooltip window. */ unsigned int tooltip_window() const {return flags() & TOOLTIP_WINDOW;} @@ -323,13 +321,13 @@ public: \deprecated please use force_position(0) instead */ - void free_position() {clear_flag(FORCE_POSITION);} + void free_position() {clear_flag(FORCE_POSITION);} void size_range(int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0); /** See void Fl_Window::label(const char*) */ - const char* label() const {return Fl_Widget::label();} + const char* label() const {return Fl_Widget::label();} /** See void Fl_Window::iconlabel(const char*) */ - const char* iconlabel() const {return iconlabel_;} + const char* iconlabel() const {return iconlabel_;} /** Sets the window title bar label. */ void label(const char*); /** Sets the icon label. */ @@ -426,7 +424,7 @@ public: /** Makes the window completely fill one or more screens, without any window manager border visible. You must use fullscreen_off() to - undo this. + undo this. \note On some platforms, this can result in the keyboard being grabbed. The window may also be recreated, meaning hide() and @@ -440,18 +438,18 @@ public: */ void fullscreen_off(); /** - Turns off any side effects of fullscreen() and does + Turns off any side effects of fullscreen() and does resize(x,y,w,h). */ void fullscreen_off(int X,int Y,int W,int H); /** - Returns non zero if FULLSCREEN flag is set, 0 otherwise. + Returns non zero if FULLSCREEN flag is set, 0 otherwise. */ unsigned int fullscreen_active() const { return flags() & FULLSCREEN; } /** Sets which screens should be used when this window is in fullscreen mode. The window will be resized to the top of the screen with index - \p top, the bottom of the screen with index \p bottom, etc. + \p top, the bottom of the screen with index \p bottom, etc. If this method is never called, or if any argument is < 0, then the window will be resized to fill the screen it is currently on. @@ -467,7 +465,7 @@ public: Call show() to restore the window. When a window is iconified/restored (either by these calls or by the - user) the handle() method is called with FL_HIDE and + user) the handle() method is called with FL_HIDE and FL_SHOW events and visible() is turned on and off. There is no way to control what is drawn in the icon except with the @@ -510,16 +508,16 @@ public: void default_cursor(Fl_Cursor c, Fl_Color, Fl_Color=FL_WHITE); static void default_callback(Fl_Window*, void* v); - + /** Returns the window width including any frame added by the window manager. - + Same as w() if applied to a subwindow. */ int decorated_w() const; - /** Returns the window height including any window title bar and any frame + /** Returns the window height including any window title bar and any frame added by the window manager. - + Same as h() if applied to a subwindow. */ int decorated_h() const; @@ -536,7 +534,7 @@ public: Return non-null if this is an Fl_Double_Window object. */ virtual class Fl_Double_Window *as_double_window() {return 0L;} - + void shape(const Fl_Image* img); void shape(const Fl_Image& b) ; const Fl_Image *shape(); @@ -545,7 +543,3 @@ public: }; #endif - -// -// End of "$Id$". -// diff --git a/FL/Fl_Wizard.H b/FL/Fl_Wizard.H index e89203f60..785cee450 100644 --- a/FL/Fl_Wizard.H +++ b/FL/Fl_Wizard.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Wizard widget definitions. // // Copyright 1999-2010 by Easy Software Products. @@ -12,9 +10,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -58,7 +56,3 @@ public: }; #endif // !_Fl_Wizard_H_ - -// -// End of "$Id$". -// diff --git a/FL/Fl_XBM_Image.H b/FL/Fl_XBM_Image.H index 13938e26e..2c4e1b0f0 100644 --- a/FL/Fl_XBM_Image.H +++ b/FL/Fl_XBM_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // XBM image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -35,7 +33,3 @@ class FL_EXPORT Fl_XBM_Image : public Fl_Bitmap { }; #endif // !Fl_XBM_Image_H - -// -// End of "$Id$". -// diff --git a/FL/Fl_XPM_Image.H b/FL/Fl_XPM_Image.H index c910fbffa..a10a24825 100644 --- a/FL/Fl_XPM_Image.H +++ b/FL/Fl_XPM_Image.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // XPM image header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,15 +7,15 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file - + Fl_XPM_Image class . */ #ifndef Fl_XPM_Image_H @@ -36,7 +34,3 @@ class FL_EXPORT Fl_XPM_Image : public Fl_Pixmap { }; #endif // !Fl_XPM_Image - -// -// End of "$Id$". -// diff --git a/FL/Makefile.in b/FL/Makefile.in index 52141e8d6..b34b55db6 100644 --- a/FL/Makefile.in +++ b/FL/Makefile.in @@ -1,6 +1,4 @@ # -# "$Id$" -# # Header makefile for the Fast Light Tool Kit (FLTK). # # Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # include ../makeinclude @@ -47,8 +45,3 @@ uninstall: echo "Uninstalling include files..." $(RMDIR) $(DESTDIR)$(includedir)/FL @HLINKS@ $(RM) $(DESTDIR)$(includedir)/Fl - - -# -# End of "$Id$". -# diff --git a/FL/android.H b/FL/android.H index eea3d616c..f1ad220e1 100644 --- a/FL/android.H +++ b/FL/android.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Template header file for the Fast Light Tool Kit (FLTK). // // Copyright 2016-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Do not directly include this file, instead use <FL/android.H>. @@ -159,8 +157,3 @@ enum Fl_Android_Platform_Event */ FL_ANDROID_EVENT_DESTROY }; - - -// -// End of "$Id$". -// diff --git a/FL/filename.H b/FL/filename.H index 5c1bab4d2..d9caa70bb 100644 --- a/FL/filename.H +++ b/FL/filename.H @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Filename header file for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /** \file @@ -96,8 +94,8 @@ FL_EXPORT void fl_filename_free_list(struct dirent ***l, int n); * system-defined program (added in FLTK 1.1.8) */ -FL_EXPORT int fl_open_uri(const char *uri, char *msg = (char *)0, - int msglen = 0); +FL_EXPORT int fl_open_uri(const char *uri, char *msg = (char *)0, + int msglen = 0); FL_EXPORT void fl_decode_uri(char *uri); @@ -110,7 +108,3 @@ FL_EXPORT void fl_decode_uri(char *uri); #endif /* FL_FILENAME_H */ /** @} */ - -/* - * End of "$Id$". - */ diff --git a/FL/fl_ask.H b/FL/fl_ask.H index 2a9f1b107..84e9ef227 100644 --- a/FL/fl_ask.H +++ b/FL/fl_ask.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Standard dialog header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// https://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file fl_ask.H @@ -26,7 +24,7 @@ # include "Enumerations.H" class Fl_Widget; -/** Different system beeps available. +/** Different system beeps available. \sa fl_beep(int) */ enum Fl_Beep { FL_BEEP_DEFAULT = 0, ///< Default beep. @@ -84,7 +82,3 @@ extern FL_EXPORT const char* fl_ok; extern FL_EXPORT const char* fl_cancel; extern FL_EXPORT const char* fl_close; #endif // !fl_ask_H - -// -// End of "$Id$". -// diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 7f1a63451..4b9796acf 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -46,9 +44,9 @@ FL_EXPORT extern char fl_draw_shortcut; then a least-squares algorithm is used to find the closest color. If no valid graphical context (fl_gc) is available, the foreground is not set for the current window. - \param[in] c color + \param[in] c color */ -inline void fl_color(Fl_Color c) {fl_graphics_driver->color(c); } // select indexed color +inline void fl_color(Fl_Color c) {fl_graphics_driver->color(c); } // select indexed color /** for back compatibility - use fl_color(Fl_Color c) instead */ inline void fl_color(int c) {fl_color((Fl_Color)c);} /** @@ -61,7 +59,7 @@ inline void fl_color(int c) {fl_color((Fl_Color)c);} the foreground is not set for the current window. \param[in] r,g,b color components */ -inline void fl_color(uchar r, uchar g, uchar b) {fl_graphics_driver->color(r,g,b); } // select actual color +inline void fl_color(uchar r, uchar g, uchar b) {fl_graphics_driver->color(r,g,b); } // select actual color /** Returns the last fl_color() that was set. This can be used for state save/restore. @@ -94,7 +92,7 @@ inline void fl_push_clip(int x, int y, int w, int h) {fl_graphics_driver->push_c inline void fl_push_no_clip() {fl_graphics_driver->push_no_clip(); } /** Restores the previous clip region. - + You must call fl_pop_clip() once for every time you call fl_push_clip(). Unpredictable results may occur if the clip stack is not empty when you return to FLTK. @@ -137,9 +135,9 @@ inline int fl_not_clipped(int x, int y, int w, int h) { int X = 0, Y = 0, W = 0, H = 0; int ret = fl_clip_box(x(), y(), w(), h(), X, Y, W, H); if (ret == 0) { // entire group is visible (not clipped) - // full drawing code here + // full drawing code here } else { // parts of this group are clipped - // partial drawing code here (uses X, Y, W, and H to test) + // partial drawing code here (uses X, Y, W, and H to test) } } \endcode @@ -171,7 +169,7 @@ inline void fl_restore_clip() { /** Replaces the top of the clipping stack with a clipping region of any shape. - + Fl_Region is an operating system specific type. \note This function is mostly intended for internal use by the FLTK library when drawing to the display. @@ -200,7 +198,7 @@ inline void fl_point(int x, int y) { fl_graphics_driver->point(x,y); } Sets how to draw lines (the "pen"). If you change this it is your responsibility to set it back to the default using \c fl_line_style(0). - + \param[in] style A bitmask which is a bitwise-OR of a line style, a cap style, and a join style. If you don't specify a dash type you will get a solid line. If you don't specify a cap or join type @@ -215,7 +213,7 @@ inline void fl_point(int x, int y) { fl_graphics_driver->point(x,y); } with a zero-length entry. A \c NULL pointer or a zero-length array results in a solid line. Odd array sizes are not supported and result in undefined behavior. - + \note Because of how line styles are implemented on Win32 systems, you \e must set the line style \e after setting the drawing color. If you set the color after the line style you will lose @@ -225,26 +223,26 @@ inline void fl_point(int x, int y) { fl_graphics_driver->point(x,y); } */ inline void fl_line_style(int style, int width=0, char* dashes=0) {fl_graphics_driver->line_style(style,width,dashes); } enum { - FL_SOLID = 0, ///< line style: <tt>___________</tt> - FL_DASH = 1, ///< line style: <tt>_ _ _ _ _ _</tt> - FL_DOT = 2, ///< line style: <tt>. . . . . .</tt> - FL_DASHDOT = 3, ///< line style: <tt>_ . _ . _ .</tt> - FL_DASHDOTDOT = 4, ///< line style: <tt>_ . . _ . .</tt> - - FL_CAP_FLAT = 0x100, ///< cap style: end is flat - FL_CAP_ROUND = 0x200, ///< cap style: end is round - FL_CAP_SQUARE = 0x300, ///< cap style: end wraps end point - - FL_JOIN_MITER = 0x1000, ///< join style: line join extends to a point - FL_JOIN_ROUND = 0x2000, ///< join style: line join is rounded - FL_JOIN_BEVEL = 0x3000 ///< join style: line join is tidied + FL_SOLID = 0, ///< line style: <tt>___________</tt> + FL_DASH = 1, ///< line style: <tt>_ _ _ _ _ _</tt> + FL_DOT = 2, ///< line style: <tt>. . . . . .</tt> + FL_DASHDOT = 3, ///< line style: <tt>_ . _ . _ .</tt> + FL_DASHDOTDOT = 4, ///< line style: <tt>_ . . _ . .</tt> + + FL_CAP_FLAT = 0x100, ///< cap style: end is flat + FL_CAP_ROUND = 0x200, ///< cap style: end is round + FL_CAP_SQUARE = 0x300, ///< cap style: end wraps end point + + FL_JOIN_MITER = 0x1000, ///< join style: line join extends to a point + FL_JOIN_ROUND = 0x2000, ///< join style: line join is rounded + FL_JOIN_BEVEL = 0x3000 ///< join style: line join is tidied }; // rectangles tweaked to exactly fill the pixel rectangle: -/** +/** Draws a 1-pixel border \e inside the given bounding box. - This function is meant for quick drawing of simple boxes. The behavior is + This function is meant for quick drawing of simple boxes. The behavior is undefined for line widths that are not 1. */ inline void fl_rect(int x, int y, int w, int h) { fl_graphics_driver->rect(x,y,w,h); } @@ -287,7 +285,7 @@ inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_d /** Outlines a 4-sided polygon with lines */ -inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) +inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {fl_graphics_driver->loop(x,y,x1,y1,x2,y2,x3,y3); } // filled polygons @@ -298,7 +296,7 @@ inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {fl_graphic /** Fills a 4-sided polygon. The polygon must be convex. */ -inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) +inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) { fl_graphics_driver->polygon(x,y,x1,y1,x2,y2,x3,y3); } // draw rectilinear lines, horizontal segment first: @@ -334,21 +332,21 @@ inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver- // circular lines and pie slices (code in fl_arci.C): /** Draw ellipse sections using integer coordinates. - + These functions match the rather limited circle drawing code provided by X and Windows. The advantage over using fl_arc with floating point coordinates is that they are faster because they often use the hardware, and they draw much nicer small circles, since the small sizes are often hard-coded bitmaps. - + If a complete circle is drawn it will fit inside the passed bounding box. The two angles are measured in degrees counter-clockwise from 3 o'clock and are the starting and ending angle of the arc, \p a2 must be greater or equal to \p a1. - + fl_arc() draws a series of lines to approximate the arc. Notice that the integer version of fl_arc() has a different number of arguments than the double version fl_arc(double x, double y, double r, double start, double end) - + \param[in] x,y,w,h bounding box of complete circle \param[in] a1,a2 start and end angles of arc measured in degrees counter-clockwise from 3 o'clock. \p a2 must be greater @@ -360,11 +358,11 @@ inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver- inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {fl_graphics_driver->arc(x,y,w,h,a1,a2); } /** Draw filled ellipse sections using integer coordinates. - + Like fl_arc(), but fl_pie() draws a filled-in pie slice. This slice may extend outside the line drawn by fl_arc(); to avoid this use w - 1 and h - 1. - + \param[in] x,y,w,h bounding box of complete circle \param[in] a1,a2 start and end angles of arc measured in degrees counter-clockwise from 3 o'clock. \p a2 must be greater @@ -379,7 +377,7 @@ FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // ny // scalable drawing code (code in fl_vertex.C and fl_arc.C): /** - Saves the current transformation matrix on the stack. + Saves the current transformation matrix on the stack. The maximum depth of the stack is 32. */ inline void fl_push_matrix() { fl_graphics_driver->push_matrix(); } @@ -413,12 +411,12 @@ inline void fl_translate(double x, double y) { fl_graphics_driver->translate(x, inline void fl_rotate(double d) { fl_graphics_driver->rotate(d); } /** Concatenates another transformation onto the current one. - + \param[in] a,b,c,d,x,y transformation matrix elements such that <tt> X' = aX + cY + x </tt> and <tt> Y' = bX +dY + y </tt> */ -inline void fl_mult_matrix(double a, double b, double c, double d, double x,double y) - { fl_graphics_driver->mult_matrix(a, b, c, d, x, y); } +inline void fl_mult_matrix(double a, double b, double c, double d, double x,double y) + { fl_graphics_driver->mult_matrix(a, b, c, d, x, y); } /** Starts drawing a list of points. Points are added to the list with fl_vertex() */ @@ -482,7 +480,7 @@ inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, doub inline void fl_arc(double x, double y, double r, double start, double end) {fl_graphics_driver->arc(x,y,r,start,end); } /** fl_circle(x,y,r) is equivalent to fl_arc(x,y,r,0,360), but may be faster. - + It must be the \e only thing in the path: if you want a circle as part of a complex polygon you must use fl_arc() \param[in] x,y,r center and radius of circle @@ -506,13 +504,13 @@ inline void fl_end_loop() {fl_graphics_driver->end_loop(); } inline void fl_end_polygon() {fl_graphics_driver->end_polygon(); } /** Starts drawing a complex filled polygon. - + The polygon may be concave, may have holes in it, or may be several disconnected pieces. Call fl_gap() to separate loops of the path. - + To outline the polygon, use fl_begin_loop() and replace each fl_gap() with fl_end_loop();fl_begin_loop() pairs. - + \note For portability, you should only draw polygons that appear the same whether "even/odd" or "non-zero" winding rules are used to fill them. @@ -521,7 +519,7 @@ inline void fl_end_polygon() {fl_graphics_driver->end_polygon(); } inline void fl_begin_complex_polygon() {fl_graphics_driver->begin_complex_polygon(); } /** Call fl_gap() to separate loops of the path. - + It is unnecessary but harmless to call fl_gap() before the first vertex, after the last vertex, or several times in a row. */ @@ -558,8 +556,8 @@ inline double fl_transform_dy(double x, double y) {return fl_graphics_driver->tr inline void fl_transformed_vertex(double xf, double yf) {fl_graphics_driver->transformed_vertex(xf,yf); } /** Copy a rectangular area of the given offscreen buffer into the current drawing destination. - \param x,y position where to draw the copied rectangle - \param w,h size of the copied rectangle + \param x,y position where to draw the copied rectangle + \param w,h size of the copied rectangle \param pixmap offscreen buffer containing the rectangle to copy \param srcx,srcy origin in offscreen buffer of rectangle to copy */ @@ -620,7 +618,7 @@ inline double fl_width(const char* txt, int n) {return fl_graphics_driver->width \note if a valid fl_gc is NOT found then it uses the first window gc, or the screen gc if no fltk window is available when called. */ inline double fl_width(unsigned int c) {return fl_graphics_driver->width(c);} -/** Determines the minimum pixel dimensions of a nul-terminated string +/** Determines the minimum pixel dimensions of a nul-terminated string using the current fl_font(). Usage: given a string "txt" drawn using fl_draw(txt, x, y) you would determine @@ -717,9 +715,9 @@ inline void fl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->d rotating \p angle degrees counter-clockwise. \note When using X11 (Unix, Linux, Cygwin et al.) this needs Xft to work. - Under plain X11 (w/o Xft) rotated text is not supported by FLTK. - A warning will be issued to stderr at runtime (only once) if you - use this method with an angle other than 0. + Under plain X11 (w/o Xft) rotated text is not supported by FLTK. + A warning will be issued to stderr at runtime (only once) if you + use this method with an angle other than 0. */ inline void fl_draw(int angle, const char* str, int n, int x, int y) {fl_graphics_driver->draw(angle,str,n,x,y); } /** @@ -747,16 +745,16 @@ FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color); Draws an 8-bit per color RGB or luminance image. \param[in] buf points at the "r" data of the top-left pixel. Color data must be in <tt>r,g,b</tt> order. - Luminance data is only one <tt>gray</tt> byte. + Luminance data is only one <tt>gray</tt> byte. \param[in] X,Y position where to put top-left corner of image \param[in] W,H size of the image \param[in] D delta to add to the pointer between pixels. It may be any value greater than or equal to 1, or it can be - negative to flip the image horizontally + negative to flip the image horizontally \param[in] L delta to add to the pointer between lines (if 0 is passed it uses \p W * \p D), and may be larger than - \p W * \p D to crop data, or negative to flip the - image vertically + \p W * \p D to crop data, or negative to flip the + image vertically It is highly recommended that you put the following code before the first <tt>show()</tt> of \e any window in your program to get rid of @@ -893,7 +891,3 @@ FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scal /** @} */ #endif - -// -// End of "$Id$". -// diff --git a/FL/fl_message.H b/FL/fl_message.H index b83f13c67..5932b76b8 100644 --- a/FL/fl_message.H +++ b/FL/fl_message.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Standard message header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,15 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "fl_ask.H" - -// -// End of "$Id$". -// diff --git a/FL/fl_show_colormap.H b/FL/fl_show_colormap.H index 49dfaf0fb..97c93dc21 100644 --- a/FL/fl_show_colormap.H +++ b/FL/fl_show_colormap.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Colormap picker header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -43,7 +41,3 @@ FL_EXPORT Fl_Color fl_show_colormap(Fl_Color oldcol); /** @} */ #endif - -// -// End of "$Id$". -// diff --git a/FL/fl_show_input.H b/FL/fl_show_input.H index 622cb22db..217556f0d 100644 --- a/FL/fl_show_input.H +++ b/FL/fl_show_input.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Standard input dialog header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,15 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "fl_ask.H" - -// -// End of "$Id$". -// diff --git a/FL/fl_types.h b/FL/fl_types.h index 631c7250b..c571f3dce 100644 --- a/FL/fl_types.h +++ b/FL/fl_types.h @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Simple "C"-style types for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ * * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * https://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /** \file @@ -23,8 +21,8 @@ #ifndef FL_TYPES_H #define FL_TYPES_H -/** \name Miscellaneous */ -/*@{*/ /* group: Miscellaneous */ +/** \name Miscellaneous */ +/*@{*/ /* group: Miscellaneous */ /** unsigned char */ typedef unsigned char uchar; @@ -68,10 +66,6 @@ typedef unsigned int Fl_Shortcut; /** 24-bit Unicode character - upper 8 bits are unused */ typedef unsigned int Fl_Char; -/*@}*/ /* group: Miscellaneous */ +/*@}*/ /* group: Miscellaneous */ #endif - -/* - * End of "$Id$". - */ diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h index faa69e7e8..8cf26900a 100644 --- a/FL/fl_utf8.h +++ b/FL/fl_utf8.h @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2010 by O'ksi'D. * Copyright 2016-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ * * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * https://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* Merged in some functionality from the fltk-2 version. IMM. @@ -218,7 +216,3 @@ FL_EXPORT char fl_make_path( const char *path ); #endif /* _HAVE_FL_UTF8_HDR_ */ - -/* - * End of "$Id$". - */ diff --git a/FL/forms.H b/FL/forms.H index f14be6ab0..7e08b176b 100644 --- a/FL/forms.H +++ b/FL/forms.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms emulation header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef __FORMS_H__ @@ -38,116 +36,116 @@ typedef Fl_Window FL_FORM; #define TRUE 1 #endif -#define FL_ON 1 -#define FL_OK 1 -#define FL_VALID 1 -#define FL_PREEMPT 1 -#define FL_AUTO 2 -#define FL_WHEN_NEEDED FL_AUTO -#define FL_OFF 0 -#define FL_NONE 0 -#define FL_CANCEL 0 -#define FL_INVALID 0 -#define FL_IGNORE -1 -//#define FL_CLOSE -2 // this variable is never used in FLTK Forms. It is removed becaus it conflicts with the window FL_CLOSE event - -#define FL_LCOL FL_BLACK -#define FL_COL1 FL_GRAY -#define FL_MCOL FL_LIGHT1 -#define FL_LEFT_BCOL FL_LIGHT3 // 53 is better match -#define FL_TOP_BCOL FL_LIGHT2 // 51 -#define FL_BOTTOM_BCOL FL_DARK2 // 40 -#define FL_RIGHT_BCOL FL_DARK3 // 36 -#define FL_INACTIVE FL_INACTIVE_COLOR -#define FL_INACTIVE_COL FL_INACTIVE_COLOR -#define FL_FREE_COL1 FL_FREE_COLOR -#define FL_FREE_COL2 ((Fl_Color)(FL_FREE_COLOR+1)) -#define FL_FREE_COL3 ((Fl_Color)(FL_FREE_COLOR+2)) -#define FL_FREE_COL4 ((Fl_Color)(FL_FREE_COLOR+3)) -#define FL_FREE_COL5 ((Fl_Color)(FL_FREE_COLOR+4)) -#define FL_FREE_COL6 ((Fl_Color)(FL_FREE_COLOR+5)) -#define FL_FREE_COL7 ((Fl_Color)(FL_FREE_COLOR+6)) -#define FL_FREE_COL8 ((Fl_Color)(FL_FREE_COLOR+7)) -#define FL_FREE_COL9 ((Fl_Color)(FL_FREE_COLOR+8)) -#define FL_FREE_COL10 ((Fl_Color)(FL_FREE_COLOR+9)) -#define FL_FREE_COL11 ((Fl_Color)(FL_FREE_COLOR+10)) -#define FL_FREE_COL12 ((Fl_Color)(FL_FREE_COLOR+11)) -#define FL_FREE_COL13 ((Fl_Color)(FL_FREE_COLOR+12)) -#define FL_FREE_COL14 ((Fl_Color)(FL_FREE_COLOR+13)) -#define FL_FREE_COL15 ((Fl_Color)(FL_FREE_COLOR+14)) -#define FL_FREE_COL16 ((Fl_Color)(FL_FREE_COLOR+15)) -#define FL_TOMATO ((Fl_Color)(131)) -#define FL_INDIANRED ((Fl_Color)(164)) -#define FL_SLATEBLUE ((Fl_Color)(195)) -#define FL_DARKGOLD ((Fl_Color)(84)) -#define FL_PALEGREEN ((Fl_Color)(157)) -#define FL_ORCHID ((Fl_Color)(203)) -#define FL_DARKCYAN ((Fl_Color)(189)) -#define FL_DARKTOMATO ((Fl_Color)(113)) -#define FL_WHEAT ((Fl_Color)(174)) - -#define FL_ALIGN_BESIDE FL_ALIGN_INSIDE - -#define FL_PUP_TOGGLE 2 // FL_MENU_TOGGLE +#define FL_ON 1 +#define FL_OK 1 +#define FL_VALID 1 +#define FL_PREEMPT 1 +#define FL_AUTO 2 +#define FL_WHEN_NEEDED FL_AUTO +#define FL_OFF 0 +#define FL_NONE 0 +#define FL_CANCEL 0 +#define FL_INVALID 0 +#define FL_IGNORE -1 +//#define FL_CLOSE -2 // this variable is never used in FLTK Forms. It is removed becaus it conflicts with the window FL_CLOSE event + +#define FL_LCOL FL_BLACK +#define FL_COL1 FL_GRAY +#define FL_MCOL FL_LIGHT1 +#define FL_LEFT_BCOL FL_LIGHT3 // 53 is better match +#define FL_TOP_BCOL FL_LIGHT2 // 51 +#define FL_BOTTOM_BCOL FL_DARK2 // 40 +#define FL_RIGHT_BCOL FL_DARK3 // 36 +#define FL_INACTIVE FL_INACTIVE_COLOR +#define FL_INACTIVE_COL FL_INACTIVE_COLOR +#define FL_FREE_COL1 FL_FREE_COLOR +#define FL_FREE_COL2 ((Fl_Color)(FL_FREE_COLOR+1)) +#define FL_FREE_COL3 ((Fl_Color)(FL_FREE_COLOR+2)) +#define FL_FREE_COL4 ((Fl_Color)(FL_FREE_COLOR+3)) +#define FL_FREE_COL5 ((Fl_Color)(FL_FREE_COLOR+4)) +#define FL_FREE_COL6 ((Fl_Color)(FL_FREE_COLOR+5)) +#define FL_FREE_COL7 ((Fl_Color)(FL_FREE_COLOR+6)) +#define FL_FREE_COL8 ((Fl_Color)(FL_FREE_COLOR+7)) +#define FL_FREE_COL9 ((Fl_Color)(FL_FREE_COLOR+8)) +#define FL_FREE_COL10 ((Fl_Color)(FL_FREE_COLOR+9)) +#define FL_FREE_COL11 ((Fl_Color)(FL_FREE_COLOR+10)) +#define FL_FREE_COL12 ((Fl_Color)(FL_FREE_COLOR+11)) +#define FL_FREE_COL13 ((Fl_Color)(FL_FREE_COLOR+12)) +#define FL_FREE_COL14 ((Fl_Color)(FL_FREE_COLOR+13)) +#define FL_FREE_COL15 ((Fl_Color)(FL_FREE_COLOR+14)) +#define FL_FREE_COL16 ((Fl_Color)(FL_FREE_COLOR+15)) +#define FL_TOMATO ((Fl_Color)(131)) +#define FL_INDIANRED ((Fl_Color)(164)) +#define FL_SLATEBLUE ((Fl_Color)(195)) +#define FL_DARKGOLD ((Fl_Color)(84)) +#define FL_PALEGREEN ((Fl_Color)(157)) +#define FL_ORCHID ((Fl_Color)(203)) +#define FL_DARKCYAN ((Fl_Color)(189)) +#define FL_DARKTOMATO ((Fl_Color)(113)) +#define FL_WHEAT ((Fl_Color)(174)) + +#define FL_ALIGN_BESIDE FL_ALIGN_INSIDE + +#define FL_PUP_TOGGLE 2 // FL_MENU_TOGGLE #define FL_PUP_INACTIVE 1 // FL_MENU_INACTIVE -#define FL_NO_FRAME FL_NO_BOX -#define FL_ROUNDED3D_UPBOX FL_ROUND_UP_BOX -#define FL_ROUNDED3D_DOWNBOX FL_ROUND_DOWN_BOX -#define FL_OVAL3D_UPBOX FL_ROUND_UP_BOX -#define FL_OVAL3D_DOWNBOX FL_ROUND_DOWN_BOX - -#define FL_MBUTTON1 1 -#define FL_LEFTMOUSE 1 -#define FL_MBUTTON2 2 -#define FL_MIDDLEMOUSE 2 -#define FL_MBUTTON3 3 -#define FL_RIGHTMOUSE 3 -#define FL_MBUTTON4 4 -#define FL_MBUTTON5 5 +#define FL_NO_FRAME FL_NO_BOX +#define FL_ROUNDED3D_UPBOX FL_ROUND_UP_BOX +#define FL_ROUNDED3D_DOWNBOX FL_ROUND_DOWN_BOX +#define FL_OVAL3D_UPBOX FL_ROUND_UP_BOX +#define FL_OVAL3D_DOWNBOX FL_ROUND_DOWN_BOX + +#define FL_MBUTTON1 1 +#define FL_LEFTMOUSE 1 +#define FL_MBUTTON2 2 +#define FL_MIDDLEMOUSE 2 +#define FL_MBUTTON3 3 +#define FL_RIGHTMOUSE 3 +#define FL_MBUTTON4 4 +#define FL_MBUTTON5 5 #define FL_INVALID_STYLE 255 -#define FL_NORMAL_STYLE FL_HELVETICA -#define FL_BOLD_STYLE FL_HELVETICA_BOLD -#define FL_ITALIC_STYLE FL_HELVETICA_ITALIC +#define FL_NORMAL_STYLE FL_HELVETICA +#define FL_BOLD_STYLE FL_HELVETICA_BOLD +#define FL_ITALIC_STYLE FL_HELVETICA_ITALIC #define FL_BOLDITALIC_STYLE FL_HELVETICA_BOLD_ITALIC -#define FL_FIXED_STYLE FL_COURIER +#define FL_FIXED_STYLE FL_COURIER #define FL_FIXEDBOLD_STYLE FL_COURIER_BOLD #define FL_FIXEDITALIC_STYLE FL_COURIER_ITALIC #define FL_FIXEDBOLDITALIC_STYLE FL_COURIER_BOLD_ITALIC -#define FL_TIMES_STYLE FL_TIMES +#define FL_TIMES_STYLE FL_TIMES #define FL_TIMESBOLD_STYLE FL_TIMES_BOLD #define FL_TIMESITALIC_STYLE FL_TIMES_ITALIC #define FL_TIMESBOLDITALIC_STYLE FL_TIMES_BOLD_ITALIC // hacks to change the labeltype() when passed to fl_set_object_lstyle(): -#define FL_SHADOW_STYLE (FL_SHADOW_LABEL<<8) -#define FL_ENGRAVED_STYLE (FL_ENGRAVED_LABEL<<8) -#define FL_EMBOSSED_STYLE (FL_EMBOSSED_LABEL<<0) +#define FL_SHADOW_STYLE (FL_SHADOW_LABEL<<8) +#define FL_ENGRAVED_STYLE (FL_ENGRAVED_LABEL<<8) +#define FL_EMBOSSED_STYLE (FL_EMBOSSED_LABEL<<0) // size values are different from XForms, match older Forms: -#define FL_TINY_SIZE 8 -#define FL_SMALL_SIZE 11 // 10 -//#define FL_NORMAL_SIZE 14 // 12 -#define FL_MEDIUM_SIZE 18 // 14 -#define FL_LARGE_SIZE 24 // 18 -#define FL_HUGE_SIZE 32 // 24 -#define FL_DEFAULT_SIZE FL_SMALL_SIZE -#define FL_TINY_FONT FL_TINY_SIZE -#define FL_SMALL_FONT FL_SMALL_SIZE -#define FL_NORMAL_FONT FL_NORMAL_SIZE -#define FL_MEDIUM_FONT FL_MEDIUM_SIZE -#define FL_LARGE_FONT FL_LARGE_SIZE -#define FL_HUGE_FONT FL_HUGE_SIZE -#define FL_NORMAL_FONT1 FL_SMALL_FONT -#define FL_NORMAL_FONT2 FL_NORMAL_FONT -#define FL_DEFAULT_FONT FL_SMALL_FONT - -#define FL_RETURN_END_CHANGED FL_WHEN_RELEASE -#define FL_RETURN_CHANGED FL_WHEN_CHANGED -#define FL_RETURN_END FL_WHEN_RELEASE_ALWAYS -#define FL_RETURN_ALWAYS (FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED) - -#define FL_BOUND_WIDTH 3 +#define FL_TINY_SIZE 8 +#define FL_SMALL_SIZE 11 // 10 +//#define FL_NORMAL_SIZE 14 // 12 +#define FL_MEDIUM_SIZE 18 // 14 +#define FL_LARGE_SIZE 24 // 18 +#define FL_HUGE_SIZE 32 // 24 +#define FL_DEFAULT_SIZE FL_SMALL_SIZE +#define FL_TINY_FONT FL_TINY_SIZE +#define FL_SMALL_FONT FL_SMALL_SIZE +#define FL_NORMAL_FONT FL_NORMAL_SIZE +#define FL_MEDIUM_FONT FL_MEDIUM_SIZE +#define FL_LARGE_FONT FL_LARGE_SIZE +#define FL_HUGE_FONT FL_HUGE_SIZE +#define FL_NORMAL_FONT1 FL_SMALL_FONT +#define FL_NORMAL_FONT2 FL_NORMAL_FONT +#define FL_DEFAULT_FONT FL_SMALL_FONT + +#define FL_RETURN_END_CHANGED FL_WHEN_RELEASE +#define FL_RETURN_CHANGED FL_WHEN_CHANGED +#define FL_RETURN_END FL_WHEN_RELEASE_ALWAYS +#define FL_RETURN_ALWAYS (FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED) + +#define FL_BOUND_WIDTH 3 typedef int FL_Coord; typedef int FL_COLOR; @@ -276,31 +274,31 @@ inline void fl_set_form_geometry(Fl_Window* f,int x,int y,int w,int h) { inline void fl_adjust_form_size(Fl_Window*) {} FL_EXPORT void fl_show_form(Fl_Window* f,int p,int b,const char* n); -enum { // "p" argument values: - FL_PLACE_FREE = 0, // make resizable - FL_PLACE_MOUSE = 1, // mouse centered on form - FL_PLACE_CENTER = 2, // center of the screen +enum { // "p" argument values: + FL_PLACE_FREE = 0, // make resizable + FL_PLACE_MOUSE = 1, // mouse centered on form + FL_PLACE_CENTER = 2, // center of the screen FL_PLACE_POSITION = 4,// fixed position, resizable - FL_PLACE_SIZE = 8, // fixed size, normal fltk behavior + FL_PLACE_SIZE = 8, // fixed size, normal fltk behavior FL_PLACE_GEOMETRY =16,// fixed size and position - FL_PLACE_ASPECT = 32, // keep aspect ratio (ignored) + FL_PLACE_ASPECT = 32, // keep aspect ratio (ignored) FL_PLACE_FULLSCREEN=64,// fill screen FL_PLACE_HOTSPOT = 128,// enables hotspot FL_PLACE_ICONIC = 256,// iconic (ignored) - FL_FREE_SIZE=(1<<14), // force resizable - FL_FIX_SIZE =(1<<15) // force off resizable + FL_FREE_SIZE=(1<<14), // force resizable + FL_FIX_SIZE =(1<<15) // force off resizable }; #define FL_PLACE_FREE_CENTER (FL_PLACE_CENTER|FL_FREE_SIZE) #define FL_PLACE_CENTERFREE (FL_PLACE_CENTER|FL_FREE_SIZE) -enum { // "b" arguement values: +enum { // "b" arguement values: FL_NOBORDER = 0, FL_FULLBORDER, FL_TRANSIENT -//FL_MODAL = (1<<8) // not implemented yet in Forms +//FL_MODAL = (1<<8) // not implemented yet in Forms }; inline void fl_set_form_hotspot(Fl_Window* w,int x,int y) {w->hotspot(x,y);} inline void fl_set_form_hotobject(Fl_Window* w, Fl_Widget* o) {w->hotspot(o);} -extern FL_EXPORT char fl_flip; // in forms.C +extern FL_EXPORT char fl_flip; // in forms.C inline void fl_flip_yorigin() {fl_flip = 1;} #define fl_prepare_form_window fl_show_form @@ -346,8 +344,8 @@ inline void fl_drw_frame(Fl_Boxtype b,int x,int y,int w,int h,Fl_Color bgc,int=3 fl_draw_box(b,x,y,w,h,bgc);} inline void fl_drw_text(Fl_Align align, int x, int y, int w, int h, - Fl_Color fgcolor, int size, Fl_Font style, - const char* s) { + Fl_Color fgcolor, int size, Fl_Font style, + const char* s) { fl_font(style,size); fl_color(fgcolor); fl_draw(s,x,y,w,h,align); @@ -355,8 +353,8 @@ inline void fl_drw_text(Fl_Align align, int x, int y, int w, int h, // this does not work except for CENTER... inline void fl_drw_text_beside(Fl_Align align, int x, int y, int w, int h, - Fl_Color fgcolor, int size, Fl_Font style, - const char* s) { + Fl_Color fgcolor, int size, Fl_Font style, + const char* s) { fl_font(style,size); fl_color(fgcolor); fl_draw(s,x,y,w,h,align); @@ -465,13 +463,13 @@ inline int fl_isdisplayed_browser_line(Fl_Widget* o, int n) { #include "Fl_Button.H" -#define FL_NORMAL_BUTTON 0 -#define FL_TOUCH_BUTTON 4 -#define FL_INOUT_BUTTON 5 -#define FL_RETURN_BUTTON 6 -#define FL_HIDDEN_RET_BUTTON 7 -#define FL_PUSH_BUTTON FL_TOGGLE_BUTTON -#define FL_MENU_BUTTON 9 +#define FL_NORMAL_BUTTON 0 +#define FL_TOUCH_BUTTON 4 +#define FL_INOUT_BUTTON 5 +#define FL_RETURN_BUTTON 6 +#define FL_HIDDEN_RET_BUTTON 7 +#define FL_PUSH_BUTTON FL_TOGGLE_BUTTON +#define FL_MENU_BUTTON 9 FL_EXPORT Fl_Button* fl_add_button(uchar t,int x,int y,int w,int h,const char* l); inline int fl_get_button(Fl_Widget* b) {return ((Fl_Button*)b)->value();} @@ -528,9 +526,9 @@ inline void fl_set_chart_lcolor(Fl_Widget* o, Fl_Color v) { #include "Fl_Choice.H" -#define FL_NORMAL_CHOICE 0 -#define FL_NORMAL_CHOICE2 0 -#define FL_DROPLIST_CHOICE 0 +#define FL_NORMAL_CHOICE 0 +#define FL_NORMAL_CHOICE2 0 +#define FL_DROPLIST_CHOICE 0 forms_constructor(Fl_Choice, fl_add_choice) inline void fl_clear_choice(Fl_Widget* o) { @@ -631,7 +629,7 @@ inline Fl_Widget* fl_add_labelframe(Fl_Boxtype i,int x,int y,int w,int h,const c #include "Fl_Free.H" inline Fl_Free* fl_add_free(int t,double x,double y,double w,double h,const char* l, - FL_HANDLEPTR hdl) { + FL_HANDLEPTR hdl) { return (Fl_Free*)(fl_add_new( new Fl_Free(t,int(x),int(y),int(w),int(h),l,hdl))); } @@ -657,7 +655,7 @@ FL_EXPORT int fl_show_choice( inline void fl_set_goodies_font(Fl_Font a, Fl_Fontsize b) {fl_message_font(a,b);} #define fl_show_messages fl_message inline int fl_show_choices(const char* c,int n,const char* b1,const char* b2, - const char* b3, int) { + const char* b3, int) { return fl_show_choice(0,c,0,n,b1,b2,b3); } @@ -667,10 +665,10 @@ inline int do_matching(char* a, const char* b) {return fl_filename_match(a,b);} // Forms-compatible file chooser (implementation in fselect.C): FL_EXPORT char* fl_show_file_selector(const char* message,const char* dir, - const char* pat,const char* fname); -FL_EXPORT char* fl_get_directory(); -FL_EXPORT char* fl_get_pattern(); -FL_EXPORT char* fl_get_filename(); + const char* pat,const char* fname); +FL_EXPORT char* fl_get_directory(); +FL_EXPORT char* fl_get_pattern(); +FL_EXPORT char* fl_get_filename(); #include "Fl_Input.H" forms_constructor(Fl_Input, fl_add_input) @@ -705,9 +703,9 @@ inline const char* fl_get_input(Fl_Widget* o) {return ((Fl_Input*)o)->value();} #include "Fl_Menu_Button.H" // types are not implemented, they all act like FL_PUSH_MENU: -#define FL_TOUCH_MENU 0 -#define FL_PUSH_MENU 1 -#define FL_PULLDOWN_MENU 2 +#define FL_TOUCH_MENU 0 +#define FL_PUSH_MENU 1 +#define FL_PULLDOWN_MENU 2 forms_constructor(Fl_Menu_Button, fl_add_menu) inline void fl_clear_menu(Fl_Widget* o) { @@ -739,7 +737,7 @@ inline const char* fl_get_menu_text(Fl_Widget* o) { return ((Fl_Menu_Button*)o)->text();} #include "Fl_Positioner.H" -#define FL_NORMAL_POSITIONER 0 +#define FL_NORMAL_POSITIONER 0 forms_constructor(Fl_Positioner, fl_add_positioner) inline void fl_set_positioner_xvalue(Fl_Widget* o, double v) { ((Fl_Positioner*)o)->xvalue(v);} @@ -807,7 +805,7 @@ protected: void draw(); public: Fl_FormsText(Fl_Boxtype b, int X, int Y, int W, int H, const char* l=0) - : Fl_Widget(X,Y,W,H,l) {box(b); align(FL_ALIGN_LEFT);} + : Fl_Widget(X,Y,W,H,l) {box(b); align(FL_ALIGN_LEFT);} }; #define FL_NORMAL_TEXT FL_NO_BOX forms_constructorb(Fl_FormsText, fl_add_text) @@ -829,8 +827,4 @@ void FL_EXPORT fl_gettime(long* sec, long* usec); inline int fl_double_click() {return Fl::event_clicks();} inline void fl_draw() {Fl::flush();} -#endif /* define __FORMS_H__ */ - -// -// End of "$Id$". -// +#endif /* define __FORMS_H__ */ diff --git a/FL/gl.h b/FL/gl.h index bd0e8b6e6..4579be21a 100644 --- a/FL/gl.h +++ b/FL/gl.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -16,11 +14,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -97,7 +95,3 @@ FL_EXPORT int gl_texture_pile_height(); FL_EXPORT void gl_draw_image(const uchar *, int x,int y,int w,int h, int d=3, int ld=0); #endif // !FL_gl_H - -// -// End of "$Id$". -// diff --git a/FL/gl2opengl.h b/FL/gl2opengl.h index b89614e0f..5ba1fef20 100644 --- a/FL/gl2opengl.h +++ b/FL/gl2opengl.h @@ -1,8 +1,8 @@ -/* gl.h +/* gl.h - GL to OpenGL translator. - If you include this, you might be able to port old GL programs. - There are also much better emulators available on the net. + GL to OpenGL translator. + If you include this, you might be able to port old GL programs. + There are also much better emulators available on the net. */ diff --git a/FL/gl_draw.H b/FL/gl_draw.H index 52c57fd4a..dbd17fd58 100644 --- a/FL/gl_draw.H +++ b/FL/gl_draw.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,18 +7,13 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "gl.h" extern FL_EXPORT void gl_remove_displaylist_fonts(); - - -// -// End of "$Id$". -// diff --git a/FL/glu.h b/FL/glu.h index cce6243fa..de923871b 100644 --- a/FL/glu.h +++ b/FL/glu.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // GLu header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -16,11 +14,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FL_glu_H @@ -45,7 +43,3 @@ # endif #endif // !FL_glu_H - -// -// End of "$Id$". -// diff --git a/FL/glut.H b/FL/glut.H index a447f4fe6..3e55bc7bd 100644 --- a/FL/glut.H +++ b/FL/glut.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // GLUT emulation header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Emulation of GLUT using fltk. @@ -37,7 +35,7 @@ # include "Fl.H" # include "Fl_Gl_Window.H" -/** +/** GLUT is emulated using this window class and these static variables (plus several more static variables hidden in glut_compatibility.cxx): */ @@ -67,8 +65,8 @@ public: // so the inline functions work ~Fl_Glut_Window(); }; -extern FL_EXPORT Fl_Glut_Window *glut_window; // the current window -extern FL_EXPORT int glut_menu; // the current menu +extern FL_EXPORT Fl_Glut_Window *glut_window; // the current window +extern FL_EXPORT int glut_menu; // the current menu // function pointers that are not per-window: extern FL_EXPORT void (*glut_idle_function)(); @@ -83,18 +81,18 @@ FL_EXPORT void glutInit(int *argcp, char **argv); // creates first window FL_EXPORT void glutInitDisplayMode(unsigned int mode); // the FL_ symbols have the same value as the GLUT ones: -# define GLUT_RGB FL_RGB -# define GLUT_RGBA FL_RGB -# define GLUT_INDEX FL_INDEX -# define GLUT_SINGLE FL_SINGLE -# define GLUT_DOUBLE FL_DOUBLE -# define GLUT_ACCUM FL_ACCUM -# define GLUT_ALPHA FL_ALPHA -# define GLUT_DEPTH FL_DEPTH -# define GLUT_STENCIL FL_STENCIL +# define GLUT_RGB FL_RGB +# define GLUT_RGBA FL_RGB +# define GLUT_INDEX FL_INDEX +# define GLUT_SINGLE FL_SINGLE +# define GLUT_DOUBLE FL_DOUBLE +# define GLUT_ACCUM FL_ACCUM +# define GLUT_ALPHA FL_ALPHA +# define GLUT_DEPTH FL_DEPTH +# define GLUT_STENCIL FL_STENCIL # define GLUT_MULTISAMPLE FL_MULTISAMPLE -# define GLUT_STEREO FL_STEREO -// # define GLUT_LUMINANCE 512 +# define GLUT_STEREO FL_STEREO +// # define GLUT_LUMINANCE 512 FL_EXPORT void glutInitWindowPosition(int x, int y); @@ -141,29 +139,29 @@ inline void glutFullScreen() {glut_window->fullscreen();} inline void glutSetCursor(Fl_Cursor cursor) {glut_window->cursor(cursor);} // notice that the numeric values are different than glut: -# define GLUT_CURSOR_RIGHT_ARROW ((Fl_Cursor)2) -# define GLUT_CURSOR_LEFT_ARROW ((Fl_Cursor)67) -# define GLUT_CURSOR_INFO FL_CURSOR_HAND -# define GLUT_CURSOR_DESTROY ((Fl_Cursor)45) -# define GLUT_CURSOR_HELP FL_CURSOR_HELP -# define GLUT_CURSOR_CYCLE ((Fl_Cursor)26) -# define GLUT_CURSOR_SPRAY ((Fl_Cursor)63) -# define GLUT_CURSOR_WAIT FL_CURSOR_WAIT -# define GLUT_CURSOR_TEXT FL_CURSOR_INSERT -# define GLUT_CURSOR_CROSSHAIR FL_CURSOR_CROSS -# define GLUT_CURSOR_UP_DOWN FL_CURSOR_NS -# define GLUT_CURSOR_LEFT_RIGHT FL_CURSOR_WE -# define GLUT_CURSOR_TOP_SIDE FL_CURSOR_N -# define GLUT_CURSOR_BOTTOM_SIDE FL_CURSOR_S -# define GLUT_CURSOR_LEFT_SIDE FL_CURSOR_W -# define GLUT_CURSOR_RIGHT_SIDE FL_CURSOR_E -# define GLUT_CURSOR_TOP_LEFT_CORNER FL_CURSOR_NW -# define GLUT_CURSOR_TOP_RIGHT_CORNER FL_CURSOR_NE -# define GLUT_CURSOR_BOTTOM_RIGHT_CORNER FL_CURSOR_SE -# define GLUT_CURSOR_BOTTOM_LEFT_CORNER FL_CURSOR_SW -# define GLUT_CURSOR_INHERIT FL_CURSOR_DEFAULT -# define GLUT_CURSOR_NONE FL_CURSOR_NONE -# define GLUT_CURSOR_FULL_CROSSHAIR FL_CURSOR_CROSS +# define GLUT_CURSOR_RIGHT_ARROW ((Fl_Cursor)2) +# define GLUT_CURSOR_LEFT_ARROW ((Fl_Cursor)67) +# define GLUT_CURSOR_INFO FL_CURSOR_HAND +# define GLUT_CURSOR_DESTROY ((Fl_Cursor)45) +# define GLUT_CURSOR_HELP FL_CURSOR_HELP +# define GLUT_CURSOR_CYCLE ((Fl_Cursor)26) +# define GLUT_CURSOR_SPRAY ((Fl_Cursor)63) +# define GLUT_CURSOR_WAIT FL_CURSOR_WAIT +# define GLUT_CURSOR_TEXT FL_CURSOR_INSERT +# define GLUT_CURSOR_CROSSHAIR FL_CURSOR_CROSS +# define GLUT_CURSOR_UP_DOWN FL_CURSOR_NS +# define GLUT_CURSOR_LEFT_RIGHT FL_CURSOR_WE +# define GLUT_CURSOR_TOP_SIDE FL_CURSOR_N +# define GLUT_CURSOR_BOTTOM_SIDE FL_CURSOR_S +# define GLUT_CURSOR_LEFT_SIDE FL_CURSOR_W +# define GLUT_CURSOR_RIGHT_SIDE FL_CURSOR_E +# define GLUT_CURSOR_TOP_LEFT_CORNER FL_CURSOR_NW +# define GLUT_CURSOR_TOP_RIGHT_CORNER FL_CURSOR_NE +# define GLUT_CURSOR_BOTTOM_RIGHT_CORNER FL_CURSOR_SE +# define GLUT_CURSOR_BOTTOM_LEFT_CORNER FL_CURSOR_SW +# define GLUT_CURSOR_INHERIT FL_CURSOR_DEFAULT +# define GLUT_CURSOR_NONE FL_CURSOR_NONE +# define GLUT_CURSOR_FULL_CROSSHAIR FL_CURSOR_CROSS inline void glutWarpPointer(int, int) { /* do nothing */ } @@ -212,11 +210,11 @@ inline void glutKeyboardFunc(void (*f)(uchar key, int x, int y)) { inline void glutMouseFunc(void (*f)(int b, int state, int x, int y)) { glut_window->mouse = f;} -# define GLUT_LEFT_BUTTON 0 -# define GLUT_MIDDLE_BUTTON 1 -# define GLUT_RIGHT_BUTTON 2 -# define GLUT_DOWN 0 -# define GLUT_UP 1 +# define GLUT_LEFT_BUTTON 0 +# define GLUT_MIDDLE_BUTTON 1 +# define GLUT_RIGHT_BUTTON 2 +# define GLUT_DOWN 0 +# define GLUT_UP 1 inline void glutMotionFunc(void (*f)(int x, int y)) {glut_window->motion= f;} @@ -244,28 +242,28 @@ enum {GLUT_MENU_NOT_IN_USE, GLUT_MENU_IN_USE}; inline void glutSpecialFunc(void (*f)(int key, int x, int y)) { glut_window->special = f;} -# define GLUT_KEY_F1 1 -# define GLUT_KEY_F2 2 -# define GLUT_KEY_F3 3 -# define GLUT_KEY_F4 4 -# define GLUT_KEY_F5 5 -# define GLUT_KEY_F6 6 -# define GLUT_KEY_F7 7 -# define GLUT_KEY_F8 8 -# define GLUT_KEY_F9 9 -# define GLUT_KEY_F10 10 -# define GLUT_KEY_F11 11 -# define GLUT_KEY_F12 12 +# define GLUT_KEY_F1 1 +# define GLUT_KEY_F2 2 +# define GLUT_KEY_F3 3 +# define GLUT_KEY_F4 4 +# define GLUT_KEY_F5 5 +# define GLUT_KEY_F6 6 +# define GLUT_KEY_F7 7 +# define GLUT_KEY_F8 8 +# define GLUT_KEY_F9 9 +# define GLUT_KEY_F10 10 +# define GLUT_KEY_F11 11 +# define GLUT_KEY_F12 12 // WARNING: Different values than GLUT uses: -# define GLUT_KEY_LEFT FL_Left -# define GLUT_KEY_UP FL_Up -# define GLUT_KEY_RIGHT FL_Right -# define GLUT_KEY_DOWN FL_Down -# define GLUT_KEY_PAGE_UP FL_Page_Up -# define GLUT_KEY_PAGE_DOWN FL_Page_Down -# define GLUT_KEY_HOME FL_Home -# define GLUT_KEY_END FL_End -# define GLUT_KEY_INSERT FL_Insert +# define GLUT_KEY_LEFT FL_Left +# define GLUT_KEY_UP FL_Up +# define GLUT_KEY_RIGHT FL_Right +# define GLUT_KEY_DOWN FL_Down +# define GLUT_KEY_PAGE_UP FL_Page_Up +# define GLUT_KEY_PAGE_DOWN FL_Page_Down +# define GLUT_KEY_HOME FL_Home +# define GLUT_KEY_END FL_End +# define GLUT_KEY_INSERT FL_Insert //inline void glutSpaceballMotionFunc(void (*)(int x, int y, int z)); @@ -286,14 +284,14 @@ inline void glutOverlayDisplayFunc(void (*f)()) { //inline void glutWindowStatusFunc(void (*)(int state)); //enum {GLUT_HIDDEN, GLUT_FULLY_RETAINED, GLUT_PARTIALLY_RETAINED, -// GLUT_FULLY_COVERED}; +// GLUT_FULLY_COVERED}; //inline void glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); //inline GLfloat glutGetColor(int ndx, int component); -//#define GLUT_RED 0 -//#define GLUT_GREEN 1 -//#define GLUT_BLUE 2 +//#define GLUT_RED 0 +//#define GLUT_GREEN 1 +//#define GLUT_BLUE 2 //inline void glutCopyColormap(int win); @@ -325,36 +323,36 @@ enum { //GLUT_ELAPSED_TIME, }; -# define GLUT_WINDOW_STENCIL_SIZE GL_STENCIL_BITS -# define GLUT_WINDOW_DEPTH_SIZE GL_DEPTH_BITS -# define GLUT_WINDOW_RED_SIZE GL_RED_BITS -# define GLUT_WINDOW_GREEN_SIZE GL_GREEN_BITS -# define GLUT_WINDOW_BLUE_SIZE GL_BLUE_BITS -# define GLUT_WINDOW_ALPHA_SIZE GL_ALPHA_BITS -# define GLUT_WINDOW_ACCUM_RED_SIZE GL_ACCUM_RED_BITS -# define GLUT_WINDOW_ACCUM_GREEN_SIZE GL_ACCUM_GREEN_BITS -# define GLUT_WINDOW_ACCUM_BLUE_SIZE GL_ACCUM_BLUE_BITS -# define GLUT_WINDOW_ACCUM_ALPHA_SIZE GL_ACCUM_ALPHA_BITS -# define GLUT_WINDOW_DOUBLEBUFFER GL_DOUBLEBUFFER -# define GLUT_WINDOW_RGBA GL_RGBA -# define GLUT_WINDOW_COLORMAP_SIZE GL_INDEX_BITS +# define GLUT_WINDOW_STENCIL_SIZE GL_STENCIL_BITS +# define GLUT_WINDOW_DEPTH_SIZE GL_DEPTH_BITS +# define GLUT_WINDOW_RED_SIZE GL_RED_BITS +# define GLUT_WINDOW_GREEN_SIZE GL_GREEN_BITS +# define GLUT_WINDOW_BLUE_SIZE GL_BLUE_BITS +# define GLUT_WINDOW_ALPHA_SIZE GL_ALPHA_BITS +# define GLUT_WINDOW_ACCUM_RED_SIZE GL_ACCUM_RED_BITS +# define GLUT_WINDOW_ACCUM_GREEN_SIZE GL_ACCUM_GREEN_BITS +# define GLUT_WINDOW_ACCUM_BLUE_SIZE GL_ACCUM_BLUE_BITS +# define GLUT_WINDOW_ACCUM_ALPHA_SIZE GL_ACCUM_ALPHA_BITS +# define GLUT_WINDOW_DOUBLEBUFFER GL_DOUBLEBUFFER +# define GLUT_WINDOW_RGBA GL_RGBA +# define GLUT_WINDOW_COLORMAP_SIZE GL_INDEX_BITS # ifdef GL_SAMPLES_SGIS -# define GLUT_WINDOW_NUM_SAMPLES GL_SAMPLES_SGIS +# define GLUT_WINDOW_NUM_SAMPLES GL_SAMPLES_SGIS # else -# define GLUT_WINDOW_NUM_SAMPLES GLUT_RETURN_ZERO +# define GLUT_WINDOW_NUM_SAMPLES GLUT_RETURN_ZERO # endif -# define GLUT_WINDOW_STEREO GL_STEREO - -# define GLUT_HAS_KEYBOARD 600 -# define GLUT_HAS_MOUSE 601 -# define GLUT_HAS_SPACEBALL 602 -# define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 -# define GLUT_HAS_TABLET 604 -# define GLUT_NUM_MOUSE_BUTTONS 605 -# define GLUT_NUM_SPACEBALL_BUTTONS 606 -# define GLUT_NUM_BUTTON_BOX_BUTTONS 607 -# define GLUT_NUM_DIALS 608 -# define GLUT_NUM_TABLET_BUTTONS 609 +# define GLUT_WINDOW_STEREO GL_STEREO + +# define GLUT_HAS_KEYBOARD 600 +# define GLUT_HAS_MOUSE 601 +# define GLUT_HAS_SPACEBALL 602 +# define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 +# define GLUT_HAS_TABLET 604 +# define GLUT_NUM_MOUSE_BUTTONS 605 +# define GLUT_NUM_SPACEBALL_BUTTONS 606 +# define GLUT_NUM_BUTTON_BOX_BUTTONS 607 +# define GLUT_NUM_DIALS 608 +# define GLUT_NUM_TABLET_BUTTONS 609 FL_EXPORT int glutDeviceGet(GLenum type); // WARNING: these values are different than GLUT uses: @@ -364,12 +362,12 @@ FL_EXPORT int glutDeviceGet(GLenum type); inline int glutGetModifiers() {return Fl::event_state() & (GLUT_ACTIVE_SHIFT | GLUT_ACTIVE_CTRL | GLUT_ACTIVE_ALT);} FL_EXPORT int glutLayerGet(GLenum); -# define GLUT_OVERLAY_POSSIBLE 800 -//#define GLUT_LAYER_IN_USE 801 -//#define GLUT_HAS_OVERLAY 802 -# define GLUT_TRANSPARENT_INDEX 803 -# define GLUT_NORMAL_DAMAGED 804 -# define GLUT_OVERLAY_DAMAGED 805 +# define GLUT_OVERLAY_POSSIBLE 800 +//#define GLUT_LAYER_IN_USE 801 +//#define GLUT_HAS_OVERLAY 802 +# define GLUT_TRANSPARENT_INDEX 803 +# define GLUT_NORMAL_DAMAGED 804 +# define GLUT_OVERLAY_DAMAGED 805 extern "C" { typedef void (*GLUTproc)(); @@ -378,16 +376,16 @@ typedef void (*GLUTproc)(); FL_EXPORT GLUTproc glutGetProcAddress(const char *procName); //inline int glutVideoResizeGet(GLenum param); -//#define GLUT_VIDEO_RESIZE_POSSIBLE 900 -//#define GLUT_VIDEO_RESIZE_IN_USE 901 -//#define GLUT_VIDEO_RESIZE_X_DELTA 902 -//#define GLUT_VIDEO_RESIZE_Y_DELTA 903 -//#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 +//#define GLUT_VIDEO_RESIZE_POSSIBLE 900 +//#define GLUT_VIDEO_RESIZE_IN_USE 901 +//#define GLUT_VIDEO_RESIZE_X_DELTA 902 +//#define GLUT_VIDEO_RESIZE_Y_DELTA 903 +//#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 //#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 -//#define GLUT_VIDEO_RESIZE_X 906 -//#define GLUT_VIDEO_RESIZE_Y 907 -//#define GLUT_VIDEO_RESIZE_WIDTH 908 -//#define GLUT_VIDEO_RESIZE_HEIGHT 909 +//#define GLUT_VIDEO_RESIZE_X 906 +//#define GLUT_VIDEO_RESIZE_Y 907 +//#define GLUT_VIDEO_RESIZE_WIDTH 908 +//#define GLUT_VIDEO_RESIZE_HEIGHT 909 //inline void glutSetupVideoResizing(); @@ -438,15 +436,15 @@ struct Fl_Glut_StrokeChar { }; struct Fl_Glut_StrokeFont { - char* Name; // The source font name - int Quantity; // Number of chars in font - GLfloat Height; // Height of the characters + char* Name; // The source font name + int Quantity; // Number of chars in font + GLfloat Height; // Height of the characters const Fl_Glut_StrokeChar** Characters;// The characters mapping }; extern FL_EXPORT Fl_Glut_StrokeFont glutStrokeRoman; extern FL_EXPORT Fl_Glut_StrokeFont glutStrokeMonoRoman; -# define GLUT_STROKE_ROMAN (&glutStrokeRoman) -# define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) +# define GLUT_STROKE_ROMAN (&glutStrokeRoman) +# define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) FL_EXPORT void glutStrokeCharacter(void *font, int character); FL_EXPORT GLfloat glutStrokeHeight(void *font); @@ -475,7 +473,3 @@ FL_EXPORT void glutWireIcosahedron(); FL_EXPORT void glutSolidIcosahedron(); #endif // !Fl_glut_H - -// -// End of "$Id$". -// diff --git a/FL/mac.H b/FL/mac.H index 7e4f345ff..588afcfc7 100644 --- a/FL/mac.H +++ b/FL/mac.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Mac header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Do not directly include this file, instead use <FL/platform.H>. It will @@ -142,7 +140,7 @@ public: /** Localizable text for the "About xxx" application menu item */ static const char *about; /** Localizable text for the "Print Front Window" application menu item. - This menu item won't be displayed if Fl_Mac_App_Menu::print + This menu item won't be displayed if Fl_Mac_App_Menu::print is set to an empty string. */ static const char *print; @@ -166,7 +164,3 @@ public: /** @} */ -// -// End of "$Id$". -// - diff --git a/FL/math.h b/FL/math.h index e5182352b..b78357e07 100644 --- a/FL/math.h +++ b/FL/math.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Math header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,23 +9,23 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Xcode on macOS includes files by recursing down into directories. // This code catches the cycle and directly includes the required file. -#ifdef fl_math_h_cyclic_include +#ifdef fl_math_h_cyclic_include # include "/usr/include/math.h" #endif #ifndef fl_math_h # define fl_math_h -# define fl_math_h_cyclic_include +# define fl_math_h_cyclic_include # include <math.h> -# undef fl_math_h_cyclic_include +# undef fl_math_h_cyclic_include # ifndef M_PI # define M_PI 3.14159265358979323846 @@ -50,8 +48,3 @@ inline double copysign(double a, double b) {return b<0 ? -a : a;} # endif // (_WIN32 || CRAY) && !__MINGW32__ #endif // !fl_math_h - - -// -// End of "$Id$". -// diff --git a/FL/names.h b/FL/names.h index 7b4700fbe..9aaef5490 100644 --- a/FL/names.h +++ b/FL/names.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Event names header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Thanks to Greg Ercolano for this addition. @@ -32,7 +30,7 @@ \b Example: \code - #include <FL/names.h> // array will be defined here + #include <FL/names.h> // array will be defined here int MyClass::handle(int e) { printf("Event was %s (%d)\n", fl_eventnames[e], e); // ..resulting output might be e.g. "Event was FL_PUSH (1)".. @@ -82,7 +80,7 @@ const char * const fl_eventnames[] = \b Example: \code - #include <FL/names.h> // array will be defined here + #include <FL/names.h> // array will be defined here int MyClass::my_callback(Fl_Widget *w, void*) { int fnum = w->labelfont(); // Resulting output might be e.g. "Label's font is FL_HELVETICA (0)" @@ -115,7 +113,3 @@ const char * const fl_fontnames[] = /** @} */ #endif /* FL_NAMES_H */ - -// -// End of "$Id$". -// diff --git a/FL/platform.H b/FL/platform.H index 834e30f81..7271b1feb 100644 --- a/FL/platform.H +++ b/FL/platform.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Platform header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // These are FLTK symbols that are necessary or useful for calling @@ -150,7 +148,3 @@ extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) extern FL_EXPORT void fl_open_callback(void (*)(const char *)); #endif // !FL_PLATFORM_H - -// -// End of "$Id$". -// diff --git a/FL/platform_types.h b/FL/platform_types.h index c13448614..9b3fa8431 100644 --- a/FL/platform_types.h +++ b/FL/platform_types.h @@ -1,17 +1,15 @@ /* - * "$Id$" - * * Copyright 2016-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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /** \file @@ -101,8 +99,8 @@ typedef int FL_SOCKET; #include <sys/stat.h> #include <sys/types.h> #include <dirent.h> -# define FL_COMMAND FL_META -# define FL_CONTROL FL_CTRL +# define FL_COMMAND FL_META +# define FL_CONTROL FL_CTRL #elif defined(_WIN32) typedef struct HBITMAP__ *HBITMAP; @@ -110,7 +108,7 @@ typedef HBITMAP Fl_Offscreen; typedef HBITMAP Fl_Bitmask; typedef struct HRGN__ *Fl_Region; # if defined(_WIN64) && defined(_MSC_VER) -typedef unsigned __int64 FL_SOCKET; /* *FIXME* - FL_SOCKET (see above) */ +typedef unsigned __int64 FL_SOCKET; /* *FIXME* - FL_SOCKET (see above) */ # else typedef int FL_SOCKET; # endif @@ -153,14 +151,10 @@ typedef struct __GLXcontextRec *GLContext; #ifndef __APPLE__ -# define FL_COMMAND FL_CTRL /**< An alias for FL_CTRL on Windows and X11, or FL_META on MacOS X */ -# define FL_CONTROL FL_META /**< An alias for FL_META on Windows and X11, or FL_CTRL on MacOS X */ +# define FL_COMMAND FL_CTRL /**< An alias for FL_CTRL on Windows and X11, or FL_META on MacOS X */ +# define FL_CONTROL FL_META /**< An alias for FL_META on Windows and X11, or FL_CTRL on MacOS X */ #endif #endif /* FL_PLATFORM_TYPES_H */ #endif // FL_DOXYGEN - -/* - * End of "$Id$". - */ diff --git a/FL/win32.H b/FL/win32.H index 94cd44f78..018928d0b 100644 --- a/FL/win32.H +++ b/FL/win32.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows system header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Do not directly include this file, instead use <FL/platform.H>. It will @@ -29,7 +27,7 @@ typedef HWND Window; // this part is included only when compiling the FLTK library or if requested explicitly -#if defined(FL_LIBRARY) || defined(FL_INTERNALS) +#if defined(FL_LIBRARY) || defined(FL_INTERNALS) // In some of the distributions, the gcc header files are missing some stuff: #ifndef LPMINMAXINFO @@ -52,9 +50,9 @@ extern FL_EXPORT void fl_save_dc( HWND w, HDC dc); // most recent fl_color() or fl_rgbcolor() points at one of these: extern FL_EXPORT struct Fl_XMap { - COLORREF rgb; // this should be the type the RGB() macro returns - HPEN pen; // pen, 0 if none created yet - int brush; // ref to solid brush, 0 if none created yet + COLORREF rgb; // this should be the type the RGB() macro returns + HPEN pen; // pen, 0 if none created yet + int brush; // ref to solid brush, 0 if none created yet int pwidth; // the width of the pen, if present } *fl_current_xmap; inline COLORREF fl_RGB() {return fl_current_xmap->rgb;} @@ -69,7 +67,3 @@ extern FL_EXPORT HDC fl_GetDC(Window); extern FL_EXPORT HDC fl_makeDC(HBITMAP); #endif // FL_DOXYGEN - -// -// End of "$Id$". -// diff --git a/FL/x.H b/FL/x.H index 4fb9873a1..92bc2c8a0 100644 --- a/FL/x.H +++ b/FL/x.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // *Deprecated* platform header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // IMPORTANT: This file is deprecated since FLTK 1.4.0. DO NOT include it. @@ -22,11 +20,7 @@ // Please #include <FL/platform.H> instead if you really need it. See // documentation in FL/platform.H to decide whether you need that file. -#if !defined(Fl_X_H) && !defined(FL_DOXYGEN) +#if !defined(Fl_X_H) && !defined(FL_DOXYGEN) # define Fl_X_H # include <FL/platform.H> #endif // !Fl_X_H - -// -// End of "$Id$". -// diff --git a/GL/glut.h b/GL/glut.h index da03916ef..6d5ae2ac1 100644 --- a/GL/glut.h +++ b/GL/glut.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // GLUT compatibility header for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,15 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/glut.H> - -// -// End of "$Id$". -// diff --git a/Makefile b/Makefile index cfd97b46d..386d91219 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,4 @@ # -# "$Id$" -# # Top-level makefile for the Fast Light Tool Kit (FLTK). # # Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # include makeinclude @@ -133,8 +131,3 @@ clang: scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all clang-changes: scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all - - -# -# End of "$Id$". -# diff --git a/README.Android.md b/README.Android.md index f9854045a..4dfba17df 100644 --- a/README.Android.md +++ b/README.Android.md @@ -26,7 +26,7 @@ device, you are ready to install FLTK. Build FLTK for your native platform first using CMake. AndroidStudio will need a native version of the user interface design tool _Fluid_. -The following example is for the _Xcode_ IDE on _macOS_. The same should work for +The following example is for the _Xcode_ IDE on _macOS_. The same should work for other IDEs and Makefiles on other platforms that run _AndroidStudio_. ```bash @@ -43,8 +43,8 @@ cmake -G "Unix Makefiles" \ -D OPTION_CREATE_ANDROID_STUDIO_IDE=On \ ../.. ``` -Note the last option, `-D OPTION_CREATE_ANDROID_STUDIO_IDE=On`. This option will -create the file needed to create an FLTK demo project in +Note the last option, `-D OPTION_CREATE_ANDROID_STUDIO_IDE=On`. This option will +create the file needed to create an FLTK demo project in `fltk-1.4.git/build/Xcode/AndroidStudio`. - open the `build/Xcode/AndroidStudio/` directory as a project in AndroidStudio3 diff --git a/README.CMake.txt b/README.CMake.txt index 370e97e43..57c0cc9b0 100644 --- a/README.CMake.txt +++ b/README.CMake.txt @@ -5,8 +5,8 @@ README.CMake.txt - Building and using FLTK with CMake CONTENTS ========== - 1 Introduction to CMake - 2 Using CMake to Build FLTK + 1 Introduction to CMake + 2 Using CMake to Build FLTK 2.1 Prerequisites 2.2 Options 2.3 Building under Linux with Unix Makefiles @@ -14,10 +14,10 @@ README.CMake.txt - Building and using FLTK with CMake 2.5 Building under Windows with MinGW using Makefiles 2.6 Building under MacOS with Xcode 2.7 Crosscompiling - 3 Using CMake with FLTK + 3 Using CMake with FLTK 3.1 Library Names 3.2 Using Fluid Files - 4 Document History + 4 Document History 1. INTRODUCTION TO CMAKE @@ -246,15 +246,15 @@ in the GUI (cmake-gui). to where you've extracted an fltk distribution tar file (or snapshot tar file), and run the following commands: - cd C:\fltk-1.4.x <-- change to your FLTK directory - mkdir build <-- create an empty directory + cd C:\fltk-1.4.x <-- change to your FLTK directory + mkdir build <-- create an empty directory cd build cmake -G "Visual Studio 7" -D CMAKE_BUILD_TYPE=Release .. IMPORTANT: The trailing ".." on the cmake command must be specified (it is NOT an ellipsis). ^^^^^^^^^^^^^^^^^ - This will create the file FLTK.sln in the current 'build' directory. + This will create the file FLTK.sln in the current 'build' directory. 3) Open Visual Studio 7, and choose File -> Open -> Project, and pick the "FLTK.sln" created by step #2 in the 'build' directory. @@ -267,7 +267,7 @@ in the GUI (cmake-gui). 5) In the "Solution Explorer", right click on: - Solution 'FLTK' (## projects) + Solution 'FLTK' (## projects) ..and in the popup menu, choose "Build Solution" @@ -275,25 +275,25 @@ in the GUI (cmake-gui). The test programs (*.exe) can be found in e.g. - Release: C:\fltk-1.4.x\build\bin\examples\release\*.exe - Debug: C:\fltk-1.4.x\build\bin\examples\debug\*.exe + Release: C:\fltk-1.4.x\build\bin\examples\release\*.exe + Debug: C:\fltk-1.4.x\build\bin\examples\debug\*.exe ..and the FLTK include files (*.H & *.h) your own apps can compile with can be found in: - Release & Debug: C:\fltk-1.4.x\build\FL - *and* [1] in: C:\fltk-1.4.x\FL + Release & Debug: C:\fltk-1.4.x\build\FL + *and* [1] in: C:\fltk-1.4.x\FL ..and the FLTK library files (*.lib) which your own apps can link with can be found in: - Release: C:\fltk-1.4.x\build\lib\release\*.lib - Debug: C:\fltk-1.4.x\build\lib\debug\*.lib + Release: C:\fltk-1.4.x\build\lib\release\*.lib + Debug: C:\fltk-1.4.x\build\lib\debug\*.lib [1] If you want to build your own FLTK application directly using - the build directories (i.e. without "installation") you need - to include both the build tree (first) and then the FLTK source - tree in the compiler's header search list. + the build directories (i.e. without "installation") you need + to include both the build tree (first) and then the FLTK source + tree in the compiler's header search list. 2.5 Building under Windows with MinGW using Makefiles @@ -540,8 +540,8 @@ include_directories(${FLTK_INCLUDE_DIRS}) #run fluid -c to generate CubeViewUI.cxx and CubeViewUI.h files add_custom_command( - OUTPUT "CubeViewUI.cxx" "CubeViewUI.h" - COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/CubeViewUI.fl + OUTPUT "CubeViewUI.cxx" "CubeViewUI.h" + COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/CubeViewUI.fl ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/README.Cairo.txt b/README.Cairo.txt index 3e94196ea..d4b519d2a 100644 --- a/README.Cairo.txt +++ b/README.Cairo.txt @@ -139,21 +139,21 @@ on the various supported operating systems. ..and then rebuild FLTK: make distclean - ./configure --enable-cairo - make + ./configure --enable-cairo + make If you get this error: [..] - Linking cairo_test... - /usr/bin/ld: cannot find -lpixman-1 - collect2: ld returned 1 exit status - make[1]: *** [cairo_test] Error 1 + Linking cairo_test... + /usr/bin/ld: cannot find -lpixman-1 + collect2: ld returned 1 exit status + make[1]: *** [cairo_test] Error 1 ..remove "-lpixman-1" from FLTK's makeinclude file, i.e. change this line: - -CAIROLIBS = -lcairo -lpixman-1 - +CAIROLIBS = -lcairo + -CAIROLIBS = -lcairo -lpixman-1 + +CAIROLIBS = -lcairo ..then another 'make' should finish the build without errors. You should be able to then run the test/cairo_test program. @@ -161,7 +161,7 @@ on the various supported operating systems. According to the cairo site, "For Debian and Debian derivatives including Ubuntu" you need to install libcairo2-dev, i.e. - sudo apt-get install libcairo2-dev + sudo apt-get install libcairo2-dev This has been tested and works with Ubuntu 11.10. Note that this also installs libpixman-1-dev, so that dependencies on this should be resolved diff --git a/README.Unix.txt b/README.Unix.txt index 9450a57d3..60d6961db 100644 --- a/README.Unix.txt +++ b/README.Unix.txt @@ -4,7 +4,7 @@ README.Unix.txt - 2010-11-14 - Building FLTK on Unix CONTENTS -========== +========== 1 INTRODUCTION 2 PREREQUISITES @@ -44,7 +44,7 @@ platforms: - gcc command line tools - Code::Blocks - ... - + The Symbol font and the Zapf Dingbats font do not work on X11. This is correct behavior for UTF-8 platforms. @@ -60,7 +60,7 @@ behavior for UTF-8 platforms. Ubuntu Linux can be downloaded here: http://www.ubuntu.com/ - + If you have not done so yet, download and install Ubuntu. Open a shell and install some software: @@ -71,9 +71,9 @@ Open a shell and install some software: sudo apt-get install autoconf sudo apt-get install libx11-dev sudo apt-get install libglu1-mesa-dev - -These two are optional, but highly recommended: - + +These two are optional, but highly recommended: + sudo apt-get install libasound2-dev sudo apt-get install libxft-dev @@ -84,7 +84,7 @@ If you are planning to use the Code::Blocks IDE, also install this I like to use subversion to install the latest FLTK-1.3.release: svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3 - + To update to the latest version, just go into the fltk-1.3 directory and type svn update @@ -96,7 +96,7 @@ To update to the latest version, just go into the fltk-1.3 directory and type Linux Mint 9 can be downloaded here: http://www.linuxmint.com/ - + If you have not done so yet, download and install Linux Mint. Open a shell and install some software: @@ -107,9 +107,9 @@ Open a shell and install some software: sudo apt-get install autoconf sudo apt-get install libx11-dev sudo apt-get install libglu1-mesa-dev - -These two are optional, but highly recommended: - + +These two are optional, but highly recommended: + sudo apt-get install libasound2-dev sudo apt-get install libxft-dev @@ -120,7 +120,7 @@ If you are planning to use the Code::Blocks IDE, also install this I like to use subversion to install the latest FLTK-1.3.release: svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3 - + To update to the latest version, just go into the fltk-1.3 directory and type svn update @@ -134,10 +134,10 @@ FIXME: no FL_SYMBOL font (-*-symbol-*), font 15 (Zapf-Dingbats) Fedora 13 Linux can be downloaded here: http://fedoraproject.org/ - + If you have not done so yet, download and install Fedora. -Open a terminal window and install some software. In Fedora, the default user +Open a terminal window and install some software. In Fedora, the default user has no permission to call "sudo", so we will change user a few times: su root @@ -149,14 +149,14 @@ If you are planning to use the Code::Blocks IDE, also install this yum install codeblocks.i686 (for 64 bit machines) -Don't forget to leave root status (Ctrl-D) before loading FLTK. To install FLTK -for every user, you either have to set root user again, or use "visudo" to add +Don't forget to leave root status (Ctrl-D) before loading FLTK. To install FLTK +for every user, you either have to set root user again, or use "visudo" to add yourself to the "sudo" list. I like to use subversion to install the latest FLTK-1.3.release: svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3 - + To update to the latest version, just go into the fltk-1.3 directory and type svn update @@ -276,11 +276,11 @@ To install GNU autoconf from pkgsrc: Download FLTK from here: - http://www.fltk.org/software.php + https://www.fltk.org/software.php -If you are familiar with "subversion" and like to stay current with your -version, you will find the subversion access parameters at the bottom of that -page. Unpack FLTK into a convenient location. I like to have everything in my +If you are familiar with "subversion" and like to stay current with your +version, you will find the subversion access parameters at the bottom of that +page. Unpack FLTK into a convenient location. I like to have everything in my dev directory: cd @@ -289,7 +289,7 @@ dev directory: mv ~/Downloads/fltk-1.3.xxxx.tar.gz . tar xvfz fltk-1.3.xxxx.tar.gz cd fltk-1.3.xxxx - + 3.2 Configuring FLTK ----------------------- @@ -303,10 +303,10 @@ following: Now configure your FLTK installation: ./configure - -ADVANCED: type "./configure --help" to get a complete list of optional + +ADVANCED: type "./configure --help" to get a complete list of optional configuration parameters. These should be pretty self-explanatory. Some -more details can be found in README. +more details can be found in README. :END_ADVANCED The configuration script will check your machine for the required resources @@ -317,11 +317,11 @@ Review the Configuration Summary, maybe take some notes. 3.3 Building FLTK -------------------- -Now this is easy. Stay in your FLTK source-code directory and type: +Now this is easy. Stay in your FLTK source-code directory and type: make -The entire FLTK toolkit including many test programs will be built for you. No +The entire FLTK toolkit including many test programs will be built for you. No warnings should appear. If some do, please let the FLTK developer team know via the mailing list or the bug reporting template at www.fltk.org . @@ -340,19 +340,19 @@ After a successful build, you can test FLTK's capabilities: 3.5 Installing FLTK ---------------------- -If you did not change any of the configuration settings, FLTK will be installed +If you did not change any of the configuration settings, FLTK will be installed in "/usr/local/include" and "/usr/local/lib" by typing sudo make install - + If you are using the KDE, GNOME or XFCE desktop environments and want to call "fluid" from the desktop menu, you will need to install additional files and icons under "/usr/share" by typing: sudo make install-desktop - -It is possible to install FLTK without superuser privileges by changing the -installation path to a location within the user account by adding the + +It is possible to install FLTK without superuser privileges by changing the +installation path to a location within the user account by adding the "--prefix=PREFIX" parameters to the "./configure" command. @@ -377,16 +377,16 @@ recommend that you add it to the command search path. Code::Blocks is a free and popular C++ IDE in the Linux world. It also runs on OS X and Windows. Configured correctly, it can also cross-compile between -these platforms. This chapter focuses on creating a new FLTK project for Linux, -assuming that FLTK 1.3 was previously built and installed in its default +these platforms. This chapter focuses on creating a new FLTK project for Linux, +assuming that FLTK 1.3 was previously built and installed in its default location from the command line. -If not done yet, install Code::Blocks as described in the Prerequisites chapter -above, or download it from their web site. This description is based on +If not done yet, install Code::Blocks as described in the Prerequisites chapter +above, or download it from their web site. This description is based on version 10.05: http://www.codeblocks.org/ - + Start Code::Blocks. Select File > New > Project. In the "New from template" dialog box, click on "FLTK project" and follow the instructions. @@ -400,7 +400,7 @@ compiler flags, select your project in the tree view, then select the `fltk-config --cxxflags` in front of the second "`". The linker flags are located in the "Linker Settings" tab under "Other Linker -Options". Add the flags to `fltk-config --ldstaticflags` in front of the +Options". Add the flags to `fltk-config --ldstaticflags` in front of the second "`". CodeBlocks can be set up to use fluid to manage modules. @@ -409,24 +409,24 @@ The following info is from mingodad@gmail.com posted on fltk.general 06/17/2013: """ I have these settings in codeblocks on linux: - Settings -> + Settings -> Compiler and debugging settings -> - Other settings -> - Advanced options: + Other settings -> + Advanced options: -- Add an extension (in my case "fl") -- On command line macro: - cd $file_dir; fluid -c $file + cd $file_dir; fluid -c $file -- Generated files (to be further compiled): - $file_dir/$file_name.cxx - $file_dir/$file_name.h + $file_dir/$file_name.cxx + $file_dir/$file_name.h Settings -> Environment -> Files extension handling : - Wildcard : *.fl - To open file: Launch an external program - External program: fluid + Wildcard : *.fl + To open file: Launch an external program + External program: fluid With that I can double click on any fluid file I include on a project and it opens with fluid. When I press "run" or "build" codeblocks diff --git a/README.Windows.txt b/README.Windows.txt index d159f8aac..edfdbe56f 100644 --- a/README.Windows.txt +++ b/README.Windows.txt @@ -514,11 +514,11 @@ The following links may be of use: 1. Main Cygwin homepage: - https://www.cygwin.com/ + https://www.cygwin.com/ 2. Main MinGW homepage: - http://www.mingw.org/ + http://www.mingw.org/ In particular look for the MinGW FAQ at this link for a lot of useful MinGW-native development documentation. @@ -526,7 +526,7 @@ The following links may be of use: 3. Check out the FLTK newsgroups at the FLTK homepage: - https://www.fltk.org/ + https://www.fltk.org/ Its archival search facilities are EXTREMELY useful to check back through previous problems with this @@ -534,15 +534,15 @@ The following links may be of use: 4. GNU Compiler Collection (GCC) compiler homepage: - https://gcc.gnu.org/ + https://gcc.gnu.org/ 5. OpenGL page - for OpenGL and GLUT libs - https://www.opengl.org/ + https://www.opengl.org/ 6. CMake homepage: - https://cmake.org/ + https://cmake.org/ Note: all links in this document have been checked on Mar 21, 2020. We can't guarantee that these links are still valid any time later. diff --git a/README.abi-version.txt b/README.abi-version.txt index bf9d54f9f..19a42e99d 100644 --- a/README.abi-version.txt +++ b/README.abi-version.txt @@ -12,13 +12,13 @@ Since FLTK 1.3.1 the FLTK team began to introduce ABI-breaking features wrapped in so-called ABI guards in the library code, e.g. #if FL_ABI_VERSION >= 10401 - ... new, ABI breaking code ... + ... new, ABI breaking code ... #else - ... old, ABI preserving code ... + ... old, ABI preserving code ... #endif - Note: In FLTK 1.3.x this preprocessor macro was named FLTK_ABI_VERSION. - In FLTK 1.4.0 FLTK_ABI_VERSION was renamed to FL_ABI_VERSION. + Note: In FLTK 1.3.x this preprocessor macro was named FLTK_ABI_VERSION. + In FLTK 1.4.0 FLTK_ABI_VERSION was renamed to FL_ABI_VERSION. This documentation is written for FLTK 1.4.x, but it applies to all later versions as well. Replace the version numbers given here with the version @@ -53,9 +53,9 @@ the version number. ---------------------------------------------------------- Run - make clean - ./configure --with-abiversion=10401 - make + make clean + ./configure --with-abiversion=10401 + make This will generate FL/abi-version.h and build FLTK as usual. @@ -72,11 +72,11 @@ the version number. ABI version, use ccmake, cmake-gui, or run cmake with the following command: - cmake -D OPTION_ABI_VERSION:STRING=10401 /path/to/fltk + cmake -D OPTION_ABI_VERSION:STRING=10401 /path/to/fltk Then execute - make + make You can define OPTION_ABI_VERSION to the required version number using one of the graphical CMake tools. diff --git a/README.bundled-libs.txt b/README.bundled-libs.txt index f47ccee30..f1cb3a766 100644 --- a/README.bundled-libs.txt +++ b/README.bundled-libs.txt @@ -14,7 +14,7 @@ Current versions of bundled libraries: ** work in progress -- not yet completely upgraded ** - Library Version Release date FLTK Version + Library Version Release date FLTK Version -------------------------------------------------------------------------- jpeg jpeg-9c 2018-01-14 1.4.0 nanosvg f31098fa85 [1] 2019-05-23 1.4.0 @@ -23,7 +23,7 @@ Current versions of bundled libraries: Previous versions of bundled libraries: - Library Version Release date FLTK Version + Library Version Release date FLTK Version ------------------------------------------------------------------ nanosvg ce81a6577c [1] 2018-07-01 1.4.0 jpeg jpeg-9a 2014-01-19 1.3.5 diff --git a/README.macOS.md b/README.macOS.md index c804e5a72..6cef26876 100644 --- a/README.macOS.md +++ b/README.macOS.md @@ -33,7 +33,7 @@ _README.macOS.md - Building FLTK under Apple macOS_ * [Testing FLTK](#bam_test) * [Installing FLTK](#bam_install) * [Creating new Projects](#bam_new_projects) - + * [Make an Application Launchable by Dropping Files on its Icon](#dropstart) * [Document History](#doc_history) @@ -67,16 +67,16 @@ This option requires an Apple ID and the Administrator password. In order to build FLTK, you need to install _CMake_ and _Xcode_. -_Xcode_ is Apple's IDE (Integrated Devloper Environment) and can be downloaded via the +_Xcode_ is Apple's IDE (Integrated Devloper Environment) and can be downloaded via the [App Store](https://itunes.apple.com/de/app/xcode/id497799835?l=en&mt=12). You will need an Apple ID and administrator right for this. Installing _Xcode_ needs little to no user input, but will likely take well over an hour. -"CMake is used to control the software compilation process using simple platform and +"CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice." -Please download and install the Mac OS X version of _CMake_ from +Please download and install the Mac OS X version of _CMake_ from [www.cmake.org](https://cmake.org/download/). Download the .dmg file, click it, and when the Finder window opens, drag the _CMake_ icon into the Applications folder. @@ -88,24 +88,24 @@ You will need to clone the repository to check out the source code onto your mac has the great benefit that the source code can be updated later simply by telling _git_ to _pull_ the newest release. -If you want to use _Xcode_ to clone the FLTK GitHub repository, you will have to give _Xcode_ +If you want to use _Xcode_ to clone the FLTK GitHub repository, you will have to give _Xcode_ access to your GitHub Account in the _Xcode_ preferences. If you don't have a GitHub -account, or don't want to share your credentials with _Xcode_, you can use still the command -line `git clone https://github.com/fltk/fltk.git fltk-1.4.git` +account, or don't want to share your credentials with _Xcode_, you can use still the command +line `git clone https://github.com/fltk/fltk.git fltk-1.4.git` to ceck out the repo. -Start _Xcode_. Select `Source Control >> Clone...` in the main menu. +Start _Xcode_. Select `Source Control >> Clone...` in the main menu. -A dialog box will open with a search field and a list of repositories. Enter `fltk/fltk` in -the search field. A list of matchin repositories appears. The first one should be named `fltk` +A dialog box will open with a search field and a list of repositories. Enter `fltk/fltk` in +the search field. A list of matchin repositories appears. The first one should be named `fltk` and be owned by `fltk`. Select it and click _Clone_. A file chooser appears. Navigate to your home directory. The create a new folder named `dev`. Enter `fltk-1.4.git` in the _Save As:_ field and click _Clone_, then _Done_ in the -previous dialog. +previous dialog. The local copy of your repository can be updated by loading it into _Xcode_ and selecting -`Source Control >> Pull...` in the main menu. +`Source Control >> Pull...` in the main menu. <a name="bcx_config"></a> ### Configuring FLTK (CMake, Xcode) @@ -120,7 +120,7 @@ The next input field is marked _Where to build the binaries:_. Click _Browse Bui and navigate to your home folder, then `dev`, then `fltk-1.4.git`, then use _New Folder_ to create a folder named `build`, and inside that, create a folder named `Xcode`. Click _Open_. -The top two input fields should read +The top two input fields should read ``` /Users/your_name/dev/fltk-1.4.git ``` @@ -129,17 +129,17 @@ and /Users/your_name/dev/fltk-1.4.git/build/Xcode ``` -Back in the _CMake_ main window, click _Configure_, select _Xcode_ as the generator and +Back in the _CMake_ main window, click _Configure_, select _Xcode_ as the generator and click _Done_. _CMake_ will now analyse your system and find tools and dependencies. When -done, the upper list field in _CMake_ will show CMAKE, FLTK, and OPTION. Open the OPTION +done, the upper list field in _CMake_ will show CMAKE, FLTK, and OPTION. Open the OPTION field and find the entries OPTION_USE_SYSTEM_LIBJPEG and OPTION_USE_SYSTEM_LIBPNG, and disable both for maximum compatibility with other macOS installation. Finally, click _Generate_ to generate the _Xcode_ IDE file. -You may be wondering why we chose this rather involved way of creating the IDE files instead +You may be wondering why we chose this rather involved way of creating the IDE files instead of just including the IDEs in the repo. Well, we did for the longest time, but creating new IDEs -for every possible platform is quite involved. IDE file formats change, platforms change, and +for every possible platform is quite involved. IDE file formats change, platforms change, and FLTK changes as well, and maintenance of the IDEs had become a nightmare. _CMake_ on the other hand is very smart, knows about platforms and IDEs that we could never support manually, and usually needs to be run only once. Even when updating the FLTK source code later, @@ -149,22 +149,22 @@ _CMake_ will be smart enough to update the build files as well. ### Building FLTK (CMake, Xcode) Now this is easy if all the previous steps were successful. If you are still in _CMake_, just click -_Open Project_ and _CMake_ will launch _XCode_ for you. If not, just launch _XCode_ and +_Open Project_ and _CMake_ will launch _XCode_ for you. If not, just launch _XCode_ and open `Macintosh HD ▸ Users ▸ your_name ▸ dev ▸ fltk-1.4.git ▸ build ▸ Xcode ▸ FLTK.xcodeproj`. _XCode_ may or may not ask to Autocreate Schemes. Click _Automatically Create Schemes_. -In _Xcode_, set the 'active Scheme' to 'hello' or any other test program and press CMD+R +In _Xcode_, set the 'active Scheme' to 'hello' or any other test program and press CMD+R to compile and run that application. <a name="bcx_test"></a> ### Testing FLTK (CMake, Xcode) -After a successful build, you can test FLTK's capabilities by choosing 'ALL_BUILD' as the -'active Scheme' and pressing CMD+B to build, then choosing 'demo' and pressing CMD+R to -run the demo program. +After a successful build, you can test FLTK's capabilities by choosing 'ALL_BUILD' as the +'active Scheme' and pressing CMD+B to build, then choosing 'demo' and pressing CMD+R to +run the demo program. -TODO: as of Jan 2019, compiling 'demo' will not compile any of the other demo programs. +TODO: as of Jan 2019, compiling 'demo' will not compile any of the other demo programs. We really have to update the dependencies! <a name="bcx_install"></a> @@ -176,15 +176,15 @@ permission. <a name="bcx_new_projects"></a> ### Creating new Projects (CMake, Xcode) -TODO: we still need to write a simple CMake file for creating a minimal cross platform app. +TODO: we still need to write a simple CMake file for creating a minimal cross platform app. <a name="build_cmake_make"></a> ## How to Build FLTK Using _CMake_ and _make_ This option is best for users who like to develop their apps without using Apple's Xcode IDE, -but like the advantages of _CMake_ over _autoconf_. Users should be comfortable with -using `bash` or `tcsh` in a terminal window. +but like the advantages of _CMake_ over _autoconf_. Users should be comfortable with +using `bash` or `tcsh` in a terminal window. This option requires neither administrator rights, nor an Apple ID. @@ -193,15 +193,15 @@ This option requires neither administrator rights, nor an Apple ID. In order to build FLTK, you need to install _CMake_ and the _Xcode_ command line tools. -"CMake is used to control the software compilation process using simple platform and +"CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice." -Please download and install the Mac OS X version of _CMake_ from +Please download and install the Mac OS X version of _CMake_ from [www.cmake.org](https://cmake.org/download/). Download the .dmg file, click it, and when the Finder window opens, drag the _CMake_ icon into the Applications folder. -We will be using _CMake_ from the command line. Please launch _CMake_ and choose +We will be using _CMake_ from the command line. Please launch _CMake_ and choose `Tools > How to Install for Command Line Use` and follow the instructions in the dialog box. If you have admin right, you can also use @@ -209,14 +209,14 @@ in the dialog box. If you have admin right, you can also use sudo ln -s /Applications/CMake.app/Contents/bin/cmake /usr/local/bin/cmake ``` -Installing the _Xcode_ command line tools is pretty straight forward. Just enter this +Installing the _Xcode_ command line tools is pretty straight forward. Just enter this in your shell and follow the dialogs: ```bash xcode-select --install ``` -On older versions of macOS, you will have to install _Xcode_ from the +On older versions of macOS, you will have to install _Xcode_ from the [App Store](https://itunes.apple.com/de/app/xcode/id497799835?l=en&mt=12) and then install the command line tools from within _Xcode_. @@ -253,15 +253,15 @@ cmake -G "Unix Makefiles" \ _CMake_ runs a number of tests to find external headers, libraries, and tools. The configuration summary should not show any errors. You can now continue to build FLTK. -For the advanced user, there are a few more optinons to the _CMake_ setup. Type -`cmake -L ../..` to get a complete list of options. These should be pretty -self-explanatory. Some more details can be found in +For the advanced user, there are a few more optinons to the _CMake_ setup. Type +`cmake -L ../..` to get a complete list of options. These should be pretty +self-explanatory. Some more details can be found in [online documentation](https://www.fltk.org/doc-1.4/intro.html#intro_unix). <a name="bcm_build"></a> ### Building FLTK (CMake, make) -Now this is easy if all the previous steps were successful. Stay in your `build/Makefiles` +Now this is easy if all the previous steps were successful. Stay in your `build/Makefiles` directory and type: ```bash @@ -308,7 +308,7 @@ file is: fltk-config --compile myProgram.cxx ``` -`fltk-config` and our user interface designer `fluid` will be installed in +`fltk-config` and our user interface designer `fluid` will be installed in `/usr/local/bin/` by default. I recommend that you add this directory to the shell `PATH` variable. @@ -317,35 +317,35 @@ fltk-config --compile myProgram.cxx ## How to Build FLTK Using _autoconf_ and _make_ This option is best for users who like to develop their apps without using Apple's Xcode IDE -and prefer minimal dependencies of a _Makefile_ over _CMake_. Users should be comfortable -with using `bash` or `tcsh` in a terminal window. +and prefer minimal dependencies of a _Makefile_ over _CMake_. Users should be comfortable +with using `bash` or `tcsh` in a terminal window. This option requires administrator rights, but no Apple ID. <a name="bam_prerequisites"></a> ### Prerequisites (autoconf, make) -In order to build FLTK from the command line, you need to install a C++ compiler +In order to build FLTK from the command line, you need to install a C++ compiler environment, `make` and `autoconf`. Installing the _Xcode_ command line tools is the easiest way to get all prerequisites in one simple step. <a name="xcode_command_line_tools"></a> -Launch _Terminal.app_ by pressing Command+Spacebar and typing `Terminal` and pressing _return_. +Launch _Terminal.app_ by pressing Command+Spacebar and typing `Terminal` and pressing _return_. I like to keep the Terminal in the Dock for future use (launch Terminal, right-click or control-click on the Terminal icon that is now in the docking bar, and choose _Options_->_Keep in Dock_). -Installing the _Xcode_ command line tools is pretty straight forward. Just enter this +Installing the _Xcode_ command line tools is pretty straight forward. Just enter this and follow the dialogs: ```bash xcode-select --install ``` -On older versions of macOS, you will have to install _Xcode_ from the +On older versions of macOS, you will have to install _Xcode_ from the [App Store](https://itunes.apple.com/de/app/xcode/id497799835?l=en&mt=12) and then install the command line tools from within _Xcode_. -Apple no longer includes _autoconf_ in the _Xcode_ command line tools. To install +Apple no longer includes _autoconf_ in the _Xcode_ command line tools. To install _autoconf_, we first need to installe _brew_ by typing this rather cryptic command in the shell you will need the root password): @@ -390,7 +390,7 @@ cd fltk-1.4.git Using you shell in the terminal, make sure that you are in the root directory of your FLTK source code tree. -If you are configuring fltk for the first time, you need to instruct FLTK to create some +If you are configuring fltk for the first time, you need to instruct FLTK to create some very basic configuration files. Type: ```bash @@ -408,15 +408,15 @@ and type The configuration script runs a number of tests to find external headers, libraries, and tools. The configuration summary should not show any errors. You can now continue to build FLTK. -For the advanced user, there are a few more optinons to the _configure_ script. Type -`./configure --help` to get a complete list of options. These should be pretty -self-explanatory. Some more details can be found in +For the advanced user, there are a few more optinons to the _configure_ script. Type +`./configure --help` to get a complete list of options. These should be pretty +self-explanatory. Some more details can be found in [online documentation](https://www.fltk.org/doc-1.4/intro.html#intro_unix). <a name="bam_build"></a> ### Building FLTK (autoconf, make) -Now this is easy if all the previous steps were successful. Stay in your FLTK source-code +Now this is easy if all the previous steps were successful. Stay in your FLTK source-code directory and type: ```bash @@ -472,7 +472,7 @@ fltk-config --compile main.cxx ./main ``` -`fltk-config` and our user interface designer `fluid` will be installed in +`fltk-config` and our user interface designer `fluid` will be installed in `/usr/local/bin/` by default. I recommend that you add this directory to the shell `PATH` variable. diff --git a/README.txt b/README.txt index af3292276..2e4c3e8df 100644 --- a/README.txt +++ b/README.txt @@ -28,7 +28,7 @@ ON-LINE DOCUMENTATION starting point. PostScript(tm) and PDF versions of this documentation is also available from the FLTK web site at: - http://www.fltk.org/documentation.php + https://www.fltk.org/documentation.php BUILDING AND INSTALLING FLTK UNDER UNIX AND Mac OS X @@ -54,22 +54,22 @@ BUILDING AND INSTALLING FLTK UNDER UNIX AND Mac OS X You can run configure yourself to get the exact setup you need. Type "./configure <options>". Options include: - --enable-cygwin - Enable the Cygwin libraries (Windows) - --enable-debug - Enable debugging code & symbols - --disable-gl - Disable OpenGL support - --enable-shared - Enable generation of shared libraries - --enable-threads - Enable multithreading support - --enable-xdbe - Enable the X double-buffer extension - --enable-xft - Enable the Xft library (anti-aliased fonts) - - --bindir=/path - Set the location for executables - [default = /usr/local/bin] - --libdir=/path - Set the location for libraries - [default = /usr/local/lib] - --includedir=/path - Set the location for include files. - [default = /usr/local/include] - --prefix=/dir - Set the directory prefix for files - [default = /usr/local] + --enable-cygwin - Enable the Cygwin libraries (Windows) + --enable-debug - Enable debugging code & symbols + --disable-gl - Disable OpenGL support + --enable-shared - Enable generation of shared libraries + --enable-threads - Enable multithreading support + --enable-xdbe - Enable the X double-buffer extension + --enable-xft - Enable the Xft library (anti-aliased fonts) + + --bindir=/path - Set the location for executables + [default = /usr/local/bin] + --libdir=/path - Set the location for libraries + [default = /usr/local/lib] + --includedir=/path - Set the location for include files. + [default = /usr/local/include] + --prefix=/dir - Set the directory prefix for files + [default = /usr/local] When the configure script is done you can just run the "make" command. This will build the library, FLUID tool, and @@ -119,11 +119,11 @@ BUILDING HTML DOCUMENTATION If you want to build the HTML documentation: - ( cd documentation && make html ) + ( cd documentation && make html ) If you want to build the PDF documentation: - ( cd documentation && make pdf ) + ( cd documentation && make pdf ) FLTK uses doxygen for documentation, so you'll at least need doxygen installed for creating html docs, and LaTeX for creating PDF docs. @@ -133,19 +133,19 @@ INTERNET RESOURCES FLTK is available on the 'net in a bunch of locations: - - WWW: http://www.fltk.org/ - http://www.fltk.org/str.php [for reporting bugs] - http://www.fltk.org/software.php [source code] + - WWW: https://www.fltk.org/ + https://www.fltk.org/bugs.php [for reporting bugs] + https://www.fltk.org/software.php [source code] To join the FLTK mailing list, go the following web page: - http://www.fltk.org/newsgroups.php + https://www.fltk.org/newsgroups.php REPORTING BUGS To report a bug in FLTK, use the form at: - http://www.fltk.org/str.php + https://www.fltk.org/bugs.php For general support and questions, please use the FLTK mailing list at "fltk@fltk.org". @@ -169,5 +169,4 @@ COPYRIGHT 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 - + https://www.fltk.org/COPYING.php diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx index de70d33df..28c0079f1 100644 --- a/cairo/Fl_Cairo.cxx +++ b/cairo/Fl_Cairo.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Main header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -37,7 +35,7 @@ #endif // static Fl module initialization : -Fl_Cairo_State Fl::cairo_state_; ///< contains all necessary info for current cairo context mapping +Fl_Cairo_State Fl::cairo_state_; ///< contains all necessary info for current cairo context mapping // Fl cairo features implementation @@ -49,11 +47,11 @@ void Fl_Cairo_State::autolink(bool b) { autolink_ = b; #else Fl::fatal("In Fl::autolink(bool) : Cairo autolink() feature is only " - "available with the enable-cairoext configure option, now quitting."); + "available with the enable-cairoext configure option, now quitting."); #endif } -/** +/** Provides a corresponding cairo context for window \a wi. This is needed in a draw() override if Fl::cairo_autolink_context() returns false, which is the default. @@ -71,16 +69,16 @@ void Fl_Cairo_State::autolink(bool b) { */ cairo_t * Fl::cairo_make_current(Fl_Window* wi) { if (!wi) return NULL; // Precondition - + if (fl_gc==0) { // means remove current cc - Fl::cairo_cc(0); // destroy any previous cc - cairo_state_.window(0); - return 0; + Fl::cairo_cc(0); // destroy any previous cc + cairo_state_.window(0); + return 0; } // don't re-create a context if it's the same gc/window couple if (fl_gc==Fl::cairo_state_.gc() && fl_xid(wi) == (Window) Fl::cairo_state_.window()) - return Fl::cairo_cc(); + return Fl::cairo_cc(); cairo_state_.window(wi); @@ -100,7 +98,7 @@ cairo_t * Fl::cairo_make_current(Fl_Window* wi) { return cairo_ctxt; } -/* +/* Creates transparently a cairo_surface_t object. gc is an HDC context in Windows, a CGContext* in Quartz, and a display on X11 (not used on this platform) @@ -118,7 +116,7 @@ static cairo_surface_t * cairo_create_surface(void * gc, int W, int H) { # endif } -/** +/** Creates a cairo context from a \a gc only, gets its window size or offscreen size if fl_window is null. \note Only available when configure has the --enable-cairo option @@ -129,7 +127,7 @@ cairo_t * Fl::cairo_make_current(void *gc) { //FIXME X11 get W,H // gc will be the window handle here # warning FIXME get W,H for cairo_make_current(void*) -#elif defined(__APPLE_QUARTZ__) +#elif defined(__APPLE_QUARTZ__) if (fl_window) { W = Fl_Window::current()->w(); H = Fl_Window::current()->h(); @@ -144,14 +142,14 @@ cairo_t * Fl::cairo_make_current(void *gc) { # error Cairo is not supported on this platform. #endif if (!gc) { - Fl::cairo_cc(0); - cairo_state_.gc(0); // keep track for next time - return 0; + Fl::cairo_cc(0); + cairo_state_.gc(0); // keep track for next time + return 0; } - if (gc==Fl::cairo_state_.gc() && - fl_window== (Window) Fl::cairo_state_.window() && - cairo_state_.cc()!=0) - return Fl::cairo_cc(); + if (gc==Fl::cairo_state_.gc() && + fl_window== (Window) Fl::cairo_state_.window() && + cairo_state_.cc()!=0) + return Fl::cairo_cc(); cairo_state_.gc(fl_gc); // keep track for next time cairo_surface_t * s = cairo_create_surface(gc, W, H); cairo_t * c = cairo_create(s); @@ -160,15 +158,15 @@ cairo_t * Fl::cairo_make_current(void *gc) { return c; } -/** - Creates a cairo context from a \a gc and its size +/** + Creates a cairo context from a \a gc and its size \note Only available when configure has the --enable-cairo option */ cairo_t * Fl::cairo_make_current(void *gc, int W, int H) { - if (gc==Fl::cairo_state_.gc() && - fl_window== (Window) Fl::cairo_state_.window() && - cairo_state_.cc()!=0) // no need to create a cc, just return that one - return cairo_state_.cc(); + if (gc==Fl::cairo_state_.gc() && + fl_window== (Window) Fl::cairo_state_.window() && + cairo_state_.cc()!=0) // no need to create a cc, just return that one + return cairo_state_.cc(); // we need to (re-)create a fresh cc ... cairo_state_.gc(gc); // keep track for next time @@ -183,7 +181,3 @@ cairo_t * Fl::cairo_make_current(void *gc, int W, int H) { #include <FL/Fl_Export.H> FL_EXPORT int fltk_cairo_dummy() { return 1;} #endif // FLTK_HAVE_CAIRO - -// -// End of "$Id$" . -// diff --git a/cairo/Makefile b/cairo/Makefile index 56f08edaa..c933f8504 100644 --- a/cairo/Makefile +++ b/cairo/Makefile @@ -1,6 +1,4 @@ # -# "$Id$" -# # CAIRO library makefile for the Fast Light Toolkit (FLTK). # # Copyright 1997-2009 by Easy Software Products. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # Note: see ../configure.in and/or ../makeinclude for definition of @@ -172,7 +170,3 @@ depend: $(CAIROCPPFILES) mv makedepend.tmp makedepend include makedepend - -# -# End of "$Id$". -# diff --git a/configh.cmake.in b/configh.cmake.in index 8b6a86985..b47774498 100644 --- a/configh.cmake.in +++ b/configh.cmake.in @@ -1,7 +1,5 @@ /* @CONFIG_H@. Generated from @CONFIG_H_IN@ by CMake. */ /* - * "$Id$" - * * Configuration file for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2016 by Bill Spitzak and others. @@ -10,11 +8,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -372,7 +370,3 @@ */ #cmakedefine FL_CFG_NO_FILESYSTEM_SUPPORT 1 - -/* - * End of "$Id$". - */ diff --git a/configh.in b/configh.in index 65d90dc6d..f3133d7a2 100644 --- a/configh.in +++ b/configh.in @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Configuration file for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -366,7 +364,3 @@ */ #undef FL_CFG_NO_FILESYSTEM_SUPPORT - -/* - * End of "$Id$". - */ diff --git a/configure.ac b/configure.ac index 20fcbe05a..921b17814 100644 --- a/configure.ac +++ b/configure.ac @@ -11,9 +11,9 @@ dnl file is missing or damaged, see the license at: dnl dnl https://www.fltk.org/COPYING.php dnl -dnl Please report all bugs and problems on the following page: +dnl Please see the following page on how to report bugs and issues: dnl -dnl https://www.fltk.org/str.php +dnl https://www.fltk.org/bugs.php dnl dnl We need at least autoconf 2.50... @@ -49,10 +49,10 @@ AC_PROG_CXX dnl So --with-archflags option is used during "checking size of long" case $host_os in darwin*) - if test "x$with_archflags" != x ; then - CFLAGS="$CFLAGS $with_archflags" - fi - ;; + if test "x$with_archflags" != x ; then + CFLAGS="$CFLAGS $with_archflags" + fi + ;; esac dnl FLTK library versions... @@ -81,26 +81,26 @@ dnl host_os_gui equals $host_os unless we target Cygwin or Darwin in combination host_os_gui=$host_os case $host_os in cygwin*) - # Handle Cygwin option *first*, before all other tests. - AC_ARG_ENABLE(cygwin, [ --enable-cygwin use the Cygwin libraries [[default=no]]]) - AC_ARG_ENABLE(x11, [ --enable-x11 with Cygwin or Mac OS, use X11 [[default=no]]]) - if test x$enable_cygwin = xyes; then - # we target Cygwin in combination with X11 - if test x$enable_x11 = xyes; then - host_os_gui="X11$host_os" - fi - fi - ;; + # Handle Cygwin option *first*, before all other tests. + AC_ARG_ENABLE(cygwin, [ --enable-cygwin use the Cygwin libraries [[default=no]]]) + AC_ARG_ENABLE(x11, [ --enable-x11 with Cygwin or Mac OS, use X11 [[default=no]]]) + if test x$enable_cygwin = xyes; then + # we target Cygwin in combination with X11 + if test x$enable_x11 = xyes; then + host_os_gui="X11$host_os" + fi + fi + ;; darwin*) - if test x$enable_x11 = xyes; then - host_os_gui="X11" - OPTIM="-U__APPLE__ $OPTIM" - macosversion=`sw_vers -productVersion | cut -d. -f2` - if test $macosversion -ge "13" ; then - CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.9 -D_LIBCPP_HAS_THREAD_API_PTHREAD" - fi - fi - ;; + if test x$enable_x11 = xyes; then + host_os_gui="X11" + OPTIM="-U__APPLE__ $OPTIM" + macosversion=`sw_vers -productVersion | cut -d. -f2` + if test $macosversion -ge "13" ; then + CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.9 -D_LIBCPP_HAS_THREAD_API_PTHREAD" + fi + fi + ;; *) ;; esac @@ -140,30 +140,30 @@ AC_ARG_ENABLE(cairoext,[ --enable-cairoext use fltk code instrumentation AC_ARG_ENABLE(cairo, [ --enable-cairo use lib Cairo [[default=no]]]) if test x$enable_cairoext = xyes; then - AC_DEFINE(FLTK_USE_CAIRO) - AC_DEFINE(FLTK_HAVE_CAIRO) - dnl FIXME This part should be fixed so configure do not depend on - dnl we do not rely on pkg-config . - CAIRODIR="cairo" - CAIROFLAGS="`pkg-config --cflags cairo`" - CAIROLIBS="-lcairo -lpixman-1" - CXXFLAGS="$CAIROFLAGS $CXXFLAGS" - LINKFLTKCAIRO="../lib/libfltk_cairo.a" - FLTKCAIROOPTION="-L ../cairo -lfltk_cairo$SHAREDSUFFIX" - LIBS="$CAIROLIBS $LIBS" - dnl $LINKFLTKCAIRO - LINKFLTK+=" $LINKFLTKCAIRO" + AC_DEFINE(FLTK_USE_CAIRO) + AC_DEFINE(FLTK_HAVE_CAIRO) + dnl FIXME This part should be fixed so configure do not depend on + dnl we do not rely on pkg-config . + CAIRODIR="cairo" + CAIROFLAGS="`pkg-config --cflags cairo`" + CAIROLIBS="-lcairo -lpixman-1" + CXXFLAGS="$CAIROFLAGS $CXXFLAGS" + LINKFLTKCAIRO="../lib/libfltk_cairo.a" + FLTKCAIROOPTION="-L ../cairo -lfltk_cairo$SHAREDSUFFIX" + LIBS="$CAIROLIBS $LIBS" + dnl $LINKFLTKCAIRO + LINKFLTK+=" $LINKFLTKCAIRO" else if test x$enable_cairo = xyes; then - AC_DEFINE(FLTK_HAVE_CAIRO) - dnl FIXME This part should be fixed so configure do not depend on - dnl we do not rely on pkg-config . - CAIRODIR="cairo" - CAIROFLAGS="`pkg-config --cflags cairo`" - CAIROLIBS="-lcairo -lpixman-1" - CXXFLAGS="$CAIROFLAGS $CXXFLAGS" - LINKFLTKCAIRO="../lib/libfltk_cairo.a" - FLTKCAIROOPTION="-L ../cairo -lfltk_cairo$SHAREDSUFFIX" + AC_DEFINE(FLTK_HAVE_CAIRO) + dnl FIXME This part should be fixed so configure do not depend on + dnl we do not rely on pkg-config . + CAIRODIR="cairo" + CAIROFLAGS="`pkg-config --cflags cairo`" + CAIROLIBS="-lcairo -lpixman-1" + CXXFLAGS="$CAIROFLAGS $CXXFLAGS" + LINKFLTKCAIRO="../lib/libfltk_cairo.a" + FLTKCAIROOPTION="-L ../cairo -lfltk_cairo$SHAREDSUFFIX" fi fi @@ -228,156 +228,156 @@ if test x$enable_shared = xyes; then FLUID="fluid-shared" case $host_os in - darwin*) - DSONAME="libfltk.$FL_DSO_VERSION.dylib" - FLDSONAME="libfltk_forms.$FL_DSO_VERSION.dylib" - GLDSONAME="libfltk_gl.$FL_DSO_VERSION.dylib" - IMGDSONAME="libfltk_images.$FL_DSO_VERSION.dylib" - CAIRODSONAME="libfltk_cairo.$FL_DSO_VERSION.dylib" - DSOCOMMAND="\$(CXX) \$(ARCHFLAGS) \$(DSOFLAGS) -dynamiclib -lc -o" - ;; - - solaris*) - DSONAME="libfltk.so.$FL_DSO_VERSION" - FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" - GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" - IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" - CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" - DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o" - if test "x$libdir" != "x/usr/lib"; then - DSOLINK="-R$libdir" - fi - ;; - hpux*) - DSONAME="libfltk.sl.$FL_DSO_VERSION" - FLDSONAME="libfltk_forms.sl.$FL_DSO_VERSION" - GLDSONAME="libfltk_gl.sl.$FL_DSO_VERSION" - IMGDSONAME="libfltk_images.sl.$FL_DSO_VERSION" - CAIRODSONAME="libfltk_cairo.sl.$FL_DSO_VERSION" - DSOCOMMAND="ld \$(DSOFLAGS) -b -z +h \$@ $DEBUGFLAG -o" - if test "x$libdir" != "x/usr/lib"; then - DSOLINK="-Wl,-rpath,$libdir" - fi - ;; - irix*) - DSONAME="libfltk.so.$FL_DSO_VERSION" - FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" - GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" - IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" - CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" - DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@,-set_version,sgi1.1 \$(LDLIBS) -shared $DEBUGFLAG -o" - if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib32" -a "x$libdir" != "x/usr/lib64"; then - DSOLINK="-Wl,-rpath,$libdir" - fi - ;; - osf*) - DSONAME="libfltk.so.$FL_DSO_VERSION" - FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" - GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" - IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" - CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" - DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o" - if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib32"; then - DSOLINK="-Wl,-rpath,$libdir" - fi - ;; - linux* | *bsd*) - DSONAME="libfltk.so.$FL_DSO_VERSION" - FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" - GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" - IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" - CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" - DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o" - - # See if the compiler supports -fvisibility... - AC_CACHE_CHECK([if the compiler supports -fvisibility], - ac_cv_cxx_fvisibility, [ - OLDCXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fvisibility=hidden" - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [ac_cv_cxx_fvisibility=yes], - [ac_cv_cxx_fvisibility=no]) - CXXFLAGS="$OLDCXXFLAGS" - AC_LANG_POP([]) - ]) - if test x"$ac_cv_cxx_fvisibility" = xyes; then - OPTIM="$OPTIM -fvisibility=hidden" - fi - - # See if the compiler supports -fvisibility-inlines-hidden... - AC_CACHE_CHECK([if the compiler supports -fvisibility-inlines-hidden], - ac_cv_cxx_fvisibility_inlines, [ - OLDCXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [ac_cv_cxx_fvisibility_inlines=yes], - [ac_cv_cxx_fvisibility_inlines=no]) - CXXFLAGS="$OLDCXXFLAGS" - AC_LANG_POP([]) - ]) - if test x"$ac_cv_cxx_fvisibility_inlines" = xyes; then - CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" - fi - - if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib64"; then - DSOLINK="-Wl,-rpath,$libdir" - fi - ;; - aix*) - DSONAME="libfltk_s.a" - FLDSONAME="libfltk_forms_s.a" - GLDSONAME="libfltk_gl_s.a" - IMGDSONAME="libfltk_images_s.a" - CAIRODSONAME="libfltk_cairo_s.a" - DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-bexpall,-bM:SRE,-bnoentry -o" - SHAREDSUFFIX="_s" - ;; - cygwin* | mingw*) - PICFLAG=0 - if test x$enable_cygwin != xyes; then - DSONAME="mgwfltknox-$FL_DSO_VERSION.dll" - FLDSONAME="mgwfltknox_forms-$FL_DSO_VERSION.dll" - GLDSONAME="mgwfltknox_gl-$FL_DSO_VERSION.dll" - IMGDSONAME="mgwfltknox_images-$FL_DSO_VERSION.dll" - CAIRODSONAME="mgwfltknox_cairo-$FL_DSO_VERSION.dll" - else - if test x$enable_x11 = xyes; then - DSONAME="cygfltk-$FL_DSO_VERSION.dll" - FLDSONAME="cygfltk_forms-$FL_DSO_VERSION.dll" - GLDSONAME="cygfltk_gl-$FL_DSO_VERSION.dll" - IMGDSONAME="cygfltk_images-$FL_DSO_VERSION.dll" - CAIRODSONAME="cygfltk_cairo-$FL_DSO_VERSION.dll" - else - DSONAME="cygfltknox-$FL_DSO_VERSION.dll" - FLDSONAME="cygfltknox_forms-$FL_DSO_VERSION.dll" - GLDSONAME="cygfltknox_gl-$FL_DSO_VERSION.dll" - IMGDSONAME="cygfltknox_images-$FL_DSO_VERSION.dll" - CAIRODSONAME="cygfltknox_cairo-$FL_DSO_VERSION.dll" - fi - fi - #----------------------------------------------------------- - # -Wl,--enable-runtime-pseudo-reloc: See str 1585 - # appears to be necessary for older binutils versions < 2.16 - #----------------------------------------------------------- - LDFLAGS="$LDFLAGS -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" - DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -shared \ - -Wl,--whole-archive -Wl,--export-all-symbols \ - -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-import \ - -Wl,--enable-auto-image-base -o \$@" - ;; - *) - AC_MSG_WARN([Shared libraries may not be supported. Trying -shared option with compiler.]) - DSONAME="libfltk.so.$FL_DSO_VERSION" - FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" - GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" - IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" - CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" - DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o" - ;; + darwin*) + DSONAME="libfltk.$FL_DSO_VERSION.dylib" + FLDSONAME="libfltk_forms.$FL_DSO_VERSION.dylib" + GLDSONAME="libfltk_gl.$FL_DSO_VERSION.dylib" + IMGDSONAME="libfltk_images.$FL_DSO_VERSION.dylib" + CAIRODSONAME="libfltk_cairo.$FL_DSO_VERSION.dylib" + DSOCOMMAND="\$(CXX) \$(ARCHFLAGS) \$(DSOFLAGS) -dynamiclib -lc -o" + ;; + + solaris*) + DSONAME="libfltk.so.$FL_DSO_VERSION" + FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" + GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" + IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" + CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" + DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o" + if test "x$libdir" != "x/usr/lib"; then + DSOLINK="-R$libdir" + fi + ;; + hpux*) + DSONAME="libfltk.sl.$FL_DSO_VERSION" + FLDSONAME="libfltk_forms.sl.$FL_DSO_VERSION" + GLDSONAME="libfltk_gl.sl.$FL_DSO_VERSION" + IMGDSONAME="libfltk_images.sl.$FL_DSO_VERSION" + CAIRODSONAME="libfltk_cairo.sl.$FL_DSO_VERSION" + DSOCOMMAND="ld \$(DSOFLAGS) -b -z +h \$@ $DEBUGFLAG -o" + if test "x$libdir" != "x/usr/lib"; then + DSOLINK="-Wl,-rpath,$libdir" + fi + ;; + irix*) + DSONAME="libfltk.so.$FL_DSO_VERSION" + FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" + GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" + IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" + CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" + DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@,-set_version,sgi1.1 \$(LDLIBS) -shared $DEBUGFLAG -o" + if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib32" -a "x$libdir" != "x/usr/lib64"; then + DSOLINK="-Wl,-rpath,$libdir" + fi + ;; + osf*) + DSONAME="libfltk.so.$FL_DSO_VERSION" + FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" + GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" + IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" + CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" + DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o" + if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib32"; then + DSOLINK="-Wl,-rpath,$libdir" + fi + ;; + linux* | *bsd*) + DSONAME="libfltk.so.$FL_DSO_VERSION" + FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" + GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" + IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" + CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" + DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o" + + # See if the compiler supports -fvisibility... + AC_CACHE_CHECK([if the compiler supports -fvisibility], + ac_cv_cxx_fvisibility, [ + OLDCXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fvisibility=hidden" + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [ac_cv_cxx_fvisibility=yes], + [ac_cv_cxx_fvisibility=no]) + CXXFLAGS="$OLDCXXFLAGS" + AC_LANG_POP([]) + ]) + if test x"$ac_cv_cxx_fvisibility" = xyes; then + OPTIM="$OPTIM -fvisibility=hidden" + fi + + # See if the compiler supports -fvisibility-inlines-hidden... + AC_CACHE_CHECK([if the compiler supports -fvisibility-inlines-hidden], + ac_cv_cxx_fvisibility_inlines, [ + OLDCXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [ac_cv_cxx_fvisibility_inlines=yes], + [ac_cv_cxx_fvisibility_inlines=no]) + CXXFLAGS="$OLDCXXFLAGS" + AC_LANG_POP([]) + ]) + if test x"$ac_cv_cxx_fvisibility_inlines" = xyes; then + CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" + fi + + if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib64"; then + DSOLINK="-Wl,-rpath,$libdir" + fi + ;; + aix*) + DSONAME="libfltk_s.a" + FLDSONAME="libfltk_forms_s.a" + GLDSONAME="libfltk_gl_s.a" + IMGDSONAME="libfltk_images_s.a" + CAIRODSONAME="libfltk_cairo_s.a" + DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-bexpall,-bM:SRE,-bnoentry -o" + SHAREDSUFFIX="_s" + ;; + cygwin* | mingw*) + PICFLAG=0 + if test x$enable_cygwin != xyes; then + DSONAME="mgwfltknox-$FL_DSO_VERSION.dll" + FLDSONAME="mgwfltknox_forms-$FL_DSO_VERSION.dll" + GLDSONAME="mgwfltknox_gl-$FL_DSO_VERSION.dll" + IMGDSONAME="mgwfltknox_images-$FL_DSO_VERSION.dll" + CAIRODSONAME="mgwfltknox_cairo-$FL_DSO_VERSION.dll" + else + if test x$enable_x11 = xyes; then + DSONAME="cygfltk-$FL_DSO_VERSION.dll" + FLDSONAME="cygfltk_forms-$FL_DSO_VERSION.dll" + GLDSONAME="cygfltk_gl-$FL_DSO_VERSION.dll" + IMGDSONAME="cygfltk_images-$FL_DSO_VERSION.dll" + CAIRODSONAME="cygfltk_cairo-$FL_DSO_VERSION.dll" + else + DSONAME="cygfltknox-$FL_DSO_VERSION.dll" + FLDSONAME="cygfltknox_forms-$FL_DSO_VERSION.dll" + GLDSONAME="cygfltknox_gl-$FL_DSO_VERSION.dll" + IMGDSONAME="cygfltknox_images-$FL_DSO_VERSION.dll" + CAIRODSONAME="cygfltknox_cairo-$FL_DSO_VERSION.dll" + fi + fi + #----------------------------------------------------------- + # -Wl,--enable-runtime-pseudo-reloc: See str 1585 + # appears to be necessary for older binutils versions < 2.16 + #----------------------------------------------------------- + LDFLAGS="$LDFLAGS -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" + DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -shared \ + -Wl,--whole-archive -Wl,--export-all-symbols \ + -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-import \ + -Wl,--enable-auto-image-base -o \$@" + ;; + *) + AC_MSG_WARN([Shared libraries may not be supported. Trying -shared option with compiler.]) + DSONAME="libfltk.so.$FL_DSO_VERSION" + FLDSONAME="libfltk_forms.so.$FL_DSO_VERSION" + GLDSONAME="libfltk_gl.so.$FL_DSO_VERSION" + IMGDSONAME="libfltk_images.so.$FL_DSO_VERSION" + CAIRODSONAME="libfltk_cairo.so.$FL_DSO_VERSION" + DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o" + ;; esac LINKSHARED="-L../src $FLTKCAIROOPTION -lfltk_images$SHAREDSUFFIX -lfltk_forms$SHAREDSUFFIX -lfltk$SHAREDSUFFIX" @@ -423,16 +423,16 @@ AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support AC_ARG_WITH(optim, [ --with-optim="flags" use custom optimization flags]) AC_ARG_WITH(archflags, [ --with-archflags="flags" - use custom architecture flags - (possible Mac OS X values include -arch i386, -arch x86_64, -arch ppc)], + use custom architecture flags + (possible Mac OS X values include -arch i386, -arch x86_64, -arch ppc)], ARCHFLAGS="$withval") dnl Find commands... AC_PROG_INSTALL case $host_os in osf*) - INSTALL="`pwd`/install-sh -c" - ;; + INSTALL="`pwd`/install-sh -c" + ;; esac if test "$INSTALL" = "$ac_install_sh"; then # Use full path to install-sh script... @@ -443,9 +443,9 @@ if test "x$NROFF" = "x:"; then # Try groff instead of nroff... AC_PATH_PROG(GROFF,groff) if test "x$GROFF" = "x:"; then - NROFF="echo" + NROFF="echo" else - NROFF="$GROFF -T ascii" + NROFF="$GROFF -T ascii" fi fi AC_PATH_PROG(DOXYDOC,doxygen) @@ -481,41 +481,41 @@ if test $ac_cv_sizeof_int -eq 4; then AC_DEFINE(U32,unsigned) else if test $ac_cv_sizeof_long -eq 4; then - AC_DEFINE(U32,unsigned long) + AC_DEFINE(U32,unsigned long) fi fi case $host_os in darwin*) - ;; + ;; *) - AC_C_BIGENDIAN - - if test $ac_cv_sizeof_int -eq 8; then - AC_DEFINE(U64,unsigned) - else - if test $ac_cv_sizeof_long -eq 8; then - AC_DEFINE(U64,unsigned long) - fi - fi - ;; + AC_C_BIGENDIAN + + if test $ac_cv_sizeof_int -eq 8; then + AC_DEFINE(U64,unsigned) + else + if test $ac_cv_sizeof_long -eq 8; then + AC_DEFINE(U64,unsigned long) + fi + fi + ;; esac dnl Does the C++ compiler support the bool type? AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type, ac_cv_cxx_bool,[ - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[ - int f(int x){return 1;} - int f(char x){return 1;} - int f(bool x){return 1;} - ]], [[ - bool b = true; - return f(b); - ]])], - [ac_cv_cxx_bool=yes], - [ac_cv_cxx_bool=no]) - AC_LANG_POP([]) + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + int f(int x){return 1;} + int f(char x){return 1;} + int f(bool x){return 1;} + ]], [[ + bool b = true; + return f(b); + ]])], + [ac_cv_cxx_bool=yes], + [ac_cv_cxx_bool=no]) + AC_LANG_POP([]) ]) if test "$ac_cv_cxx_bool" != yes; then @@ -529,19 +529,19 @@ AC_CHECK_HEADERS([sys/select.h sys/stdtypes.h]) dnl Do we have the POSIX compatible scandir() prototype? AC_CACHE_CHECK([whether we have the POSIX compatible scandir() prototype], ac_cv_cxx_scandir_posix,[ - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include <dirent.h> - int func (const char *d, dirent ***list, void *sort) { - int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); - return n; - } - ]], [[ - ]])], - [ac_cv_cxx_scandir_posix=yes], - [ac_cv_cxx_scandir_posix=no]) - AC_LANG_POP([]) + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <dirent.h> + int func (const char *d, dirent ***list, void *sort) { + int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); + return n; + } + ]], [[ + ]])], + [ac_cv_cxx_scandir_posix=yes], + [ac_cv_cxx_scandir_posix=no]) + AC_LANG_POP([]) ]) dnl Define both HAVE_SCANDIR... macros, if the POSIX compatible function is @@ -554,39 +554,39 @@ if test "$ac_cv_cxx_scandir_posix" = yes; then AC_DEFINE(HAVE_SCANDIR_POSIX) else AC_CHECK_FUNC(scandir,[ - case $host_os in - solaris* | *qnx*) - AC_MSG_WARN([Not using $host_os scandir emulation function.]) - ;; - *) - AC_DEFINE(HAVE_SCANDIR) - ;; - esac]) + case $host_os in + solaris* | *qnx*) + AC_MSG_WARN([Not using $host_os scandir emulation function.]) + ;; + *) + AC_DEFINE(HAVE_SCANDIR) + ;; + esac]) fi AC_CHECK_FUNC(vsnprintf,[ case $host_os in - hpux1020) - AC_MSG_WARN([Not using built-in vsnprintf function because you are running HP-UX 10.20.]) - ;; - osf4) - AC_MSG_WARN([Not using built-in vsnprintf function because you are running Tru64 4.0.]) - ;; - *) - AC_DEFINE(HAVE_VSNPRINTF) - ;; + hpux1020) + AC_MSG_WARN([Not using built-in vsnprintf function because you are running HP-UX 10.20.]) + ;; + osf4) + AC_MSG_WARN([Not using built-in vsnprintf function because you are running Tru64 4.0.]) + ;; + *) + AC_DEFINE(HAVE_VSNPRINTF) + ;; esac]) AC_CHECK_FUNC(snprintf,[ case $host_os in - hpux1020) - AC_MSG_WARN([Not using built-in snprintf function because you are running HP-UX 10.20.]) - ;; - osf4) - AC_MSG_WARN([Not using built-in snprintf function because you are running Tru64 4.0.]) - ;; - *) - AC_DEFINE(HAVE_SNPRINTF) - ;; + hpux1020) + AC_MSG_WARN([Not using built-in snprintf function because you are running HP-UX 10.20.]) + ;; + osf4) + AC_MSG_WARN([Not using built-in snprintf function because you are running Tru64 4.0.]) + ;; + *) + AC_DEFINE(HAVE_SNPRINTF) + ;; esac]) AC_CHECK_HEADERS(strings.h) AC_CHECK_FUNCS(strcasecmp strlcat strlcpy) @@ -603,32 +603,32 @@ AC_SYS_LARGEFILE dnl Define largefile options as needed... LARGEFILE="" if test x$enable_largefile != xno; then - LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" + LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" - if test x$ac_cv_sys_large_files = x1; then - LARGEFILE="$LARGEFILE -D_LARGE_FILES" - fi + if test x$ac_cv_sys_large_files = x1; then + LARGEFILE="$LARGEFILE -D_LARGE_FILES" + fi - if test x$ac_cv_sys_file_offset_bits = x64; then - LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64" - fi + if test x$ac_cv_sys_file_offset_bits = x64; then + LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64" + fi fi AC_SUBST(LARGEFILE) dnl Check for "long long" support... AC_CACHE_CHECK(for long long int, ac_cv_c_long_long, - [if test "$GCC" = yes; then - ac_cv_c_long_long=yes - else - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[long long int i;]])], - [ac_cv_c_long_long=yes], - [ac_cv_c_long_long=no]) - fi]) + [if test "$GCC" = yes; then + ac_cv_c_long_long=yes + else + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], + [[long long int i;]])], + [ac_cv_c_long_long=yes], + [ac_cv_c_long_long=no]) + fi]) if test $ac_cv_c_long_long = yes; then - AC_DEFINE(HAVE_LONG_LONG) + AC_DEFINE(HAVE_LONG_LONG) fi dnl Check for dlopen/dlsym... @@ -640,19 +640,19 @@ AUDIOLIBS="" case $host_os in cygwin* | mingw*) - dnl Cygwin environment... - AUDIOLIBS="-lwinmm" - ;; + dnl Cygwin environment... + AUDIOLIBS="-lwinmm" + ;; darwin*) - AUDIOLIBS="-framework CoreAudio" - ;; + AUDIOLIBS="-framework CoreAudio" + ;; *) - AC_CHECK_HEADER(alsa/asoundlib.h, - AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H) - AUDIOLIBS="-lasound") - ;; + AC_CHECK_HEADER(alsa/asoundlib.h, + AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H) + AUDIOLIBS="-lasound") + ;; esac AC_SUBST(AUDIOLIBS) @@ -674,11 +674,11 @@ syszlib_ok=no syszinc_ok=no if test x$enable_localzlib != xyes; then AC_CHECK_LIB(z,gzgets, - [AC_CHECK_HEADER(zlib.h, - syszinc_ok=yes) - if test x$syszinc_ok = xyes; then - syszlib_ok=yes - fi]) + [AC_CHECK_HEADER(zlib.h, + syszinc_ok=yes) + if test x$syszinc_ok = xyes; then + syszlib_ok=yes + fi]) fi # Now set the Z lib and include flags according to the requested mode and availability if test x$enable_localzlib = xyes -o x$syszlib_ok = xno ; then @@ -691,7 +691,7 @@ if test x$enable_localzlib = xyes -o x$syszlib_ok = xno ; then ac_cv_lib_z_gzgets=no # fc: is still necessary ? # Finally, warn user if system lib was requested but not found if test x$enable_localzlib = xno; then - AC_MSG_WARN([Cannot find system z lib or header: choosing the local lib mode.]) + AC_MSG_WARN([Cannot find system z lib or header: choosing the local lib mode.]) fi else ZLIBINC="" @@ -714,13 +714,13 @@ syspnginc_ok=no if test x$enable_localpng != xyes; then AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, - AC_DEFINE(HAVE_PNG_H) - syspnginc_ok=yes) + AC_DEFINE(HAVE_PNG_H) + syspnginc_ok=yes) AC_CHECK_HEADER(libpng/png.h, - AC_DEFINE(HAVE_LIBPNG_PNG_H) - syspnginc_ok=yes) + AC_DEFINE(HAVE_LIBPNG_PNG_H) + syspnginc_ok=yes) if test x$syspnginc_ok = xyes; then - syspnglib_ok=yes + syspnglib_ok=yes fi]) fi @@ -736,7 +736,7 @@ if test x$enable_localpng = xyes -o x$syspnglib_ok = xno ; then AC_DEFINE(HAVE_PNG_SET_TRNS_TO_ALPHA) # Finally, warn user if system lib was requested but not found if test x$enable_localpng = xno; then - AC_MSG_WARN([Cannot find system png lib or header: choosing the local lib mode.]) + AC_MSG_WARN([Cannot find system png lib or header: choosing the local lib mode.]) fi else PNGINC="" @@ -757,11 +757,11 @@ sysjpeglib_ok=no sysjpeginc_ok=no if test x$enable_localjpeg != xyes; then AC_CHECK_LIB(jpeg,jpeg_CreateCompress, - [AC_CHECK_HEADER(jpeglib.h, - sysjpeginc_ok=yes) - if test x$sysjpeginc_ok = xyes; then - sysjpeglib_ok=yes - fi]) + [AC_CHECK_HEADER(jpeglib.h, + sysjpeginc_ok=yes) + if test x$sysjpeginc_ok = xyes; then + sysjpeglib_ok=yes + fi]) fi # Now set the jpeg lib and include flags according to the requested mode and availability if test x$enable_localjpeg = xyes -o x$sysjpeglib_ok = xno; then @@ -772,7 +772,7 @@ if test x$enable_localjpeg = xyes -o x$sysjpeglib_ok = xno; then AC_DEFINE(HAVE_LIBJPEG) # Finally, warn user if system lib was requested but not found if test x$enable_localjpeg = xno; then - AC_MSG_WARN([Cannot find system jpeg lib or header: choosing the local lib mode.]) + AC_MSG_WARN([Cannot find system jpeg lib or header: choosing the local lib mode.]) fi else JPEGINC="" @@ -811,48 +811,48 @@ dnl native threads on Windows (even if libpthread is available) check_pthread=yes case $host_os in mingw*) - check_pthread=no - ;; + check_pthread=no + ;; cygwin*) - if test "x$enable_cygwin" != xyes; then - check_pthread=no - fi - ;; + if test "x$enable_cygwin" != xyes; then + check_pthread=no + fi + ;; *) - ;; + ;; esac if test "x$enable_threads" != xno -a x$check_pthread = xyes; then AC_CHECK_HEADERS(pthread.h) if test x$ac_cv_header_pthread_h = xyes; then - dnl Check various threading options for the platforms we support - for flag in -lpthreads -lpthread -pthread; do - AC_MSG_CHECKING([for pthread_create using $flag]) - SAVELIBS="$LIBS" - LIBS="$flag $LIBS" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include <pthread.h>]], - [[pthread_create(0, 0, 0, 0);]])], - [have_pthread=yes], - [LIBS="$SAVELIBS"]) - AC_MSG_RESULT([$have_pthread]) - - if test $have_pthread = yes; then - AC_DEFINE(HAVE_PTHREAD) - PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT" - - # Solaris requires -D_POSIX_PTHREAD_SEMANTICS to - # be POSIX-compliant... :( - case $host_os in - solaris*) - PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - break - fi - done + dnl Check various threading options for the platforms we support + for flag in -lpthreads -lpthread -pthread; do + AC_MSG_CHECKING([for pthread_create using $flag]) + SAVELIBS="$LIBS" + LIBS="$flag $LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <pthread.h>]], + [[pthread_create(0, 0, 0, 0);]])], + [have_pthread=yes], + [LIBS="$SAVELIBS"]) + AC_MSG_RESULT([$have_pthread]) + + if test $have_pthread = yes; then + AC_DEFINE(HAVE_PTHREAD) + PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT" + + # Solaris requires -D_POSIX_PTHREAD_SEMANTICS to + # be POSIX-compliant... :( + case $host_os in + solaris*) + PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + break + fi + done fi fi @@ -870,184 +870,184 @@ UNINSTALL_DESKTOP="" case $host_os_gui in cygwin* | mingw*) - dnl Cygwin environment, using windows GDI ... - # Recent versions of Cygwin are seriously broken and the size - # checks don't work because the shell puts out \r\n instead of - # \n. Here we just force U32 to be defined to "unsigned"... - AC_DEFINE(U32,unsigned) - # We do no longer define WIN32 or _WIN32 (since FLTK 1.4.0) - # and we don't need to define USE_OPENGL32 (added in svn r6657 - # but never used, see STR #2147) - # CFLAGS="-mwindows -D_WIN32 -DUSE_OPENGL32 $CFLAGS" - # CXXFLAGS="-mwindows -D_WIN32 -DUSE_OPENGL32 $CXXFLAGS" - CFLAGS="-mwindows $CFLAGS" - CXXFLAGS="-mwindows $CXXFLAGS" - LDFLAGS="-mwindows $LDFLAGS" - DSOFLAGS="-mwindows $DSOFLAGS" - LIBS="$LIBS -lole32 -luuid -lcomctl32 -lws2_32" - BUILD="WIN" - if test "x$with_optim" = x; then - dnl Avoid -Os optimization on Cygwin/MinGW - with_optim="-O3" - fi - - if test x$enable_gl != xno; then - AC_CHECK_HEADER(GL/gl.h, - AC_DEFINE(HAVE_GL) - GLLIBS="-lopengl32") - AC_CHECK_HEADER(GL/glu.h, - AC_DEFINE(HAVE_GL_GLU_H) - GLLIBS="-lglu32 $GLLIBS") - else - LINKFLTKGL="" - GLLIBNAME="" - GLDSONAME="" - GLDEMOS="" - fi - - if test "x$enable_threads" != xno; then - if test x$have_pthread = xyes; then - AC_DEFINE(HAVE_PTHREAD) - fi - fi - - THREADS="threads$EXEEXT" - - # Don't make symlinks since Windows is not case sensitive. - if test "x$with_links" != xyes; then - HLINKS="#" - fi - ;; + dnl Cygwin environment, using windows GDI ... + # Recent versions of Cygwin are seriously broken and the size + # checks don't work because the shell puts out \r\n instead of + # \n. Here we just force U32 to be defined to "unsigned"... + AC_DEFINE(U32,unsigned) + # We do no longer define WIN32 or _WIN32 (since FLTK 1.4.0) + # and we don't need to define USE_OPENGL32 (added in svn r6657 + # but never used, see STR #2147) + # CFLAGS="-mwindows -D_WIN32 -DUSE_OPENGL32 $CFLAGS" + # CXXFLAGS="-mwindows -D_WIN32 -DUSE_OPENGL32 $CXXFLAGS" + CFLAGS="-mwindows $CFLAGS" + CXXFLAGS="-mwindows $CXXFLAGS" + LDFLAGS="-mwindows $LDFLAGS" + DSOFLAGS="-mwindows $DSOFLAGS" + LIBS="$LIBS -lole32 -luuid -lcomctl32 -lws2_32" + BUILD="WIN" + if test "x$with_optim" = x; then + dnl Avoid -Os optimization on Cygwin/MinGW + with_optim="-O3" + fi + + if test x$enable_gl != xno; then + AC_CHECK_HEADER(GL/gl.h, + AC_DEFINE(HAVE_GL) + GLLIBS="-lopengl32") + AC_CHECK_HEADER(GL/glu.h, + AC_DEFINE(HAVE_GL_GLU_H) + GLLIBS="-lglu32 $GLLIBS") + else + LINKFLTKGL="" + GLLIBNAME="" + GLDSONAME="" + GLDEMOS="" + fi + + if test "x$enable_threads" != xno; then + if test x$have_pthread = xyes; then + AC_DEFINE(HAVE_PTHREAD) + fi + fi + + THREADS="threads$EXEEXT" + + # Don't make symlinks since Windows is not case sensitive. + if test "x$with_links" != xyes; then + HLINKS="#" + fi + ;; darwin*) - AC_DEFINE(__APPLE_QUARTZ__) - - BUILD="OSX" - - # MacOS X uses Cocoa for graphics. - LIBS="$LIBS -framework Cocoa" - - if test x$have_pthread = xyes; then - AC_DEFINE(HAVE_PTHREAD) - THREADS="threads$EXEEXT" - fi - - if test x$enable_gl != xno; then - AC_DEFINE(HAVE_GL) - AC_DEFINE(HAVE_GL_GLU_H) - GLLIBS="-framework OpenGL" - else - LINKFLTKGL="" - GLLIBNAME="" - GLDSONAME="" - GLDEMOS="" - fi - - # Don't make symlinks because HFS+ is not case sensitive... - if test "x$with_links" != xyes; then - HLINKS="#" - fi - - # Some steps are only done for OS X package management - OSX_ONLY= - - # Install/Uninstall FLUID application - INSTALL_DESKTOP="install-osx" - UNINSTALL_DESKTOP="uninstall-osx" - ;; + AC_DEFINE(__APPLE_QUARTZ__) + + BUILD="OSX" + + # MacOS X uses Cocoa for graphics. + LIBS="$LIBS -framework Cocoa" + + if test x$have_pthread = xyes; then + AC_DEFINE(HAVE_PTHREAD) + THREADS="threads$EXEEXT" + fi + + if test x$enable_gl != xno; then + AC_DEFINE(HAVE_GL) + AC_DEFINE(HAVE_GL_GLU_H) + GLLIBS="-framework OpenGL" + else + LINKFLTKGL="" + GLLIBNAME="" + GLDSONAME="" + GLDEMOS="" + fi + + # Don't make symlinks because HFS+ is not case sensitive... + if test "x$with_links" != xyes; then + HLINKS="#" + fi + + # Some steps are only done for OS X package management + OSX_ONLY= + + # Install/Uninstall FLUID application + INSTALL_DESKTOP="install-osx" + UNINSTALL_DESKTOP="uninstall-osx" + ;; *) - # All others are UNIX/X11... - # This includes Cygwin target combined with X11 - if test x$have_pthread = xyes; then - AC_DEFINE(HAVE_PTHREAD) - THREADS="threads$EXEEXT" - fi - - dnl Check for X11... - AC_PATH_XTRA - - if test x$no_x = xyes; then - AC_MSG_ERROR([Configure could not find required X11 libraries, aborting.]) - fi - - if test "x$X_PRE_LIBS" != x; then - AC_MSG_WARN([Ignoring libraries "$X_PRE_LIBS" requested by configure.]) - fi - - LIBS="$LIBS -lX11 $X_EXTRA_LIBS" - CFLAGS="$CFLAGS $X_CFLAGS" - CXXFLAGS="$CXXFLAGS $X_CFLAGS" - LDFLAGS="$X_LIBS $LDFLAGS" - DSOFLAGS="$X_LIBS $DSOFLAGS" - AC_DEFINE(USE_X11) - BUILD="X11" - if test "x$x_includes" != x; then - ac_cpp="$ac_cpp -I$x_includes" - fi - - dnl Check for OpenGL unless disabled... - GLLIBS= - - if test x$enable_gl != xno; then - AC_SEARCH_LIBS(dlopen, dl) - AC_CHECK_HEADER(GL/gl.h, - AC_CHECK_LIB(GL, glXMakeCurrent, - [AC_DEFINE(HAVE_GL) - GLLIBS="-lGL"], - AC_CHECK_LIB(MesaGL, glXMakeCurrent, - [AC_DEFINE(HAVE_GL) - GLLIBS="-lMesaGL"],, - [-lm]), - [-lm]) - AC_CHECK_LIB(GL, glXGetProcAddressARB, - AC_DEFINE(HAVE_GLXGETPROCADDRESSARB),, [-lm]) - ) - AC_CHECK_HEADER(GL/glu.h, - AC_DEFINE(HAVE_GL_GLU_H) - if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then - GLLIBS="-lGLU $GLLIBS" - fi - if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then - GLLIBS="-lMesaGLU $GLLIBS" - fi - ) - - if test x$ac_cv_lib_GL_glXMakeCurrent != xyes -a x$ac_cv_lib_MesaGL_glXMakeCurrent != xyes; then - LINKFLTKGL="" - GLLIBNAME="" - GLDSONAME="" - GLDEMOS="" - fi - else - LINKFLTKGL="" - GLLIBNAME="" - GLDSONAME="" - GLDEMOS="" - fi - - dnl Check whether print support was disabled... - AC_ARG_ENABLE(print, [ --enable-print turn on print support (X11 platform) [[default=yes]]]) - if test x$enable_print = xno; then - AC_DEFINE(FL_NO_PRINT_SUPPORT) - fi - - dnl Check for Xinerama support unless disabled... - AC_ARG_ENABLE(xinerama, [ --enable-xinerama turn on Xinerama support [[default=yes]]]) - - xinerama_found=no - if test x$enable_xinerama != xno; then - AC_CHECK_LIB(Xinerama, XineramaIsActive, - [AC_DEFINE(HAVE_XINERAMA) - LIBS="-lXinerama $LIBS" - xinerama_found=yes]) - fi - - dnl Check for the Xft library unless disabled... - AC_ARG_ENABLE(xft, [ --enable-xft turn on Xft support [[default=yes]]]) - - xft_found=no - if test x$enable_xft != xno; then + # All others are UNIX/X11... + # This includes Cygwin target combined with X11 + if test x$have_pthread = xyes; then + AC_DEFINE(HAVE_PTHREAD) + THREADS="threads$EXEEXT" + fi + + dnl Check for X11... + AC_PATH_XTRA + + if test x$no_x = xyes; then + AC_MSG_ERROR([Configure could not find required X11 libraries, aborting.]) + fi + + if test "x$X_PRE_LIBS" != x; then + AC_MSG_WARN([Ignoring libraries "$X_PRE_LIBS" requested by configure.]) + fi + + LIBS="$LIBS -lX11 $X_EXTRA_LIBS" + CFLAGS="$CFLAGS $X_CFLAGS" + CXXFLAGS="$CXXFLAGS $X_CFLAGS" + LDFLAGS="$X_LIBS $LDFLAGS" + DSOFLAGS="$X_LIBS $DSOFLAGS" + AC_DEFINE(USE_X11) + BUILD="X11" + if test "x$x_includes" != x; then + ac_cpp="$ac_cpp -I$x_includes" + fi + + dnl Check for OpenGL unless disabled... + GLLIBS= + + if test x$enable_gl != xno; then + AC_SEARCH_LIBS(dlopen, dl) + AC_CHECK_HEADER(GL/gl.h, + AC_CHECK_LIB(GL, glXMakeCurrent, + [AC_DEFINE(HAVE_GL) + GLLIBS="-lGL"], + AC_CHECK_LIB(MesaGL, glXMakeCurrent, + [AC_DEFINE(HAVE_GL) + GLLIBS="-lMesaGL"],, + [-lm]), + [-lm]) + AC_CHECK_LIB(GL, glXGetProcAddressARB, + AC_DEFINE(HAVE_GLXGETPROCADDRESSARB),, [-lm]) + ) + AC_CHECK_HEADER(GL/glu.h, + AC_DEFINE(HAVE_GL_GLU_H) + if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then + GLLIBS="-lGLU $GLLIBS" + fi + if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then + GLLIBS="-lMesaGLU $GLLIBS" + fi + ) + + if test x$ac_cv_lib_GL_glXMakeCurrent != xyes -a x$ac_cv_lib_MesaGL_glXMakeCurrent != xyes; then + LINKFLTKGL="" + GLLIBNAME="" + GLDSONAME="" + GLDEMOS="" + fi + else + LINKFLTKGL="" + GLLIBNAME="" + GLDSONAME="" + GLDEMOS="" + fi + + dnl Check whether print support was disabled... + AC_ARG_ENABLE(print, [ --enable-print turn on print support (X11 platform) [[default=yes]]]) + if test x$enable_print = xno; then + AC_DEFINE(FL_NO_PRINT_SUPPORT) + fi + + dnl Check for Xinerama support unless disabled... + AC_ARG_ENABLE(xinerama, [ --enable-xinerama turn on Xinerama support [[default=yes]]]) + + xinerama_found=no + if test x$enable_xinerama != xno; then + AC_CHECK_LIB(Xinerama, XineramaIsActive, + [AC_DEFINE(HAVE_XINERAMA) + LIBS="-lXinerama $LIBS" + xinerama_found=yes]) + fi + + dnl Check for the Xft library unless disabled... + AC_ARG_ENABLE(xft, [ --enable-xft turn on Xft support [[default=yes]]]) + + xft_found=no + if test x$enable_xft != xno; then # Try pkg-config first (freetype2 deprecated freetype-config from some version on) AC_PATH_PROG(PKGCONFIG, pkg-config) FT_FLAGS="" @@ -1073,23 +1073,23 @@ case $host_os_gui in CFLAGS="$FT_FLAGS $CFLAGS" AC_CHECK_LIB(fontconfig, FcPatternCreate) - AC_CHECK_HEADER(X11/Xft/Xft.h, - AC_CHECK_LIB(Xft, XftDrawCreate, - [AC_DEFINE(USE_XFT) - LIBS="-lXft $LIBS" - BUILD="XFT" - xft_found=yes])) - fi - - dnl Issue a warning message if Xft was not found, abort configure - dnl if Xft was requested explicitly (but not found) - if test x$enable_xft != xno -a x$xft_found != xyes; then - AC_MSG_WARN([could not find the required Xft headers and/or libraries.]) - AC_MSG_NOTICE([please install Xft headers and libraries or use 'configure --disable-xft'.]) - if test x$enable_xft = xyes; then - AC_MSG_ERROR([Aborting.]) - fi - fi + AC_CHECK_HEADER(X11/Xft/Xft.h, + AC_CHECK_LIB(Xft, XftDrawCreate, + [AC_DEFINE(USE_XFT) + LIBS="-lXft $LIBS" + BUILD="XFT" + xft_found=yes])) + fi + + dnl Issue a warning message if Xft was not found, abort configure + dnl if Xft was requested explicitly (but not found) + if test x$enable_xft != xno -a x$xft_found != xyes; then + AC_MSG_WARN([could not find the required Xft headers and/or libraries.]) + AC_MSG_NOTICE([please install Xft headers and libraries or use 'configure --disable-xft'.]) + if test x$enable_xft = xyes; then + AC_MSG_ERROR([Aborting.]) + fi + fi dnl test if pango is asked but xft was not found if test x$enable_pango = xyes -a x$xft_found = xno; then @@ -1098,141 +1098,141 @@ case $host_os_gui in AC_MSG_ERROR([Aborting.]) fi - dnl Check for the pango library unless disabled... + dnl Check for the pango library unless disabled... AC_ARG_ENABLE(pango, [ --enable-pango turn on Pango support [[default=no]]]) pango_found=no - if test x$enable_pango = xyes; then + if test x$enable_pango = xyes; then if test x$PKGCONFIG != x; then CXXFLAGS="`$PKGCONFIG --cflags pangoxft` $CXXFLAGS" LIBS="`$PKGCONFIG --libs pangoxft` $LIBS" else - case $host_os in - linux*) - CXXFLAGS="-I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include $CXXFLAGS" - CXXFLAGS="-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include $CXXFLAGS" - ;; - freebsd*) - CXXFLAGS="-I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include $CXXFLAGS" - ;; - netbsd*) - CXXFLAGS="-I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/glib-2.0 -I/usr/pkg/lib/glib-2.0/include $CXXFLAGS" - CXXFLAGS="-I/usr/pkg/include/glib/glib-2.0 $CXXFLAGS" - PANGOLIBDIR="-L/usr/pkg/lib" - LDFLAGS="-Wl,-rpath,/usr/pkg/lib $LDFLAGS" - ;; - esac + case $host_os in + linux*) + CXXFLAGS="-I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include $CXXFLAGS" + CXXFLAGS="-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include $CXXFLAGS" + ;; + freebsd*) + CXXFLAGS="-I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include $CXXFLAGS" + ;; + netbsd*) + CXXFLAGS="-I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/glib-2.0 -I/usr/pkg/lib/glib-2.0/include $CXXFLAGS" + CXXFLAGS="-I/usr/pkg/include/glib/glib-2.0 $CXXFLAGS" + PANGOLIBDIR="-L/usr/pkg/lib" + LDFLAGS="-Wl,-rpath,/usr/pkg/lib $LDFLAGS" + ;; + esac LIBS="$PANGOLIBDIR -lpango-1.0 -lpangoxft-1.0 -lgobject-2.0 $LIBS" fi - CPPFLAGS="$CXXFLAGS" - AC_CHECK_HEADERS([pango/pango.h pango/pangoxft.h], - AC_CHECK_LIB(pango-1.0, pango_layout_new, - AC_CHECK_LIB(pangoxft-1.0, pango_xft_render_layout, - AC_DEFINE(USE_PANGO) + CPPFLAGS="$CXXFLAGS" + AC_CHECK_HEADERS([pango/pango.h pango/pangoxft.h], + AC_CHECK_LIB(pango-1.0, pango_layout_new, + AC_CHECK_LIB(pangoxft-1.0, pango_xft_render_layout, + AC_DEFINE(USE_PANGO) pango_found=yes))) - CPPFLAGS=$CXXFLAGS - fi - - dnl Check for the Xdbe extension unless disabled... - AC_ARG_ENABLE(xdbe, [ --enable-xdbe turn on Xdbe support [[default=yes]]]) - - xdbe_found=no - if test x$enable_xdbe != xno; then - AC_CHECK_HEADER( - [X11/extensions/Xdbe.h], - [AC_CHECK_LIB(Xext, XdbeQueryExtension, - [AC_DEFINE(HAVE_XDBE) - LIBS="-lXext $LIBS" - xdbe_found=yes])], - [], - [#include <X11/Xlib.h>]) - fi - - dnl Check for the Xfixes extension unless disabled... - AC_ARG_ENABLE(xfixes, [ --enable-xfixes turn on Xfixes support [[default=yes]]]) - - xfixes_found=no - if test x$enable_xfixes != xno; then - AC_CHECK_HEADER( - [X11/extensions/Xfixes.h], - [AC_CHECK_LIB(Xfixes, XFixesQueryExtension, - [AC_DEFINE(HAVE_XFIXES) - LIBS="-lXfixes $LIBS" - xfixes_found=yes])], - [], - [#include <X11/Xlib.h>]) - fi - - dnl Check for the Xcursor library unless disabled... - AC_ARG_ENABLE(xcursor, [ --enable-xcursor turn on Xcursor support [[default=yes]]]) - - xcursor_found=no - if test x$enable_xcursor != xno; then - AC_CHECK_HEADER( - [X11/Xcursor/Xcursor.h], - [AC_CHECK_LIB(Xcursor, XcursorImageCreate, - [AC_DEFINE(HAVE_XCURSOR) - LIBS="-lXcursor $LIBS" - xcursor_found=yes])], - [], - [#include <X11/Xlib.h>]) - fi - - dnl Check for the Xrender library unless disabled... - AC_ARG_ENABLE(xrender, [ --enable-xrender turn on Xrender support [[default=yes]]]) - - xrender_found=no - if test x$enable_xrender != xno; then - AC_CHECK_HEADER( - [X11/extensions/Xrender.h], - [AC_CHECK_LIB(Xrender, XRenderQueryVersion, - [AC_DEFINE(HAVE_XRENDER) - LIBS="-lXrender $LIBS" - xrender_found=yes])], - [], - [#include <X11/Xlib.h>]) - fi - - dnl Check for the X11/Xregion.h header file... - AC_CHECK_HEADER(X11/Xregion.h, AC_DEFINE(HAVE_X11_XREGION_H),, - [#include <X11/Xlib.h>]) - - dnl Check for overlay visuals... - AC_PATH_PROG(XPROP, xprop) - AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay, - if test "x$XPROP" != x; then - if $XPROP -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then - ac_cv_have_overlay=yes - else - ac_cv_have_overlay=no - fi - else - ac_cv_have_overlay=no - fi) - - if test x$ac_cv_have_overlay = xyes; then - AC_DEFINE(HAVE_OVERLAY) - fi - - # Make symlinks since UNIX/Linux is case sensitive, - # but Cygwin in general not. - case $host_os in - cygwin*) - HLINKS="#" - ;; - *) - ;; - esac - # Make symlinks since UNIX/Linux is case sensitive, - # but only if explicitly configured (default=no) - if test "x$with_links" != xyes; then - HLINKS="#" - fi - - # Install/Uninstall FLUID application support files - INSTALL_DESKTOP="install-linux" - UNINSTALL_DESKTOP="uninstall-linux" - ;; + CPPFLAGS=$CXXFLAGS + fi + + dnl Check for the Xdbe extension unless disabled... + AC_ARG_ENABLE(xdbe, [ --enable-xdbe turn on Xdbe support [[default=yes]]]) + + xdbe_found=no + if test x$enable_xdbe != xno; then + AC_CHECK_HEADER( + [X11/extensions/Xdbe.h], + [AC_CHECK_LIB(Xext, XdbeQueryExtension, + [AC_DEFINE(HAVE_XDBE) + LIBS="-lXext $LIBS" + xdbe_found=yes])], + [], + [#include <X11/Xlib.h>]) + fi + + dnl Check for the Xfixes extension unless disabled... + AC_ARG_ENABLE(xfixes, [ --enable-xfixes turn on Xfixes support [[default=yes]]]) + + xfixes_found=no + if test x$enable_xfixes != xno; then + AC_CHECK_HEADER( + [X11/extensions/Xfixes.h], + [AC_CHECK_LIB(Xfixes, XFixesQueryExtension, + [AC_DEFINE(HAVE_XFIXES) + LIBS="-lXfixes $LIBS" + xfixes_found=yes])], + [], + [#include <X11/Xlib.h>]) + fi + + dnl Check for the Xcursor library unless disabled... + AC_ARG_ENABLE(xcursor, [ --enable-xcursor turn on Xcursor support [[default=yes]]]) + + xcursor_found=no + if test x$enable_xcursor != xno; then + AC_CHECK_HEADER( + [X11/Xcursor/Xcursor.h], + [AC_CHECK_LIB(Xcursor, XcursorImageCreate, + [AC_DEFINE(HAVE_XCURSOR) + LIBS="-lXcursor $LIBS" + xcursor_found=yes])], + [], + [#include <X11/Xlib.h>]) + fi + + dnl Check for the Xrender library unless disabled... + AC_ARG_ENABLE(xrender, [ --enable-xrender turn on Xrender support [[default=yes]]]) + + xrender_found=no + if test x$enable_xrender != xno; then + AC_CHECK_HEADER( + [X11/extensions/Xrender.h], + [AC_CHECK_LIB(Xrender, XRenderQueryVersion, + [AC_DEFINE(HAVE_XRENDER) + LIBS="-lXrender $LIBS" + xrender_found=yes])], + [], + [#include <X11/Xlib.h>]) + fi + + dnl Check for the X11/Xregion.h header file... + AC_CHECK_HEADER(X11/Xregion.h, AC_DEFINE(HAVE_X11_XREGION_H),, + [#include <X11/Xlib.h>]) + + dnl Check for overlay visuals... + AC_PATH_PROG(XPROP, xprop) + AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay, + if test "x$XPROP" != x; then + if $XPROP -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then + ac_cv_have_overlay=yes + else + ac_cv_have_overlay=no + fi + else + ac_cv_have_overlay=no + fi) + + if test x$ac_cv_have_overlay = xyes; then + AC_DEFINE(HAVE_OVERLAY) + fi + + # Make symlinks since UNIX/Linux is case sensitive, + # but Cygwin in general not. + case $host_os in + cygwin*) + HLINKS="#" + ;; + *) + ;; + esac + # Make symlinks since UNIX/Linux is case sensitive, + # but only if explicitly configured (default=no) + if test "x$with_links" != xyes; then + HLINKS="#" + fi + + # Install/Uninstall FLUID application support files + INSTALL_DESKTOP="install-linux" + UNINSTALL_DESKTOP="uninstall-linux" + ;; esac AC_SUBST(GLDEMOS) @@ -1249,23 +1249,23 @@ AC_SUBST(BUILD) dnl Figure out the appropriate formatted man page extension... case "$host_os" in *bsd* | darwin*) - # *BSD - CAT1EXT=0 - CAT3EXT=0 - CAT6EXT=0 - ;; + # *BSD + CAT1EXT=0 + CAT3EXT=0 + CAT6EXT=0 + ;; irix*) - # SGI IRIX - CAT1EXT=z - CAT3EXT=z - CAT6EXT=z - ;; + # SGI IRIX + CAT1EXT=z + CAT3EXT=z + CAT6EXT=z + ;; *) - # All others - CAT1EXT=1 - CAT3EXT=3 - CAT6EXT=6 - ;; + # All others + CAT1EXT=1 + CAT3EXT=3 + CAT6EXT=6 + ;; esac AC_SUBST(CAT1EXT) @@ -1275,14 +1275,14 @@ AC_SUBST(CAT6EXT) dnl Fix "mandir" variable... if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then case "$host_os" in - *bsd* | darwin* | linux*) - # *BSD, Darwin, and Linux - mandir="\${prefix}/share/man" - ;; - irix*) - # SGI IRIX - mandir="\${prefix}/share/catman" - ;; + *bsd* | darwin* | linux*) + # *BSD, Darwin, and Linux + mandir="\${prefix}/share/man" + ;; + irix*) + # SGI IRIX + mandir="\${prefix}/share/catman" + ;; esac fi @@ -1297,12 +1297,12 @@ fi case $host_os in irix[1-5]*) - ;; + ;; irix*) - if test "$libdir" = "\${exec_prefix}/lib" -a "$exec_prefix" = "\${prefix}" -a "$prefix" = "/usr"; then - libdir="/usr/lib32" - fi - ;; + if test "$libdir" = "\${exec_prefix}/lib" -a "$exec_prefix" = "\${prefix}" -a "$prefix" = "/usr"; then + libdir="/usr/lib32" + fi + ;; esac dnl Define the command used to update the dependencies (this option @@ -1324,39 +1324,39 @@ if test -n "$GCC"; then # We know that Carbon is deprecated on OS X 10.4. To avoid hundreds of warnings # we will temporarily disable 'deprecated' warnings on OS X. case $host_os in - darwin[1-7]) - ;; - darwin*) - OPTIM="-Wno-deprecated-declarations $OPTIM" - ;; + darwin[1-7]) + ;; + darwin*) + OPTIM="-Wno-deprecated-declarations $OPTIM" + ;; esac # Set the default compiler optimizations... if test -z "$DEBUGFLAG"; then - # - # Note: Can't use -fomit-frame-pointer - prevents tools like - # libsafe from working! - # - # Don't use -fforce-mem, -fforce-addr, or -fcaller-saves. - # They all seem to make either no difference or enlarge - # the code by a few hundred bytes. - # - # "-Os" seems to be the best compromise between speed and - # code size. "-O3" and higher seem to make no effective - # difference in the speed of the code, but does bloat the - # library 10+%. - # - - if test "x$with_optim" != x; then - OPTIM="$with_optim $OPTIM" - else - OPTIM="-Os $OPTIM" - fi + # + # Note: Can't use -fomit-frame-pointer - prevents tools like + # libsafe from working! + # + # Don't use -fforce-mem, -fforce-addr, or -fcaller-saves. + # They all seem to make either no difference or enlarge + # the code by a few hundred bytes. + # + # "-Os" seems to be the best compromise between speed and + # code size. "-O3" and higher seem to make no effective + # difference in the speed of the code, but does bloat the + # library 10+%. + # + + if test "x$with_optim" != x; then + OPTIM="$with_optim $OPTIM" + else + OPTIM="-Os $OPTIM" + fi fi # Generate position-independent code when needed... if test $PICFLAG = 1; then - OPTIM="$OPTIM -fPIC" + OPTIM="$OPTIM -fPIC" fi # See if GCC supports -fno-exceptions... @@ -1364,10 +1364,10 @@ if test -n "$GCC"; then OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-exceptions" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [OPTIM="$OPTIM -fno-exceptions" - AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)]) + [AC_LANG_PROGRAM([[]], [[]])], + [OPTIM="$OPTIM -fno-exceptions" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) CFLAGS="$OLDCFLAGS" # See if GCC supports -fno-strict-aliasing... @@ -1375,10 +1375,10 @@ if test -n "$GCC"; then OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-strict-aliasing" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [OPTIM="$OPTIM -fno-strict-aliasing" - AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)]) + [AC_LANG_PROGRAM([[]], [[]])], + [OPTIM="$OPTIM -fno-strict-aliasing" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) CFLAGS="$OLDCFLAGS" dnl Make sure that shared libraries don't have undefined references @@ -1387,10 +1387,10 @@ dnl Make sure that shared libraries don't have undefined references OLDLDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,-no-undefined" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [DSOFLAGS="$DSOFLAGS -Wl,-no-undefined" - AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)]) + [AC_LANG_PROGRAM([[]], [[]])], + [DSOFLAGS="$DSOFLAGS -Wl,-no-undefined" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) LDFLAGS="$OLDLDFLAGS" # See if ld supports -Bsymbolic-functions... @@ -1398,10 +1398,10 @@ dnl Make sure that shared libraries don't have undefined references OLDLDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [DSOFLAGS="$DSOFLAGS -Wl,-Bsymbolic-functions" - AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)]) + [AC_LANG_PROGRAM([[]], [[]])], + [DSOFLAGS="$DSOFLAGS -Wl,-Bsymbolic-functions" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) LDFLAGS="$OLDLDFLAGS" # See if toolchain supports a sectioned build... @@ -1411,11 +1411,11 @@ dnl Make sure that shared libraries don't have undefined references LDFLAGS="$LDFLAGS -Wl,-gc-sections" CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [DSOFLAGS="$DSOFLAGS -Wl,-gc-sections" - OPTIM="$OPTIM -ffunction-sections -fdata-sections" - AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)]) + [AC_LANG_PROGRAM([[]], [[]])], + [DSOFLAGS="$DSOFLAGS -Wl,-gc-sections" + OPTIM="$OPTIM -ffunction-sections -fdata-sections" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) LDFLAGS="$OLDLDFLAGS" CFLAGS="$OLDCFLAGS" @@ -1427,108 +1427,108 @@ dnl Make sure that shared libraries don't have undefined references # in CFLAGS and CXXFLAGS so that fltk-config will provide the option # to clients - otherwise client apps will not compile properly... case $host_os in - solaris*) - AC_MSG_CHECKING([if GCC supports -fpermissive]) - - OLDCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fpermissive" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [CXXFLAGS="$CXXFLAGS -fpermissive" - AC_MSG_RESULT(yes)], - [CFLAGS="$OLDCFLAGS" - AC_MSG_RESULT(no)]) - ;; + solaris*) + AC_MSG_CHECKING([if GCC supports -fpermissive]) + + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fpermissive" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [CXXFLAGS="$CXXFLAGS -fpermissive" + AC_MSG_RESULT(yes)], + [CFLAGS="$OLDCFLAGS" + AC_MSG_RESULT(no)]) + ;; esac else case "$host_os" in - irix*) - # Running some flavor of IRIX; see which version and - # set things up according... - if test "$uversion" -ge 62; then - # We are running IRIX 6.2 or higher; uncomment the following - # lines if you don't have IDO 7.2 or higher: - # - # CXX="CC -n32 -mips3" - # CC="cc -n32 -mips3" - # LD="ld -n32 -mips3" - # MAKEDEPEND="CC -M" - - if test "x`grep abi=n32 /etc/compiler.defaults`" = x; then - AC_MSG_WARN([FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI "-n32 -mips3"]) - fi - - OPTIM="-fullwarn $OPTIM" - fi - if test -z "$DEBUGFLAG"; then - if test "x$with_optim" != x; then - OPTIM="$with_optim $OPTIM" - else - OPTIM="-O2 $OPTIM" - if test $uversion -gt 62; then - OPTIM="-OPT:Olimit=4000 $OPTIM" - fi - fi - fi - ;; - hpux*) - # Running HP-UX; these options should work for the HP compilers. - if test -z "$DEBUGFLAG"; then - if test "x$with_optim" != x; then - OPTIM="$with_optim $OPTIM" - else - OPTIM="+O2 $OPTIM" - fi - fi - - if test $PICFLAG = 1; then - OPTIM="+z $OPTIM" - fi - - CXXFLAGS="$CXXFLAGS +W336,501,736,740,749,829" - ;; - OSF1*) - # Running Digital/Tru64 UNIX; these options should work for the - # Digital/Compaq/NewHP compilers. - if test -z "$DEBUGFLAG"; then - if test "x$with_optim" != x; then - OPTIM="$with_optim $OPTIM" - else - OPTIM="-O2 $OPTIM" - fi - fi - ;; - solaris*) - # Solaris - if test -z "$DEBUGFLAG"; then - if test "x$with_optim" != x; then - OPTIM="$with_optim $OPTIM" - else - OPTIM="-xO3 $OPTIM" - fi - fi - - if test $PICFLAG = 1; then - OPTIM="-KPIC $OPTIM" - fi - ;; - aix*) - if test -z "$DEBUGFLAG"; then - if test "x$with_optim" != x; then - OPTIM="$with_optim $OPTIM" - else - OPTIM="-O2 $OPTIM" - fi - fi - - AC_MSG_WARN([The AIX C and C++ compilers are known not to correctly compile the FLTK library.]) - ;; - *) - # Running some other operating system; inform the user they - # should contribute the necessary options via the STR form.. - AC_MSG_WARN([Building FLTK with default compiler optimizations]) - AC_MSG_WARN([Send the FLTK developers your uname and compiler options via http://www.fltk.org/str.php]) - ;; + irix*) + # Running some flavor of IRIX; see which version and + # set things up according... + if test "$uversion" -ge 62; then + # We are running IRIX 6.2 or higher; uncomment the following + # lines if you don't have IDO 7.2 or higher: + # + # CXX="CC -n32 -mips3" + # CC="cc -n32 -mips3" + # LD="ld -n32 -mips3" + # MAKEDEPEND="CC -M" + + if test "x`grep abi=n32 /etc/compiler.defaults`" = x; then + AC_MSG_WARN([FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI "-n32 -mips3"]) + fi + + OPTIM="-fullwarn $OPTIM" + fi + if test -z "$DEBUGFLAG"; then + if test "x$with_optim" != x; then + OPTIM="$with_optim $OPTIM" + else + OPTIM="-O2 $OPTIM" + if test $uversion -gt 62; then + OPTIM="-OPT:Olimit=4000 $OPTIM" + fi + fi + fi + ;; + hpux*) + # Running HP-UX; these options should work for the HP compilers. + if test -z "$DEBUGFLAG"; then + if test "x$with_optim" != x; then + OPTIM="$with_optim $OPTIM" + else + OPTIM="+O2 $OPTIM" + fi + fi + + if test $PICFLAG = 1; then + OPTIM="+z $OPTIM" + fi + + CXXFLAGS="$CXXFLAGS +W336,501,736,740,749,829" + ;; + OSF1*) + # Running Digital/Tru64 UNIX; these options should work for the + # Digital/Compaq/NewHP compilers. + if test -z "$DEBUGFLAG"; then + if test "x$with_optim" != x; then + OPTIM="$with_optim $OPTIM" + else + OPTIM="-O2 $OPTIM" + fi + fi + ;; + solaris*) + # Solaris + if test -z "$DEBUGFLAG"; then + if test "x$with_optim" != x; then + OPTIM="$with_optim $OPTIM" + else + OPTIM="-xO3 $OPTIM" + fi + fi + + if test $PICFLAG = 1; then + OPTIM="-KPIC $OPTIM" + fi + ;; + aix*) + if test -z "$DEBUGFLAG"; then + if test "x$with_optim" != x; then + OPTIM="$with_optim $OPTIM" + else + OPTIM="-O2 $OPTIM" + fi + fi + + AC_MSG_WARN([The AIX C and C++ compilers are known not to correctly compile the FLTK library.]) + ;; + *) + # Running some other operating system; inform the user they + # should contribute the necessary options via the STR form.. + AC_MSG_WARN([Building FLTK with default compiler optimizations]) + AC_MSG_WARN([Send the FLTK developers your uname and compiler options via https://www.fltk.org/bugs.php]) + ;; esac fi @@ -1537,25 +1537,25 @@ OPTIM="$DEBUGFLAG $OPTIM" dnl Take archflags away from CFLAGS (makefiles use ARCHFLAGS explicitly) case $host_os in darwin*) - if test "x$with_archflags" != x ; then - CFLAGS="`echo $CFLAGS | sed -e "s/$with_archflags//g"`" - fi - ;; + if test "x$with_archflags" != x ; then + CFLAGS="`echo $CFLAGS | sed -e "s/$with_archflags//g"`" + fi + ;; esac dnl Define the FLTK documentation directory... case $host_os in mingw*) # Determine the path where MSys has /usr installed - msyspath=`mount | grep '\/usr ' | cut -d ' ' -f -1 | sed -e 's/\\\/\// g'` + msyspath=`mount | grep '\/usr ' | cut -d ' ' -f -1 | sed -e 's/\\\/\// g'` # Then substitute that in the Windows path instead of /usr - AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$msyspath/local/share/doc/fltk") + AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$msyspath/local/share/doc/fltk") ;; *) if test x$prefix = xNONE; then - AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "/usr/local/share/doc/fltk") + AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "/usr/local/share/doc/fltk") else - AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$prefix/share/doc/fltk") + AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$prefix/share/doc/fltk") fi ;; esac @@ -1574,35 +1574,35 @@ echo "-------------------------------------------------------------------------" case $host_os_gui in cygwin* | mingw*) - graphics="GDI" - ;; + graphics="GDI" + ;; darwin*) - graphics="Quartz" - ;; + graphics="Quartz" + ;; *) - graphics="X11" - if test x$xft_found = xyes; then - graphics="$graphics + Xft" - fi - if test x$xdbe_found = xyes; then - graphics="$graphics + Xdbe" - fi - if test x$xfixes_found = xyes; then - graphics="$graphics + Xfixes" - fi - if test x$xinerama_found = xyes; then - graphics="$graphics + Xinerama" - fi - if test x$xcursor_found = xyes; then - graphics="$graphics + Xcursor" - fi - if test x$xrender_found = xyes; then - graphics="$graphics + Xrender" - fi + graphics="X11" + if test x$xft_found = xyes; then + graphics="$graphics + Xft" + fi + if test x$xdbe_found = xyes; then + graphics="$graphics + Xdbe" + fi + if test x$xfixes_found = xyes; then + graphics="$graphics + Xfixes" + fi + if test x$xinerama_found = xyes; then + graphics="$graphics + Xinerama" + fi + if test x$xcursor_found = xyes; then + graphics="$graphics + Xcursor" + fi + if test x$xrender_found = xyes; then + graphics="$graphics + Xrender" + fi if test x$pango_found = xyes; then graphics="$graphics + pango" fi - ;; + ;; esac echo " Directories: prefix=$prefix" diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index b27568bf4..66546cfa6 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -1,6 +1,4 @@ # -# "$Id$" -# # CMakeLists.txt to build docs for the FLTK project using CMake (www.cmake.org) # # Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # set (DOCS) @@ -36,29 +34,29 @@ if (OPTION_BUILD_HTML_DOCUMENTATION) # generate Doxygen file "Doxyfile" - set(GENERATE_HTML YES) - set(GENERATE_LATEX NO) - set(LATEX_HEADER "") + set(GENERATE_HTML YES) + set(GENERATE_LATEX NO) + set(LATEX_HEADER "") configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - @ONLY + ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + @ONLY ) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/src/tiny.png - ${CMAKE_CURRENT_BINARY_DIR}/html/tiny.png - COPYONLY + ${CMAKE_CURRENT_SOURCE_DIR}/src/tiny.png + ${CMAKE_CURRENT_BINARY_DIR}/html/tiny.png + COPYONLY ) # generate html docs add_custom_target(html - # ALL - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating HTML documentation" VERBATIM + # ALL + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating HTML documentation" VERBATIM ) endif (OPTION_BUILD_HTML_DOCUMENTATION) @@ -73,14 +71,14 @@ if (OPTION_BUILD_PDF_DOCUMENTATION) # generate Doxygen file "Doxybook" - set(GENERATE_HTML NO) - set(GENERATE_LATEX YES) - set(LATEX_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex") + set(GENERATE_HTML NO) + set(GENERATE_LATEX YES) + set(LATEX_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex") configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in - ${CMAKE_CURRENT_BINARY_DIR}/Doxybook - @ONLY + ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in + ${CMAKE_CURRENT_BINARY_DIR}/Doxybook + @ONLY ) # generate LaTeX header fltk-book.tex @@ -88,30 +86,30 @@ if (OPTION_BUILD_PDF_DOCUMENTATION) set(FL_VERSION ${FLTK_VERSION_FULL}) set(DOXY_VERSION ${DOXYGEN_VERSION}) execute_process(COMMAND date +%Y - OUTPUT_VARIABLE YEAR + OUTPUT_VARIABLE YEAR ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/fltk-book.tex.in - ${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex - @ONLY + ${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex + @ONLY ) # generate fltk.pdf add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf - COMMAND ${DOXYGEN_EXECUTABLE} Doxybook - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_pdf - COMMAND cp -f latex/refman.pdf fltk.pdf - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating PDF documentation" VERBATIM + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf + COMMAND ${DOXYGEN_EXECUTABLE} Doxybook + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_pdf + COMMAND cp -f latex/refman.pdf fltk.pdf + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating PDF documentation" VERBATIM ) # add target 'pdf' add_custom_target(pdf - # ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf + # ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf ) endif(OPTION_BUILD_PDF_DOCUMENTATION) @@ -123,8 +121,8 @@ endif(OPTION_BUILD_PDF_DOCUMENTATION) if (DOCS) add_custom_target(docs - # ALL - DEPENDS ${DOCS} + # ALL + DEPENDS ${DOCS} ) endif (DOCS) @@ -136,7 +134,7 @@ endif (DOCS) if (OPTION_INSTALL_HTML_DOCUMENTATION AND OPTION_BUILD_HTML_DOCUMENTATION) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html - DESTINATION ${FLTK_DATADIR}/doc/fltk + DESTINATION ${FLTK_DATADIR}/doc/fltk ) endif (OPTION_INSTALL_HTML_DOCUMENTATION AND OPTION_BUILD_HTML_DOCUMENTATION) @@ -144,7 +142,7 @@ endif (OPTION_INSTALL_HTML_DOCUMENTATION AND OPTION_BUILD_HTML_DOCUMENTATION) if (OPTION_INSTALL_PDF_DOCUMENTATION AND OPTION_BUILD_PDF_DOCUMENTATION) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf - DESTINATION ${FLTK_DATADIR}/doc/fltk/ + DESTINATION ${FLTK_DATADIR}/doc/fltk/ ) endif (OPTION_INSTALL_PDF_DOCUMENTATION AND OPTION_BUILD_PDF_DOCUMENTATION) diff --git a/documentation/Makefile b/documentation/Makefile index 97886ae03..0c03b8c56 100644 --- a/documentation/Makefile +++ b/documentation/Makefile @@ -1,6 +1,4 @@ # -# "$Id$" -# # Makefile for the Fast Light Tool Kit (FLTK) documentation. # # Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # Get configuration stuff... @@ -187,7 +185,3 @@ src/fltk-book.tex: src/fltk-book.tex.in -e"s/@FL_VERSION@/$(FL_VERSION)/g" \ -e"s/@DOXY_VERSION@/$$DOXY_VERSION/g" \ < $< > $@ - -# -# End of "$Id$". -# diff --git a/documentation/README.txt b/documentation/README.txt index 6b7e39980..f144bc68b 100644 --- a/documentation/README.txt +++ b/documentation/README.txt @@ -71,8 +71,8 @@ more CMake options using cmake-gui, ccmake, or cmake -DOPTION... These options are predefined to OFF and can be switched ON: - - OPTION_BUILD_HTML_DOCUMENTATION:BOOL=OFF target: html - - OPTION_BUILD_PDF_DOCUMENTATION:BOOL=OFF target: pdf + - OPTION_BUILD_HTML_DOCUMENTATION:BOOL=OFF target: html + - OPTION_BUILD_PDF_DOCUMENTATION:BOOL=OFF target: pdf - OPTION_INSTALL_HTML_DOCUMENTATION:BOOL=OFF - OPTION_INSTALL_PDF_DOCUMENTATION:BOOL=OFF @@ -106,7 +106,7 @@ Bugs and Feature Requests: -------------------------- If you find any typos, things that are unclear, or would like to contribute an example, section, or chapter to the FLTK manual, please -post a question in the fltk newsgroup fltk.general or post a bug -report or feature request at: +post a question in the fltk group fltk.general or post a bug +report or feature request. For more information see this page: - https://www.fltk.org/str.php + https://www.fltk.org/bugs.php diff --git a/documentation/make_pdf b/documentation/make_pdf index dd8894895..7580cb1d8 100755 --- a/documentation/make_pdf +++ b/documentation/make_pdf @@ -1,7 +1,5 @@ #! /bin/sh # -# $Id$ -# # Makefile helper script for the Fast Light Tool Kit (FLTK) documentation. # # Copyright 1998-2015 by Bill Spitzak and others. @@ -10,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # This script generates latex/refman.pdf after doxygen has been executed. @@ -41,7 +39,3 @@ latex_count=`expr $latex_count - 1` done cd ..) > pdfall.log 2>&1 - -# -# End of "$Id$". -# diff --git a/documentation/src/basics.dox b/documentation/src/basics.dox index 97cdb53ea..2b839c322 100644 --- a/documentation/src/basics.dox +++ b/documentation/src/basics.dox @@ -1,7 +1,7 @@ /** \page basics FLTK Basics - + This chapter teaches you the basics of compiling programs that use FLTK. @@ -104,22 +104,22 @@ copy of it - it just uses the pointer. \subsection basics_hierarchies Creating Widget hierarchies -Widgets are commonly ordered into functional groups, which -in turn may be grouped again, creating a hierarchy of widgets. -FLTK makes it easy to fill groups by automatically adding all widgets +Widgets are commonly ordered into functional groups, which +in turn may be grouped again, creating a hierarchy of widgets. +FLTK makes it easy to fill groups by automatically adding all widgets that are created between a <tt>myGroup->begin()</tt> -and +and <tt>myGroup->end()</tt>. In this example, \p myGroup would be the \e current group. Newly created groups and their derived widgets implicitly call -\p begin() in the constructor, effectively adding all +\p begin() in the constructor, effectively adding all subsequently created widgets to itself until \p end() is called. Setting the current group to \p NULL will stop automatic -hierarchies. New widgets can now be added manually using +hierarchies. New widgets can now be added manually using <tt>Fl_Group::add(...)</tt> and <tt>Fl_Group::insert(...)</tt>. @@ -208,7 +208,7 @@ write, or when an error condition occurs on a file. They are most often used to monitor network connections (sockets) for data-driven displays. -FLTK applications must periodically check (Fl::check()) +FLTK applications must periodically check (Fl::check()) or wait (Fl::wait()) for events or use the Fl::run() method to enter a standard event processing loop. Calling Fl::run() is equivalent to the following code: @@ -310,10 +310,10 @@ SRCS = CubeMain.cxx CubeView.cxx CubeViewUI.cxx .SUFFIXES: .o .cxx %.o: %.cxx - $(CXX) $(CXXFLAGS) $(DEBUG) -c $< + $(CXX) $(CXXFLAGS) $(DEBUG) -c $< all: $(TARGET) - $(LINK) -o $(TARGET) $(OBJS) $(LDSTATIC) + $(LINK) -o $(TARGET) $(OBJS) $(LDSTATIC) $(TARGET): $(OBJS) CubeMain.o: CubeMain.cxx CubeViewUI.h @@ -321,16 +321,16 @@ CubeView.o: CubeView.cxx CubeView.h CubeViewUI.h CubeViewUI.o: CubeViewUI.cxx CubeView.h clean: $(TARGET) $(OBJS) - rm -f *.o 2> /dev/null - rm -f $(TARGET) 2> /dev/null + rm -f *.o 2> /dev/null + rm -f $(TARGET) 2> /dev/null \endcode \section basics_visual_cpp Compiling Programs with Microsoft Visual C++ In Visual C++ you will need to tell the compiler where to find the FLTK header files. This can be done by selecting -"Settings" from the "Project" menu and then changing the -"Preprocessor" settings under the "C/C++" tab. You will also +"Settings" from the "Project" menu and then changing the +"Preprocessor" settings under the "C/C++" tab. You will also need to add the FLTK (<tt>FLTK.LIB</tt> or <tt>FLTKD.LIB</tt>) and the Windows Common Controls (<tt>COMCTL32.LIB</tt>) libraries to the "Link" settings. diff --git a/documentation/src/blocks.man b/documentation/src/blocks.man index 920300708..18f263d42 100644 --- a/documentation/src/blocks.man +++ b/documentation/src/blocks.man @@ -21,6 +21,6 @@ Press the spacebar to pause the game. .SH SEE ALSO fltk(3) .br -FLTK Web Site, http://www.fltk.org/ +FLTK Web Site, https://www.fltk.org/ .SH AUTHOR Michael R Sweet. diff --git a/documentation/src/checkers.man b/documentation/src/checkers.man index 097277474..927f22c1c 100644 --- a/documentation/src/checkers.man +++ b/documentation/src/checkers.man @@ -19,6 +19,6 @@ to a "king" which can move both forwards and backwards. .SH SEE ALSO fltk(3) .br -FLTK Web Site, http://www.fltk.org/ +FLTK Web Site, https://www.fltk.org/ .SH AUTHORS Bill Spitzak and others. diff --git a/documentation/src/common.dox b/documentation/src/common.dox index 70cbe8901..2c586a352 100644 --- a/documentation/src/common.dox +++ b/documentation/src/common.dox @@ -1,6 +1,6 @@ /** - \page common Common Widgets and Attributes + \page common Common Widgets and Attributes This chapter describes many of the widgets that are provided with FLTK and covers how to query and set the standard @@ -46,10 +46,10 @@ lbutton->type(FL_TOGGLE_BUTTON); rbutton->type(FL_RADIO_BUTTON); \endcode -For toggle and radio buttons, the \p value() method returns +For toggle and radio buttons, the \p value() method returns the current button state (0 = off, 1 = on). The \p set() and -\p clear() methods can be used on toggle buttons to turn a -toggle button on or off, respectively. +\p clear() methods can be used on toggle buttons to turn a +toggle button on or off, respectively. Radio buttons can be turned on with the \p setonly() method; this will also turn off other radio buttons in the same group. @@ -64,7 +64,7 @@ FLTK provides several text widgets for displaying and receiving text: \li Fl_Multiline_Input - A multi-line text input field. -\li Fl_Multiline_Output - A multi-line text output field. +\li Fl_Multiline_Output - A multi-line text output field. \li Fl_Text_Display - A multi-line text display widget. @@ -76,7 +76,7 @@ The Fl_Output and Fl_Multiline_Output widgets allow the user to copy text from the output field but not change it. -The \p value() method is used to get or set the +The \p value() method is used to get or set the string that is displayed: \code @@ -113,7 +113,7 @@ strings. FLTK provides the following valuators: \image html valuators.png "Figure 3-2: FLTK valuator widgets" \image latex valuators.png "FLTK valuator widgets" width=10cm -The \p value() method gets and sets the current value +The \p value() method gets and sets the current value of the widget. The \p minimum() and \p maximum() methods set the range of values that are reported by the widget. @@ -329,14 +329,14 @@ The last 4 arguments to Fl::set_boxtype() are the offsets for the \p x, \p y, \p width, and \p height values that should be subtracted when drawing the label inside the box. -A complete box design contains four box types in this order: +A complete box design contains four box types in this order: a filled, neutral box (<tt>UP_BOX</tt>), a filled, depressed box (<tt>DOWN_BOX</tt>), and the same as outlines only (<tt>UP_FRAME</tt> and <tt>DOWN_FRAME</tt>). The function \ref common_fl_down "fl_down(Fl_Boxtype)" -expects the neutral design on a boxtype with a numerical -value evenly dividable by two. +expects the neutral design on a boxtype with a numerical +value evenly dividable by two. \ref common_fl_frame "fl_frame(Fl_Boxtype)" expects the \p UP_BOX design at a value dividable by four. @@ -507,7 +507,7 @@ It is also possible to define your own drawings and add them to the symbol list, so they can be rendered as part of any label. -To create a new symbol, you implement a drawing function +To create a new symbol, you implement a drawing function <tt>void drawit(Fl_Color c)</tt> which typically uses the functions described in \ref ssect_Complex to generate a vector shape inside a two-by-two units sized box @@ -567,28 +567,28 @@ button->when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED); <CENTER><TABLE WIDTH="80%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc"> <TR> - <TD><B>Note:</B> + <TD><B>Note:</B> - You cannot delete a widget inside a callback, as the - widget may still be accessed by FLTK after your callback - is completed. Instead, use the Fl::delete_widget() - method to mark your widget for deletion when it is safe - to do so. + You cannot delete a widget inside a callback, as the + widget may still be accessed by FLTK after your callback + is completed. Instead, use the Fl::delete_widget() + method to mark your widget for deletion when it is safe + to do so. - <B>Hint:</B> + <B>Hint:</B> - Many programmers new to FLTK or C++ try to use a - non-static class method instead of a static class method - or function for their callback. Since callbacks are done - outside a C++ class, the <tt>this</tt> pointer is not - initialized for class methods. + Many programmers new to FLTK or C++ try to use a + non-static class method instead of a static class method + or function for their callback. Since callbacks are done + outside a C++ class, the <tt>this</tt> pointer is not + initialized for class methods. - To work around this problem, define a static method - in your class that accepts a pointer to the class, and - then have the static method call the class method(s) as - needed. The data pointer you provide to the - \p callback() method of the widget can be a - pointer to the instance of your class. + To work around this problem, define a static method + in your class that accepts a pointer to the class, and + then have the static method call the class method(s) as + needed. The data pointer you provide to the + \p callback() method of the widget can be a + pointer to the instance of your class. \code class Foo { @@ -601,7 +601,7 @@ class Foo { w->callback(my_static_callback, (void *)this); \endcode - </TD> + </TD> </TR> </TABLE></CENTER> diff --git a/documentation/src/development.dox b/documentation/src/development.dox index 13808e6a6..071db9263 100644 --- a/documentation/src/development.dox +++ b/documentation/src/development.dox @@ -15,14 +15,14 @@ This chapter describes FLTK development and documentation. /** \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. - \image html clock.png - \image latex clock.png "" width=10cm + \image html clock.png + \image latex clock.png "" width=10cm \image html round_clock.png - \image latex clock.png "" width=10cm + \image latex clock.png "" width=10cm \image html round_clock.png "" width=10cm */ /** @@ -163,10 +163,10 @@ Alternatively you can use \b UTF-8 encoding within Doxygen comments. \section development_structure Document Structure - \li \b \\page creates a named page - \li \b \\section creates a named section within that page - \li \b \\subsection creates a named subsection within the current section - \li \b \\subsubsection creates a named subsubsection within the current subsection + \li \b \\page creates a named page + \li \b \\section creates a named section within that page + \li \b \\subsection creates a named subsection within the current section + \li \b \\subsubsection creates a named subsubsection within the current subsection All these statements take a "name" as their first argument, and a title as their second argument. The title can contain spaces. @@ -176,7 +176,7 @@ a size like \b "<H1>", \b "<H2>", and \b "<H3>", and \b "<H4>", respectively. By <b>FLTK documentation convention</b>, a file like this one with a doxygen documentation chapter has the name <b>"<chapter>.dox".</b> -The \b \\page statement at the top of the page is +The \b \\page statement at the top of the page is <b>"\page <chapter> This is the title"</b>. Sections within a documentation page must be called \b "<chapter>_<section>", where \b "<chapter>" is the name part of the file, and \b "<section>" is a @@ -190,18 +190,18 @@ links \b from normal (e.g. class) documentation \b to documentation sections This page has \code - \page development I - Developer Information + \page development I - Developer Information \endcode at its top. This section is \code - \section development_structure Document Structure + \section development_structure Document Structure \endcode The following section is \code - \section development_links Creating Links + \section development_links Creating Links \endcode diff --git a/documentation/src/drawing.dox b/documentation/src/drawing.dox index d49518a5f..4e12affb2 100644 --- a/documentation/src/drawing.dox +++ b/documentation/src/drawing.dox @@ -1,12 +1,12 @@ /** - \page drawing Drawing Things in FLTK + \page drawing Drawing Things in FLTK This chapter covers the drawing functions that are provided with FLTK. \section sect_WhenCanYouDraw When Can You Draw Things in FLTK? -There are only certain places you can execute FLTK code +There are only certain places you can execute FLTK code that draws to the computer's display. Calling these functions at other places will result in undefined behavior! @@ -22,16 +22,16 @@ Calling these functions at other places will result in undefined behavior! \li You can call Fl_Window::make_current() to do incremental update of a widget. Use Fl_Widget::window() to find the window. - + In contrast, code that draws to other drawing surfaces than the display -(i.e., instances of derived classes of the Fl_Surface_Device class, except -Fl_Display_Device, such as Fl_Printer and Fl_Copy_Surface) can be executed +(i.e., instances of derived classes of the Fl_Surface_Device class, except +Fl_Display_Device, such as Fl_Printer and Fl_Copy_Surface) can be executed at any time as follows: -<ol><li> Make your surface the new current drawing surface calling the +<ol><li> Make your surface the new current drawing surface calling the Fl_Surface_Device::push_current(Fl_Surface_Device*) function. <li> Make a series of calls to any of the drawing functions described below; these will operate on the new current drawing surface; -<li> Set the current drawing surface back to its previous state calling +<li> Set the current drawing surface back to its previous state calling Fl_Surface_Device::pop_current(). </ol> @@ -162,7 +162,7 @@ is the order of the line segments: \par Note that -\ref common_fl_frame "fl_frame(Fl_Boxtype b)" +\ref common_fl_frame "fl_frame(Fl_Boxtype b)" is described in the \ref common_boxtypes section. @@ -231,7 +231,7 @@ Fl_Region fl_clip_region() \par Replace the top of the clip stack with a clipping region of any shape. -Fl_Region is an operating system specific type. The second form returns +Fl_Region is an operating system specific type. The second form returns the current clipping region. @@ -529,8 +529,8 @@ use \p w-1 and \p h-1. void \ref fl_scroll(int X, int Y, int W, int H, int dx, int dy, void (*draw_area)(void*, int,int,int,int), void* data) \par Scroll a rectangle and draw the newly exposed portions. The contents -of the rectangular area is first shifted by \p dx and -\p dy \ref ssect_DrawingUnit "FLTK units". The callback is then called for every newly +of the rectangular area is first shifted by \p dx and +\p dy \ref ssect_DrawingUnit "FLTK units". The callback is then called for every newly exposed rectangular area, @@ -613,7 +613,7 @@ the path. It is unnecessary but harmless to call or several times in a row. \par -\p %fl_gap() should only be called between +\p %fl_gap() should only be called between \p %fl_begin_complex_polygon() and \p %fl_end_complex_polygon(). To outline the polygon, use @@ -687,13 +687,13 @@ the baseline of the font. To align to the bottom, subtract \p %fl_descent() from \p y. To align to the top, subtract \p %fl_descent() and add \p %fl_height(). This version of \p %fl_draw() provides direct access to -the text drawing function of the underlying OS. It does not apply any -special handling to control characters. +the text drawing function of the underlying OS. It does not apply any +special handling to control characters. void fl_rtl_draw(const char *str, int n, int x, int y) \par -Draw a UTF-8 string of length n bytes right to left starting at the given x, y location. +Draw a UTF-8 string of length n bytes right to left starting at the given x, y location. void fl_draw(const char* str, int x, int y, int w, int h, Fl_Align align, Fl_Image* img, int draw_symbols) @@ -769,7 +769,7 @@ ie. the 'inked area'. Given a string "txt" drawn using fl_draw(txt, x, y) you would determine its extents in \ref ssect_DrawingUnit "FLTK units" on the display using fl_text_extents(txt, dx, dy, wo, ho) such that a bounding box that exactly fits around the inked area of the text -could be drawn with fl_rect(x+dx, y+dy, wo, ho). +could be drawn with fl_rect(x+dx, y+dy, wo, ho). \par Refer to the full documentation for fl_text_extents() for details on usage. @@ -833,21 +833,21 @@ Returns the face and size set by the most recent call to \subsection ssect_CharacterEncoding Character Encoding -FLTK 1.3 expects all text in Unicode UTF-8 encoding. UTF-8 is -ASCII compatible for the first 128 characters. International -characters are encoded in multibyte sequences. +FLTK 1.3 expects all text in Unicode UTF-8 encoding. UTF-8 is +ASCII compatible for the first 128 characters. International +characters are encoded in multibyte sequences. -FLTK expects individual characters, characters that are not part of -a string, in UCS-4 encoding, which is also ASCII compatible, but +FLTK expects individual characters, characters that are not part of +a string, in UCS-4 encoding, which is also ASCII compatible, but requires 4 bytes to store a Unicode character. FLTK can draw accurately any Unicode-supported script for which the system contains relevant fonts. Under X11 platforms, this requires -to build the library with the OPTION_USE_PANGO CMake option turned On +to build the library with the OPTION_USE_PANGO CMake option turned On (or with configure --enable-pango). Plain text drawing starting at a user-given coordinate -is well supported by FLTK, including for right-to-left scripts. +is well supported by FLTK, including for right-to-left scripts. Further text-related operations (i.e., selection, formatting, input, and editing) are functional with left-to-right scripts only. @@ -917,7 +917,7 @@ or negative to flip the image vertically. \par It is highly recommended that you put the following code before the first show() of \e any window in your program to get rid -of the dithering if possible: +of the dithering if possible: \code Fl::visual(FL_RGB); @@ -1039,7 +1039,7 @@ for widgets using the \p image() and \p deimage() methods or drawn directly. Images can be drawn scaled to any size, independently from the size of the image's data (see Fl_Image::scale()). -The Fl_Image class does almost nothing by itself, but is instead +The Fl_Image class does almost nothing by itself, but is instead supported by three basic image types: \li Fl_Bitmap @@ -1054,29 +1054,29 @@ The Fl_Pixmap class encapsulates a colormapped image. The \p draw() method draws the image using the colors in the file, and masks off any transparent colors automatically. -The Fl_RGB_Image class encapsulates a full-color -(or grayscale) image with 1 to 4 color components. Images with -an even number of components are assumed to contain an -alpha channel that is used for transparency. The transparency -provided by the draw() method is either a 24-bit -blend against the existing window contents or a "screen door" -transparency mask, depending on the platform and screen color depth. +The Fl_RGB_Image class encapsulates a full-color +(or grayscale) image with 1 to 4 color components. Images with +an even number of components are assumed to contain an +alpha channel that is used for transparency. The transparency +provided by the draw() method is either a 24-bit +blend against the existing window contents or a "screen door" +transparency mask, depending on the platform and screen color depth. char fl_can_do_alpha_blending() \par \p %fl_can_do_alpha_blending() will return 1, if your -platform supports true alpha blending for RGBA images, or 0, +platform supports true alpha blending for RGBA images, or 0, if FLTK will use screen door transparency. FLTK also provides several image classes based on the three standard image types for common file formats: -\li Fl_GIF_Image -\li Fl_JPEG_Image -\li Fl_PNG_Image -\li Fl_PNM_Image -\li Fl_XBM_Image +\li Fl_GIF_Image +\li Fl_JPEG_Image +\li Fl_PNG_Image +\li Fl_PNM_Image +\li Fl_XBM_Image \li Fl_XPM_Image \li Fl_SVG_Image @@ -1127,7 +1127,7 @@ where img is a pointer to any Fl_Image type. \subsection ssect_Offscreen Offscreen Drawing Sometimes it can be very useful to generate a complex drawing -in memory first and copy it to the screen at a later point in +in memory first and copy it to the screen at a later point in time. This technique can significantly reduce the amount of repeated drawing. Offscreen drawing functions are declared in <FL/fl_draw.H>. @@ -1148,8 +1148,8 @@ Delete a previously created offscreen buffer. All drawings are lost. void fl_begin_offscreen(Fl_Offscreen) \par -Send all subsequent drawing commands to this offscreen buffer. -FLTK can draw into a buffer at any time. There is no need to wait for +Send all subsequent drawing commands to this offscreen buffer. +FLTK can draw into a buffer at any time. There is no need to wait for an Fl_Widget::draw() to occur. void fl_end_offscreen() diff --git a/documentation/src/editor.dox b/documentation/src/editor.dox index 2531dfbae..77c8bbaa5 100644 --- a/documentation/src/editor.dox +++ b/documentation/src/editor.dox @@ -1,6 +1,6 @@ /** - \page editor Designing a Simple Text Editor + \page editor Designing a Simple Text Editor This chapter takes you through the design of a simple FLTK-based text editor. diff --git a/documentation/src/enumerations.dox b/documentation/src/enumerations.dox index fee48b32d..b7c04d055 100644 --- a/documentation/src/enumerations.dox +++ b/documentation/src/enumerations.dox @@ -1,10 +1,10 @@ /** - \page enumerations FLTK Enumerations + \page enumerations FLTK Enumerations - \note This file is not actively maintained any more, but is left - here as a reference, until the doxygen documentation is - completed. + \note This file is not actively maintained any more, but is left + here as a reference, until the doxygen documentation is + completed. \sa \ref FL/Enumerations.H. @@ -31,10 +31,10 @@ The FLTK version number is stored in a number of compile-time constants: currently 10400 (default) \note The ABI version (FL_ABI_VERSION) is usually constant throughout one - major/minor release version, for instance 10300 if FL_API_VERSION is 10304. - Hence the ABI is constant if only the patch version is changed. - You can change this with configure or CMake though if you want the - latest enhancements (called "ABI features", see CHANGES). + major/minor release version, for instance 10300 if FL_API_VERSION is 10304. + Hence the ABI is constant if only the patch version is changed. + You can change this with configure or CMake though if you want the + latest enhancements (called "ABI features", see CHANGES). \section enumerations_events Events diff --git a/documentation/src/events.dox b/documentation/src/events.dox index 82718bec6..7657ce933 100644 --- a/documentation/src/events.dox +++ b/documentation/src/events.dox @@ -1,7 +1,7 @@ /** - \page events Handling Events - + \page events Handling Events + This chapter discusses the FLTK event model and how to handle events in your program or widget. @@ -20,7 +20,7 @@ Other information about the most recent event is stored in static locations and acquired by calling the \ref events_event_xxx. This static information remains valid until the next event -is read from the window system, so it is ok to look at it outside +is read from the window system, so it is ok to look at it outside of the \p handle() method. @@ -59,7 +59,7 @@ the matching \p FL_RELEASE events. If \p handle() returns zero then FLTK will try sending the \p FL_PUSH to -another widget. +another widget. \subsection events_fl_drag FL_DRAG @@ -84,7 +84,7 @@ return non-zero when handling \p FL_PUSH. \subsection events_fl_move FL_MOVE -The mouse has moved without any mouse buttons held down. +The mouse has moved without any mouse buttons held down. This event is sent to the Fl::belowmouse() widget. @@ -169,7 +169,7 @@ If you are writing a text-editing widget you may also want to call the Fl::compose() function to translate individual keystrokes into characters. -\p FL_KEYUP events are sent to the widget that +\p FL_KEYUP events are sent to the widget that currently has focus. This is not necessarily the same widget that received the corresponding \p FL_KEYDOWN event because focus may have changed between events. @@ -241,12 +241,12 @@ class \p handle() method!</I> -\note The events in this chapter ("Widget Events"), i.e. - FL_ACTIVATE, FL_DEACTIVATE, FL_SHOW, and FL_HIDE, - are the only events deactivated and invisible widgets - can usually get, depending on their states. Under certain - circumstances, there may also be FL_LEAVE or FL_UNFOCUS - events delivered to deactivated or hidden widgets. +\note The events in this chapter ("Widget Events"), i.e. + FL_ACTIVATE, FL_DEACTIVATE, FL_SHOW, and FL_HIDE, + are the only events deactivated and invisible widgets + can usually get, depending on their states. Under certain + circumstances, there may also be FL_LEAVE or FL_UNFOCUS + events delivered to deactivated or hidden widgets. \section events_clipboard Clipboard Events @@ -266,17 +266,17 @@ selection indication. Most modern programs ignore this. \section events_dnd Drag and Drop Events -FLTK supports drag and drop of text and files from any +FLTK supports drag and drop of text and files from any application on the desktop to an FLTK widget. Text is transferred using UTF-8 encoding. Files are received as a list of full path -and file names, separated by newline. +and file names, separated by newline. On some X11 platforms, files are received as a URL-encoded UTF-8 string, -that is, non-ASCII bytes (and a few others such as space and %) are +that is, non-ASCII bytes (and a few others such as space and %) are replaced by the 3 bytes "%XY" where XY are the byte's hexadecimal value. The \ref fl_decode_uri() function can be used to transform in-place the received string into a proper UTF-8 string. On these platforms, -strings corresponding to dropped files are further prepended +strings corresponding to dropped files are further prepended by <tt>file://</tt> (or other prefixes such as <tt>computer://</tt>). See Fl::dnd() for drag and drop from an FLTK widget. @@ -308,7 +308,7 @@ The mouse has moved out of the widget. \subsection events_fl_dnd_release FL_DND_RELEASE -The user has released the mouse button dropping data into +The user has released the mouse button dropping data into the widget. If the widget returns 1, it will receive the data in the immediately following \p FL_PASTE event. @@ -324,7 +324,7 @@ Use Fl::add_handler() to be notified of this event. The application window has been changed from normal to fullscreen, or from fullscreen to normal. If you are using a X window manager which supports Extended Window Manager Hints, this event will not be -delivered until the change has actually happened. +delivered until the change has actually happened. \section events_event_xxx Fl::event_*() methods @@ -337,7 +337,7 @@ and \p callback() methods. -These are all trivial inline functions and thus very fast and small: +These are all trivial inline functions and thus very fast and small: \li Fl::event_button() \li Fl::event_clicks() @@ -361,7 +361,7 @@ These are all trivial inline functions and thus very fast and small: Widgets receive events via the virtual handle() function. The argument indicates the type of event that can be handled. The widget must indicate if it handled the -event by returning 1. FLTK will then remove the event and wait for further events +event by returning 1. FLTK will then remove the event and wait for further events from the host. If the widget's handle function returns 0, FLTK may redistribute the event based on a few rules. @@ -399,7 +399,7 @@ Mouse motion (FL_MOVE) events are sent to the Fl::belowmouse() widget, i.e. the widget that returned 1 on the last FL_ENTER event. Mouse wheel events are sent to the window that caused the event. The window -propagates the event down the tree, first to the widget that is below the +propagates the event down the tree, first to the widget that is below the mouse pointer, and if that does not succeed, to all other widgets in the group. This ensures that scroll widgets work as expected with the widget furthest down in the hierarchy getting the first opportunity to use the wheel event, @@ -407,22 +407,22 @@ but also giving scroll bars, that are not directly below the mouse a chance. Keyboard events are sent directly to the widget that has keyboard focus. If the focused widget rejects the event, it is resent as a shortcut event, -first to the top-most window, then to the widget below the mouse pointer, +first to the top-most window, then to the widget below the mouse pointer, propagating up the hierarchy to all its parents. Those send the event also -to all widgets that are not below the mouse pointer. Now if that did not work +to all widgets that are not below the mouse pointer. Now if that did not work out, the shortcut is sent to all registered shortcut handlers. If we are still unsuccessful, the event handler flips the case of the shortcut -letter and starts over. Finally, if the key is "escape", FLTK sends a close +letter and starts over. Finally, if the key is "escape", FLTK sends a close event to the top-most window. -All other events are pretty much sent right away to the window that created +All other events are pretty much sent right away to the window that created the event. Widgets can "grab" events. The grabbing window gets all events exclusively, but usually by the same rules as described above. -Windows can also request exclusivity in event handling by making the +Windows can also request exclusivity in event handling by making the window modal. @@ -433,7 +433,7 @@ requires that you call the Fl::compose() function if you are writing your own text editor widget. Currently, all characters made by single key strokes -with or without modifier keys, or by system-defined character +with or without modifier keys, or by system-defined character compose sequences (that can involve dead keys or a compose key) can be input. You should call Fl::compose() in case any enhancements to this processing are done in the future. The diff --git a/documentation/src/examples.dox b/documentation/src/examples.dox index e7fa38154..4bd3ccd0d 100644 --- a/documentation/src/examples.dox +++ b/documentation/src/examples.dox @@ -1,6 +1,6 @@ /** - \page examples Example Source Code + \page examples Example Source Code The FLTK distribution contains over 60 sample applications written in, or ported to, FLTK. If the FLTK archive you received does not diff --git a/documentation/src/faq.dox b/documentation/src/faq.dox index a407327dd..b42aafeb7 100644 --- a/documentation/src/faq.dox +++ b/documentation/src/faq.dox @@ -1,6 +1,6 @@ /** - \page FAQ FAQ (Frequently Asked Questions) + \page FAQ FAQ (Frequently Asked Questions) A list of frequently asked questions about FLTK. @@ -32,7 +32,7 @@ and then read them, download and build FLTK from the source, then run the test/demo program. Also, go into the 'examples/' directory and run 'make', then run some of those programs. -If you prefer watching TV to reading books and code, google search for +If you prefer watching TV to reading books and code, google search for "FLTK video tutorials" which has some introductory examples of how to write FLTK programs in C++ and build them. @@ -79,8 +79,8 @@ clause ("exception") to allow for static linking. Specifically: 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). + [program/widget] is based in part on the work of the + FLTK project (https://www.fltk.org). \endverbatim diff --git a/documentation/src/fltk-config.man b/documentation/src/fltk-config.man index 2fc3b7f09..6b53958b8 100644 --- a/documentation/src/fltk-config.man +++ b/documentation/src/fltk-config.man @@ -85,6 +85,6 @@ fluid(1), fltk(3) .br FLTK Programming Manual .br -FLTK Web Site, http://www.fltk.org/ +FLTK Web Site, https://www.fltk.org/ .SH AUTHORS Bill Spitzak and others. diff --git a/documentation/src/fltk.man b/documentation/src/fltk.man index 8950712cd..89d680a75 100644 --- a/documentation/src/fltk.man +++ b/documentation/src/fltk.man @@ -21,7 +21,7 @@ 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: .IP - http://www.fltk.org/str.php + https://www.fltk.org/bugs.php .IP 2. Widgets that are subclassed from FLTK widgets do not constitute a derivative work. @@ -46,12 +46,12 @@ following example statement can be included in user documentation to satisfy this requirement: .IP [program/widget] is based in part on the work of the FLTK -project (http://www.fltk.org). +project (https://www.fltk.org). .SH SEE ALSO fltk\-config(1), fluid(1) .br FLTK Programming Manual .br -FLTK Web Site, http://www.fltk.org/ +FLTK Web Site, https://www.fltk.org/ .SH AUTHORS Bill Spitzak and others. diff --git a/documentation/src/fluid.dox b/documentation/src/fluid.dox index 1978ce636..9d1e1fcc4 100644 --- a/documentation/src/fluid.dox +++ b/documentation/src/fluid.dox @@ -3,7 +3,7 @@ <!-- Warning: \p .h does not work but <tt>.h</tt> does --> <!-- Warning: \p .cxx does not work but <tt>.cxx</tt> does --> - \page fluid Programming with FLUID + \page fluid Programming with FLUID This chapter shows how to use the Fast Light User-Interface Designer ("FLUID") to create your GUIs. @@ -135,7 +135,7 @@ files: \code my_panels.h my_panels.cxx: my_panels.fl - fluid -c my_panels.fl + fluid -c my_panels.fl \endcode Most versions of make support rules that cause <tt>.fl</tt> @@ -144,7 +144,7 @@ files to be compiled: \code .SUFFIXES: .fl .cxx .h .fl.h .fl.cxx: - fluid -c $< + fluid -c $< \endcode If you use diff --git a/documentation/src/fluid.man b/documentation/src/fluid.man index cb6849bc3..1e00598ac 100644 --- a/documentation/src/fluid.man +++ b/documentation/src/fluid.man @@ -9,7 +9,7 @@ fluid [ \-c [ \-o .I header-filename ] ] [ .I filename.fl -] +] .fi .SH DESCRIPTION \fIfluid\fR is an interactive GUI designer for FLTK. When run @@ -19,7 +19,7 @@ Functions, classes, windows, and GUI components can be manipulated as needed. .LP When used with the \fI\-c\fR option, \fIfluid\fR will create the -necessary C++ header and code files in the current directory. +necessary C++ header and code files in the current directory. You can override the default extensions, filenames, and directories using the \fI\-o\fR and \fI\-h\fR options. .SH SEE ALSO @@ -27,6 +27,6 @@ fltk\-config(1), fltk(3) .br FLTK Programming Manual, Chapter 9 .br -FLTK Web Site, http://www.fltk.org/ +FLTK Web Site, https://www.fltk.org/ .SH AUTHORS Bill Spitzak and others. diff --git a/documentation/src/forms.dox b/documentation/src/forms.dox index c2379e983..bb6279934 100644 --- a/documentation/src/forms.dox +++ b/documentation/src/forms.dox @@ -1,7 +1,7 @@ /** <!-- Warning: \p .fd does not work but <tt>.fd</tt> does --> - \page forms Forms Compatibility + \page forms Forms Compatibility This appendix describes the Forms compatibility included with FLTK. @@ -27,7 +27,7 @@ new name so you don't write over the old one. You will need to edit your main code considerably to get it to link with the output from FLUID. If you are not interested in this you may -have more immediate luck with the forms compatibility header, <FL/forms.H>. +have more immediate luck with the forms compatibility header, <FL/forms.H>. \section forms_using Using the Compatibility Header File @@ -42,31 +42,31 @@ without changes. You will also have to compile your Forms or XForms program using a C++ compiler. The FLTK library does not provide C bindings or header -files. +files. Although FLTK was designed to be compatible with the GL Forms library (version 0.3 or so), XForms has bloated severely and its interface is X-specific. Therefore, XForms compatibility is no longer a goal of FLTK. Compatibility was limited to things that were free, or that would add code that would not be linked in if the feature is -unused, or that was not X-specific. +unused, or that was not X-specific. To use any new features of FLTK, you should rewrite your code to not use the inline functions and instead use "pure" FLTK. This will make it a lot cleaner and make it easier to figure out how to call the FLTK functions. Unfortunately this conversion is harder than expected and -even Digital Domain's inhouse code still uses <tt>forms.H</tt> a lot. +even Digital Domain's inhouse code still uses <tt>forms.H</tt> a lot. \section forms_problems Problems You Will Encounter Many parts of XForms use X-specific structures like \c XEvent in their interface. I did not emulate these! Unfortunately these features (such as the "canvas" widget) are needed by most large -programs. You will need to rewrite these to use FLTK subclasses. +programs. You will need to rewrite these to use FLTK subclasses. Fl_Free widgets emulate the \e old Forms "free" widget. It may be useful for porting programs that change the \c handle() -function on widgets, but you will still need to rewrite things. +function on widgets, but you will still need to rewrite things. Fl_Timer widgets are provided to emulate the XForms timer. These work, but are quite @@ -77,33 +77,33 @@ the \p x, \p y, \p w, \p h, \p label, or other fields of your Forms widgets you will have to add empty parenthesis after each reference. The easiest way to do this is to globally replace <tt>"->x"</tt> with <tt>"->x()"</tt>, etc. -Replace <tt>"boxtype"</tt> with <tt>"box()"</tt>. +Replace <tt>"boxtype"</tt> with <tt>"box()"</tt>. <tt>const char *</tt> arguments to most FLTK methods are simply stored, while Forms would \c strdup() the passed string. This is most noticeable with the label of widgets. Your program must always pass static data such as a string constant or malloc'd buffer to \c label(). If you are using labels to display program output you -may want to try the Fl_Output widget. +may want to try the Fl_Output widget. The default fonts and sizes are matched to the older GL version of Forms, so all labels will draw somewhat larger than an XForms program -does. +does. fdesign outputs a setting of a "fdui" instance variable to the main window. I did not emulate this because I wanted all instance variables to be hidden. You can store the same information in the \c user_data() field of a window. To do this, search through the fdesign output for all occurrences of <tt>"->fdui"</tt> and edit to use <tt>"->user_data()"</tt> -instead. This will require casts and is not trivial. +instead. This will require casts and is not trivial. The prototype for the functions passed to \c fl_add_timeout() -and \c fl_set_idle_callback() callback are different. +and \c fl_set_idle_callback() callback are different. <B>All the following XForms calls are missing:</B> \li \c FL_REVISION, \c fl_library_version() -\li \c FL_RETURN_DBLCLICK (use Fl::event_clicks()) +\li \c FL_RETURN_DBLCLICK (use Fl::event_clicks()) \li \c fl_add_signal_callback() \li \c fl_set_form_atactivate() \c fl_set_form_atdeactivate() \li \c fl_set_form_property() @@ -111,38 +111,38 @@ and \c fl_set_idle_callback() callback are different. \li \c fl_set_form_minsize(), \c fl_set_form_maxsize() \li \c fl_set_form_event_cmask(), \c fl_get_form_event_cmask() \li \c fl_set_form_dblbuffer(), \c fl_set_object_dblbuffer() - (use an Fl_Double_Window instead) + (use an Fl_Double_Window instead) \li \c fl_adjust_form_size() \li \c fl_register_raw_callback() \li \c fl_set_object_bw(), \c fl_set_border_width() \li \c fl_set_object_resize(), \c fl_set_object_gravity() \li \c fl_set_object_shortcutkey() \li \c fl_set_object_automatic() -\li \c fl_get_object_bbox() (maybe FLTK should do this) +\li \c fl_get_object_bbox() (maybe FLTK should do this) \li \c fl_set_object_prehandler(), \c fl_set_object_posthandler() \li \c fl_enumerate_fonts() -\li Most drawing functions -\li \c fl_set_coordunit() (FLTK uses pixels all the time) +\li Most drawing functions +\li \c fl_set_coordunit() (FLTK uses pixels all the time) \li \c fl_ringbell() \li \c fl_gettime() -\li \c fl_win*() (all these functions) -\li \c fl_initialize(argc,argv,x,y,z) ignores last 3 arguments +\li \c fl_win*() (all these functions) +\li \c fl_initialize(argc,argv,x,y,z) ignores last 3 arguments \li \c fl_read_bitmapfile(), \c fl_read_pixmapfile() \li \c fl_addto_browser_chars() -\li \c FL_MENU_BUTTON just draws normally +\li \c FL_MENU_BUTTON just draws normally \li \c fl_set_bitmapbutton_file(), \c fl_set_pixmapbutton_file() -\li \c FL_CANVAS objects -\li \c FL_DIGITAL_CLOCK (comes out analog) +\li \c FL_CANVAS objects +\li \c FL_DIGITAL_CLOCK (comes out analog) \li \c fl_create_bitmap_cursor(), \c fl_set_cursor_color() \li \c fl_set_dial_angles() \li \c fl_show_oneliner() -\li \c fl_set_choice_shortcut(a,b,c) -\li command log -\li Only some of file selector is emulated +\li \c fl_set_choice_shortcut(a,b,c) +\li command log +\li Only some of file selector is emulated \li \c FL_DATE_INPUT -\li \c fl_pup*() (all these functions) -\li textbox object (should be easy but I had no sample programs) -\li xyplot object +\li \c fl_pup*() (all these functions) +\li textbox object (should be easy but I had no sample programs) +\li xyplot object \section forms_notes Additional Notes @@ -166,15 +166,15 @@ panels. If the user did things to the IRISGL window, you would find this out by having the value FL_EVENT returned from the call to Forms. None of this works with FLTK. Nor will it compile, the necessary -calls are not in the interface. +calls are not in the interface. You have to make a subclass of Fl_Gl_Window and write a \c draw() method and \c handle() method. This may require anywhere from a trivial to a -major rewrite. +major rewrite. If you draw into the overlay planes you will have to also write a \c draw_overlay() method and call \c redraw_overlay() on the -OpenGL window. +OpenGL window. One easy way to hack your program so it works is to make the \c draw() and \c handle() methods on your window set some static variables, storing @@ -186,7 +186,7 @@ they are events read from \c fl_queue. The file <FL/gl.h> defines replacements for a lot of IRISGL calls, translating them to OpenGL. There are much better translators -available that you might want to investigate. +available that you might want to investigate. \par You Cannot Make Forms Subclasses @@ -200,10 +200,10 @@ if it "understood" the event. An attempt has been made to emulate the "free" widget. This appears to work quite well. It may be quicker to modify your subclass into a -"free" widget, since the "handle" functions match. +"free" widget, since the "handle" functions match. If your subclass draws into the overlay you are in trouble and will -have to rewrite things a lot. +have to rewrite things a lot. \par You Cannot Use <device.h> diff --git a/documentation/src/glut.dox b/documentation/src/glut.dox index 985d3074f..0effbe5a4 100644 --- a/documentation/src/glut.dox +++ b/documentation/src/glut.dox @@ -1,6 +1,6 @@ /** - \page glut GLUT Compatibility + \page glut GLUT Compatibility This appendix describes the GLUT compatibility header file supplied with FLTK. FLTK's GLUT compatibility is based on the original GLUT 3.7 and @@ -42,7 +42,7 @@ to compile: \li \p glutLayerGet(GLUT_LAYER_IN_USE) \li \p glutPushWindow() \li \p glutSetColor(), \p glutGetColor(), \p glutCopyColormap() -\li \p glutVideoResize() missing. +\li \p glutVideoResize() missing. \li \p glutWarpPointer() \li \p glutWindowStatusFunc() \li Spaceball, buttonbox, dials, and tablet functions @@ -94,17 +94,17 @@ Fl_Window parent window must already be shown. \li Don't call \p glutInit(). \li Create your Fl_Window, and any FLTK widgets. Leave a - blank area in the window for your GLUT window. + blank area in the window for your GLUT window. \li \p show() the Fl_Window. Perhaps call \p show(argc,argv). \li Call <tt>window->begin()</tt> so that the GLUT window will be - automatically added to it. + automatically added to it. \li Use \p glutInitWindowSize() and \p glutInitWindowPosition() - to set the location in the parent window to put the GLUT window. + to set the location in the parent window to put the GLUT window. \li Put your GLUT code next. It probably does not need many changes. Call <tt>window->end()</tt> immediately after the \p glutCreateWindow()! \li You can call either \p glutMainLoop(), Fl::run(), - or loop calling Fl::wait() to run the program. + or loop calling Fl::wait() to run the program. \section glut_Fl_Glut_Window class Fl_Glut_Window @@ -139,7 +139,7 @@ or make the window current. <tt>window->make_current()</tt> is the same as \p glutSetWindow(number). If the window has not had \p show() called on it yet, some functions -that assume an OpenGL context will not work. +that assume an OpenGL context will not work. If you do \p show() the window, call \p make_current() again to set the context. @@ -152,57 +152,57 @@ be altered directly: <CENTER><TABLE WIDTH="80%" BORDER="1" ALT="Fl_Glut_Window public members."> <TR> - <TH>member</TH> - <TH>description</TH> + <TH>member</TH> + <TH>description</TH> </TR> <TR> - <TD>display</TD> - <TD>A pointer to the function to call to draw the normal planes.</TD> + <TD>display</TD> + <TD>A pointer to the function to call to draw the normal planes.</TD> </TR> <TR> - <TD>entry</TD> - <TD>A pointer to the function to call when the mouse moves into - or out of the window.</TD> + <TD>entry</TD> + <TD>A pointer to the function to call when the mouse moves into + or out of the window.</TD> </TR> <TR> - <TD>keyboard</TD> - <TD>A pointer to the function to call when a regular key is pressed.</TD> + <TD>keyboard</TD> + <TD>A pointer to the function to call when a regular key is pressed.</TD> </TR> <TR> - <TD>menu[3]</TD> - <TD>The menu to post when one of the mouse buttons is pressed.</TD> + <TD>menu[3]</TD> + <TD>The menu to post when one of the mouse buttons is pressed.</TD> </TR> <TR> - <TD>mouse</TD> - <TD>A pointer to the function to call when a button is pressed or - released.</TD> + <TD>mouse</TD> + <TD>A pointer to the function to call when a button is pressed or + released.</TD> </TR> <TR> - <TD>motion</TD> - <TD>A pointer to the function to call when the mouse is moved with - a button down.</TD> + <TD>motion</TD> + <TD>A pointer to the function to call when the mouse is moved with + a button down.</TD> </TR> <TR> - <TD>overlaydisplay</TD> - <TD>A pointer to the function to call to draw the overlay planes.</TD> + <TD>overlaydisplay</TD> + <TD>A pointer to the function to call to draw the overlay planes.</TD> </TR> <TR> - <TD>passivemotion</TD> - <TD>A pointer to the function to call when the mouse is moved with - no buttons down.</TD> + <TD>passivemotion</TD> + <TD>A pointer to the function to call when the mouse is moved with + no buttons down.</TD> </TR> <TR> - <TD>reshape</TD> - <TD>A pointer to the function to call when the window is resized.</TD> + <TD>reshape</TD> + <TD>A pointer to the function to call when the window is resized.</TD> </TR> <TR> - <TD>special</TD> - <TD>A pointer to the function to call when a special key is pressed.</TD> + <TD>special</TD> + <TD>A pointer to the function to call when a special key is pressed.</TD> </TR> <TR> - <TD>visibility</TD> - <TD>A pointer to the function to call when the window is iconified - or restored (made visible.)</TD> + <TD>visibility</TD> + <TD>A pointer to the function to call when the window is iconified + or restored (made visible.)</TD> </TR> </TABLE></CENTER> diff --git a/documentation/src/html_footer b/documentation/src/html_footer index ac12b5f5f..4d60ab346 100644 --- a/documentation/src/html_footer +++ b/documentation/src/html_footer @@ -2,7 +2,7 @@ <li class="footer"> <!-- Generated for $projectname by Doxygen --> © 1998-2018 by Bill Spitzak and others. - <a href="http://www.fltk.org"><img src="tiny.png" align="bottom" alt="FLTK"></a> + <a href="https://www.fltk.org"><img src="tiny.png" align="bottom" alt="FLTK"></a> </li> </ul> </div> @@ -11,7 +11,7 @@ <hr class="footer"/><address class="footer"><small> <!-- Generated for $projectname by Doxygen --> © 1998-2018 by Bill Spitzak and others. - <a href="http://www.fltk.org"><img src="tiny.png" align="bottom" alt="FLTK"></a> + <a href="https://www.fltk.org"><img src="tiny.png" align="bottom" alt="FLTK"></a> </small></address> <hr class="footer"/><address class="footer"><small> <div align="center"> diff --git a/documentation/src/index.dox b/documentation/src/index.dox index c81ac5f23..09b4545bd 100644 --- a/documentation/src/index.dox +++ b/documentation/src/index.dox @@ -38,27 +38,27 @@ \subpage basics \subpage common - - \ref common_colors - - \ref common_boxtypes - - \ref common_labels - - \ref drawing_images + - \ref common_colors + - \ref common_boxtypes + - \ref common_labels + - \ref drawing_images \subpage editor \subpage drawing \subpage events - - \ref events_event_xxx - - \ref events_propagation + - \ref events_event_xxx + - \ref events_propagation \subpage subclassing \subpage opengl \subpage fluid - - \ref fluid_widget_attributes - - \ref fluid_selecting_moving - - \ref fluid_images + - \ref fluid_widget_attributes + - \ref fluid_selecting_moving + - \ref fluid_images </TD> <TD ALIGN="LEFT" VALIGN="TOP"> @@ -70,25 +70,25 @@ <b>Appendices:</b> - - \subpage enumerations + - \subpage enumerations - - \subpage glut - - \ref glut_Fl_Glut_Window - <!-- - Fl_Glut_Window (not yet commented ?) --> + - \subpage glut + - \ref glut_Fl_Glut_Window + <!-- - Fl_Glut_Window (not yet commented ?) --> - - \subpage forms + - \subpage forms - - \subpage osissues + - \subpage osissues - - \subpage migration_1_4 + - \subpage migration_1_4 - - \subpage development + - \subpage development - - \subpage license + - \subpage license - - \subpage examples + - \subpage examples - - \subpage FAQ + - \subpage FAQ </TD> </TR> diff --git a/documentation/src/intro.dox b/documentation/src/intro.dox index 338e8ae99..8df76f07c 100644 --- a/documentation/src/intro.dox +++ b/documentation/src/intro.dox @@ -356,7 +356,7 @@ FLTK is available on the 'net in a bunch of locations: \par WWW https://www.fltk.org/ <br> -https://www.fltk.org/str.php [for reporting bugs] <br> +https://www.fltk.org/bugs.php [for reporting bugs] <br> https://www.fltk.org/software.php [download source code]<br> https://www.fltk.org/newsgroups.php [newsgroup/forums] @@ -368,7 +368,7 @@ https://www.fltk.org/newsgroups.php [web interface]<br> \section intro_reporting Reporting Bugs To report a bug in FLTK, or for feature requests, please use the form at -<A href="https://www.fltk.org/str.php">https://www.fltk.org/str.php</A>, +<A href="https://www.fltk.org/bugs.php">https://www.fltk.org/bugs.php</A>, and click on "Submit Bug or Feature Request". You'll be prompted for the FLTK version, operating system & version, diff --git a/documentation/src/license.dox b/documentation/src/license.dox index 63c96ad2a..1110280ed 100644 --- a/documentation/src/license.dox +++ b/documentation/src/license.dox @@ -1,6 +1,6 @@ /** - \page license Software License + \page license Software License \par December 11, 2001 @@ -8,43 +8,43 @@ The FLTK library and included programs are provided under the terms of the GNU Library General Public License (LGPL) with the following exceptions: --# 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.<BR> - <BR> +-# 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.<BR> + <BR> 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<BR> - <BR> --# Widgets that are subclassed from FLTK widgets do not - constitute a derivative work.<BR> - <BR> --# 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.<BR> - <BR> - 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.<BR> - <BR> --# 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.<BR> - <BR> - However, programs must still identify their use of FLTK. - The following example statement can be included in user - documentation to satisfy this requirement:<BR> - <BR> - <I>[program/widget] is based in part on the work of - the FLTK project (http://www.fltk.org).</I> + https://www.fltk.org/bugs.php<BR> + <BR> +-# Widgets that are subclassed from FLTK widgets do not + constitute a derivative work.<BR> + <BR> +-# 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.<BR> + <BR> + 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.<BR> + <BR> +-# 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.<BR> + <BR> + However, programs must still identify their use of FLTK. + The following example statement can be included in user + documentation to satisfy this requirement:<BR> + <BR> + <I>[program/widget] is based in part on the work of + the FLTK project (https://www.fltk.org).</I> <HR> @@ -68,7 +68,7 @@ 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. +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 @@ -153,7 +153,7 @@ General Public License rather than by this special one. \b 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"). +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 diff --git a/documentation/src/migration_1_4.dox b/documentation/src/migration_1_4.dox index 57fd9faea..1a24d487a 100644 --- a/documentation/src/migration_1_4.dox +++ b/documentation/src/migration_1_4.dox @@ -1,6 +1,6 @@ /** - \page migration_1_4 Migrating Code from FLTK 1.3 to 1.4 + \page migration_1_4 Migrating Code from FLTK 1.3 to 1.4 This appendix describes the differences between the FLTK 1.3.x and FLTK 1.4.x functions and classes. diff --git a/documentation/src/opengl.dox b/documentation/src/opengl.dox index 94c13eb17..9d727d87a 100644 --- a/documentation/src/opengl.dox +++ b/documentation/src/opengl.dox @@ -1,6 +1,6 @@ /** - \page opengl Using OpenGL + \page opengl Using OpenGL This chapter discusses using FLTK for your OpenGL applications. @@ -55,15 +55,15 @@ glDrawBuffer(GL_BACK); <CENTER><TABLE WIDTH="80%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc"> <TR> - <TD><B>Note:</B> + <TD><B>Note:</B> - If you are using the Mesa graphics library, the call - to \p glDrawBuffer() is not required and will slow - down drawing considerably. The preprocessor instructions - shown above will optimize your code based upon the - graphics library used. + If you are using the Mesa graphics library, the call + to \p glDrawBuffer() is not required and will slow + down drawing considerably. The preprocessor instructions + shown above will optimize your code based upon the + graphics library used. - </TD> + </TD> </TR> </TABLE></CENTER> @@ -150,12 +150,12 @@ loading functions by doing: \code case FL_PUSH: - make_current(); // make OpenGL context current + make_current(); // make OpenGL context current if (!valid()) { ... set up projection exactly the same as draw ... - valid(1); // stop it from doing this next time + valid(1); // stop it from doing this next time } ... ok to call NON-DRAWING OpenGL code here, such as hit detection, loading textures, etc... @@ -453,10 +453,10 @@ void OptimizerWindow::draw() { // Clear the window... context_->clear(csContext::COLOR_CLEAR | csContext::DEPTH_CLEAR, - 0.0f, // Red - 0.0f, // Green - 0.0f, // Blue - 1.0f); // Alpha + 0.0f, // Red + 0.0f, // Green + 0.0f, // Blue + 1.0f); // Alpha // Then draw the scene (if any)... if (scene_) diff --git a/documentation/src/osissues.dox b/documentation/src/osissues.dox index e2511f4ef..d629acfab 100644 --- a/documentation/src/osissues.dox +++ b/documentation/src/osissues.dox @@ -1,6 +1,6 @@ /** - \page osissues Operating System Issues + \page osissues Operating System Issues This appendix describes the operating system specific interfaces in FLTK: \li \ref osissues_accessing @@ -21,24 +21,24 @@ This header file will define the appropriate interface for your environment. The pages that follow describe the functionality that is provided for each operating system. -\note These definitions used to be in FL/x.H up to FLTK 1.3.x. Usage of - FL/x.H is deprecated since FLTK 1.4.0. You should replace all references - of FL/x.H with FL/platform.H if your target is FLTK 1.4 or later. - FL/x.H will be retained for backwards compatibility for some - releases but will be removed in a later (not yet specified) - FLTK release. +\note These definitions used to be in FL/x.H up to FLTK 1.3.x. Usage of + FL/x.H is deprecated since FLTK 1.4.0. You should replace all references + of FL/x.H with FL/platform.H if your target is FLTK 1.4 or later. + FL/x.H will be retained for backwards compatibility for some + releases but will be removed in a later (not yet specified) + FLTK release. <CENTER> <TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc"> <TR> - <TD><B>WARNING:</B> + <TD><B>WARNING:</B> - The interfaces provided by this header file may - change radically in new FLTK releases. Use them only - when an existing generic FLTK interface is not - sufficient. + The interfaces provided by this header file may + change radically in new FLTK releases. Use them only + when an existing generic FLTK interface is not + sufficient. - </TD> + </TD> </TR> </TABLE> </CENTER> @@ -157,7 +157,7 @@ int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) Convert a name into the red, green, and blue values of a color by parsing the X11 color names. On other systems, \c fl_parse_color() can only convert names in hexadecimal encoding, for example <tt>\#ff8083</tt>. - + extern XFontStruct *fl_xfont \par @@ -167,7 +167,7 @@ This is not necessarily the current font of \c fl_gc, which is not set until \ref ssect_Text "fl_draw()" is called. If FLTK was compiled with Xft support, \c fl_xfont -will usually be 0 and \c fl_xftfont will contain a pointer +will usually be 0 and \c fl_xftfont will contain a pointer to the \c XftFont structure instead. extern void *fl_xftfont @@ -176,7 +176,7 @@ extern void *fl_xftfont If FLTK was compiled with Xft support enabled, \c fl_xftfont points to the xft font selected by the most recent \ref ssect_Fonts "fl_font()". -Otherwise it will be 0. \c fl_xftfont should be cast to +Otherwise it will be 0. \c fl_xftfont should be cast to <tt>XftFont*</tt>. \subsection osissues_xvisual Changing the Display, Screen, or X Visual @@ -283,7 +283,7 @@ An example: \code void MyWindow::show() { if (shown()) {Fl_Window::show(); return;} // you must do this! - fl_open_display(); // necessary if this is first window + fl_open_display(); // necessary if this is first window // we only calculate the necessary visual colormap once: static XVisualInfo *visual; static Colormap colormap; @@ -428,13 +428,13 @@ of libraries that are used to link the application (usually "-lXpm"). <CENTER> <TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc"> <TR> - <TD><B>NOTE:</B> - - You must call Fl_Window::show(int argc, char** argv) - for the icon to be used. The Fl_Window::show() method - does not bind the icon to the window. + <TD><B>NOTE:</B> + + You must call Fl_Window::show(int argc, char** argv) + for the icon to be used. The Fl_Window::show() method + does not bind the icon to the window. - </TD> + </TD> </TR> </TABLE> </CENTER> @@ -446,27 +446,27 @@ Fl_Window::show(int argc, char** argv) method is called, FLTK looks for the following X resources: \li \c background - The default background color - for widgets (color). + for widgets (color). \li \c dndTextOps - The default setting for - drag and drop text operations (boolean). + drag and drop text operations (boolean). \li \c foreground - The default foreground (label) - color for widgets (color). + color for widgets (color). \li \c scheme - The default scheme to use (string). \li \c selectBackground - The default selection - color for menus, etc. (color). + color for menus, etc. (color). \li <tt>Text.background</tt> - The default background - color for text fields (color). + color for text fields (color). \li \c tooltips - The default setting for - tooltips (boolean). + tooltips (boolean). \li \c visibleFocus - The default setting for - visible keyboard focus on non-text widgets (boolean). + visible keyboard focus on non-text widgets (boolean). Resources associated with the first window's Fl_Window::xclass() string are queried first, or if no class has been specified then @@ -488,7 +488,7 @@ state information and data structures. \subsection non_ascii_filenames Using filenames with non-ASCII characters In FLTK, all strings, including filenames, are UTF-8 encoded. The utility functions -fl_fopen() and fl_open() allow to open files potentially having non-ASCII names in a +fl_fopen() and fl_open() allow to open files potentially having non-ASCII names in a cross-platform fashion, whereas the standard fopen()/open() functions fail to do so. \subsection osissues_wm_quit Responding to WM_QUIT @@ -615,13 +615,13 @@ bitmap data. <CENTER> <TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc"> <TR> - <TD><B>NOTE:</B> - - You must call Fl_Window::show(int argc, char** argv) - for the icon to be used. The Fl_Window::show() method - does not bind the icon to the window. + <TD><B>NOTE:</B> + + You must call Fl_Window::show(int argc, char** argv) + for the icon to be used. The Fl_Window::show() method + does not bind the icon to the window. - </TD> + </TD> </TR> </TABLE> </CENTER> @@ -656,32 +656,32 @@ them in the foreground. The following is a list of known bugs and problems in the Windows version of FLTK: -\li If a program is deactivated, <tt>Fl::wait()</tt> - does not return until it is activated again, even though - many events are delivered to the program. This can cause - idle background processes to stop unexpectedly. This - also happens while the user is dragging or resizing - windows or otherwise holding the mouse down. We were - forced to remove most of the efficiency FLTK uses for - redrawing in order to get windows to update while being - moved. This is a design error in Windows and probably - impossible to get around. - -\li <tt>Fl_Gl_Window::can_do_overlay()</tt> returns true - until the first time it attempts to draw an overlay, and - then correctly returns whether or not there is overlay - hardware. - -\li <tt>SetCapture</tt> (used by <tt>Fl::grab()</tt>) - doesn't work, and the main window title bar turns gray - while menus are popped up. - -\li Compilation with <tt>gcc 3.4.4</tt> and <tt>-Os</tt> exposes an - optimisation bug in gcc. The symptom is that when drawing - filled circles only the perimeter is drawn. This can for instance - be seen in the symbols demo. Other optimisation options such - as -O2 and -O3 seem to work OK. More details can be found - in STR#1656 +\li If a program is deactivated, <tt>Fl::wait()</tt> + does not return until it is activated again, even though + many events are delivered to the program. This can cause + idle background processes to stop unexpectedly. This + also happens while the user is dragging or resizing + windows or otherwise holding the mouse down. We were + forced to remove most of the efficiency FLTK uses for + redrawing in order to get windows to update while being + moved. This is a design error in Windows and probably + impossible to get around. + +\li <tt>Fl_Gl_Window::can_do_overlay()</tt> returns true + until the first time it attempts to draw an overlay, and + then correctly returns whether or not there is overlay + hardware. + +\li <tt>SetCapture</tt> (used by <tt>Fl::grab()</tt>) + doesn't work, and the main window title bar turns gray + while menus are popped up. + +\li Compilation with <tt>gcc 3.4.4</tt> and <tt>-Os</tt> exposes an + optimisation bug in gcc. The symptom is that when drawing + filled circles only the perimeter is drawn. This can for instance + be seen in the symbols demo. Other optimisation options such + as -O2 and -O3 seem to work OK. More details can be found + in STR#1656 \section osissues_macos The Apple OS X Interface @@ -707,8 +707,8 @@ Right Click simulation with Ctrl Click The Apple HIG guidelines indicate applications should support 'Ctrl Click' to simulate 'Right Click' for e.g. context menus, so users with one-button mice and one-click trackpads can still -access right-click features. However, paraphrasing -<A HREF="http://www.fltk.org/newsgroups.php?gfltk.coredev+v:14725"> +access right-click features. However, paraphrasing +<A HREF="https://www.fltk.org/newsgroups.php?gfltk.coredev+v:14725"> Manolo's comment on the fltk.coredev newsgroup</A>: \par <UL><LI> @@ -725,24 +725,24 @@ showing an example of how to do this: \code case FL_PUSH: { - int btn = Fl::event_button(); + int btn = Fl::event_button(); #ifdef __APPLE__ - int ev_state = Fl::event_state(); + int ev_state = Fl::event_state(); #endif - // - // Context menu can be called up in one of two ways: - - // 1 - right click, as normally used on Windows and Linux - // 2 - Ctrl + left click, as sometimes used on Mac - // + // + // Context menu can be called up in one of two ways: - + // 1 - right click, as normally used on Windows and Linux + // 2 - Ctrl + left click, as sometimes used on Mac + // #ifdef __APPLE__ - // On apple, check right click, and ctrl+left click - if ((btn == FL_RIGHT_MOUSE) || (ev_state == (FL_CTRL | FL_BUTTON1))) + // On apple, check right click, and ctrl+left click + if ((btn == FL_RIGHT_MOUSE) || (ev_state == (FL_CTRL | FL_BUTTON1))) #else - // On other platforms, only check right click as ctrl+left is used for selections - if (btn == FL_RIGHT_MOUSE) + // On other platforms, only check right click as ctrl+left is used for selections + if (btn == FL_RIGHT_MOUSE) #endif - { - // Did we right click on the object?.. + { + // Did we right click on the object?.. \endcode \par There is a thread about this subject on fltk.coredev (Aug 1-14, 2014) @@ -753,7 +753,7 @@ Apple "Quit" Event \par When the user presses Cmd-Q or requests a termination of the application, FLTK sends an \c FL_CLOSE event to all open -windows. If any window remains open, the termination request aborts. +windows. If any window remains open, the termination request aborts. If all windows close, the application's event loop terminates, that is, Fl::run() returns. The application can then follow FLTK's normal termination path executing cleanup code that may be programmed @@ -789,7 +789,7 @@ Fl_Window *fl_find(Window xid) Returns the Fl_Window that corresponds to the given window reference, or \c NULL if not found. -void fl_mac_set_about( Fl_Callback *cb, void *user_data, int shortcut) +void fl_mac_set_about( Fl_Callback *cb, void *user_data, int shortcut) \par Attaches the callback \c cb to the "About myprog" item of the system application menu. @@ -816,14 +816,14 @@ it is necessary to use the iconutil command-line utility. <key>CFBundleIconFile</key> <string>foo.icns</string> \endverbatim -replacing <tt>foo</tt> by your application name. If you use Xcode, just add your .icns file to your +replacing <tt>foo</tt> by your application name. If you use Xcode, just add your .icns file to your application target. \subsection osissues_quartz Drawing Things Using Quartz All code inside Fl_Widget::draw() -is expected to call Quartz drawing functions. The Quartz coordinate system +is expected to call Quartz drawing functions. The Quartz coordinate system is flipped to match FLTK's coordinate system. The origin for all drawing is in the top left corner of the enclosing Fl_Window. The global variable @@ -834,9 +834,9 @@ Include FL/platform.H to declare the \c fl_gc variable. All FLTK programs contain an application menu with, e.g., the About xxx, Hide xxx, and Quit xxx items. This menu can be internationalized/localized by any of two means. \li using the Fl_Mac_App_Menu class. -\li using the standard Mac OS X localization procedure. Create a language-specific .lproj directory -(e.g., <tt>German.lproj</tt>) in the Resources subdirectory of the application bundle. -Create therein a <tt>Localizable.strings</tt> file that translates all menu items to this language. +\li using the standard Mac OS X localization procedure. Create a language-specific .lproj directory +(e.g., <tt>German.lproj</tt>) in the Resources subdirectory of the application bundle. +Create therein a <tt>Localizable.strings</tt> file that translates all menu items to this language. The German <tt>Localizable.strings</tt> file, for example, contains: \verbatim "About %@" = "Über %@"; @@ -854,9 +854,9 @@ and put <tt>CFBundleName = "localized name";</tt> in each such file. \subsection osissues_retina OpenGL and 'retina' displays It is possible to have OpenGL produce graphics at the high pixel resolution allowed by the so-called 'retina' displays present on recent Apple hardware. -For this, call +For this, call \verbatim -Fl::use_high_res_GL(1); +Fl::use_high_res_GL(1); \endverbatim before any Fl_Gl_Window is shown. Also, adapt your Fl_Gl_Window::draw() and Fl_Gl_Window::draw_overlay() methods replacing \verbatim @@ -909,13 +909,13 @@ fluid". It is advisable to use the Finder for moving and copying and Mac archiving tools like Sit for distribution as they will -handle the Resource Fork correctly. +handle the Resource Fork correctly. \par Mac File Paths FLTK uses UTF-8-encoded UNIX-style filenames and paths. -\sa group_macosx +\sa group_macosx \htmlonly diff --git a/documentation/src/preface.dox b/documentation/src/preface.dox index ef3a6c155..ab61efc03 100644 --- a/documentation/src/preface.dox +++ b/documentation/src/preface.dox @@ -63,7 +63,7 @@ The X Window System version 11. The X Window System interface library. \par MS Windows, <tt>WIN32</tt> -The Microsoft Windows Application Programmer's Interface for Windows 2000, +The Microsoft Windows Application Programmer's Interface for Windows 2000, Windows XP, Windows Vista, Windows 7 and later Windows versions. FLTK uses the preprocessor definition <tt>_WIN32</tt> for the 32 bit and 64 bit MS Windows API. @@ -79,7 +79,7 @@ FLTK is Copyright 1998-2020 by Bill Spitzak and others. Use and distribution of FLTK is governed by the GNU Library General Public License with 4 exceptions, located in \ref license. -UNIX is a registered trademark of the X Open Group, Inc. +UNIX is a registered trademark of the X Open Group, Inc. Microsoft and Windows are registered trademarks of Microsoft Corporation. OpenGL is a registered trademark of Silicon Graphics, Inc. Apple, Macintosh, MacOS, and Mac OS X are diff --git a/documentation/src/subclassing.dox b/documentation/src/subclassing.dox index 0ae55489a..f2a41472e 100644 --- a/documentation/src/subclassing.dox +++ b/documentation/src/subclassing.dox @@ -1,6 +1,6 @@ /** - \page subclassing Adding and Extending Widgets + \page subclassing Adding and Extending Widgets This chapter describes how to add your own widgets or extend existing @@ -12,18 +12,18 @@ New widgets are created by \e subclassing an existing FLTK widget, typically Fl_Widget for controls and Fl_Group for composite widgets. A control widget typically interacts with the user to receive and/or -display a value of some sort. +display a value of some sort. A composite widget holds a list of child widgets and handles moving, sizing, showing, or hiding them as needed. Fl_Group is the main composite widget class in FLTK, and all of the other composite widgets -(Fl_Pack, Fl_Scroll, Fl_Tabs, Fl_Tile, and Fl_Window) are subclasses of it. +(Fl_Pack, Fl_Scroll, Fl_Tabs, Fl_Tile, and Fl_Window) are subclasses of it. You can also subclass other existing widgets to provide a different look or user-interface. For example, the button widgets are all subclasses of Fl_Button since they all interact with the user via a mouse button click. The only difference is the code that draws -the face of the button. +the face of the button. \section subclassing_fl_widget Making a Subclass of Fl_Widget @@ -44,7 +44,7 @@ This will allow the class to be used in without problems. The constructor must call the constructor for the base class and -pass the same arguments: +pass the same arguments: \code MyClass::MyClass(int x, int y, int w, int h, const char *label) @@ -107,7 +107,7 @@ The second form indicates that a region is damaged. If only these calls are done in a window (no calls to \p damage(n)) then FLTK will clip to the union of all these calls before drawing anything. This can greatly speed up incremental displays. The mask bits are -OR'd into \p damage() unless this is a Fl_Window widget. +OR'd into \p damage() unless this is a Fl_Window widget. \par The third form returns the bitwise-OR of all \p damage(n) @@ -171,13 +171,13 @@ draw those labels). \par The second form uses the passed bounding box instead of the widget's bounding box. This is useful so "centered" labels are aligned with some -feature, like a moving slider. +feature, like a moving slider. \par The third form draws the label anywhere. It acts as though \p FL_ALIGN_INSIDE has been forced on so the label will appear inside the passed bounding box. This is designed for parent groups to draw -labels with. +labels with. \anchor subclassing_set_flag void Fl_Widget::set_flag(int c) <br> @@ -201,15 +201,15 @@ int Fl_Widget::test_shortcut() <br> static int Fl_Widget::test_shortcut(const char *s) \par -The first version tests Fl_Widget::label() against the current event -(which should be a \p FL_SHORTCUT event). If the label contains a '&' +The first version tests Fl_Widget::label() against the current event +(which should be a \p FL_SHORTCUT event). If the label contains a '&' character and the character after it matches the keypress, this returns -true. This returns false if the \p SHORTCUT_LABEL flag is off, if the -label is \p NULL, or does not have a '&' character in it, or if the +true. This returns false if the \p SHORTCUT_LABEL flag is off, if the +label is \p NULL, or does not have a '&' character in it, or if the keypress does not match the character. \par -The second version lets you do this test against an arbitrary string. +The second version lets you do this test against an arbitrary string. \todo Clarify Fl_Widget::test_shortcut() explanations. Fl_Widget.h says Internal Use only, but subclassing chapter gives details! @@ -236,21 +236,21 @@ be greater than the symbol \p FL_RESERVED_TYPE (which is 100) and less than \p FL_WINDOW (unless you make a subclass of Fl_Window). Look through the header files for \p FL_RESERVED_TYPE to find an unused number. If you make a subclass of Fl_Window you must use -<tt>FL_WINDOW + n</tt> (where \p n must be in the range 1 to 7). +<tt>FL_WINDOW + n</tt> (where \p n must be in the range 1 to 7). \section subclassing_events Handling Events The virtual method Fl_Widget::handle(int event) is called to handle each event passed to the widget. It can: -\li Change the state of the widget. -\li Call Fl_Widget::redraw() if the widget needs to be redisplayed. +\li Change the state of the widget. +\li Call Fl_Widget::redraw() if the widget needs to be redisplayed. \li Call Fl_Widget::damage(uchar c) if the widget needs a partial-update (assuming you provide support for this in your \ref subclassing_drawing "draw()" - method). -\li Call Fl_Widget::do_callback() if a callback should be generated. -\li Call Fl_Widget::handle() on child widgets. + method). +\li Call Fl_Widget::do_callback() if a callback should be generated. +\li Call Fl_Widget::handle() on child widgets. Events are identified by the integer argument. Other information about the most recent event is stored in static locations and acquired @@ -259,7 +259,7 @@ by calling the This information remains valid until another event is handled. Here is a sample \p handle() method for a widget that acts as -a pushbutton and also accepts the keystroke \p 'x' to cause the callback: +a pushbutton and also accepts the keystroke \p 'x' to cause the callback: \code int MyClass::handle(int event) { @@ -272,23 +272,23 @@ int MyClass::handle(int event) { int t = Fl::event_inside(this); if (t != highlight) { highlight = t; - redraw(); - } + redraw(); + } } return 1; case FL_RELEASE: if (highlight) { - highlight = 0; - redraw(); + highlight = 0; + redraw(); do_callback(); - // never do anything after a callback, as the callback - // may delete the widget! + // never do anything after a callback, as the callback + // may delete the widget! } return 1; case FL_SHORTCUT: if (Fl::event_key() == 'x') { do_callback(); - return 1; + return 1; } return 0; default: @@ -301,10 +301,10 @@ You must return non-zero if your \p handle() method uses the event. If you return zero, the parent widget will try sending the event to another widget. -For debugging purposes, event numbers can be printed as their actual event names +For debugging purposes, event numbers can be printed as their actual event names using the \ref fl_eventnames[] array, e.g.: \code - #include <FL/names.h> // defines fl_eventnames[] + #include <FL/names.h> // defines fl_eventnames[] [..] int MyClass::handle(int e) { printf("Event was %s (%d)\n", fl_eventnames[e], e); // e.g. "Event was FL_PUSH (1)" @@ -325,15 +325,15 @@ the \p damage(n) calls to this widget since it was last drawn. This can be used for minimal update, by only redrawing the parts whose bits are set. FLTK will turn on the \p FL_DAMAGE_ALL bit if it thinks the entire widget must -be redrawn, e.g. for an expose event. +be redrawn, e.g. for an expose event. -Expose events (and the -\ref subclassing_damage "damage(mask,x,y,w,h)" function described +Expose events (and the +\ref subclassing_damage "damage(mask,x,y,w,h)" function described above) will cause \p draw() to be called with FLTK's \ref ssect_Clipping "clipping" turned on. You can greatly speed up redrawing in some cases by testing \p fl_not_clipped(x,y,w,h) or \p %fl_clip_box() -and skipping invisible parts. +and skipping invisible parts. Besides the protected methods described above, FLTK provides a large number of basic drawing functions, which are described in the chapter @@ -350,7 +350,7 @@ actually change. This should \e not call \p redraw(), at least if only the \p x() and \p y() change. This is because composite widgets like -Fl_Scroll may have a more efficient way of drawing the new position. +Fl_Scroll may have a more efficient way of drawing the new position. \section subclassing_composite Making a Composite Widget @@ -360,7 +360,7 @@ It is possible to make a composite object that is not a subclass of Fl_Group, but you'll have to duplicate the code in Fl_Group anyways. -Instances of the child widgets may be included in the parent: +Instances of the child widgets may be included in the parent: \code class MyClass : public Fl_Group { @@ -370,7 +370,7 @@ class MyClass : public Fl_Group { }; \endcode -The constructor has to initialize these instances. They are automatically +The constructor has to initialize these instances. They are automatically added to the group, since the Fl_Group constructor does Fl_Group::begin(). <I>Don't forget to call Fl_Group::end() or use the Fl_End pseudo-class:</I> @@ -501,7 +501,7 @@ system specific. See \ref osissues for more details. FLTK provides routines to drag and drop UTF-8 encoded text between applications: -Drag'n'drop operations are initiated by copying data to the +Drag'n'drop operations are initiated by copying data to the clipboard and calling the function Fl::dnd(). Drop attempts are handled via the following events, @@ -525,7 +525,7 @@ that expects a system window ID to indicate where to draw. Subclassing Fl_Window is almost exactly like subclassing Fl_Group, and in fact you can easily switch a subclass back and forth. Watch out for the following -differences: +differences: -# Fl_Window is a subclass of Fl_Group so <I>make sure your constructor calls</I> \p end() diff --git a/documentation/src/sudoku.man b/documentation/src/sudoku.man index 32d496e8e..f72d4e245 100644 --- a/documentation/src/sudoku.man +++ b/documentation/src/sudoku.man @@ -28,6 +28,6 @@ with the actual number to use. .SH SEE ALSO fltk(3) .br -FLTK Web Site, http://www.fltk.org/ +FLTK Web Site, https://www.fltk.org/ .SH AUTHOR Michael R Sweet. diff --git a/documentation/src/unicode.dox b/documentation/src/unicode.dox index 63f8bb773..4d74f9931 100644 --- a/documentation/src/unicode.dox +++ b/documentation/src/unicode.dox @@ -484,7 +484,7 @@ converts the strings to lower case Unicode as part of the comparison. \b OksiD - char* fl_getenv(const char* name) \b OksiD -- char fl_make_path(const char* path) - returns char ? +- char fl_make_path(const char* path) - returns char ? \b OksiD - void fl_make_path_for_file(const char* path) \b OksiD diff --git a/examples/OpenGL3-glut-test.cxx b/examples/OpenGL3-glut-test.cxx index 84c9322a4..4688cde79 100644 --- a/examples/OpenGL3-glut-test.cxx +++ b/examples/OpenGL3-glut-test.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tiny OpenGL v3 + glut demo program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -32,13 +30,13 @@ // Globals // Real programs don't use globals :-D // Data would normally be read from files -GLfloat vertices[] = { -1.0f,0.0f,0.0f, +GLfloat vertices[] = { -1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f, 0.0f,0.0f,0.0f }; -GLfloat colours[] = { 1.0f, 0.0f, 0.0f, +GLfloat colours[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f }; -GLfloat vertices2[] = { 0.0f,0.0f,0.0f, +GLfloat vertices2[] = { 0.0f,0.0f,0.0f, 0.0f,-1.0f,0.0f, 1.0f,0.0f,0.0f }; @@ -52,7 +50,7 @@ void printShaderInfoLog(GLint shader) { int infoLogLen = 0; GLchar *infoLog; - + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLen); if (infoLogLen > 0) { @@ -68,35 +66,35 @@ void printShaderInfoLog(GLint shader) void init(void) { // Would load objects from file here - but using globals in this example - + // Allocate Vertex Array Objects glGenVertexArrays(2, &vertexArrayObjID[0]); // Setup first Vertex Array Object glBindVertexArray(vertexArrayObjID[0]); glGenBuffers(2, vertexBufferObjID); - + // VBO for vertex data glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObjID[0]); glBufferData(GL_ARRAY_BUFFER, 9*sizeof(GLfloat), vertices, GL_STATIC_DRAW); glVertexAttribPointer((GLuint)0, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(0); - + // VBO for colour data glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObjID[1]); glBufferData(GL_ARRAY_BUFFER, 9*sizeof(GLfloat), colours, GL_STATIC_DRAW); glVertexAttribPointer((GLuint)1, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(1); - + // Setup second Vertex Array Object glBindVertexArray(vertexArrayObjID[1]); glGenBuffers(1, &vertexBufferObjID[2]); - + // VBO for vertex data glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObjID[2]); glBufferData(GL_ARRAY_BUFFER, 9*sizeof(GLfloat), vertices2, GL_STATIC_DRAW); glVertexAttribPointer((GLuint)0, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(0); - + glBindVertexArray(0); } @@ -105,10 +103,10 @@ void initShaders(void) { GLuint p, f, v; glClearColor (1.0, 1.0, 1.0, 0.0); - + v = glCreateShader(GL_VERTEX_SHADER); f = glCreateShader(GL_FRAGMENT_SHADER); - + #ifdef __APPLE__ #define SHADING_LANG_VERS "140" #else @@ -124,7 +122,7 @@ void initShaders(void) ex_Color = in_Color;\ gl_Position = vec4(in_Position, 1.0);\ }"; - + const char *ff = "#version "SHADING_LANG_VERS"\n\ precision highp float;\ in vec3 ex_Color;\ @@ -133,12 +131,12 @@ void initShaders(void) {\ out_Color = vec4(ex_Color,1.0);\ }"; - + glShaderSource(v, 1, &vv,NULL); glShaderSource(f, 1, &ff,NULL); - + GLint compiled; - + glCompileShader(v); glGetShaderiv(v, GL_COMPILE_STATUS, &compiled); if (!compiled) @@ -146,7 +144,7 @@ void initShaders(void) fprintf(stderr, "Vertex shader not compiled.\n"); printShaderInfoLog(v); } - + glCompileShader(f); glGetShaderiv(f, GL_COMPILE_STATUS, &compiled); if (!compiled) @@ -154,9 +152,9 @@ void initShaders(void) fprintf(stderr, "Fragment shader not compiled.\n"); printShaderInfoLog(f); } - + p = glCreateProgram(); - + glAttachShader(p,v); glAttachShader(p,f); glBindAttribLocation(p,0, "in_Position"); @@ -180,13 +178,13 @@ void display(void) { // clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glBindVertexArray(vertexArrayObjID[0]); // First VAO - glDrawArrays(GL_TRIANGLES, 0, 3); // draw first object - - glBindVertexArray(vertexArrayObjID[1]); // select second VAO + + glBindVertexArray(vertexArrayObjID[0]); // First VAO + glDrawArrays(GL_TRIANGLES, 0, 3); // draw first object + + glBindVertexArray(vertexArrayObjID[1]); // select second VAO glVertexAttrib3f((GLuint)1, 1.0, 0.0, 0.0); // set constant color attribute - glDrawArrays(GL_TRIANGLES, 0, 3); // draw second object + glDrawArrays(GL_TRIANGLES, 0, 3); // draw second object } int fullscreen = 0; @@ -218,7 +216,3 @@ int main (int argc, char* argv[]) glutMainLoop(); return 0; } - -// -// End of "$Id$". -// diff --git a/examples/OpenGL3test.cxx b/examples/OpenGL3test.cxx index b8fe670d5..1b7983529 100644 --- a/examples/OpenGL3test.cxx +++ b/examples/OpenGL3test.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tiny OpenGL v3 demo program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdarg.h> @@ -86,17 +84,17 @@ public: glCompileShader(vs); glGetShaderiv(vs, GL_COMPILE_STATUS, &err); if (err != GL_TRUE) { - glGetShaderInfoLog(vs, sizeof(CLOG), &length, CLOG); - add_output("vs ShaderInfoLog=%s\n",CLOG); - } + glGetShaderInfoLog(vs, sizeof(CLOG), &length, CLOG); + add_output("vs ShaderInfoLog=%s\n",CLOG); + } fs = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fs, 1, &fss, NULL); glCompileShader(fs); glGetShaderiv(fs, GL_COMPILE_STATUS, &err); if (err != GL_TRUE) { - glGetShaderInfoLog(fs, sizeof(CLOG), &length, CLOG); - add_output("fs ShaderInfoLog=%s\n",CLOG); - } + glGetShaderInfoLog(fs, sizeof(CLOG), &length, CLOG); + add_output("fs ShaderInfoLog=%s\n",CLOG); + } // Attach the shaders shaderProgram = glCreateProgram(); glAttachShader(shaderProgram, vs); @@ -121,11 +119,11 @@ public: 0.5,-0.5,0.0,1.0, 1.0,1.0,1.0,1.0}; glGenVertexArrays(1, &vertexArrayObject); glBindVertexArray(vertexArrayObject); - + glGenBuffers(1, &vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); glBufferData(GL_ARRAY_BUFFER, 4*8*sizeof(GLfloat), vertexData, GL_STATIC_DRAW); - + glEnableVertexAttribArray((GLuint)positionAttribute); glEnableVertexAttribArray((GLuint)colourAttribute ); glVertexAttribPointer((GLuint)positionAttribute, 4, GL_FLOAT, GL_FALSE, 8*sizeof(GLfloat), 0); @@ -157,7 +155,7 @@ public: if (gl_version_major < 3) add_output("\nThis platform does not support OpenGL V3\n\n"); redraw(); } - + if (event == FL_PUSH && gl_version_major >= 3) { static float factor = 1.1; GLfloat data[4]; @@ -229,7 +227,3 @@ int main(int argc, char **argv) Fl::run(); } -// -// End of "$Id$". -// - diff --git a/examples/README.txt b/examples/README.txt index d1a53821d..024bafffe 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -19,7 +19,7 @@ FLTK EXAMPLE PROGRAMS misused or hard to document o Demonstrate code that are FAQs on the newsgroup forum. - (such as how to use threads, callbacks, etc) + (such as how to use threads, callbacks, etc) o Example code should be short, but not at the expense of clarity. @@ -119,5 +119,7 @@ DISCLAIMER BUGS - If you find a bug, please report it through the fltk STR form at - https://www.fltk.org/str.php + If you find a bug, please report it to the FLTK team. For more + information on how to do this see this page: + + https://www.fltk.org/bugs.php diff --git a/examples/browser-simple.cxx b/examples/browser-simple.cxx index 2bd1e1a2d..4198424e4 100644 --- a/examples/browser-simple.cxx +++ b/examples/browser-simple.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Simple Fl_Browser widget example. - erco 07/26/2019 +// Simple Fl_Browser widget example. - erco 07/26/2019 // // Copyright 2019 Greg Ercolano. // Copyright 1998-2016 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> #include <FL/Fl.H> @@ -38,7 +36,7 @@ void MultiBrowserCallback(Fl_Widget *w, void *data) { Fl_Multi_Browser *brow = (Fl_Multi_Browser*)w; // Multi browser can have many items selected, so print all selected for ( int t=1; t<=brow->size(); t++ ) - if ( brow->selected(t) ) + if ( brow->selected(t) ) printf("[multi browser] item %d selected: %s\n", t, brow->text(t)); printf("\n"); } @@ -51,7 +49,7 @@ int main(int argc, char *argv[]) { { // Create Hold Browser Fl_Hold_Browser *brow = new Fl_Hold_Browser(10, 10, win->w()-20, 80, "Hold"); - brow->callback(HoldBrowserCallback); // callback for hold browser + brow->callback(HoldBrowserCallback); // callback for hold browser // Add some items brow->add("One"); brow->add("Two"); @@ -63,7 +61,7 @@ int main(int argc, char *argv[]) { { // Create Multi Browser Fl_Multi_Browser *brow = new Fl_Multi_Browser(10, 120, win->w()-20, 80, "Multi"); - brow->callback(MultiBrowserCallback); // callback for multi browser + brow->callback(MultiBrowserCallback); // callback for multi browser // Add some items brow->add("Aaa"); brow->add("Bbb"); @@ -79,7 +77,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/clipboard.cxx b/examples/clipboard.cxx index bb0a62d0e..4b4d921c6 100644 --- a/examples/clipboard.cxx +++ b/examples/clipboard.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Clipboard display test application for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Window.H> @@ -56,9 +54,9 @@ public: fl_color(FL_LIGHT2); const int side = 4, side2 = 2*side; for (int j=Y; j<Y+H; j+=side) { - for (int i=X + (j-Y)%side2; i<X+W; i+=side2) { - fl_rectf(i,j,side,side); - } + for (int i=X + (j-Y)%side2; i<X+W; i+=side2) { + fl_rectf(i,j,side,side); + } } fl_pop_clip(); fl_pop_clip(); @@ -160,7 +158,3 @@ int main(int argc, char **argv) Fl_Image::RGB_scaling(FL_RGB_SCALING_BILINEAR); // set bilinear image scaling method return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/draggable-group.cxx b/examples/draggable-group.cxx index eee143fe6..9bfd4694f 100644 --- a/examples/draggable-group.cxx +++ b/examples/draggable-group.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Demonstrate deriving a class with draggable children. // // Copyright 2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // K Dmitrij <kdiman@...> wrote on Wed, 26 Jul 2017 19:54:12 +0000 in @@ -99,70 +97,70 @@ public: switch (e) { case FL_PUSH: { - if (Fl::event_button() == FL_RIGHT_MOUSE) { - if (Fl::belowmouse()->parent() == this) { - drag_widget = Fl::belowmouse(); - - // save pointer offsets relative to drag_widget's x/y position - xoff = Fl::event_x() - drag_widget->x(); - yoff = Fl::event_y() - drag_widget->y(); - - top_level(drag_widget); // raise to top for visible feedback - redraw(); - return 1; - } - } - break; + if (Fl::event_button() == FL_RIGHT_MOUSE) { + if (Fl::belowmouse()->parent() == this) { + drag_widget = Fl::belowmouse(); + + // save pointer offsets relative to drag_widget's x/y position + xoff = Fl::event_x() - drag_widget->x(); + yoff = Fl::event_y() - drag_widget->y(); + + top_level(drag_widget); // raise to top for visible feedback + redraw(); + return 1; + } + } + break; } case FL_DRAG: { - if (!drag_widget) - break; + if (!drag_widget) + break; - int nX = Fl::event_x() - xoff; // new x coordinate - int nY = Fl::event_y() - yoff; // new y coordinate + int nX = Fl::event_x() - xoff; // new x coordinate + int nY = Fl::event_y() - yoff; // new y coordinate - int bbx = Fl::box_dx(box()); // left and right border width - int bby = Fl::box_dy(box()); // top and bottom border width + int bbx = Fl::box_dx(box()); // left and right border width + int bby = Fl::box_dy(box()); // top and bottom border width - // keep the widget inside its parent's borders + // keep the widget inside its parent's borders - if (nX < x() + bbx) { - nX = x() + bbx; - } else if (nX + drag_widget->w() > x() + w() - bbx) { - nX = x() + w() - drag_widget->w() - bbx; - } + if (nX < x() + bbx) { + nX = x() + bbx; + } else if (nX + drag_widget->w() > x() + w() - bbx) { + nX = x() + w() - drag_widget->w() - bbx; + } - if (nY < y() + bby) { - nY = y() + bby; - } else if (nY + drag_widget->h() > y() + h() - bby) { - nY = y() + h() - drag_widget->h() - bby; - } + if (nY < y() + bby) { + nY = y() + bby; + } else if (nY + drag_widget->h() > y() + h() - bby) { + nY = y() + h() - drag_widget->h() - bby; + } - drag_widget->position(nX, nY); // set the new position - redraw(); - return 1; + drag_widget->position(nX, nY); // set the new position + redraw(); + return 1; } case FL_RELEASE: { - if (drag_widget && Fl::event_button() == FL_RIGHT_MOUSE) { - - // Optional: restore the original widget order in the group. - // Remove the next statement (or comment it out) if not desired. - insert(*drag_widget, drag_index); - - init_sizes(); // save widget positions for later resizing - drag_widget = 0; - redraw(); - if (parent()) - parent()->redraw(); - return 1; - } - break; + if (drag_widget && Fl::event_button() == FL_RIGHT_MOUSE) { + + // Optional: restore the original widget order in the group. + // Remove the next statement (or comment it out) if not desired. + insert(*drag_widget, drag_index); + + init_sizes(); // save widget positions for later resizing + drag_widget = 0; + redraw(); + if (parent()) + parent()->redraw(); + return 1; + } + break; } default: - break; + break; } // switch(e) return Fl_Group::handle(e); @@ -189,11 +187,11 @@ void button_cb(Fl_Widget *w, void *v) { // tooltips: -const char *tt_drag = "Drag this DraggableGroup and/or its child groups and squares. " - "Use the right mouse button (MB3) to drag objects."; -const char *tt_group = "You can drag this Fl_Group, but not its children (squares)."; +const char *tt_drag = "Drag this DraggableGroup and/or its child groups and squares. " + "Use the right mouse button (MB3) to drag objects."; +const char *tt_group = "You can drag this Fl_Group, but not its children (squares)."; const char *tt_button = "You can drag this button with the right mouse button " - "and you can click it with the left mouse button."; + "and you can click it with the left mouse button."; // main program: @@ -270,7 +268,3 @@ int main() { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/fltk-versions.cxx b/examples/fltk-versions.cxx index c68353990..ed80c7b1f 100644 --- a/examples/fltk-versions.cxx +++ b/examples/fltk-versions.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Library version test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -78,7 +76,3 @@ int main(int argc, char **argv) { window->show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/howto-add_fd-and-popen.cxx b/examples/howto-add_fd-and-popen.cxx index 285a377f3..c6afe5049 100644 --- a/examples/howto-add_fd-and-popen.cxx +++ b/examples/howto-add_fd-and-popen.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // How to use popen() and Fl::add_fd() - erco 10/04/04 // Originally from erco's cheat sheet, permission by author. // @@ -16,11 +14,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> #include <FL/Fl.H> @@ -28,16 +26,16 @@ #include <FL/Fl_Multi_Browser.H> #ifdef _WIN32 -# define PING_CMD "ping -n 10 localhost" // 'slow command' under windows +# define PING_CMD "ping -n 10 localhost" // 'slow command' under windows # ifdef _MSC_VER # define popen _popen # define pclose _pclose # else /*_MSC_VER*/ -# include <unistd.h> // non-MS win32 compilers (untested) +# include <unistd.h> // non-MS win32 compilers (untested) # endif /*_MSC_VER*/ #else # include <unistd.h> -# define PING_CMD "ping -i 2 -c 10 localhost" // 'slow command' under unix +# define PING_CMD "ping -i 2 -c 10 localhost" // 'slow command' under unix #endif // GLOBALS @@ -49,28 +47,24 @@ FILE *G_fp = NULL; void HandleFD(FL_SOCKET fd, void *data) { Fl_Multi_Browser *brow = (Fl_Multi_Browser*)data; char s[1024]; - if ( fgets(s, 1023, G_fp) == NULL ) { // read the line of data - Fl::remove_fd(fileno(G_fp)); // command ended? disconnect callback - pclose(G_fp); // close the descriptor - brow->add(""); brow->add("<<DONE>>"); // append msg indicating command finished + if ( fgets(s, 1023, G_fp) == NULL ) { // read the line of data + Fl::remove_fd(fileno(G_fp)); // command ended? disconnect callback + pclose(G_fp); // close the descriptor + brow->add(""); brow->add("<<DONE>>"); // append msg indicating command finished return; } - brow->add(s); // line of data read? append to widget + brow->add(s); // line of data read? append to widget } int main(int argc, char *argv[]) { Fl_Window win(600,600); Fl_Multi_Browser brow(10,10,580,580); - if ( ( G_fp = popen(PING_CMD, "r") ) == NULL ) { // start the external unix command + if ( ( G_fp = popen(PING_CMD, "r") ) == NULL ) { // start the external unix command perror("popen failed"); return(1); } - Fl::add_fd(fileno(G_fp), HandleFD, (void*)&brow); // setup a callback for the popen()ed descriptor + Fl::add_fd(fileno(G_fp), HandleFD, (void*)&brow); // setup a callback for the popen()ed descriptor win.resizable(brow); win.show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/howto-browser-with-icons.cxx b/examples/howto-browser-with-icons.cxx index d21d53f49..965b3fc94 100644 --- a/examples/howto-browser-with-icons.cxx +++ b/examples/howto-browser-with-icons.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Demonstrate creating an Fl_Browser with icons - Greg Ercolano 10/07/09 (STR#1739) // // Shows how one can add icons to items in a browser. @@ -12,12 +10,12 @@ // 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 +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: // -// Please report all bugs and problems on the following page: +// https://www.fltk.org/bugs.php // -// http://www.fltk.org/str.php -// #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Browser.H> @@ -147,7 +145,7 @@ public: // See which icon the user picked Fl_Image *i = 0; - if ( strcmp(ch->text(), "None" ) == 0 ) { i = 0; } + if ( strcmp(ch->text(), "None" ) == 0 ) { i = 0; } else if ( strcmp(ch->text(), "Small" ) == 0 ) { i = mb->sml_icon; } else if ( strcmp(ch->text(), "Medium") == 0 ) { i = mb->med_icon; } else if ( strcmp(ch->text(), "Large" ) == 0 ) { i = mb->big_icon; } @@ -179,8 +177,4 @@ int main() { w->end(); w->show(); return(Fl::run()); -} - -// -// End of "$Id$". -// +} diff --git a/examples/howto-drag-and-drop.cxx b/examples/howto-drag-and-drop.cxx index 98829c39c..35a45ed25 100644 --- a/examples/howto-drag-and-drop.cxx +++ b/examples/howto-drag-and-drop.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // A simple demo of 'drag and drop' with FLTK. // Originally from erco's cheat sheet, permission by author. // Inspired by Michael Sephton's original example posted on fltk.general. @@ -17,11 +15,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -45,10 +43,10 @@ public: switch ( event ) { case FL_PUSH: { // do 'copy/dnd' when someone clicks on box const char *msg = "It works!"; - Fl::copy(msg,strlen(msg),0); - Fl::dnd(); - ret = 1; - break; + Fl::copy(msg,strlen(msg),0); + Fl::dnd(); + ret = 1; + break; } } return(ret); @@ -70,55 +68,55 @@ public: int ret = Fl_Box::handle(event); int len; switch ( event ) { - case FL_DND_ENTER: // return(1) for this event to 'accept' dnd - label("ENTER"); // visible only if you stop the mouse at the widget's border - fprintf(stderr, "FL_DND_ENTER\n"); - dnd_inside = 1; // status: inside the widget, accept drop - ret = 1; - break; - case FL_DND_DRAG: // return(1) for this event to 'accept' dnd - label("drop\nhere"); - fprintf(stderr, "FL_DND_DRAG\n"); - ret = 1; - break; - case FL_DND_RELEASE: // return(1) for this event to 'accept' the payload (drop) - fprintf(stderr, "FL_DND_RELEASE\n"); - if (dnd_inside) { - ret = 1; // return(1) and expect FL_PASTE event to follow - label("RELEASE"); - } else { - ret = 0; // return(0) to reject the DND payload (drop) - label("DND\nREJECTED!"); - } - break; + case FL_DND_ENTER: // return(1) for this event to 'accept' dnd + label("ENTER"); // visible only if you stop the mouse at the widget's border + fprintf(stderr, "FL_DND_ENTER\n"); + dnd_inside = 1; // status: inside the widget, accept drop + ret = 1; + break; + case FL_DND_DRAG: // return(1) for this event to 'accept' dnd + label("drop\nhere"); + fprintf(stderr, "FL_DND_DRAG\n"); + ret = 1; + break; + case FL_DND_RELEASE: // return(1) for this event to 'accept' the payload (drop) + fprintf(stderr, "FL_DND_RELEASE\n"); + if (dnd_inside) { + ret = 1; // return(1) and expect FL_PASTE event to follow + label("RELEASE"); + } else { + ret = 0; // return(0) to reject the DND payload (drop) + label("DND\nREJECTED!"); + } + break; case FL_PASTE: // handle actual drop (paste) operation - fprintf(stderr, "FL_PASTE\n"); - copy_label(Fl::event_text()); - fprintf(stderr, "Pasted '%s'\n", Fl::event_text()); + fprintf(stderr, "FL_PASTE\n"); + copy_label(Fl::event_text()); + fprintf(stderr, "Pasted '%s'\n", Fl::event_text()); - // Don't pop up dialog windows in FL_DND_* or FL_PASTE event handling - // resulting from DND operations. This may hang or even crash the - // application on *some* platforms. Use a short timer to delay the - // message display after the event processing is completed. + // Don't pop up dialog windows in FL_DND_* or FL_PASTE event handling + // resulting from DND operations. This may hang or even crash the + // application on *some* platforms. Use a short timer to delay the + // message display after the event processing is completed. - delete[] dnd_text; // don't leak (just in case) - dnd_text = 0; + delete[] dnd_text; // don't leak (just in case) + dnd_text = 0; - len = Fl::event_length(); - if (len && Fl::event_text()) { - dnd_text = new char[len + 1]; - memcpy(dnd_text, Fl::event_text(), len); - dnd_text[len] = '\0'; - Fl::add_timeout(0.001, timer_cb, this); // delay message popup - } - ret = 1; - break; - case FL_DND_LEAVE: // not strictly necessary to return(1) for this event - label("..to\nhere"); // reset label - fprintf(stderr, "FL_DND_LEAVE\n"); - dnd_inside = 0; // status: mouse is outside, don't accept drop - ret = 1; // return(1) anyway.. - break; + len = Fl::event_length(); + if (len && Fl::event_text()) { + dnd_text = new char[len + 1]; + memcpy(dnd_text, Fl::event_text(), len); + dnd_text[len] = '\0'; + Fl::add_timeout(0.001, timer_cb, this); // delay message popup + } + ret = 1; + break; + case FL_DND_LEAVE: // not strictly necessary to return(1) for this event + label("..to\nhere"); // reset label + fprintf(stderr, "FL_DND_LEAVE\n"); + dnd_inside = 0; // status: mouse is outside, don't accept drop + ret = 1; // return(1) anyway.. + break; } return(ret); } @@ -152,7 +150,3 @@ int main(int argc, char **argv) { win_b.show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/howto-draw-an-x.cxx b/examples/howto-draw-an-x.cxx index 4c0038f0d..c1bce5b0f 100644 --- a/examples/howto-draw-an-x.cxx +++ b/examples/howto-draw-an-x.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Demonstrate how to draw an 'X' in fltk // // Create a custom widget that draws an 'X' to the corners of the window, @@ -14,11 +12,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -31,7 +29,7 @@ public: } void draw() { // Draw background - a white filled rectangle - fl_color(FL_WHITE); fl_rectf(x(),y(),w(),h()); + fl_color(FL_WHITE); fl_rectf(x(),y(),w(),h()); // Draw black 'X' over base widget's background fl_color(FL_BLACK); int x1 = x(), y1 = y(); @@ -42,13 +40,9 @@ public: }; int main() { Fl_Double_Window win(200,200,"Draw X"); - DrawX draw_x(10, 10, win.w()-20, win.h()-20); // put our widget 10 pixels within window edges - draw_x.color(FL_WHITE); // make widget's background white + DrawX draw_x(10, 10, win.w()-20, win.h()-20); // put our widget 10 pixels within window edges + draw_x.color(FL_WHITE); // make widget's background white win.resizable(draw_x); win.show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/howto-menu-with-images.cxx b/examples/howto-menu-with-images.cxx index 04b01c1fb..1262ffd38 100644 --- a/examples/howto-menu-with-images.cxx +++ b/examples/howto-menu-with-images.cxx @@ -1,4 +1,4 @@ -// "$Id$" +// // vim: autoindent tabstop=2 shiftwidth=2 expandtab softtabstop=2 filetype=cpp // // How to use Fl_Multi_Label to make menu items with images and labels. @@ -10,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> @@ -200,7 +200,3 @@ int main() { win->show(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/howto-parse-args.cxx b/examples/howto-parse-args.cxx index 19230cf9f..a95e2a66f 100644 --- a/examples/howto-parse-args.cxx +++ b/examples/howto-parse-args.cxx @@ -1,8 +1,6 @@ // -// "$Id$" -// // How to parse command line arguments - Duncan Gibson 2010-10-23 -// First posted in http://www.fltk.org/newsgroups.php?gfltk.general+v:31449 +// First posted in https://www.fltk.org/newsgroups.php?gfltk.general+v:31449 // // Shows how to decode additional command line arguments using Fl::args() // on top of the "standard" options used by the toolkit itself. @@ -17,11 +15,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> #include <string.h> @@ -37,7 +35,7 @@ char *optionString = 0; * If there is a match, 'i' must be incremented by 2 or 1 as appropriate. * If there is no match, Fl::args() will then call Fl::arg() as fallback * to try to match the "standard" FLTK parameters. - * + * * Returns 2 if argv[i] matches with required parameter in argv[i+1], * returns 1 if argv[i] matches on its own, * returns 0 if argv[i] does not match. @@ -87,7 +85,3 @@ int main(int argc, char** argv) mainWin->show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/howto-remap-numpad-keyboard-keys.cxx b/examples/howto-remap-numpad-keyboard-keys.cxx index 049b8e203..20639224d 100644 --- a/examples/howto-remap-numpad-keyboard-keys.cxx +++ b/examples/howto-remap-numpad-keyboard-keys.cxx @@ -1,7 +1,5 @@ // vim: autoindent tabstop=8 shiftwidth=2 expandtab softtabstop=2 // -// "$Id$" -// // Demonstrate keyboard remapping: Force number pad to type numbers even if NumLock off // // DESCRIPTION @@ -31,11 +29,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -49,7 +47,7 @@ Fl_Check_Button *G_checkbut = 0; // Global event handler: FLTK calls this after event translation. It's up to us // to call Fl::handle_(e,w) to actually deliver the event to the widgets. If we // don't and just return, the event will be dropped. See docs for more. -// +// int MyHandler(int e, Fl_Window *w) { // Remapping disabled? Early exit.. if ( G_checkbut->value() == 0 ) return Fl::handle_(e, w); diff --git a/examples/howto-simple-svg.cxx b/examples/howto-simple-svg.cxx index b9f41fd71..d70f0407a 100644 --- a/examples/howto-simple-svg.cxx +++ b/examples/howto-simple-svg.cxx @@ -1,8 +1,6 @@ // -// "$Id$" -// -// Simple example of how to use an SVG image in an FLTK program. -// Assumes fltk was built with --enable-nanosvg. +// Simple example of how to use an SVG image in an FLTK program. +// Assumes fltk was built with --enable-nanosvg. // // Copyright 1998-2010 by Bill Spitzak and others. // @@ -10,13 +8,13 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -#include <config.h> /* needed only to detect FLTK_USE_NANOSVG */ +#include <config.h> /* needed only to detect FLTK_USE_NANOSVG */ #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Box.H> @@ -30,28 +28,28 @@ const char *svg_logo = "<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->\n" "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" "<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n" - " width=\"640px\" height=\"480px\" viewBox=\"0 0 640 480\" enable-background=\"new 0 0 640 480\" xml:space=\"preserve\">\n" + " width=\"640px\" height=\"480px\" viewBox=\"0 0 640 480\" enable-background=\"new 0 0 640 480\" xml:space=\"preserve\">\n" "<path d=\"M282.658,250.271c0,5.31-1.031,10.156-3.087,14.543c-2.059,4.387-4.984,8.152-8.774,11.293\n" - " c-3.793,3.144-8.477,5.58-14.055,7.312c-5.581,1.731-11.836,2.601-18.767,2.601c-9.968,0-18.605-1.572-25.917-4.713\n" - " s-13.299-6.986-17.955-11.536l13.812-15.111c4.116,3.684,8.584,6.499,13.405,8.449c4.819,1.95,9.993,2.925,15.518,2.925\n" - " c5.525,0,9.856-1.219,12.999-3.656c3.141-2.438,4.712-5.769,4.712-9.993c0-2.056-0.3-3.844-0.894-5.361\n" - " c-0.596-1.517-1.653-2.925-3.168-4.226c-1.518-1.3-3.549-2.519-6.093-3.655c-2.546-1.138-5.768-2.301-9.668-3.494\n" - " c-6.5-2.056-11.943-4.25-16.33-6.58c-4.387-2.328-7.937-4.9-10.643-7.719c-2.709-2.815-4.659-5.931-5.849-9.343\n" - " c-1.193-3.412-1.788-7.23-1.788-11.455c0-5.2,1.082-9.831,3.25-13.893c2.166-4.062,5.144-7.5,8.937-10.318\n" - " c3.791-2.815,8.178-4.956,13.162-6.418c4.981-1.462,10.343-2.193,16.086-2.193c8.449,0,15.842,1.247,22.179,3.737\n" - " c6.337,2.493,11.997,6.121,16.98,10.887l-12.674,14.624c-7.583-6.281-15.655-9.424-24.21-9.424c-4.875,0-8.721,0.95-11.537,2.844\n" - " c-2.818,1.896-4.225,4.578-4.225,8.043c0,1.843,0.297,3.412,0.894,4.712c0.594,1.3,1.65,2.519,3.168,3.656\n" - " c1.516,1.137,3.656,2.249,6.418,3.331c2.763,1.084,6.309,2.33,10.643,3.736c5.306,1.734,10.046,3.631,14.218,5.688\n" - " c4.169,2.06,7.662,4.524,10.48,7.394c2.815,2.871,4.981,6.174,6.5,9.911C281.898,240.603,282.658,245.071,282.658,250.271z\n" - " M335.953,260.833l20.637-90.181h27.46l-32.011,112.604h-33.634l-32.173-112.604h28.598l20.311,90.181H335.953z M437.832,286.019\n" - " c-16.357,0-28.896-5.01-37.615-15.03c-8.722-10.019-13.081-24.779-13.081-44.278c0-9.531,1.407-17.98,4.225-25.348\n" - " c2.815-7.366,6.688-13.54,11.618-18.524c4.928-4.981,10.668-8.747,17.223-11.293c6.555-2.544,13.568-3.818,21.043-3.818\n" - " c8.23,0,15.436,1.3,21.611,3.899c6.174,2.6,11.537,5.959,16.086,10.075l-14.137,14.624c-3.467-3.032-6.906-5.281-10.318-6.744\n" - " s-7.393-2.193-11.941-2.193c-4.01,0-7.693,0.731-11.051,2.193s-6.256,3.793-8.691,6.987c-2.438,3.196-4.334,7.287-5.688,12.268\n" - " c-1.355,4.984-2.031,10.996-2.031,18.037c0,7.367,0.486,13.567,1.463,18.604c0.975,5.037,2.408,9.1,4.305,12.187\n" - " c1.895,3.087,4.307,5.309,7.23,6.662c2.926,1.355,6.338,2.031,10.238,2.031c5.631,0,10.613-1.244,14.947-3.737v-25.186h-14.785\n" - " l-2.6-18.849h43.547v55.57c-5.85,3.793-12.297,6.718-19.336,8.774C453.051,284.987,445.631,286.019,437.832,286.019z M523.5,151.5\n" - " c0-6.627-5.373-12-12-12h-343c-6.627,0-12,5.373-12,12v150c0,6.627,5.373,12,12,12h343c6.627,0,12-5.373,12-12V151.5z\"/>\n" + " c-3.793,3.144-8.477,5.58-14.055,7.312c-5.581,1.731-11.836,2.601-18.767,2.601c-9.968,0-18.605-1.572-25.917-4.713\n" + " s-13.299-6.986-17.955-11.536l13.812-15.111c4.116,3.684,8.584,6.499,13.405,8.449c4.819,1.95,9.993,2.925,15.518,2.925\n" + " c5.525,0,9.856-1.219,12.999-3.656c3.141-2.438,4.712-5.769,4.712-9.993c0-2.056-0.3-3.844-0.894-5.361\n" + " c-0.596-1.517-1.653-2.925-3.168-4.226c-1.518-1.3-3.549-2.519-6.093-3.655c-2.546-1.138-5.768-2.301-9.668-3.494\n" + " c-6.5-2.056-11.943-4.25-16.33-6.58c-4.387-2.328-7.937-4.9-10.643-7.719c-2.709-2.815-4.659-5.931-5.849-9.343\n" + " c-1.193-3.412-1.788-7.23-1.788-11.455c0-5.2,1.082-9.831,3.25-13.893c2.166-4.062,5.144-7.5,8.937-10.318\n" + " c3.791-2.815,8.178-4.956,13.162-6.418c4.981-1.462,10.343-2.193,16.086-2.193c8.449,0,15.842,1.247,22.179,3.737\n" + " c6.337,2.493,11.997,6.121,16.98,10.887l-12.674,14.624c-7.583-6.281-15.655-9.424-24.21-9.424c-4.875,0-8.721,0.95-11.537,2.844\n" + " c-2.818,1.896-4.225,4.578-4.225,8.043c0,1.843,0.297,3.412,0.894,4.712c0.594,1.3,1.65,2.519,3.168,3.656\n" + " c1.516,1.137,3.656,2.249,6.418,3.331c2.763,1.084,6.309,2.33,10.643,3.736c5.306,1.734,10.046,3.631,14.218,5.688\n" + " c4.169,2.06,7.662,4.524,10.48,7.394c2.815,2.871,4.981,6.174,6.5,9.911C281.898,240.603,282.658,245.071,282.658,250.271z\n" + " M335.953,260.833l20.637-90.181h27.46l-32.011,112.604h-33.634l-32.173-112.604h28.598l20.311,90.181H335.953z M437.832,286.019\n" + " c-16.357,0-28.896-5.01-37.615-15.03c-8.722-10.019-13.081-24.779-13.081-44.278c0-9.531,1.407-17.98,4.225-25.348\n" + " c2.815-7.366,6.688-13.54,11.618-18.524c4.928-4.981,10.668-8.747,17.223-11.293c6.555-2.544,13.568-3.818,21.043-3.818\n" + " c8.23,0,15.436,1.3,21.611,3.899c6.174,2.6,11.537,5.959,16.086,10.075l-14.137,14.624c-3.467-3.032-6.906-5.281-10.318-6.744\n" + " s-7.393-2.193-11.941-2.193c-4.01,0-7.693,0.731-11.051,2.193s-6.256,3.793-8.691,6.987c-2.438,3.196-4.334,7.287-5.688,12.268\n" + " c-1.355,4.984-2.031,10.996-2.031,18.037c0,7.367,0.486,13.567,1.463,18.604c0.975,5.037,2.408,9.1,4.305,12.187\n" + " c1.895,3.087,4.307,5.309,7.23,6.662c2.926,1.355,6.338,2.031,10.238,2.031c5.631,0,10.613-1.244,14.947-3.737v-25.186h-14.785\n" + " l-2.6-18.849h43.547v55.57c-5.85,3.793-12.297,6.718-19.336,8.774C453.051,284.987,445.631,286.019,437.832,286.019z M523.5,151.5\n" + " c0-6.627-5.373-12-12-12h-343c-6.627,0-12,5.373-12,12v150c0,6.627,5.373,12,12,12h343c6.627,0,12-5.373,12-12V151.5z\"/>\n" "</svg>\n"; int main(int argc, char **argv) { @@ -68,7 +66,3 @@ int main(int argc, char **argv) { return(Fl::run()); #endif } - -// -// End of "$Id$". -// diff --git a/examples/howto-text-over-image-button.cxx b/examples/howto-text-over-image-button.cxx index f102dc70b..f0861a9c1 100644 --- a/examples/howto-text-over-image-button.cxx +++ b/examples/howto-text-over-image-button.cxx @@ -1,16 +1,14 @@ // -// "$Id$" +// Simple example of a button with text over an image +// Originally from erco's cheat sheet 10/25/2010, permission by author. // -// Simple example of a button with text over an image -// Originally from erco's cheat sheet 10/25/2010, permission by author. +// This shows how to include an 'inline' image (.xpm) +// and have it appear on an Fl_Button. Demonstrates the use of the +// FL_ALIGN_IMAGE_BACKDROP align() flag (new in FLTK 1.3.0). // -// This shows how to include an 'inline' image (.xpm) -// and have it appear on an Fl_Button. Demonstrates the use of the -// FL_ALIGN_IMAGE_BACKDROP align() flag (new in FLTK 1.3.0). -// -// Note that the XPM can just as easily be in an #include file, -// but to keep the example self contained, the image (a gray scale -// gradient) is included here. +// Note that the XPM can just as easily be in an #include file, +// but to keep the example self contained, the image (a gray scale +// gradient) is included here. // // Copyright 2010 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -19,11 +17,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/Fl_Window.H> @@ -33,12 +31,12 @@ /* XPM */ static const char * gradient_xpm[] = { "135 20 26 1", -"a c #e0e0e0", "b c #dcdcdc", "c c #d8d8d8", "d c #d4d4d4", "e c #d2d2d2", -"f c #d0d0d0", "g c #cccccc", "h c #c8c8c8", "i c #c4c4c4", "j c #c2c2c2", -"k c #c0c0c0", "l c #bcbcbc", "m c #b8b8b8", "n c #b4b4b4", "o c #b2b2b2", -"p c #b0b0b0", "q c #acacac", "r c #a8a8a8", "s c #a4a4a4", "t c #a2a2a2", -"u c #a0a0a0", "v c #9c9c9c", "w c #989898", "x c #949494", "y c #929292", -"z c #909090", +"a c #e0e0e0", "b c #dcdcdc", "c c #d8d8d8", "d c #d4d4d4", "e c #d2d2d2", +"f c #d0d0d0", "g c #cccccc", "h c #c8c8c8", "i c #c4c4c4", "j c #c2c2c2", +"k c #c0c0c0", "l c #bcbcbc", "m c #b8b8b8", "n c #b4b4b4", "o c #b2b2b2", +"p c #b0b0b0", "q c #acacac", "r c #a8a8a8", "s c #a4a4a4", "t c #a2a2a2", +"u c #a0a0a0", "v c #9c9c9c", "w c #989898", "x c #949494", "y c #929292", +"z c #909090", "aaaaaaaaabbbbbbbbcccccccddddddeeeeeefffffffgggggggghhhhhhhiiiiiiijjjjjjjkkkkkkkklllllllmmmmmmmnnnnnnnnnoooooooppppppppqqqqqqrrrrrrrssss", "aaaaaabbbbbbbbcccccccddddddeeeeeefffffffgggggggghhhhhhhiiiiiiijjjjjjjkkkkkkkklllllllmmmmmmmnnnnnnnnnoooooooppppppppqqqqqqrrrrrrrsssssst", "aaabbbbbbbbcccccccddddddeeeeeefffffffgggggggghhhhhhhiiiiiiijjjjjjjkkkkkkkklllllllmmmmmmmnnnnnnnnnoooooooppppppppqqqqqqrrrrrrrsssssssstt", @@ -76,7 +74,3 @@ int main(int argc, char **argv) { win->show(argc,argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/menubar-add.cxx b/examples/menubar-add.cxx index 2284b2bc4..6326d4865 100644 --- a/examples/menubar-add.cxx +++ b/examples/menubar-add.cxx @@ -1,16 +1,14 @@ // -// "$Id$" +// An example of using Fl_Menu_Bar's add() to dynamically create menubars // -// An example of using Fl_Menu_Bar's add() to dynamically create menubars +// Menu bars can be created several ways. Using add() allows +// dynamically creating a menubar using a 'pathname' syntax. +// Use if you're creating items dynamically, or if you're making +// menubars by hand (as opposed to using fluid), as it's easier +// to type and read. // -// Menu bars can be created several ways. Using add() allows -// dynamically creating a menubar using a 'pathname' syntax. -// Use if you're creating items dynamically, or if you're making -// menubars by hand (as opposed to using fluid), as it's easier -// to type and read. -// -// In this case we're using one callback for all items, -// but you can make unique callbacks for each item if needed. +// In this case we're using one callback for all items, +// but you can make unique callbacks for each item if needed. // // Copyright 2010 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -19,32 +17,32 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -#include <stdio.h> // fprintf() -#include <stdlib.h> // exit() -#include <string.h> // strcmp() +#include <stdio.h> // fprintf() +#include <stdlib.h> // exit() +#include <string.h> // strcmp() #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Menu_Bar.H> -#include <FL/filename.H> // fl_open_uri() +#include <FL/filename.H> // fl_open_uri() // This callback is invoked whenever the user clicks an item in the menu bar static void MyMenuCallback(Fl_Widget *w, void *) { - Fl_Menu_Bar *bar = (Fl_Menu_Bar*)w; // Get the menubar widget - const Fl_Menu_Item *item = bar->mvalue(); // Get the menu item that was picked + Fl_Menu_Bar *bar = (Fl_Menu_Bar*)w; // Get the menubar widget + const Fl_Menu_Item *item = bar->mvalue(); // Get the menu item that was picked - char ipath[256]; bar->item_pathname(ipath, sizeof(ipath)); // Get full pathname of picked item + char ipath[256]; bar->item_pathname(ipath, sizeof(ipath)); // Get full pathname of picked item - fprintf(stderr, "callback: You picked '%s'", item->label()); // Print item picked - fprintf(stderr, ", item_pathname() is '%s'", ipath); // ..and full pathname + fprintf(stderr, "callback: You picked '%s'", item->label()); // Print item picked + fprintf(stderr, ", item_pathname() is '%s'", ipath); // ..and full pathname - if ( item->flags & (FL_MENU_RADIO|FL_MENU_TOGGLE) ) { // Toggle or radio item? - fprintf(stderr, ", value is %s", item->value()?"on":"off"); // Print item's value + if ( item->flags & (FL_MENU_RADIO|FL_MENU_TOGGLE) ) { // Toggle or radio item? + fprintf(stderr, ", value is %s", item->value()?"on":"off"); // Print item's value } fprintf(stderr, "\n"); if ( strcmp(item->label(), "Google") == 0 ) { fl_open_uri("http://google.com/"); } @@ -53,8 +51,8 @@ static void MyMenuCallback(Fl_Widget *w, void *) { int main() { Fl::scheme("gtk+"); - Fl_Window *win = new Fl_Window(400,200, "menubar-simple"); // Create window - Fl_Menu_Bar *menu = new Fl_Menu_Bar(0,0,400,25); // Create menubar, items.. + Fl_Window *win = new Fl_Window(400,200, "menubar-simple"); // Create window + Fl_Menu_Bar *menu = new Fl_Menu_Bar(0,0,400,25); // Create menubar, items.. menu->add("&File/&Open", "^o", MyMenuCallback); menu->add("&File/&Save", "^s", MyMenuCallback, 0, FL_MENU_DIVIDER); menu->add("&File/&Quit", "^q", MyMenuCallback); @@ -62,23 +60,19 @@ int main() { menu->add("&Edit/&Paste", "^v", MyMenuCallback, 0, FL_MENU_DIVIDER); menu->add("&Edit/Radio 1", 0, MyMenuCallback, 0, FL_MENU_RADIO); menu->add("&Edit/Radio 2", 0, MyMenuCallback, 0, FL_MENU_RADIO|FL_MENU_DIVIDER); - menu->add("&Edit/Toggle 1", 0, MyMenuCallback, 0, FL_MENU_TOGGLE); // Default: off - menu->add("&Edit/Toggle 2", 0, MyMenuCallback, 0, FL_MENU_TOGGLE); // Default: off - menu->add("&Edit/Toggle 3", 0, MyMenuCallback, 0, FL_MENU_TOGGLE|FL_MENU_VALUE); // Default: on + menu->add("&Edit/Toggle 1", 0, MyMenuCallback, 0, FL_MENU_TOGGLE); // Default: off + menu->add("&Edit/Toggle 2", 0, MyMenuCallback, 0, FL_MENU_TOGGLE); // Default: off + menu->add("&Edit/Toggle 3", 0, MyMenuCallback, 0, FL_MENU_TOGGLE|FL_MENU_VALUE); // Default: on menu->add("&Help/Google", 0, MyMenuCallback); // Example: show how we can dynamically change the state of item Toggle #2 (turn it 'on') { - Fl_Menu_Item *item = (Fl_Menu_Item*)menu->find_item("&Edit/Toggle 2"); // Find item - if ( item ) item->set(); // Turn it on - else fprintf(stderr, "'Toggle 2' item not found?!\n"); // (optional) Not found? complain! + Fl_Menu_Item *item = (Fl_Menu_Item*)menu->find_item("&Edit/Toggle 2"); // Find item + if ( item ) item->set(); // Turn it on + else fprintf(stderr, "'Toggle 2' item not found?!\n"); // (optional) Not found? complain! } win->end(); win->show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/nativefilechooser-simple-app.cxx b/examples/nativefilechooser-simple-app.cxx index d206daeac..736adb8d3 100644 --- a/examples/nativefilechooser-simple-app.cxx +++ b/examples/nativefilechooser-simple-app.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// An example of how to use Fl_Native_File_Chooser to open & save files. +// An example of how to use Fl_Native_File_Chooser to open & save files. // // Copyright 2010 Greg Ercolano. // Copyright 1998-2017 by Bill Spitzak and others. @@ -10,16 +8,16 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -#include <stdio.h> // printf -#include <stdlib.h> // exit,malloc -#include <string.h> // strerror -#include <errno.h> // errno +#include <stdio.h> // printf +#include <stdlib.h> // exit,malloc +#include <string.h> // strerror +#include <errno.h> // errno #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Menu_Bar.H> @@ -62,28 +60,28 @@ class Application : public Fl_Window { static void open_cb(Fl_Widget *w, void *v) { Application *app = (Application*)v; app->fc->title("Open"); - app->fc->type(Fl_Native_File_Chooser::BROWSE_FILE); // only picks files that exist + app->fc->type(Fl_Native_File_Chooser::BROWSE_FILE); // only picks files that exist switch ( app->fc->show() ) { - case -1: break; // Error - case 1: break; // Cancel - default: // Choice + case -1: break; // Error + case 1: break; // Cancel + default: // Choice app->fc->preset_file(app->fc->filename()); app->open(app->fc->filename()); - break; + break; } } // Handle a 'Save as' request from the menu static void saveas_cb(Fl_Widget *w, void *v) { Application *app = (Application*)v; app->fc->title("Save As"); - app->fc->type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); // need this if file doesn't exist yet + app->fc->type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); // need this if file doesn't exist yet switch ( app->fc->show() ) { - case -1: break; // Error - case 1: break; // Cancel - default: // Choice + case -1: break; // Error + case 1: break; // Cancel + default: // Choice app->fc->preset_file(app->fc->filename()); app->save(app->fc->filename()); - break; + break; } } // Handle a 'Save' request from the menu @@ -103,9 +101,9 @@ class Application : public Fl_Window { static char *filename = 0; if ( !filename ) { const char *home = - fl_getenv("HOME") ? fl_getenv("HOME") : // unix - fl_getenv("HOME_PATH") ? fl_getenv("HOME_PATH") : // windows - "."; // other + fl_getenv("HOME") ? fl_getenv("HOME") : // unix + fl_getenv("HOME_PATH") ? fl_getenv("HOME_PATH") : // windows + "."; // other filename = (char*)malloc(strlen(home)+20); sprintf(filename, "%s/untitled.txt", home); } @@ -121,16 +119,16 @@ public: menu->add("&File/&Quit", FL_COMMAND+'q', quit_cb); // Describe the demo.. Fl_Box *box = new Fl_Box(20,25+20,w()-40,h()-40-25); - box->color(45); + box->color(45); box->box(FL_FLAT_BOX); box->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); box->label("This demo shows an example of implementing " "common 'File' menu operations like:\n" " File/Open, File/Save, File/Save As\n" - "..using the Fl_Native_File_Chooser widget.\n\n" - "Note 'Save' and 'Save As' really *does* create files! " - "This is to show how behavior differs when " - "files exist vs. do not."); + "..using the Fl_Native_File_Chooser widget.\n\n" + "Note 'Save' and 'Save As' really *does* create files! " + "This is to show how behavior differs when " + "files exist vs. do not."); box->labelsize(12); // Initialize the file chooser fc = new Fl_Native_File_Chooser(); @@ -146,7 +144,3 @@ int main(int argc, char *argv[]) { app->show(argc,argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/nativefilechooser-simple.cxx b/examples/nativefilechooser-simple.cxx index 8ab216950..7c8268027 100644 --- a/examples/nativefilechooser-simple.cxx +++ b/examples/nativefilechooser-simple.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Simple example of using Fl_Native_File_Chooser. +// Simple example of using Fl_Native_File_Chooser. // // Copyright 1998-2010 by Bill Spitzak and others. // @@ -9,19 +7,19 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Menu_Button.H> #include <FL/Fl_Native_File_Chooser.H> #include <FL/fl_message.H> -#include <stdlib.h> /* exit() */ -#include <string.h> /* strcmp() */ +#include <stdlib.h> /* exit() */ +#include <string.h> /* strcmp() */ Fl_Window *G_win = 0; Fl_Menu_Button *G_menu = 0; @@ -30,28 +28,28 @@ Fl_Native_File_Chooser *G_chooser = 0; static void Menu_CB(Fl_Widget*,void*data) { // Handle the popup menu item the user picked.. const char *choice = (const char*)data; - if ( strcmp(choice, "quit") == 0 ) { // Handle "quit" + if ( strcmp(choice, "quit") == 0 ) { // Handle "quit" exit(0); - } else if ( strcmp(choice, "open") == 0 ) { // Handle "open" + } else if ( strcmp(choice, "open") == 0 ) { // Handle "open" if ( G_chooser == 0 ) { // Create an instance of file chooser we can reuse.. G_chooser = new Fl_Native_File_Chooser(); - G_chooser->directory("."); // directory to start browsing with - G_chooser->preset_file("nativefilechooser-simple.cxx"); // file to start with + G_chooser->directory("."); // directory to start browsing with + G_chooser->preset_file("nativefilechooser-simple.cxx"); // file to start with G_chooser->filter("C++\t*.{cxx,cpp,h,H}\n"); - G_chooser->type(Fl_Native_File_Chooser::BROWSE_FILE); // only picks files that exist - G_chooser->title("Pick a file please.."); // custom title for chooser window + G_chooser->type(Fl_Native_File_Chooser::BROWSE_FILE); // only picks files that exist + G_chooser->title("Pick a file please.."); // custom title for chooser window } // Show the chooser // This blocks while chooser is open. // switch ( G_chooser->show() ) { - case -1: break; // Error - case 1: break; // Cancel - default: // Choice - G_chooser->preset_file(G_chooser->filename()); - fl_message("You chose: %s", G_chooser->filename()); - break; + case -1: break; // Error + case 1: break; // Cancel + default: // Choice + G_chooser->preset_file(G_chooser->filename()); + fl_message("You chose: %s", G_chooser->filename()); + break; } } } @@ -71,7 +69,3 @@ int main(int argc, char *argv[]) { G_win->show(argc,argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/progress-simple.cxx b/examples/progress-simple.cxx index 5221ddcb8..e0536f417 100644 --- a/examples/progress-simple.cxx +++ b/examples/progress-simple.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Demonstrate using the Fl_Progress widget in an application - erco 05/02/2005 // // Copyright 2005,2012 Greg Ercolano. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -72,7 +70,3 @@ int main() { win.show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/shapedwindow.cxx b/examples/shapedwindow.cxx index 200899666..cf4b7048d 100644 --- a/examples/shapedwindow.cxx +++ b/examples/shapedwindow.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // shapedwindow example source file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Window.H> @@ -119,7 +117,3 @@ int main(int argc, char **argv) { delete win; return 0; } - -// -// End of "$Id$". -// diff --git a/examples/simple-terminal.cxx b/examples/simple-terminal.cxx index 5e14cf7b9..f1b6e5d5e 100644 --- a/examples/simple-terminal.cxx +++ b/examples/simple-terminal.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Simple Example app using Fl_Simple_Terminal. - erco 10/12/2017 // // Copyright 2017 Greg Ercolano. @@ -10,14 +8,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -#include <time.h> //START +#include <time.h> //START #include <FL/Fl_Double_Window.H> #include <FL/Fl_Box.H> #include <FL/Fl_Simple_Terminal.H> @@ -53,8 +51,4 @@ int main(int argc, char **argv) { G_win->show(); Fl::add_timeout(0.5, tick_cb); return Fl::run(); -} //END - -// -// End of "$Id$". -// +} //END diff --git a/examples/table-as-container.cxx b/examples/table-as-container.cxx index 7f833cfc0..515ad884f 100644 --- a/examples/table-as-container.cxx +++ b/examples/table-as-container.cxx @@ -1,16 +1,14 @@ // -// "$Id$" +// Show how FLTK widgets can be parented by Fl_Table. -erco 03/30/2003 // -// Show how FLTK widgets can be parented by Fl_Table. -erco 03/30/2003 +// Originally the 'widgettable.cxx' example program that came with +// erco's Fl_Table widget. Added to FLTK in 2010. // -// Originally the 'widgettable.cxx' example program that came with -// erco's Fl_Table widget. Added to FLTK in 2010. -// -// This demonstrates how to use Fl_Table as a 'container' for FLTK -// widgets; one widget per cell. This isn't optimal for large tables, -// where it's better to make one instance of a widget, and move it to -// where it's needed. For an example of this, see the example program -// "table-spreadsheet.cxx". +// This demonstrates how to use Fl_Table as a 'container' for FLTK +// widgets; one widget per cell. This isn't optimal for large tables, +// where it's better to make one instance of a widget, and move it to +// where it's needed. For an example of this, see the example program +// "table-spreadsheet.cxx". // // Copyright 2010 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -19,11 +17,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -41,8 +39,8 @@ void button_cb(Fl_Widget *w, void*); // class WidgetTable : public Fl_Table { protected: - void draw_cell(TableContext context, // table cell drawing - int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0); + void draw_cell(TableContext context, // table cell drawing + int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0); public: WidgetTable(int x, int y, int w, int h, const char *l=0) : Fl_Table(x,y,w,h,l) { @@ -57,32 +55,32 @@ public: ~WidgetTable() { } void SetSize(int newrows, int newcols) { - clear(); // clear any previous widgets, if any + clear(); // clear any previous widgets, if any rows(newrows); cols(newcols); - begin(); // start adding widgets to group + begin(); // start adding widgets to group { for ( int r = 0; r<newrows; r++ ) { - for ( int c = 0; c<newcols; c++ ) { - int X,Y,W,H; - find_cell(CONTEXT_TABLE, r, c, X, Y, W, H); - - char s[40]; - if ( c & 1 ) { - // Create the input widgets - sprintf(s, "%d.%d", r, c); - Fl_Input *in = new Fl_Input(X,Y,W,H); - in->value(s); - } else { - // Create the light buttons - sprintf(s, "%d/%d ", r, c); - Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H,strdup(s)); - butt->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); - butt->callback(button_cb, (void*)0); - butt->value( ((r+c*2) & 4 ) ? 1 : 0); - } - } + for ( int c = 0; c<newcols; c++ ) { + int X,Y,W,H; + find_cell(CONTEXT_TABLE, r, c, X, Y, W, H); + + char s[40]; + if ( c & 1 ) { + // Create the input widgets + sprintf(s, "%d.%d", r, c); + Fl_Input *in = new Fl_Input(X,Y,W,H); + in->value(s); + } else { + // Create the light buttons + sprintf(s, "%d/%d ", r, c); + Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H,strdup(s)); + butt->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); + butt->callback(button_cb, (void*)0); + butt->value( ((r+c*2) & 4 ) ? 1 : 0); + } + } } } end(); @@ -90,35 +88,35 @@ public: }; // Handle drawing all cells in table -void WidgetTable::draw_cell(TableContext context, - int R, int C, int X, int Y, int W, int H) { +void WidgetTable::draw_cell(TableContext context, + int R, int C, int X, int Y, int W, int H) { switch ( context ) { case CONTEXT_STARTPAGE: - fl_font(FL_HELVETICA, 12); // font used by all headers + fl_font(FL_HELVETICA, 12); // font used by all headers break; case CONTEXT_RC_RESIZE: { int X, Y, W, H; int index = 0; for ( int r = 0; r<rows(); r++ ) { - for ( int c = 0; c<cols(); c++ ) { - if ( index >= children() ) break; - find_cell(CONTEXT_TABLE, r, c, X, Y, W, H); - child(index++)->resize(X,Y,W,H); - } + for ( int c = 0; c<cols(); c++ ) { + if ( index >= children() ) break; + find_cell(CONTEXT_TABLE, r, c, X, Y, W, H); + child(index++)->resize(X,Y,W,H); + } } - init_sizes(); // tell group children resized + init_sizes(); // tell group children resized return; } case CONTEXT_ROW_HEADER: fl_push_clip(X, Y, W, H); { - static char s[40]; - sprintf(s, "Row %d", R); - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, row_header_color()); - fl_color(FL_BLACK); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); + static char s[40]; + sprintf(s, "Row %d", R); + fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, row_header_color()); + fl_color(FL_BLACK); + fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); } fl_pop_clip(); return; @@ -126,17 +124,17 @@ void WidgetTable::draw_cell(TableContext context, case CONTEXT_COL_HEADER: fl_push_clip(X, Y, W, H); { - static char s[40]; - sprintf(s, "Column %d", C); - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, col_header_color()); - fl_color(FL_BLACK); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); + static char s[40]; + sprintf(s, "Column %d", C); + fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, col_header_color()); + fl_color(FL_BLACK); + fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); } fl_pop_clip(); return; case CONTEXT_CELL: - return; // fltk handles drawing the widgets + return; // fltk handles drawing the widgets default: return; @@ -156,7 +154,3 @@ int main() { win.show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/table-simple.cxx b/examples/table-simple.cxx index 2f3d4be68..accf3f3bb 100644 --- a/examples/table-simple.cxx +++ b/examples/table-simple.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Simple example of using Fl_Table - Greg Ercolano 11/29/2010 // // Demonstrates the simplest use of Fl_Table possible. @@ -15,24 +13,24 @@ // 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 +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: // -// Please report all bugs and problems on the following page: +// https://www.fltk.org/bugs.php // -// http://www.fltk.org/str.php -// #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Table.H> #include <FL/fl_draw.H> #define MAX_ROWS 30 -#define MAX_COLS 26 // A-Z +#define MAX_COLS 26 // A-Z // Derive a class from Fl_Table class MyTable : public Fl_Table { - int data[MAX_ROWS][MAX_COLS]; // data array for cells + int data[MAX_ROWS][MAX_COLS]; // data array for cells // Draw the row/col headings // Make this a dark thin upbox with the text inside. @@ -43,7 +41,7 @@ class MyTable : public Fl_Table { fl_color(FL_BLACK); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); fl_pop_clip(); - } + } // Draw the cell data // Dark gray text on white background with subtle border // @@ -56,7 +54,7 @@ class MyTable : public Fl_Table { // Draw box border fl_color(color()); fl_rect(X,Y,W,H); fl_pop_clip(); - } + } // Handle drawing table's cells // Fl_Table calls this function to draw each visible cell in the table. // It's up to us to use FLTK's drawing functions to draw the cells the way we want. @@ -66,15 +64,15 @@ class MyTable : public Fl_Table { switch ( context ) { case CONTEXT_STARTPAGE: // before page is drawn.. fl_font(FL_HELVETICA, 16); // set the font for our drawing operations - return; + return; case CONTEXT_COL_HEADER: // Draw column headers sprintf(s,"%c",'A'+COL); // "A", "B", "C", etc. DrawHeader(s,X,Y,W,H); - return; + return; case CONTEXT_ROW_HEADER: // Draw row headers sprintf(s,"%03d:",ROW); // "001:", "002:", etc DrawHeader(s,X,Y,W,H); - return; + return; case CONTEXT_CELL: // Draw data in cells sprintf(s,"%d",data[ROW][COL]); DrawData(s,X,Y,W,H); @@ -102,7 +100,7 @@ public: col_header(1); // enable column headers (along top) col_width_all(80); // default width of columns col_resize(1); // enable column resizing - end(); // end the Fl_Table group + end(); // end the Fl_Table group } ~MyTable() { } }; @@ -115,7 +113,3 @@ int main(int argc, char **argv) { win.show(argc,argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/table-sort.cxx b/examples/table-sort.cxx index dba178e8f..d492bf54c 100644 --- a/examples/table-sort.cxx +++ b/examples/table-sort.cxx @@ -1,12 +1,10 @@ // -// "$Id$" +// table-sort -- An example application using a sortable Fl_Table // -// table-sort -- An example application using a sortable Fl_Table -// -// Originally the 'sortapp.cxx' example program that came with -// erco's Fl_Table widget. Added to FLTK in 2010. +// Originally the 'sortapp.cxx' example program that came with +// erco's Fl_Table widget. Added to FLTK in 2010. // -// Example of a non-trivial application that uses Fl_Table +// Example of a non-trivial application that uses Fl_Table // with sortable columns. This example is not trying to be simple, // but to demonstrate the complexities of an actual app. // @@ -17,12 +15,12 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: +// +// https://www.fltk.org/bugs.php // -// http://www.fltk.org/str.php -// #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> @@ -147,17 +145,17 @@ void MyTable::draw_sort_arrow(int X,int Y,int W,int H) { // Handle drawing all cells in table void MyTable::draw_cell(TableContext context, int R, int C, int X, int Y, int W, int H) { - const char *s = ""; + const char *s = ""; if ( R < (int)_rowdata.size() && C < (int)_rowdata[R].cols.size() ) - s = _rowdata[R].cols[C]; + s = _rowdata[R].cols[C]; switch ( context ) { case CONTEXT_COL_HEADER: fl_push_clip(X,Y,W,H); { fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, FL_BACKGROUND_COLOR); if ( C < 9 ) { - fl_font(HEADER_FONTFACE, HEADER_FONTSIZE); + fl_font(HEADER_FONTFACE, HEADER_FONTSIZE); fl_color(FL_BLACK); - fl_draw(G_header[C], X+2,Y,W,H, FL_ALIGN_LEFT, 0, 0); // +2=pad left + fl_draw(G_header[C], X+2,Y,W,H, FL_ALIGN_LEFT, 0, 0); // +2=pad left // Draw sort arrow if ( C == _sort_lastcol ) { draw_sort_arrow(X,Y,W,H); @@ -165,14 +163,14 @@ void MyTable::draw_cell(TableContext context, int R, int C, int X, int Y, int W, } } fl_pop_clip(); - return; + return; case CONTEXT_CELL: { fl_push_clip(X,Y,W,H); { // Bg color Fl_Color bgcolor = row_selected(R) ? selection_color() : FL_WHITE; - fl_color(bgcolor); fl_rectf(X,Y,W,H); - fl_font(ROW_FONTFACE, ROW_FONTSIZE); - fl_color(FL_BLACK); fl_draw(s, X+2,Y,W,H, FL_ALIGN_LEFT); // +2=pad left + fl_color(bgcolor); fl_rectf(X,Y,W,H); + fl_font(ROW_FONTFACE, ROW_FONTSIZE); + fl_color(FL_BLACK); fl_draw(s, X+2,Y,W,H, FL_ALIGN_LEFT); // +2=pad left // Border fl_color(FL_LIGHT2); fl_rect(X,Y,W,H); } @@ -190,7 +188,7 @@ void MyTable::autowidth(int pad) { // Initialize all column widths to header width fl_font(HEADER_FONTFACE, HEADER_FONTSIZE); for ( int c=0; G_header[c]; c++ ) { - w=0; fl_measure(G_header[c], w, h, 0); // pixel width of header text + w=0; fl_measure(G_header[c], w, h, 0); // pixel width of header text col_width(c, w+pad); } fl_font(ROW_FONTFACE, ROW_FONTSIZE); @@ -233,9 +231,9 @@ void MyTable::load_command(const char *cmd) { if ( (int)rc.size() > cols() ) { cols((int)rc.size()); } - } + } // How many rows we loaded - rows((int)_rowdata.size()); + rows((int)_rowdata.size()); // Auto-calculate widths, with 20 pixel padding autowidth(20); } @@ -255,7 +253,7 @@ void MyTable::event_callback2() { if ( Fl::event() == FL_RELEASE && Fl::event_button() == 1 ) { if ( _sort_lastcol == COL ) { // Click same column? Toggle sort _sort_reverse ^= 1; - } else { // Click diff column? Up sort + } else { // Click diff column? Up sort _sort_reverse = 0; } sort_column(COL, _sort_reverse); @@ -277,15 +275,11 @@ int main() { table.when(FL_WHEN_RELEASE); // handle table events on release table.load_command(DIRCMD); // load table with a directory listing table.row_height_all(18); // height of all rows - table.tooltip("Click on column headings to toggle column sorting"); - table.color(FL_WHITE); + table.tooltip("Click on column headings to toggle column sorting"); + table.color(FL_WHITE); win.end(); win.resizable(table); table.resize_window(); win.show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/table-spreadsheet-with-keyboard-nav.cxx b/examples/table-spreadsheet-with-keyboard-nav.cxx index 03ba747f5..66273ceb9 100644 --- a/examples/table-spreadsheet-with-keyboard-nav.cxx +++ b/examples/table-spreadsheet-with-keyboard-nav.cxx @@ -1,9 +1,7 @@ // -// "$Id$" -// -// Simple example of an interactive spreadsheet using Fl_Table. -// Uses Mr. Satan's technique of instancing an Fl_Input around. -// Modified to test Jean-Marc's mods for keyboard nav and mouse selection. +// Simple example of an interactive spreadsheet using Fl_Table. +// Uses Mr. Satan's technique of instancing an Fl_Input around. +// Modified to test Jean-Marc's mods for keyboard nav and mouse selection. // // Fl_Table[1.00/LGPL] 04/18/03 Mister Satan -- Initial implementation, submitted to erco for Fl_Table // Fl_Table[1.10/LGPL] 05/17/03 Greg Ercolano -- Small mods to follow changes to Fl_Table @@ -17,11 +15,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> #include <stdlib.h> @@ -36,18 +34,18 @@ const int MAX_COLS = 26; const int MAX_ROWS = 500; class Spreadsheet : public Fl_Table { - Fl_Int_Input *input; // single instance of Fl_Int_Input widget - int values[MAX_ROWS][MAX_COLS]; // array of data for cells - int row_edit, col_edit; // row/col being modified - int s_left, s_top, s_right, s_bottom; // kb nav + mouse selection + Fl_Int_Input *input; // single instance of Fl_Int_Input widget + int values[MAX_ROWS][MAX_COLS]; // array of data for cells + int row_edit, col_edit; // row/col being modified + int s_left, s_top, s_right, s_bottom; // kb nav + mouse selection protected: void draw_cell(TableContext context,int=0,int=0,int=0,int=0,int=0,int=0); - void event_callback2(); // table's event callback (instance) - static void event_callback(Fl_Widget*, void *v) { // table's event callback (static) + void event_callback2(); // table's event callback (instance) + static void event_callback(Fl_Widget*, void *v) { // table's event callback (static) ((Spreadsheet*)v)->event_callback2(); } - static void input_cb(Fl_Widget*, void* v) { // input widget's callback + static void input_cb(Fl_Widget*, void* v) { // input widget's callback ((Spreadsheet*)v)->set_value_hide(); } @@ -59,13 +57,13 @@ public: input = new Fl_Int_Input(W/2,H/2,0,0); input->hide(); input->callback(input_cb, (void*)this); - input->when(FL_WHEN_ENTER_KEY_ALWAYS); // callback triggered when user hits Enter + input->when(FL_WHEN_ENTER_KEY_ALWAYS); // callback triggered when user hits Enter input->maximum_size(5); row_edit = col_edit = 0; s_left = s_top = s_right = s_bottom = 0; for (int c = 0; c < MAX_COLS; c++) for (int r = 0; r < MAX_ROWS; r++) - values[r][c] = (r + 2) * (c + 3); // initialize cells + values[r][c] = (r + 2) * (c + 3); // initialize cells end(); } ~Spreadsheet() { } @@ -74,7 +72,7 @@ public: void set_value_hide() { values[row_edit][col_edit] = atoi(input->value()); input->hide(); - window()->cursor(FL_CURSOR_DEFAULT); // XXX: if we don't do this, cursor can disappear! + window()->cursor(FL_CURSOR_DEFAULT); // XXX: if we don't do this, cursor can disappear! } // Change number of rows void rows(int val) { @@ -97,130 +95,130 @@ public: // and make the widget 'appear' at the cell's location. // void start_editing(int R, int C) { - row_edit = R; // Now editing this row/col + row_edit = R; // Now editing this row/col col_edit = C; int X,Y,W,H; - find_cell(CONTEXT_CELL, R,C, X,Y,W,H); // Find X/Y/W/H of cell - input->resize(X,Y,W,H); // Move Fl_Input widget there - char s[30]; sprintf(s, "%d", values[R][C]); // Load input widget with cell's current value + find_cell(CONTEXT_CELL, R,C, X,Y,W,H); // Find X/Y/W/H of cell + input->resize(X,Y,W,H); // Move Fl_Input widget there + char s[30]; sprintf(s, "%d", values[R][C]); // Load input widget with cell's current value input->value(s); - input->position(0,strlen(s)); // Select entire input field - input->show(); // Show the input widget, now that we've positioned it + input->position(0,strlen(s)); // Select entire input field + input->show(); // Show the input widget, now that we've positioned it input->take_focus(); } // Tell the input widget it's done editing, and to 'hide' void done_editing() { - if (input->visible()) { // input widget visible, ie. edit in progress? - set_value_hide(); // Transfer its current contents to cell and hide + if (input->visible()) { // input widget visible, ie. edit in progress? + set_value_hide(); // Transfer its current contents to cell and hide } } // Return the sum of all rows in this column int sum_rows(int C) { int sum = 0; - for (int r=0; r<rows()-1; ++r) // -1: don't include cell data in 'totals' column + for (int r=0; r<rows()-1; ++r) // -1: don't include cell data in 'totals' column sum += values[r][C]; return(sum); } // Return the sum of all cols in this row int sum_cols(int R) { int sum = 0; - for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column + for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column sum += values[R][c]; return(sum); } // Return the sum of all cells in table int sum_all() { int sum = 0; - for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column - for (int r=0; r<rows()-1; ++r) // -1: "" - sum += values[r][c]; + for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column + for (int r=0; r<rows()-1; ++r) // -1: "" + sum += values[r][c]; return(sum); } }; // Handle drawing all cells in table void Spreadsheet::draw_cell(TableContext context, int R,int C, int X,int Y,int W,int H) { - static char s[30]; + static char s[30]; switch ( context ) { - case CONTEXT_STARTPAGE: // table about to redraw + case CONTEXT_STARTPAGE: // table about to redraw // Get kb nav + mouse 'selection region' for use below get_selection(s_top, s_left, s_bottom, s_right); break; - case CONTEXT_COL_HEADER: // table wants us to draw a column heading (C is column) - fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for heading to bold - fl_push_clip(X,Y,W,H); // clip region for text + case CONTEXT_COL_HEADER: // table wants us to draw a column heading (C is column) + fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for heading to bold + fl_push_clip(X,Y,W,H); // clip region for text { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, col_header_color()); - fl_color(FL_BLACK); - if (C == cols()-1) { // Last column? show 'TOTAL' - fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); - } else { // Not last column? show column letter - sprintf(s, "%c", 'A' + C); - fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); - } + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, col_header_color()); + fl_color(FL_BLACK); + if (C == cols()-1) { // Last column? show 'TOTAL' + fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); + } else { // Not last column? show column letter + sprintf(s, "%c", 'A' + C); + fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); + } } fl_pop_clip(); return; - case CONTEXT_ROW_HEADER: // table wants us to draw a row heading (R is row) - fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for row heading to bold + case CONTEXT_ROW_HEADER: // table wants us to draw a row heading (R is row) + fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for row heading to bold fl_push_clip(X,Y,W,H); { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, row_header_color()); - fl_color(FL_BLACK); - if (R == rows()-1) { // Last row? Show 'Total' - fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); - } else { // Not last row? show row# - sprintf(s, "%d", R+1); - fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); - } + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, row_header_color()); + fl_color(FL_BLACK); + if (R == rows()-1) { // Last row? Show 'Total' + fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); + } else { // Not last row? show row# + sprintf(s, "%d", R+1); + fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); + } } fl_pop_clip(); return; - case CONTEXT_CELL: { // table wants us to draw a cell + case CONTEXT_CELL: { // table wants us to draw a cell if (R == row_edit && C == col_edit && input->visible()) { - return; // dont draw for cell with input widget over it + return; // dont draw for cell with input widget over it } // Background // Keyboard nav and mouse selection highlighting if (R >= s_top && R <= s_bottom && C >= s_left && C <= s_right) { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, FL_YELLOW); + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, FL_YELLOW); } else if ( C < cols()-1 && R < rows()-1 ) { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, FL_WHITE); + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, FL_WHITE); } else { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, 0xbbddbb00); // money green + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, 0xbbddbb00); // money green } // Text fl_push_clip(X+3, Y+3, W-6, H-6); { - fl_color(FL_BLACK); - if (C == cols()-1 || R == rows()-1) { // Last row or col? Show total - fl_font(FL_HELVETICA | FL_BOLD, 14); // ..in bold font - if (C == cols()-1 && R == rows()-1) { // Last row+col? Total all cells - sprintf(s, "%d", sum_all()); - } else if (C == cols()-1) { // Row subtotal - sprintf(s, "%d", sum_cols(R)); - } else if (R == rows()-1) { // Col subtotal - sprintf(s, "%d", sum_rows(C)); - } - fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); - } else { // Not last row or col? Show cell contents - fl_font(FL_HELVETICA, 14); // ..in regular font - sprintf(s, "%d", values[R][C]); - fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); - } + fl_color(FL_BLACK); + if (C == cols()-1 || R == rows()-1) { // Last row or col? Show total + fl_font(FL_HELVETICA | FL_BOLD, 14); // ..in bold font + if (C == cols()-1 && R == rows()-1) { // Last row+col? Total all cells + sprintf(s, "%d", sum_all()); + } else if (C == cols()-1) { // Row subtotal + sprintf(s, "%d", sum_cols(R)); + } else if (R == rows()-1) { // Col subtotal + sprintf(s, "%d", sum_rows(C)); + } + fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); + } else { // Not last row or col? Show cell contents + fl_font(FL_HELVETICA, 14); // ..in regular font + sprintf(s, "%d", values[R][C]); + fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); + } } fl_pop_clip(); return; } - case CONTEXT_RC_RESIZE: { // table resizing rows or columns + case CONTEXT_RC_RESIZE: { // table resizing rows or columns if (!input->visible()) return; find_cell(CONTEXT_TABLE, row_edit, col_edit, X, Y, W, H); if (X==input->x() && Y==input->y() && W==input->w() && H==input->h()) { - return; // no change? ignore + return; // no change? ignore } input->resize(X,Y,W,H); return; @@ -235,37 +233,37 @@ void Spreadsheet::draw_cell(TableContext context, int R,int C, int X,int Y,int W void Spreadsheet::event_callback2() { int R = callback_row(); int C = callback_col(); - TableContext context = callback_context(); + TableContext context = callback_context(); switch ( context ) { - case CONTEXT_CELL: { // A table event occurred on a cell - switch (Fl::event()) { // see what FLTK event caused it - case FL_PUSH: // mouse click? - done_editing(); // finish editing previous - if (R != rows()-1 && C != cols()-1 ) // only edit cells not in total's columns - start_editing(R,C); // start new edit - return; + case CONTEXT_CELL: { // A table event occurred on a cell + switch (Fl::event()) { // see what FLTK event caused it + case FL_PUSH: // mouse click? + done_editing(); // finish editing previous + if (R != rows()-1 && C != cols()-1 ) // only edit cells not in total's columns + start_editing(R,C); // start new edit + return; - case FL_KEYBOARD: // key press in table? - if ( Fl::event_key() == FL_Escape ) exit(0); // ESC closes app - if (C == cols()-1 || R == rows()-1) return; // no editing of totals column - done_editing(); // finish any previous editing - set_selection(R, C, R, C); // select the current cell - start_editing(R,C); // start new edit - if (Fl::event() == FL_KEYBOARD && Fl::e_text[0] != '\r') { - input->handle(Fl::event()); // pass keypress to input widget - } - return; + case FL_KEYBOARD: // key press in table? + if ( Fl::event_key() == FL_Escape ) exit(0); // ESC closes app + if (C == cols()-1 || R == rows()-1) return; // no editing of totals column + done_editing(); // finish any previous editing + set_selection(R, C, R, C); // select the current cell + start_editing(R,C); // start new edit + if (Fl::event() == FL_KEYBOARD && Fl::e_text[0] != '\r') { + input->handle(Fl::event()); // pass keypress to input widget + } + return; } return; } - case CONTEXT_TABLE: // A table event occurred on dead zone in table - case CONTEXT_ROW_HEADER: // A table event occurred on row/column header + case CONTEXT_TABLE: // A table event occurred on dead zone in table + case CONTEXT_ROW_HEADER: // A table event occurred on row/column header case CONTEXT_COL_HEADER: - done_editing(); // done editing, hide + done_editing(); // done editing, hide return; - + default: return; } @@ -290,7 +288,7 @@ void setrows_cb(Fl_Widget* w, void* v) { } int main() { - Fl::option(Fl::OPTION_ARROW_FOCUS, 1); // we want arrow keys to navigate table's widgets + Fl::option(Fl::OPTION_ARROW_FOCUS, 1); // we want arrow keys to navigate table's widgets Fl_Double_Window *win = new Fl_Double_Window(922, 382, "Fl_Table Spreadsheet with Keyboard Navigation"); Spreadsheet* table = new Spreadsheet(20, 20, win->w()-80, win->h()-80); // Table rows @@ -305,7 +303,7 @@ int main() { table->col_resize(1); table->cols(11); table->col_width_all(70); - table->set_selection(0,0,0,0); // select top/left cell + table->set_selection(0,0,0,0); // select top/left cell // Add children to window win->begin(); @@ -336,7 +334,3 @@ int main() { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/table-spreadsheet.cxx b/examples/table-spreadsheet.cxx index 8167f6be3..e276a80d4 100644 --- a/examples/table-spreadsheet.cxx +++ b/examples/table-spreadsheet.cxx @@ -1,8 +1,6 @@ // -// "$Id$" -// -// Simple example of an interactive spreadsheet using Fl_Table. -// Uses Mr. Satan's technique of instancing an Fl_Input around. +// Simple example of an interactive spreadsheet using Fl_Table. +// Uses Mr. Satan's technique of instancing an Fl_Input around. // // Copyright 1998-2010 by Bill Spitzak and others. // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> #include <stdlib.h> @@ -28,17 +26,17 @@ const int MAX_COLS = 10; const int MAX_ROWS = 10; class Spreadsheet : public Fl_Table { - Fl_Int_Input *input; // single instance of Fl_Int_Input widget - int values[MAX_ROWS][MAX_COLS]; // array of data for cells - int row_edit, col_edit; // row/col being modified + Fl_Int_Input *input; // single instance of Fl_Int_Input widget + int values[MAX_ROWS][MAX_COLS]; // array of data for cells + int row_edit, col_edit; // row/col being modified protected: void draw_cell(TableContext context,int=0,int=0,int=0,int=0,int=0,int=0); - void event_callback2(); // table's event callback (instance) - static void event_callback(Fl_Widget*,void *v) { // table's event callback (static) + void event_callback2(); // table's event callback (instance) + static void event_callback(Fl_Widget*,void *v) { // table's event callback (static) ((Spreadsheet*)v)->event_callback2(); } - static void input_cb(Fl_Widget*,void* v) { // input widget's callback + static void input_cb(Fl_Widget*,void* v) { // input widget's callback ((Spreadsheet*)v)->set_value_hide(); } @@ -50,12 +48,12 @@ public: input = new Fl_Int_Input(W/2,H/2,0,0); input->hide(); input->callback(input_cb, (void*)this); - input->when(FL_WHEN_ENTER_KEY_ALWAYS); // callback triggered when user hits Enter + input->when(FL_WHEN_ENTER_KEY_ALWAYS); // callback triggered when user hits Enter input->maximum_size(5); input->color(FL_YELLOW); for (int c = 0; c < MAX_COLS; c++) for (int r = 0; r < MAX_ROWS; r++) - values[r][c] = c + (r*MAX_COLS); // initialize cells + values[r][c] = c + (r*MAX_COLS); // initialize cells end(); row_edit = col_edit = 0; set_selection(0,0,0,0); @@ -66,129 +64,129 @@ public: void set_value_hide() { values[row_edit][col_edit] = atoi(input->value()); input->hide(); - window()->cursor(FL_CURSOR_DEFAULT); // XXX: if we don't do this, cursor can disappear! + window()->cursor(FL_CURSOR_DEFAULT); // XXX: if we don't do this, cursor can disappear! } // Start editing a new cell: move the Fl_Int_Input widget to specified row/column // Preload the widget with the cell's current value, // and make the widget 'appear' at the cell's location. // void start_editing(int R, int C) { - row_edit = R; // Now editing this row/col + row_edit = R; // Now editing this row/col col_edit = C; - set_selection(R,C,R,C); // Clear any previous multicell selection + set_selection(R,C,R,C); // Clear any previous multicell selection int X,Y,W,H; - find_cell(CONTEXT_CELL, R,C, X,Y,W,H); // Find X/Y/W/H of cell - input->resize(X,Y,W,H); // Move Fl_Input widget there - char s[30]; sprintf(s, "%d", values[R][C]); // Load input widget with cell's current value + find_cell(CONTEXT_CELL, R,C, X,Y,W,H); // Find X/Y/W/H of cell + input->resize(X,Y,W,H); // Move Fl_Input widget there + char s[30]; sprintf(s, "%d", values[R][C]); // Load input widget with cell's current value input->value(s); - input->position(0,strlen(s)); // Select entire input field - input->show(); // Show the input widget, now that we've positioned it + input->position(0,strlen(s)); // Select entire input field + input->show(); // Show the input widget, now that we've positioned it input->take_focus(); } // Tell the input widget it's done editing, and to 'hide' void done_editing() { - if (input->visible()) { // input widget visible, ie. edit in progress? - set_value_hide(); // Transfer its current contents to cell and hide + if (input->visible()) { // input widget visible, ie. edit in progress? + set_value_hide(); // Transfer its current contents to cell and hide } } // Return the sum of all rows in this column int sum_rows(int C) { int sum = 0; - for (int r=0; r<rows()-1; ++r) // -1: don't include cell data in 'totals' column + for (int r=0; r<rows()-1; ++r) // -1: don't include cell data in 'totals' column sum += values[r][C]; return(sum); } // Return the sum of all cols in this row int sum_cols(int R) { int sum = 0; - for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column + for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column sum += values[R][c]; return(sum); } // Return the sum of all cells in table int sum_all() { int sum = 0; - for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column - for (int r=0; r<rows()-1; ++r) // -1: "" - sum += values[r][c]; + for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column + for (int r=0; r<rows()-1; ++r) // -1: "" + sum += values[r][c]; return(sum); } }; // Handle drawing all cells in table void Spreadsheet::draw_cell(TableContext context, int R,int C, int X,int Y,int W,int H) { - static char s[30]; + static char s[30]; switch ( context ) { - case CONTEXT_STARTPAGE: // table about to redraw + case CONTEXT_STARTPAGE: // table about to redraw break; - case CONTEXT_COL_HEADER: // table wants us to draw a column heading (C is column) - fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for heading to bold - fl_push_clip(X,Y,W,H); // clip region for text + case CONTEXT_COL_HEADER: // table wants us to draw a column heading (C is column) + fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for heading to bold + fl_push_clip(X,Y,W,H); // clip region for text { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, col_header_color()); - fl_color(FL_BLACK); - if (C == cols()-1) { // Last column? show 'TOTAL' - fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); - } else { // Not last column? show column letter - sprintf(s, "%c", 'A' + C); - fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); - } + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, col_header_color()); + fl_color(FL_BLACK); + if (C == cols()-1) { // Last column? show 'TOTAL' + fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); + } else { // Not last column? show column letter + sprintf(s, "%c", 'A' + C); + fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); + } } fl_pop_clip(); return; - case CONTEXT_ROW_HEADER: // table wants us to draw a row heading (R is row) - fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for row heading to bold + case CONTEXT_ROW_HEADER: // table wants us to draw a row heading (R is row) + fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for row heading to bold fl_push_clip(X,Y,W,H); { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, row_header_color()); - fl_color(FL_BLACK); - if (R == rows()-1) { // Last row? Show 'Total' - fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); - } else { // Not last row? show row# - sprintf(s, "%d", R+1); - fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); - } + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, row_header_color()); + fl_color(FL_BLACK); + if (R == rows()-1) { // Last row? Show 'Total' + fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER); + } else { // Not last row? show row# + sprintf(s, "%d", R+1); + fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); + } } fl_pop_clip(); return; - case CONTEXT_CELL: { // table wants us to draw a cell + case CONTEXT_CELL: { // table wants us to draw a cell if (R == row_edit && C == col_edit && input->visible()) { - return; // dont draw for cell with input widget over it + return; // dont draw for cell with input widget over it } // Background if ( C < cols()-1 && R < rows()-1 ) { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, is_selected(R,C) ? FL_YELLOW : FL_WHITE); + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, is_selected(R,C) ? FL_YELLOW : FL_WHITE); } else { - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, is_selected(R,C) ? 0xddffdd00 : 0xbbddbb00); // money green + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, is_selected(R,C) ? 0xddffdd00 : 0xbbddbb00); // money green } // Text fl_push_clip(X+3, Y+3, W-6, H-6); { - fl_color(FL_BLACK); - if (C == cols()-1 || R == rows()-1) { // Last row or col? Show total - fl_font(FL_HELVETICA | FL_BOLD, 14); // ..in bold font - if (C == cols()-1 && R == rows()-1) { // Last row+col? Total all cells - sprintf(s, "%d", sum_all()); - } else if (C == cols()-1) { // Row subtotal - sprintf(s, "%d", sum_cols(R)); - } else if (R == rows()-1) { // Col subtotal - sprintf(s, "%d", sum_rows(C)); - } - fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); - } else { // Not last row or col? Show cell contents - fl_font(FL_HELVETICA, 14); // ..in regular font - sprintf(s, "%d", values[R][C]); - fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); - } + fl_color(FL_BLACK); + if (C == cols()-1 || R == rows()-1) { // Last row or col? Show total + fl_font(FL_HELVETICA | FL_BOLD, 14); // ..in bold font + if (C == cols()-1 && R == rows()-1) { // Last row+col? Total all cells + sprintf(s, "%d", sum_all()); + } else if (C == cols()-1) { // Row subtotal + sprintf(s, "%d", sum_cols(R)); + } else if (R == rows()-1) { // Col subtotal + sprintf(s, "%d", sum_rows(C)); + } + fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); + } else { // Not last row or col? Show cell contents + fl_font(FL_HELVETICA, 14); // ..in regular font + sprintf(s, "%d", values[R][C]); + fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT); + } } fl_pop_clip(); return; } - case CONTEXT_RC_RESIZE: // table resizing rows or columns + case CONTEXT_RC_RESIZE: // table resizing rows or columns if ( input->visible() ) { find_cell(CONTEXT_TABLE, row_edit, col_edit, X, Y, W, H); input->resize(X,Y,W,H); @@ -205,43 +203,43 @@ void Spreadsheet::draw_cell(TableContext context, int R,int C, int X,int Y,int W void Spreadsheet::event_callback2() { int R = callback_row(); int C = callback_col(); - TableContext context = callback_context(); + TableContext context = callback_context(); switch ( context ) { - case CONTEXT_CELL: { // A table event occurred on a cell - switch (Fl::event()) { // see what FLTK event caused it - case FL_PUSH: // mouse click? - done_editing(); // finish editing previous - if (R != rows()-1 && C != cols()-1 ) // only edit cells not in total's columns - start_editing(R,C); // start new edit - return; + case CONTEXT_CELL: { // A table event occurred on a cell + switch (Fl::event()) { // see what FLTK event caused it + case FL_PUSH: // mouse click? + done_editing(); // finish editing previous + if (R != rows()-1 && C != cols()-1 ) // only edit cells not in total's columns + start_editing(R,C); // start new edit + return; - case FL_KEYBOARD: // key press in table? - if ( Fl::event_key() == FL_Escape ) exit(0); // ESC closes app - done_editing(); // finish any previous editing - if (C==cols()-1 || R==rows()-1) return; // no editing of totals column - switch ( Fl::e_text[0] ) { - case '0': case '1': case '2': case '3': // any of these should start editing new cell - case '4': case '5': case '6': case '7': - case '8': case '9': case '+': case '-': - start_editing(R,C); // start new edit - input->handle(Fl::event()); // pass typed char to input - break; - case '\r': case '\n': // let enter key edit the cell - start_editing(R,C); // start new edit - break; - } - return; + case FL_KEYBOARD: // key press in table? + if ( Fl::event_key() == FL_Escape ) exit(0); // ESC closes app + done_editing(); // finish any previous editing + if (C==cols()-1 || R==rows()-1) return; // no editing of totals column + switch ( Fl::e_text[0] ) { + case '0': case '1': case '2': case '3': // any of these should start editing new cell + case '4': case '5': case '6': case '7': + case '8': case '9': case '+': case '-': + start_editing(R,C); // start new edit + input->handle(Fl::event()); // pass typed char to input + break; + case '\r': case '\n': // let enter key edit the cell + start_editing(R,C); // start new edit + break; + } + return; } return; } - case CONTEXT_TABLE: // A table event occurred on dead zone in table - case CONTEXT_ROW_HEADER: // A table event occurred on row/column header + case CONTEXT_TABLE: // A table event occurred on dead zone in table + case CONTEXT_ROW_HEADER: // A table event occurred on row/column header case CONTEXT_COL_HEADER: - done_editing(); // done editing, hide + done_editing(); // done editing, hide return; - + default: return; } @@ -250,20 +248,20 @@ void Spreadsheet::event_callback2() { int main() { Fl_Double_Window *win = new Fl_Double_Window(862, 322, "Fl_Table Spreadsheet"); Spreadsheet *table = new Spreadsheet(10, 10, win->w()-20, win->h()-20); - table->tab_cell_nav(1); // enable tab navigation of table cells (instead of fltk widgets) + table->tab_cell_nav(1); // enable tab navigation of table cells (instead of fltk widgets) table->tooltip("Use keyboard to navigate cells:\n" "Arrow keys or Tab/Shift-Tab"); // Table rows table->row_header(1); table->row_header_width(70); table->row_resize(1); - table->rows(MAX_ROWS+1); // +1: leaves room for 'total row' + table->rows(MAX_ROWS+1); // +1: leaves room for 'total row' table->row_height_all(25); // Table cols table->col_header(1); table->col_header_height(25); table->col_resize(1); - table->cols(MAX_COLS+1); // +1: leaves room for 'total column' + table->cols(MAX_COLS+1); // +1: leaves room for 'total column' table->col_width_all(70); // Show window win->end(); @@ -271,7 +269,3 @@ int main() { win->show(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/table-with-keynav.cxx b/examples/table-with-keynav.cxx index 74be7e30c..ee5f98ed5 100644 --- a/examples/table-with-keynav.cxx +++ b/examples/table-with-keynav.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Example of Fl_Table with keyboard selection navigation - Greg Ercolano 04/14/2012 // // Display a 10x10 multiplication table, and allow the user to @@ -18,11 +16,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/fl_draw.H> @@ -36,147 +34,143 @@ // GLOBALS class MyTable; -Fl_Toggle_Button *G_rowselect = 0; // toggle to enable row selection -MyTable *G_table = 0; // table widget -Fl_Output *G_sum = 0; // displays sum of user's selection +Fl_Toggle_Button *G_rowselect = 0; // toggle to enable row selection +MyTable *G_table = 0; // table widget +Fl_Output *G_sum = 0; // displays sum of user's selection class MyTable : public Fl_Table_Row { protected: // Handle drawing all cells in table void draw_cell(TableContext context, int R=0,int C=0, int X=0,int Y=0,int W=0,int H=0) { - static char s[30]; - switch ( context ) { - case CONTEXT_COL_HEADER: - case CONTEXT_ROW_HEADER: - fl_font(FL_HELVETICA | FL_BOLD, 14); - fl_push_clip(X, Y, W, H); - { - Fl_Color c = (context==CONTEXT_COL_HEADER) ? col_header_color() : row_header_color(); - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, c); - fl_color(FL_BLACK); - // Draw text for headers - sprintf(s, "%d", (context == CONTEXT_COL_HEADER) ? C : R); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - } - fl_pop_clip(); - return; - case CONTEXT_CELL: { - // Keyboard nav and mouse selection highlighting - int selected = G_rowselect->value() ? row_selected(R) : is_selected(R,C); - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, selected ? FL_YELLOW : FL_WHITE); - // Draw text for the cell - fl_push_clip(X+3, Y+3, W-6, H-6); - { - fl_font(FL_HELVETICA, 14); - fl_color(FL_BLACK); - sprintf(s, "%d", R*C); // factor row + col for data cells - fl_draw(s, X+3, Y+3, W-6, H-6, FL_ALIGN_RIGHT); - } - fl_pop_clip(); - return; - } - default: - return; - } + static char s[30]; + switch ( context ) { + case CONTEXT_COL_HEADER: + case CONTEXT_ROW_HEADER: + fl_font(FL_HELVETICA | FL_BOLD, 14); + fl_push_clip(X, Y, W, H); + { + Fl_Color c = (context==CONTEXT_COL_HEADER) ? col_header_color() : row_header_color(); + fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, c); + fl_color(FL_BLACK); + // Draw text for headers + sprintf(s, "%d", (context == CONTEXT_COL_HEADER) ? C : R); + fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); + } + fl_pop_clip(); + return; + case CONTEXT_CELL: { + // Keyboard nav and mouse selection highlighting + int selected = G_rowselect->value() ? row_selected(R) : is_selected(R,C); + fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, selected ? FL_YELLOW : FL_WHITE); + // Draw text for the cell + fl_push_clip(X+3, Y+3, W-6, H-6); + { + fl_font(FL_HELVETICA, 14); + fl_color(FL_BLACK); + sprintf(s, "%d", R*C); // factor row + col for data cells + fl_draw(s, X+3, Y+3, W-6, H-6, FL_ALIGN_RIGHT); + } + fl_pop_clip(); + return; + } + default: + return; + } } public: // CTOR MyTable(int x, int y, int w, int h, const char *l=0) : Fl_Table_Row(x,y,w,h,l) { - // Row init - row_header(1); - row_header_width(70); - row_resize(1); - rows(11); - row_height_all(20); - // Col init - col_header(1); - col_header_height(20); - col_resize(1); - cols(11); - col_width_all(70); - end(); // Fl_Table derives from Fl_Group, so end() it + // Row init + row_header(1); + row_header_width(70); + row_resize(1); + rows(11); + row_height_all(20); + // Col init + col_header(1); + col_header_height(20); + col_resize(1); + cols(11); + col_width_all(70); + end(); // Fl_Table derives from Fl_Group, so end() it } ~MyTable() { } // Update the displayed sum value int GetSelectionSum() { int sum = -1; for ( int R=0; R<rows(); R++ ) { - for ( int C=0; C<cols(); C++ ) { - if ( G_rowselect->value() ? row_selected(R) : is_selected(R,C) ) { - if ( sum == -1 ) sum = 0; - sum += R*C; - } - } - } - return(sum); + for ( int C=0; C<cols(); C++ ) { + if ( G_rowselect->value() ? row_selected(R) : is_selected(R,C) ) { + if ( sum == -1 ) sum = 0; + sum += R*C; + } + } + } + return(sum); } // Update the "Selection sum:" display void UpdateSum() { - static char s[80]; - int sum = GetSelectionSum(); - if ( sum == -1 ) { sprintf(s, "(nothing selected)"); G_sum->color(48); } - else { sprintf(s, "%d", sum); G_sum->color(FL_WHITE); } - // Update only if different (lets one copy/paste from sum) - if ( strcmp(s,G_sum->value())) - { G_sum->value(s); G_sum->redraw(); } + static char s[80]; + int sum = GetSelectionSum(); + if ( sum == -1 ) { sprintf(s, "(nothing selected)"); G_sum->color(48); } + else { sprintf(s, "%d", sum); G_sum->color(FL_WHITE); } + // Update only if different (lets one copy/paste from sum) + if ( strcmp(s,G_sum->value())) + { G_sum->value(s); G_sum->redraw(); } } // Keyboard and mouse events int handle(int e) { int ret = Fl_Table_Row::handle(e); - if ( e == FL_KEYBOARD && Fl::event_key() == FL_Escape ) exit(0); + if ( e == FL_KEYBOARD && Fl::event_key() == FL_Escape ) exit(0); switch (e) { - case FL_PUSH: - case FL_RELEASE: - case FL_KEYUP: - case FL_KEYDOWN: - case FL_DRAG: { - //ret = 1; // *don't* indicate we 'handled' these, just update ('handling' prevents e.g. tab nav) - UpdateSum(); - redraw(); - break; - } - case FL_FOCUS: // tells FLTK we're interested in keyboard events - case FL_UNFOCUS: - ret = 1; - break; - } - return(ret); + case FL_PUSH: + case FL_RELEASE: + case FL_KEYUP: + case FL_KEYDOWN: + case FL_DRAG: { + //ret = 1; // *don't* indicate we 'handled' these, just update ('handling' prevents e.g. tab nav) + UpdateSum(); + redraw(); + break; + } + case FL_FOCUS: // tells FLTK we're interested in keyboard events + case FL_UNFOCUS: + ret = 1; + break; + } + return(ret); } }; // User changed the 'row select' toggle button void RowSelect_CB(Fl_Widget *w, void*) { - w->window()->redraw(); // redraw with changes applied + w->window()->redraw(); // redraw with changes applied G_table->UpdateSum(); } int main() { - Fl::option(Fl::OPTION_ARROW_FOCUS, 0); // disable arrow focus nav (we want arrows to control cells) + Fl::option(Fl::OPTION_ARROW_FOCUS, 0); // disable arrow focus nav (we want arrows to control cells) Fl_Double_Window win(862, 312, "table-with-keynav"); win.begin(); - // Create table - G_table = new MyTable(10, 30, win.w()-20, win.h()-70, "Times Table"); - G_table->tooltip("Use mouse or Shift + Arrow Keys to make selections.\n" - "Sum of selected values is shown."); - // Row select toggle button - G_rowselect = new Fl_Toggle_Button(140,10,12,12,"Row selection"); - G_rowselect->align(FL_ALIGN_LEFT); - G_rowselect->value(0); - G_rowselect->selection_color(FL_YELLOW); - G_rowselect->callback(RowSelect_CB); - G_rowselect->tooltip("Click to toggle row vs. row/col selection"); - // Selection sum display - win.end(); - win.begin(); - G_sum = new Fl_Output(140,G_table->y()+G_table->h()+10,160,25,"Selection Sum:"); - G_sum->value("(nothing selected)"); - G_sum->color(48); - G_sum->tooltip("This field shows the sum of the selected cells in the table"); + // Create table + G_table = new MyTable(10, 30, win.w()-20, win.h()-70, "Times Table"); + G_table->tooltip("Use mouse or Shift + Arrow Keys to make selections.\n" + "Sum of selected values is shown."); + // Row select toggle button + G_rowselect = new Fl_Toggle_Button(140,10,12,12,"Row selection"); + G_rowselect->align(FL_ALIGN_LEFT); + G_rowselect->value(0); + G_rowselect->selection_color(FL_YELLOW); + G_rowselect->callback(RowSelect_CB); + G_rowselect->tooltip("Click to toggle row vs. row/col selection"); + // Selection sum display + win.end(); + win.begin(); + G_sum = new Fl_Output(140,G_table->y()+G_table->h()+10,160,25,"Selection Sum:"); + G_sum->value("(nothing selected)"); + G_sum->color(48); + G_sum->tooltip("This field shows the sum of the selected cells in the table"); win.end(); win.resizable(G_table); - win.show(); + win.show(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/examples/table-with-right-column-stretch-fit.cxx b/examples/table-with-right-column-stretch-fit.cxx index 302ef0676..374bcec5b 100644 --- a/examples/table-with-right-column-stretch-fit.cxx +++ b/examples/table-with-right-column-stretch-fit.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // // Demonstrate resizing Fl_Table_Row right column to fit window to avoid appearance of horiz scrollbar // @@ -18,11 +16,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> diff --git a/examples/tabs-simple.cxx b/examples/tabs-simple.cxx index 7f06e5e89..a6248842d 100644 --- a/examples/tabs-simple.cxx +++ b/examples/tabs-simple.cxx @@ -1,8 +1,6 @@ // -// "$Id$" -// -// Simple Fl_Tabs widget example. -// Originally from erco's cheat sheet 06/05/2010, permission by author. +// Simple Fl_Tabs widget example. +// Originally from erco's cheat sheet 06/05/2010, permission by author. // // Copyright 2010 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/Fl_Window.H> @@ -47,11 +45,11 @@ int main(int argc, char *argv[]) { // Fl_Group *aaa = new Fl_Group(10,35,500-20,200-45,"Aaa"); { - // Put some different buttons into the group, which will be shown - // when the tab is selected. - Fl_Button *b1 = new Fl_Button(50, 60,90,25,"Button A1"); b1->color(88+1); - Fl_Button *b2 = new Fl_Button(50, 90,90,25,"Button A2"); b2->color(88+2); - Fl_Button *b3 = new Fl_Button(50,120,90,25,"Button A3"); b3->color(88+3); + // Put some different buttons into the group, which will be shown + // when the tab is selected. + Fl_Button *b1 = new Fl_Button(50, 60,90,25,"Button A1"); b1->color(88+1); + Fl_Button *b2 = new Fl_Button(50, 90,90,25,"Button A2"); b2->color(88+2); + Fl_Button *b3 = new Fl_Button(50,120,90,25,"Button A3"); b3->color(88+3); } aaa->end(); @@ -60,14 +58,14 @@ int main(int argc, char *argv[]) { // Fl_Group *bbb = new Fl_Group(10,35,500-10,200-35,"Bbb"); { - // Put some different buttons into the group, which will be shown - // when the tab is selected. - Fl_Button *b1 = new Fl_Button( 50,60,90,25,"Button B1"); b1->color(88+1); - Fl_Button *b2 = new Fl_Button(150,60,90,25,"Button B2"); b2->color(88+3); - Fl_Button *b3 = new Fl_Button(250,60,90,25,"Button B3"); b3->color(88+5); - Fl_Button *b4 = new Fl_Button( 50,90,90,25,"Button B4"); b4->color(88+2); - Fl_Button *b5 = new Fl_Button(150,90,90,25,"Button B5"); b5->color(88+4); - Fl_Button *b6 = new Fl_Button(250,90,90,25,"Button B6"); b6->color(88+6); + // Put some different buttons into the group, which will be shown + // when the tab is selected. + Fl_Button *b1 = new Fl_Button( 50,60,90,25,"Button B1"); b1->color(88+1); + Fl_Button *b2 = new Fl_Button(150,60,90,25,"Button B2"); b2->color(88+3); + Fl_Button *b3 = new Fl_Button(250,60,90,25,"Button B3"); b3->color(88+5); + Fl_Button *b4 = new Fl_Button( 50,90,90,25,"Button B4"); b4->color(88+2); + Fl_Button *b5 = new Fl_Button(150,90,90,25,"Button B5"); b5->color(88+4); + Fl_Button *b6 = new Fl_Button(250,90,90,25,"Button B6"); b6->color(88+6); } bbb->end(); } @@ -77,7 +75,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/textdisplay-with-colors.cxx b/examples/textdisplay-with-colors.cxx index 6c4482402..6d66d2367 100644 --- a/examples/textdisplay-with-colors.cxx +++ b/examples/textdisplay-with-colors.cxx @@ -1,14 +1,12 @@ // -// "$Id$" +// How to use Fl_Text_Display with colors. -erco 11/09/2010 +// Originally from erco's cheat sheet, permission by author. // -// How to use Fl_Text_Display with colors. -erco 11/09/2010 -// Originally from erco's cheat sheet, permission by author. +// Shows how to use the two Fl_Text_Buffer's needed to manage +// the text and style info separately. // -// Shows how to use the two Fl_Text_Buffer's needed to manage -// the text and style info separately. -// -// For an example of a color text *editor*, see the 'editor' -// example in the test directory. +// For an example of a color text *editor*, see the 'editor' +// example in the test directory. // // Copyright 2010 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -17,11 +15,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/Fl_Window.H> @@ -38,22 +36,18 @@ int main() { }; Fl_Window *win = new Fl_Window(640, 480, "Simple Text Display With Colors"); Fl_Text_Display *disp = new Fl_Text_Display(20, 20, 640-40, 480-40); - Fl_Text_Buffer *tbuff = new Fl_Text_Buffer(); // text buffer - Fl_Text_Buffer *sbuff = new Fl_Text_Buffer(); // style buffer + Fl_Text_Buffer *tbuff = new Fl_Text_Buffer(); // text buffer + Fl_Text_Buffer *sbuff = new Fl_Text_Buffer(); // style buffer disp->buffer(tbuff); - int stable_size = sizeof(stable)/sizeof(stable[0]); // # entries in style table (4) + int stable_size = sizeof(stable)/sizeof(stable[0]); // # entries in style table (4) disp->highlight_data(sbuff, stable, stable_size, 'A', 0, 0); // Text tbuff->text("Red Line 1\nYel Line 2\nGrn Line 3\nBlu Line 4\n" - "Red Line 5\nYel Line 6\nGrn Line 7\nBlu Line 8\n"); + "Red Line 5\nYel Line 6\nGrn Line 7\nBlu Line 8\n"); // Style for text sbuff->text("AAAAAAAAAA\nBBBBBBBBBB\nCCCCCCCCCC\nDDDDDDDDDD\n" - "AAAAAAAAAA\nBBBBBBBBBB\nCCCCCCCCCC\nDDDDDDDDDD\n"); + "AAAAAAAAAA\nBBBBBBBBBB\nCCCCCCCCCC\nDDDDDDDDDD\n"); win->resizable(*disp); win->show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/texteditor-simple.cxx b/examples/texteditor-simple.cxx index 147f49720..4271b0b5a 100644 --- a/examples/texteditor-simple.cxx +++ b/examples/texteditor-simple.cxx @@ -1,16 +1,14 @@ // -// "$Id$" +// A simple example of Fl_Text_Editor // -// A simple example of Fl_Text_Editor +// Fl_Text_Editor is unlike other FLTK widgets in that +// to work correctly, it must be assigned to an instance of an +// Fl_Text_Buffer. The below shows using buffer() to connect +// the two classes together. // -// Fl_Text_Editor is unlike other FLTK widgets in that -// to work correctly, it must be assigned to an instance of an -// Fl_Text_Buffer. The below shows using buffer() to connect -// the two classes together. -// -// Note that the example can also be used to demonstrate -// Fl_Text_Display; just replace all instances of -// Fl_Text_Editor with Fl_Text_Display and rebuild. +// Note that the example can also be used to demonstrate +// Fl_Text_Display; just replace all instances of +// Fl_Text_Editor with Fl_Text_Display and rebuild. // // Copyright 2010 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -19,11 +17,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -34,7 +32,7 @@ int main() { Fl_Double_Window *win = new Fl_Double_Window(640, 480, "Simple Fl_Text_Editor"); Fl_Text_Buffer *buff = new Fl_Text_Buffer(); Fl_Text_Editor *edit = new Fl_Text_Editor(20, 20, 640-40, 480-40); - edit->buffer(buff); // attach the text buffer to our editor widget + edit->buffer(buff); // attach the text buffer to our editor widget win->resizable(*edit); win->show(); buff->text("line 0\nline 1\nline 2\n" @@ -47,7 +45,3 @@ int main() { "line 21\nline 22\nline 23\n"); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/texteditor-with-dynamic-colors.cxx b/examples/texteditor-with-dynamic-colors.cxx index 458774a56..0d5bba47e 100644 --- a/examples/texteditor-with-dynamic-colors.cxx +++ b/examples/texteditor-with-dynamic-colors.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // How to use Fl_Text_Editor with dynamic colors. -erco 08/29/2018 // Originally posted on fltk.general. // @@ -25,11 +23,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/Fl_Window.H> @@ -132,7 +130,3 @@ int main() { win->show(); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/tree-as-container.cxx b/examples/tree-as-container.cxx index e704d7a0b..d8cac5205 100644 --- a/examples/tree-as-container.cxx +++ b/examples/tree-as-container.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Fl_Tree as a container of FLTK widgets. - erco 04/15/2012 +// Fl_Tree as a container of FLTK widgets. - erco 04/15/2012 // // Copyright 2010,2012 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> #include <FL/Fl.H> @@ -32,18 +30,18 @@ class MyData : public Fl_Group { Fl_Input *fields[MAX_FIELDS]; public: MyData(int X,int Y,int W,int H) : Fl_Group(X,Y,W,H) { - static unsigned int colors[MAX_FIELDS] = { - 0xffffdd00, 0xffdddd00, 0xddffff00, 0xddffdd00, 0xddddff00 - }; + static unsigned int colors[MAX_FIELDS] = { + 0xffffdd00, 0xffdddd00, 0xddffff00, 0xddffdd00, 0xddddff00 + }; for ( int t=0; t<MAX_FIELDS; t++ ) { - fields[t] = new Fl_Input(X+t*FIELD_WIDTH,Y,FIELD_WIDTH,H); - fields[t]->color(Fl_Color(colors[t])); - } - end(); + fields[t] = new Fl_Input(X+t*FIELD_WIDTH,Y,FIELD_WIDTH,H); + fields[t]->color(Fl_Color(colors[t])); + } + end(); } void SetData(int col, const char *val) { if ( col >= 0 && col < MAX_FIELDS ) - fields[col]->value(val); + fields[col]->value(val); } }; @@ -53,7 +51,7 @@ int main(int argc, char *argv[]) { { // Create the tree Fl_Tree *tree = new Fl_Tree(10, 10, win->w()-20, win->h()-20); - tree->showroot(0); // don't show root of tree + tree->showroot(0); // don't show root of tree // Add some regular text nodes tree->add("Foo/Bar/001"); tree->add("Foo/Bar/002"); @@ -63,20 +61,20 @@ int main(int argc, char *argv[]) { for ( int t=0; t<MAX_ROWS; t++ ) { // Add item to tree static char s[80]; - sprintf(s, "FLTK Widgets/%d", t); - Fl_Tree_Item *item = tree->add(s); - // Reconfigure item to be an FLTK widget (MyData) - tree->begin(); - { - MyData *data = new MyData(0,0,FIELD_WIDTH*MAX_FIELDS, FIELD_HEIGHT); - item->widget(data); - // Initialize widget data - for ( int c=0; c<MAX_FIELDS; c++ ) { - sprintf(s, "%d-%d", t,c); - data->SetData(c,s); - } - } - tree->end(); + sprintf(s, "FLTK Widgets/%d", t); + Fl_Tree_Item *item = tree->add(s); + // Reconfigure item to be an FLTK widget (MyData) + tree->begin(); + { + MyData *data = new MyData(0,0,FIELD_WIDTH*MAX_FIELDS, FIELD_HEIGHT); + item->widget(data); + // Initialize widget data + for ( int c=0; c<MAX_FIELDS; c++ ) { + sprintf(s, "%d-%d", t,c); + data->SetData(c,s); + } + } + tree->end(); } } win->end(); @@ -84,7 +82,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/tree-custom-draw-items.cxx b/examples/tree-custom-draw-items.cxx index 45bde388e..e7fb3ecde 100644 --- a/examples/tree-custom-draw-items.cxx +++ b/examples/tree-custom-draw-items.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Demonstrate Fl_Tree custom item draw callback. - erco 11/09/2013 +// Demonstrate Fl_Tree custom item draw callback. - erco 11/09/2013 // // Copyright 2013 Greg Ercolano. // Copyright 1998-2016 by Bill Spitzak and others. @@ -10,14 +8,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> -#include <time.h> /* ctime.. */ +#include <time.h> /* ctime.. */ #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Tree.H> @@ -69,12 +67,12 @@ public: // // Our item's label dimensions int X = label_x(), Y = label_y(), - W = label_w(), H = label_h(); + W = label_w(), H = label_h(); // Render background if ( render ) { - if ( is_selected() ) { // Selected? Use selectbox() style + if ( is_selected() ) { // Selected? Use selectbox() style fl_draw_box(prefs().selectbox(),X,Y,W,H,bg); - } else { // Not Selected? use plain filled rectangle + } else { // Not Selected? use plain filled rectangle fl_color(bg); fl_rectf(X,Y,W,H); } } @@ -96,25 +94,25 @@ public: } X += 35; // Render the date and time, one over the other - fl_font(labelfont(), 8); // small font + fl_font(labelfont(), 8); // small font fl_color(fg); const struct tm *tm = GetTimeStruct(); char s[80]; sprintf(s, "Date: %02d/%02d/%02d", tm->tm_mon+1, tm->tm_mday, tm->tm_year % 100); - lw=0, lh=0; fl_measure(s, lw, lh); // get box around text (including white space) + lw=0, lh=0; fl_measure(s, lw, lh); // get box around text (including white space) if ( render ) fl_draw(s, X,Y+4,W,H, FL_ALIGN_LEFT|FL_ALIGN_TOP); sprintf(s, "Time: %02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec); if ( render ) fl_draw(s, X,Y+H/2,W,H/2, FL_ALIGN_LEFT|FL_ALIGN_TOP); int lw2=0, lh2=0; fl_measure(s, lw2, lh2); X += MAX(lw, lw2); - return X; // return right most edge of what we've rendered + return X; // return right most edge of what we've rendered } }; // TIMER TO HANDLE DYNAMIC CONTENT IN THE TREE void Timer_CB(void *data) { Fl_Tree *tree = (Fl_Tree*)data; - tree->redraw(); // keeps time updated + tree->redraw(); // keeps time updated Fl::repeat_timeout(0.2, Timer_CB, data); } @@ -125,8 +123,8 @@ int main(int argc, char *argv[]) { { // Create the tree Fl_Tree *tree = new Fl_Tree(0, 0, win->w(), win->h()); - tree->showroot(0); // don't show root of tree - tree->selectmode(FL_TREE_SELECT_MULTI); // multiselect + tree->showroot(0); // don't show root of tree + tree->selectmode(FL_TREE_SELECT_MULTI); // multiselect // Add some items tree->add("Flintstones/Fred"); @@ -134,11 +132,11 @@ int main(int argc, char *argv[]) { tree->add("Flintstones/Pebbles"); { MyTimeItem *myitem; - myitem = new MyTimeItem(tree, "Local"); // create custom item + myitem = new MyTimeItem(tree, "Local"); // create custom item myitem->labelsize(20); tree->add("Time Add Item/Local", myitem); - myitem = new MyTimeItem(tree, "GMT"); // create custom item + myitem = new MyTimeItem(tree, "GMT"); // create custom item myitem->labelsize(20); tree->add("Time Add Item/GMT", myitem); } @@ -148,15 +146,15 @@ int main(int argc, char *argv[]) { MyTimeItem *myitem; item = tree->add("Time Replace Item/Local Time"); // Replace the 'Local' item with our own - myitem = new MyTimeItem(tree, "Local"); // create custom item + myitem = new MyTimeItem(tree, "Local"); // create custom item myitem->labelsize(20); - item->replace(myitem); // replace normal item with custom + item->replace(myitem); // replace normal item with custom item = tree->add("Time Replace Item/GMT Time"); // Replace the 'GMT' item with our own - myitem = new MyTimeItem(tree, "GMT"); // create custom item + myitem = new MyTimeItem(tree, "GMT"); // create custom item myitem->labelsize(20); - item->replace(myitem); // replace normal item with custom + item->replace(myitem); // replace normal item with custom } tree->add("Superjail/Warden"); tree->add("Superjail/Jared"); @@ -176,7 +174,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/tree-custom-sort.cxx b/examples/tree-custom-sort.cxx index 5f14946ee..36a662560 100644 --- a/examples/tree-custom-sort.cxx +++ b/examples/tree-custom-sort.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Simple Fl_Tree custom (numeric) sort example. - erco 12/16/2013 +// Simple Fl_Tree custom (numeric) sort example. - erco 12/16/2013 // Demonstrates custom sorting of Fl_Tree items. // // Copyright 2013 Greg Ercolano. @@ -11,15 +9,15 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> -#include <stdlib.h> /* qsort(3), srand(3).. */ -#include <time.h> /* time(2) */ +#include <stdlib.h> /* qsort(3), srand(3).. */ +#include <time.h> /* time(2) */ #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Tree.H> @@ -29,7 +27,7 @@ Fl_Tree *G_tree = 0; // Resort the tree void MySortCallback(Fl_Widget*, void *data) { - int dir = int(fl_intptr_t(data)); // forward or reverse + int dir = int(fl_intptr_t(data)); // forward or reverse Fl_Tree_Item *i = G_tree->root(); // Bubble sort for ( int ax=0; ax<i->children(); ax++ ) { @@ -75,7 +73,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/tree-of-tables.cxx b/examples/tree-of-tables.cxx index b90a015d0..f26d685b0 100644 --- a/examples/tree-of-tables.cxx +++ b/examples/tree-of-tables.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Fl_Tree as a container of Fl_Table's. - erco 04/25/2012 +// Fl_Tree as a container of Fl_Table's. - erco 04/25/2012 // // Demonstrates how one can make a tree where each item // contains a complex widget. @@ -13,14 +11,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> -#include <math.h> // powf() +#include <math.h> // powf() #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Tree.H> @@ -35,13 +33,13 @@ public: MyTable(int X,int Y,int W,int H,const char *mode) : Fl_Table(X,Y,W,H) { rows(11); row_height_all(20); row_header(1); cols(11); col_width_all(60); col_header(1); - col_resize(1); // enable column resizing + col_resize(1); // enable column resizing this->mode = mode; end(); } void resize(int X,int Y,int W,int H) { - if ( W > 718 ) W = 718; // don't exceed 700 in width - Fl_Table::resize(X,Y,W,h()); // disallow changes in height + if ( W > 718 ) W = 718; // don't exceed 700 in width + Fl_Table::resize(X,Y,W,h()); // disallow changes in height } // Handle drawing table's cells // Fl_Table calls this function to draw each visible cell in the table. @@ -52,33 +50,33 @@ public: switch ( context ) { case CONTEXT_STARTPAGE: // before page is drawn.. fl_font(FL_HELVETICA, 10); // set the font for our drawing operations - return; - case CONTEXT_COL_HEADER: // Drawing column/row headers + return; + case CONTEXT_COL_HEADER: // Drawing column/row headers case CONTEXT_ROW_HEADER: { int val = context==CONTEXT_COL_HEADER ? COL : ROW; int col = context==CONTEXT_COL_HEADER ? col_header_color() : row_header_color(); fl_push_clip(X,Y,W,H); - if ( strcmp(mode, "SinCos" ) == 0 ) { sprintf(s, "%.2f", ((val/10.0)*PI)); } - else sprintf(s,"%d",val); - fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, col); - fl_color(FL_BLACK); - fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); + if ( strcmp(mode, "SinCos" ) == 0 ) { sprintf(s, "%.2f", ((val/10.0)*PI)); } + else sprintf(s,"%d",val); + fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, col); + fl_color(FL_BLACK); + fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); fl_pop_clip(); - return; + return; } case CONTEXT_CELL: { // Draw data in cells int col = is_selected(ROW,COL) ? FL_YELLOW : FL_WHITE; fl_push_clip(X,Y,W,H); if ( strcmp(mode, "Addition") == 0 ) { sprintf(s, "%d", ROW+COL); } else if ( strcmp(mode, "Subtract") == 0 ) { sprintf(s, "%d", ROW-COL); } else - if ( strcmp(mode, "Multiply") == 0 ) { sprintf(s, "%d", ROW*COL); } else - if ( strcmp(mode, "Divide" ) == 0 ) { if ( COL==0 ) sprintf(s, "N/A"); else sprintf(s, "%.2f", (float)ROW/(float)COL); } else - if ( strcmp(mode, "Exponent") == 0 ) { sprintf(s, "%g", powf((float)ROW,(float)COL)); } else - if ( strcmp(mode, "SinCos" ) == 0 ) { sprintf(s, "%.2f", sin((ROW/10.0)*PI) * cos((COL/10.0)*PI)); } else - { sprintf(s, "???"); } - fl_color(col); fl_rectf(X,Y,W,H); // bg - fl_color(FL_GRAY0); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); // text - fl_color(color()); fl_rect(X,Y,W,H); // box + if ( strcmp(mode, "Multiply") == 0 ) { sprintf(s, "%d", ROW*COL); } else + if ( strcmp(mode, "Divide" ) == 0 ) { if ( COL==0 ) sprintf(s, "N/A"); else sprintf(s, "%.2f", (float)ROW/(float)COL); } else + if ( strcmp(mode, "Exponent") == 0 ) { sprintf(s, "%g", powf((float)ROW,(float)COL)); } else + if ( strcmp(mode, "SinCos" ) == 0 ) { sprintf(s, "%.2f", sin((ROW/10.0)*PI) * cos((COL/10.0)*PI)); } else + { sprintf(s, "???"); } + fl_color(col); fl_rectf(X,Y,W,H); // bg + fl_color(FL_GRAY0); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); // text + fl_color(color()); fl_rect(X,Y,W,H); // box fl_pop_clip(); return; } @@ -95,13 +93,13 @@ int main(int argc, char *argv[]) { // Create tree Fl_Tree *tree = new Fl_Tree(10, 10, win->w()-20, win->h()-20); tree->root()->label("Math Tables"); - tree->item_labelfont(FL_COURIER); // font to use for items - tree->linespacing(4); // extra space between items + tree->item_labelfont(FL_COURIER); // font to use for items + tree->linespacing(4); // extra space between items tree->item_draw_mode(tree->item_draw_mode() | FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET | // draw item with widget() next to it - FL_TREE_ITEM_HEIGHT_FROM_WIDGET); // make item height follow table's height - tree->selectmode(FL_TREE_SELECT_NONE); // font to use for items - tree->widgetmarginleft(12); // space between item and table + FL_TREE_ITEM_HEIGHT_FROM_WIDGET); // make item height follow table's height + tree->selectmode(FL_TREE_SELECT_NONE); // font to use for items + tree->widgetmarginleft(12); // space between item and table tree->connectorstyle(FL_TREE_CONNECTOR_DOTTED); // Create tables, assign each a tree item @@ -141,7 +139,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/tree-simple.cxx b/examples/tree-simple.cxx index 7e3cf964d..37c6fd28c 100644 --- a/examples/tree-simple.cxx +++ b/examples/tree-simple.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Simple Fl_Tree widget example. - erco 06/05/2010 +// Simple Fl_Tree widget example. - erco 06/05/2010 // // Copyright 2010 Greg Ercolano. // Copyright 1998-2016 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> #include <FL/Fl.H> @@ -60,8 +58,8 @@ int main(int argc, char *argv[]) { { // Create the tree Fl_Tree *tree = new Fl_Tree(10, 10, win->w()-20, win->h()-20); - tree->showroot(0); // don't show root of tree - tree->callback(TreeCallback); // setup a callback for the tree + tree->showroot(0); // don't show root of tree + tree->callback(TreeCallback); // setup a callback for the tree // Add some items tree->add("Flintstones/Fred"); @@ -71,9 +69,9 @@ int main(int argc, char *argv[]) { tree->add("Simpsons/Marge"); tree->add("Simpsons/Bart"); tree->add("Simpsons/Lisa"); - tree->add("Pathnames/\\/bin"); // front slashes + tree->add("Pathnames/\\/bin"); // front slashes tree->add("Pathnames/\\/usr\\/sbin"); - tree->add("Pathnames/C:\\\\Program Files"); // backslashes + tree->add("Pathnames/C:\\\\Program Files"); // backslashes tree->add("Pathnames/C:\\\\Documents and Settings"); // Start with some items closed @@ -85,7 +83,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/examples/wizard-simple.cxx b/examples/wizard-simple.cxx index bfa6865af..f434bc9de 100644 --- a/examples/wizard-simple.cxx +++ b/examples/wizard-simple.cxx @@ -1,8 +1,6 @@ // -// "$Id$" -// -// Simple Fl_Wizard widget example. -// Originally from erco's cheat sheet 06/05/2010, permission by author. +// Simple Fl_Wizard widget example. +// Originally from erco's cheat sheet 06/05/2010, permission by author. // // Copyright 2010 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> #include <FL/Fl.H> @@ -75,7 +73,3 @@ int main(int argc, char **argv) { G_win->show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/fltk-config.in b/fltk-config.in index 5161efaa6..c98d2b538 100644 --- a/fltk-config.in +++ b/fltk-config.in @@ -1,7 +1,5 @@ #!/bin/sh # -# "$Id$" -# # FLTK configuration utility. # # Copyright 2000-2016 by Bill Spitzak and others. @@ -12,11 +10,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # MAJOR_VERSION=@FL_MAJOR_VERSION@ @@ -405,7 +403,3 @@ fi if test "$echo_includedir" = "yes"; then echo $includedir fi - -# -# End of "$Id$". -# diff --git a/fltk.list.in b/fltk.list.in index 16258f089..08877ba28 100644 --- a/fltk.list.in +++ b/fltk.list.in @@ -1,6 +1,4 @@ # -# "$Id$" -# # EPM product list file for the Fast Light Tool Kit (FLTK). # # (EPM can be found at https://www.msweet.org/epm/) @@ -13,9 +11,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # %product Fast Light Tool Kit (FLTK) @@ -101,7 +99,7 @@ f 0555 root sys $libdir/libfltk_gl.so.@FL_DSO_VERSION@ src/libfltk_gl.so.@FL_DSO %subpackage devel %description FLTK Development Environment -%description Install fltk-devel if you need to develop FLTK applications. +%description Install fltk-devel if you need to develop FLTK applications. %description You'll need to install the fltk package if you plan to run %description dynamically linked applications. @@ -428,7 +426,3 @@ f 0444 root sys $mandir/cat6/sudoku.$CAT6EXT documentation/src/sudoku.$CAT6EXT f 0444 root sys $mandir/man6/blocks.6 documentation/src/blocks.man f 0444 root sys $mandir/man6/checkers.6 documentation/src/checkers.man f 0444 root sys $mandir/man6/sudoku.6 documentation/src/sudoku.man - -# -# End of "$Id$". -# diff --git a/fltk.spec.in b/fltk.spec.in index dfe7e3502..d13e6b5d9 100644 --- a/fltk.spec.in +++ b/fltk.spec.in @@ -1,6 +1,4 @@ # -# "$Id$" -# # RPM spec file for FLTK. # # Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # %define version @FL_MAJOR_VERSION@.@FL_MINOR_VERSION@.@FL_PATCH_VERSION@ @@ -27,7 +25,7 @@ Release: %{release} License: LGPL Group: System Environment/Libraries Source: ftp://ftp.fltk.org/pub/fltk/%{version}/fltk-%{version}-source.tar.gz -URL: http://www.fltk.org/ +URL: https://www.fltk.org/ Packager: FLTK Developer <fltk@fltk.org> # use BuildRoot so as not to disturb the version already installed BuildRoot: /var/tmp/fltk-%{PACKAGE_VERSION} @@ -44,7 +42,7 @@ Summary: FLTK Development Environment Group: Development/Libraries %description devel -Install fltk-devel if you need to develop FLTK applications. +Install fltk-devel if you need to develop FLTK applications. You'll need to install the fltk package if you plan to run dynamically linked applications. @@ -130,7 +128,3 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/share/icons/hicolor/*/apps/blocks.png %{prefix}/share/icons/hicolor/*/apps/checkers.png %{prefix}/share/icons/hicolor/*/apps/sudoku.png - -# -# End of "$Id$". -# diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt index 94948f357..e730f274c 100644 --- a/fluid/CMakeLists.txt +++ b/fluid/CMakeLists.txt @@ -1,6 +1,4 @@ # -# "$Id$" -# # CMakeLists.txt to build fluid for the FLTK project using CMake (www.cmake.org) # # Copyright 1998-2018 by Bill Spitzak and others. @@ -11,9 +9,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # diff --git a/fluid/CodeEditor.cxx b/fluid/CodeEditor.cxx index 689f12855..4dd1cef96 100644 --- a/fluid/CodeEditor.cxx +++ b/fluid/CodeEditor.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code editor widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -28,91 +26,91 @@ Fl_Text_Display::Style_Table_Entry CodeEditor:: - styletable[] = { // Style table - { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain - { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments - { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments - { FL_BLUE, FL_COURIER, 11 }, // D - Strings - { FL_DARK_RED, FL_COURIER, 11 }, // E - Directives - { FL_DARK_RED, FL_COURIER_BOLD, 11 }, // F - Types - { FL_BLUE, FL_COURIER_BOLD, 11 } // G - Keywords - }; + styletable[] = { // Style table + { FL_FOREGROUND_COLOR, FL_COURIER, 11 }, // A - Plain + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // B - Line comments + { FL_DARK_GREEN, FL_COURIER_ITALIC, 11 }, // C - Block comments + { FL_BLUE, FL_COURIER, 11 }, // D - Strings + { FL_DARK_RED, FL_COURIER, 11 }, // E - Directives + { FL_DARK_RED, FL_COURIER_BOLD, 11 }, // F - Types + { FL_BLUE, FL_COURIER_BOLD, 11 } // G - Keywords + }; const char * const CodeEditor:: - code_keywords[] = { // Sorted list of C/C++ keywords... - "and", - "and_eq", - "asm", - "bitand", - "bitor", - "break", - "case", - "catch", - "compl", - "continue", - "default", - "delete", - "do", - "else", - "false", - "for", - "goto", - "if", - "new", - "not", - "not_eq", - "operator", - "or", - "or_eq", - "return", - "switch", - "template", - "this", - "throw", - "true", - "try", - "while", - "xor", - "xor_eq" - }; + code_keywords[] = { // Sorted list of C/C++ keywords... + "and", + "and_eq", + "asm", + "bitand", + "bitor", + "break", + "case", + "catch", + "compl", + "continue", + "default", + "delete", + "do", + "else", + "false", + "for", + "goto", + "if", + "new", + "not", + "not_eq", + "operator", + "or", + "or_eq", + "return", + "switch", + "template", + "this", + "throw", + "true", + "try", + "while", + "xor", + "xor_eq" + }; const char * const CodeEditor:: - code_types[] = { // Sorted list of C/C++ types... - "auto", - "bool", - "char", - "class", - "const", - "const_cast", - "double", - "dynamic_cast", - "enum", - "explicit", - "extern", - "float", - "friend", - "inline", - "int", - "long", - "mutable", - "namespace", - "private", - "protected", - "public", - "register", - "short", - "signed", - "sizeof", - "static", - "static_cast", - "struct", - "template", - "typedef", - "typename", - "union", - "unsigned", - "virtual", - "void", - "volatile" - }; + code_types[] = { // Sorted list of C/C++ types... + "auto", + "bool", + "char", + "class", + "const", + "const_cast", + "double", + "dynamic_cast", + "enum", + "explicit", + "extern", + "float", + "friend", + "inline", + "int", + "long", + "mutable", + "namespace", + "private", + "protected", + "public", + "register", + "short", + "signed", + "sizeof", + "static", + "static_cast", + "struct", + "template", + "typedef", + "typename", + "union", + "unsigned", + "virtual", + "void", + "volatile" + }; // attempt to make the fluid code editor widget honour textsize setting void CodeEditor::textsize(Fl_Fontsize s) { @@ -134,12 +132,12 @@ extern "C" { // 'style_parse()' - Parse text and produce style data. void CodeEditor::style_parse(const char *text, char *style, int length) { - char current; - int col; - int last; - char buf[255], - *bufptr; - const char *temp; + char current; + int col; + int last; + char buf[255], + *bufptr; + const char *temp; // Style letters: // @@ -160,64 +158,64 @@ void CodeEditor::style_parse(const char *text, char *style, int length) { current = 'E'; } else if (strncmp(text, "//", 2) == 0) { current = 'B'; - for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; + for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; if (length == 0) break; } else if (strncmp(text, "/*", 2) == 0) { current = 'C'; } else if (strncmp(text, "\\\"", 2) == 0) { // Quoted quote... - *style++ = current; - *style++ = current; - text ++; - length --; - col += 2; - continue; + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; } else if (*text == '\"') { current = 'D'; } else if (!last && (islower(*text) || *text == '_')) { // Might be a keyword... - for (temp = text, bufptr = buf; - (islower(*temp) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); - *bufptr++ = *temp++) { - // nothing - } + for (temp = text, bufptr = buf; + (islower(*temp) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); + *bufptr++ = *temp++) { + // nothing + } if (!islower(*temp) && *temp != '_') { - *bufptr = '\0'; + *bufptr = '\0'; bufptr = buf; - if (bsearch(&bufptr, code_types, - sizeof(code_types) / sizeof(code_types[0]), - sizeof(code_types[0]), compare_keywords)) { - while (text < temp) { - *style++ = 'F'; - text ++; - length --; - col ++; - } - - text --; - length ++; - last = 1; - continue; - } else if (bsearch(&bufptr, code_keywords, - sizeof(code_keywords) / sizeof(code_keywords[0]), - sizeof(code_keywords[0]), compare_keywords)) { - while (text < temp) { - *style++ = 'G'; - text ++; - length --; - col ++; - } - - text --; - length ++; - last = 1; - continue; - } - } + if (bsearch(&bufptr, code_types, + sizeof(code_types) / sizeof(code_types[0]), + sizeof(code_types[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'F'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } else if (bsearch(&bufptr, code_keywords, + sizeof(code_keywords) / sizeof(code_keywords[0]), + sizeof(code_keywords[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'G'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } + } } } else if (current == 'C' && strncmp(text, "*/", 2) == 0) { // Close a C comment... @@ -232,18 +230,18 @@ void CodeEditor::style_parse(const char *text, char *style, int length) { // Continuing in string... if (strncmp(text, "\\\"", 2) == 0) { // Quoted end quote... - *style++ = current; - *style++ = current; - text ++; - length --; - col += 2; - continue; + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; } else if (*text == '\"') { // End quote... - *style++ = current; - col ++; - current = 'A'; - continue; + *style++ = current; + col ++; + current = 'A'; + continue; } } @@ -269,12 +267,12 @@ void CodeEditor::style_unfinished_cb(int, void*) { } void CodeEditor::style_update(int pos, int nInserted, int nDeleted, int /*nRestyled*/, const char * /*deletedText*/, void *cbArg) { - CodeEditor *editor = (CodeEditor *)cbArg; - int start, // Start of text - end; // End of text - char last, // Last style on line - *style, // Style data - *text; // Text data + CodeEditor *editor = (CodeEditor *)cbArg; + int start, // Start of text + end; // End of text + char last, // Last style on line + *style, // Style data + *text; // Text data // If this is just a selection change, just unselect the style buffer... @@ -360,7 +358,7 @@ int CodeEditor::auto_indent(int, CodeEditor* e) { char *ptr; for (ptr = text; isspace(*ptr); ptr ++) {/*empty*/} - *ptr = '\0'; + *ptr = '\0'; if (*text) { // use only a single 'insert' call to avoid redraw issues int n = strlen(text); @@ -394,7 +392,7 @@ CodeEditor::CodeEditor(int X, int Y, int W, int H, const char *L) : highlight_data(new Fl_Text_Buffer(mBuffer->length()), styletable, sizeof(styletable) / sizeof(styletable[0]), - 'A', style_unfinished_cb, this); + 'A', style_unfinished_cb, this); style_parse(text, style, mBuffer->length()); @@ -420,9 +418,9 @@ CodeEditor::~CodeEditor() { CodeViewer::CodeViewer(int X, int Y, int W, int H, const char *L) -: CodeEditor(X, Y, W, H, L) +: CodeEditor(X, Y, W, H, L) { - default_key_function(kf_ignore); + default_key_function(kf_ignore); remove_all_key_bindings(&key_bindings); cursor_style(CARET_CURSOR); } @@ -436,7 +434,3 @@ void CodeViewer::draw() CodeEditor::draw(); Fl::set_color(FL_SELECTION_COLOR, c); } - -// -// End of "$Id$". -// diff --git a/fluid/CodeEditor.h b/fluid/CodeEditor.h index 66e3b207a..e865ac63e 100644 --- a/fluid/CodeEditor.h +++ b/fluid/CodeEditor.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code editor widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef CodeEditor_h @@ -59,7 +57,7 @@ class CodeEditor : public Fl_Text_Editor { // attempt to make the fluid code editor widget honour textsize setting void textsize(Fl_Fontsize s); - + }; class CodeViewer : public CodeEditor { @@ -75,7 +73,3 @@ class CodeViewer : public CodeEditor { }; #endif // !CodeEditor_h - -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_UNIX.cxx b/fluid/ExternalCodeEditor_UNIX.cxx index 8e415e0b3..189f29778 100644 --- a/fluid/ExternalCodeEditor_UNIX.cxx +++ b/fluid/ExternalCodeEditor_UNIX.cxx @@ -1,9 +1,7 @@ // -// "$Id$". +// External code editor management class for Unix // -// External code editor management class for Unix -// -// Note: This entire file Unix only +// Note: This entire file Unix only #include <errno.h> /* errno */ #include <string.h> /* strerror() */ @@ -84,17 +82,17 @@ void ExternalCodeEditor::close_editor() { "pid=%ld file=%s", long(pid_), filename()); break; case 0: // process still running - switch ( fl_choice("Please close external editor\npid=%ld file=%s", - "Force Close", // button 0 - "Closed", // button 1 - 0, // button 2 - long(pid_), filename() ) ) { - case 0: // Force Close - kill_editor(); - continue; - case 1: // Closed? try to reap - continue; - } + switch ( fl_choice("Please close external editor\npid=%ld file=%s", + "Force Close", // button 0 + "Closed", // button 1 + 0, // button 2 + long(pid_), filename() ) ) { + case 0: // Force Close + kill_editor(); + continue; + case 1: // Closed? try to reap + continue; + } break; case 1: // process reaped return; @@ -338,9 +336,9 @@ int ExternalCodeEditor::start_editor(const char *editor_cmd, int nargs; char **args = 0; if (make_args(cmd, &nargs, &args) > 0) { - execvp(args[0], args); // run command - doesn't return if succeeds - fl_alert("couldn't exec() '%s': %s", cmd, strerror(errno)); - exit(1); + execvp(args[0], args); // run command - doesn't return if succeeds + fl_alert("couldn't exec() '%s': %s", cmd, strerror(errno)); + exit(1); } exit(1); // break; @@ -384,7 +382,7 @@ int ExternalCodeEditor::reap_editor(pid_t *pid_reaped) { { stop_update_timer(); } break; } - if ( G_debug ) + if ( G_debug ) printf("*** EDITOR REAPED: pid=%ld #open=%d\n", long(wpid), L_editors_open); return 1; } @@ -411,7 +409,7 @@ int ExternalCodeEditor::open_editor(const char *editor_cmd, pid_t wpid; switch ( reap_editor(&wpid) ) { case -2: // no editor running? (unlikely if is_editing() true) - break; + break; case -1: // waitpid() failed fl_alert("ERROR: waitpid() failed: %s\nfile='%s', pid=%ld", strerror(errno), filename(), (long)pid_); @@ -475,7 +473,3 @@ void ExternalCodeEditor::set_update_timer_callback(Fl_Timeout_Handler cb) { int ExternalCodeEditor::editors_open() { return L_editors_open; } - -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_UNIX.h b/fluid/ExternalCodeEditor_UNIX.h index 355a041c7..d366a95c1 100644 --- a/fluid/ExternalCodeEditor_UNIX.h +++ b/fluid/ExternalCodeEditor_UNIX.h @@ -1,6 +1,4 @@ // -// "$Id$". -// // External code editor management class for Unix // // Handles starting and keeping track of an external text editor, @@ -47,6 +45,3 @@ public: }; #endif /*_EXTCODEEDITOR_H */ -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_WIN32.cxx b/fluid/ExternalCodeEditor_WIN32.cxx index 4890b1b08..05388d066 100644 --- a/fluid/ExternalCodeEditor_WIN32.cxx +++ b/fluid/ExternalCodeEditor_WIN32.cxx @@ -1,9 +1,7 @@ // -// "$Id$". +// External code editor management class for Windows // -// External code editor management class for Windows -// -// Note: This entire file Windows only. +// Note: This entire file Windows only. #include <stdio.h> // snprintf() @@ -88,7 +86,7 @@ int ExternalCodeEditor::is_editing() { return( (pinfo_.dwProcessId != 0) ? 1 : 0 ); } -// [Static/Local] Terminate_app()'s callback to send WM_CLOSE to a single window. +// [Static/Local] Terminate_app()'s callback to send WM_CLOSE to a single window. static BOOL CALLBACK terminate_app_enum(HWND hwnd, LPARAM lParam) { DWORD dwID; GetWindowThreadProcessId(hwnd, &dwID); @@ -144,17 +142,17 @@ void ExternalCodeEditor::close_editor() { "pid=%ld file=%s", long(pinfo_.dwProcessId), filename()); break; case 0: // process still running - switch ( fl_choice("Please close external editor\npid=%ld file=%s", - "Force Close", // button 0 - "Closed", // button 1 - 0, // button 2 - long(pinfo_.dwProcessId), filename() ) ) { - case 0: // Force Close - kill_editor(); - continue; - case 1: // Closed? try to reap - continue; - } + switch ( fl_choice("Please close external editor\npid=%ld file=%s", + "Force Close", // button 0 + "Closed", // button 1 + 0, // button 2 + long(pinfo_.dwProcessId), filename() ) ) { + case 0: // Force Close + kill_editor(); + continue; + case 1: // Closed? try to reap + continue; + } break; case 1: // process reaped return; @@ -178,7 +176,7 @@ void ExternalCodeEditor::kill_editor() { } case 0: { // success -- process reaped DWORD pid = pinfo_.dwProcessId; // save pid - reap_cleanup(); // clears pinfo_ + reap_cleanup(); // clears pinfo_ if ( G_debug ) printf("*** kill_editor() REAP pid=%ld #open=%ld\n", long(pid), long(L_editors_open)); @@ -217,7 +215,7 @@ int ExternalCodeEditor::handle_changes(const char **code, int force) { // Get file size if ( GetFileSizeEx(fh, &fsize) == 0 ) { DWORD err = GetLastError(); - CloseHandle(fh); + CloseHandle(fh); SetLastError(err); // return error from GetFileSizeEx(), not CloseHandle() return -1; } @@ -225,7 +223,7 @@ int ExternalCodeEditor::handle_changes(const char **code, int force) { FILETIME ftCreate, ftAccess, ftWrite; if ( GetFileTime(fh, &ftCreate, &ftAccess, &ftWrite) == 0 ) { DWORD err = GetLastError(); - CloseHandle(fh); + CloseHandle(fh); SetLastError(err); // return error from GetFileTime(), not CloseHandle() return -1; } @@ -481,7 +479,7 @@ int ExternalCodeEditor::reap_editor(DWORD *pid_reaped) { } case WAIT_OBJECT_0: { // reaped DWORD wpid = pinfo_.dwProcessId; // save pid - reap_cleanup(); // clears pinfo_ + reap_cleanup(); // clears pinfo_ if ( pid_reaped ) *pid_reaped = wpid; // return pid to caller if ( G_debug ) printf("*** EDITOR REAPED: pid=%ld #open=%d\n", long(wpid), L_editors_open); @@ -515,8 +513,8 @@ int ExternalCodeEditor::open_editor(const char *editor_cmd, // See if editor recently closed but not reaped; try to reap DWORD wpid; switch ( reap_editor(&wpid) ) { - case -2: // no editor running (unlikely to happen) - break; + case -2: // no editor running (unlikely to happen) + break; case -1: // wait failed fl_alert("ERROR: WaitForSingleObject() failed: %s\nfile='%s', pid=%ld", get_ms_errmsg(), filename(), long(pinfo_.dwProcessId)); @@ -578,7 +576,3 @@ void ExternalCodeEditor::set_update_timer_callback(Fl_Timeout_Handler cb) { int ExternalCodeEditor::editors_open() { return L_editors_open; } - -// -// End of "$Id$". -// diff --git a/fluid/ExternalCodeEditor_WIN32.h b/fluid/ExternalCodeEditor_WIN32.h index 29c3ba6a6..de4c2c4a7 100644 --- a/fluid/ExternalCodeEditor_WIN32.h +++ b/fluid/ExternalCodeEditor_WIN32.h @@ -1,6 +1,4 @@ // -// "$Id$". -// // External code editor management class for Windows // // Handles starting and keeping track of an external text editor, @@ -28,7 +26,7 @@ #include <string.h> /* sprintf().. */ class ExternalCodeEditor { - PROCESS_INFORMATION pinfo_; // CreateProcess() handle to running process + PROCESS_INFORMATION pinfo_; // CreateProcess() handle to running process FILETIME file_mtime_; // last modify time of the file (used to determine if file changed) LARGE_INTEGER file_size_; // last file size (used to determine if changed) const char * filename_; // tmpfilename editor uses @@ -59,6 +57,3 @@ public: }; #endif /*_EXTCODEEDITOR_H */ -// -// End of "$Id$". -// diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 030c6c454..d39e2164d 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // C function type code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> #include <FL/Fl_Window.H> @@ -286,7 +284,7 @@ void Fl_Function_Type::write_code1() { star = "*"; } else rtype = "void"; } - + const char* k = class_name(0); if (k) { if (havechildren) @@ -306,21 +304,21 @@ void Fl_Function_Type::write_code1() { if (havechildren) write_c("%s%s ", rtype, star); } - + // if this is a subclass, only write_h() the part before the ':' char s[1024], *sptr = s; char *nptr = (char *)name(); - + while (*nptr) { if (*nptr == ':') { if (nptr[1] != ':') break; // Copy extra ":" for "class::member"... *sptr++ = *nptr++; - } + } *sptr++ = *nptr++; } *sptr = '\0'; - + write_h("%s;\n", s); // skip all function default param. init in body: int skips=0,skipc=0; @@ -328,25 +326,25 @@ void Fl_Function_Type::write_code1() { for (sptr=s,nptr=(char*)name(); *nptr; nc++,nptr++) { if (!skips && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; - if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) + if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && !(nc && *(nptr-1)=='\\')) skipc = skipc ? 0 : 1; - if(!skips && !skipc && plevel==1 && *nptr =='=' && - !(nc && *(nptr-1)=='\'') ) // ignore '=' case + if(!skips && !skipc && plevel==1 && *nptr =='=' && + !(nc && *(nptr-1)=='\'') ) // ignore '=' case while(*++nptr && (skips || skipc || ( (*nptr!=',' && *nptr!=')') || plevel!=1) )) { - if ( *nptr=='"' && *(nptr-1)!='\\' ) + if ( *nptr=='"' && *(nptr-1)!='\\' ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && *(nptr-1)!='\\') skipc = skipc ? 0 : 1; if (!skips && !skipc && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; } - - if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; + + if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; } *sptr = '\0'; - + if (havechildren) write_c("%s::%s {\n", k, s); } else { @@ -361,7 +359,7 @@ void Fl_Function_Type::write_code1() { if (havechildren) write_c("static "); } - + // write everything but the default parameters (if any) char s[1024], *sptr; char *nptr; @@ -370,30 +368,30 @@ void Fl_Function_Type::write_code1() { for (sptr=s,nptr=(char*)name(); *nptr; nc++,nptr++) { if (!skips && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; - if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) + if ( *nptr=='"' && !(nc && *(nptr-1)=='\\') ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && !(nc && *(nptr-1)=='\\')) skipc = skipc ? 0 : 1; - if(!skips && !skipc && plevel==1 && *nptr =='=' && - !(nc && *(nptr-1)=='\'') ) // ignore '=' case + if(!skips && !skipc && plevel==1 && *nptr =='=' && + !(nc && *(nptr-1)=='\'') ) // ignore '=' case while(*++nptr && (skips || skipc || ( (*nptr!=',' && *nptr!=')') || plevel!=1) )) { - if ( *nptr=='"' && *(nptr-1)!='\\' ) + if ( *nptr=='"' && *(nptr-1)!='\\' ) skips = skips ? 0 : 1; else if(!skips && *nptr=='\'' && *(nptr-1)!='\\') skipc = skipc ? 0 : 1; if (!skips && !skipc && *nptr=='(') plevel++; else if (!skips && *nptr==')') plevel--; } - - if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; + + if (sptr < (s + sizeof(s) - 1)) *sptr++ = *nptr; } *sptr = '\0'; - + if (havechildren) write_c("%s%s %s {\n", rtype, star, s); } } - + if (havewidgets && child && !child->name()) write_c(" %s* w;\n", subclassname(child)); indentation += 2; } @@ -406,7 +404,7 @@ void Fl_Function_Type::write_code2() { havechildren = 1; if (child->is_window() && child->name()) var = child->name(); } - + if (ismain()) { if (havewidgets) write_c(" %s->show(argc, argv);\n", var); if (havechildren) write_c(" return Fl::run();\n"); @@ -421,7 +419,7 @@ void Fl_Function_Type::write_code2() { int Fl_Function_Type::has_signature(const char *rtype, const char *sig) const { if (rtype && !return_type) return 0; if (!name()) return 0; - if ( (rtype==0L || strcmp(return_type, rtype)==0) + if ( (rtype==0L || strcmp(return_type, rtype)==0) && fl_filename_match(name(), sig)) { return 1; } @@ -585,7 +583,7 @@ void Fl_CodeBlock_Type::write_code2() { //////////////////////////////////////////////////////////////// -int Fl_Decl_Type::is_public() const +int Fl_Decl_Type::is_public() const { Fl_Type *p = parent; while (p && !p->is_decl_block()) p = p->parent; @@ -615,7 +613,7 @@ void Fl_Decl_Type::write_properties() { case 1: write_string("public"); break; case 2: write_string("protected"); break; } - if (static_) + if (static_) write_string("local"); else write_string("global"); @@ -743,7 +741,7 @@ void Fl_Decl_Type::write_code1() { write_h(" %.*s; %s\n", (int)(e-c), c, csc); } else { if (public_) { - if (static_) + if (static_) write_h("extern "); else write_comment_h(); @@ -754,7 +752,7 @@ void Fl_Decl_Type::write_code1() { } } else { write_comment_c(); - if (static_) + if (static_) write_c("static "); write_c("%.*s; %s\n", (int)(e-c), c, csc); } @@ -830,7 +828,7 @@ void Fl_Data_Type::open() { leave_source_dir(); if (fn) { if (strcmp(fn, data_filename->value())) - set_modflag(1); + set_modflag(1); data_filename->value(fn); } } @@ -852,7 +850,7 @@ void Fl_Data_Type::open() { for (;;++q) { if (!*q) break; if (!isspace((unsigned char)(*q))) goto OOPS; - } + } if (n==q) { OOPS: message = "variable name must be a C identifier"; free((void*)s); @@ -881,7 +879,7 @@ void Fl_Data_Type::open() { // store the filename c = data_filename->value(); if (filename_ && strcmp(filename_, data_filename->value())) - set_modflag(1); + set_modflag(1); else if (!filename_ && *c) set_modflag(1); if (filename_) { free((void*)filename_); filename_ = 0L; } @@ -974,7 +972,7 @@ void Fl_Data_Type::write_code1() { } } else { write_comment_c(); - if (static_) + if (static_) write_c("static "); if (text_mode_) { write_c("const char *%s = /* text inlined from %s */\n", c, fn); @@ -988,7 +986,7 @@ void Fl_Data_Type::write_code1() { write_c(";\n"); } } - // if we are in interactive mode, we pop up a warning dialog + // if we are in interactive mode, we pop up a warning dialog // giving the error: (batch_mode && !write_sourceview) ??? if (message && !write_sourceview) { if (batch_mode) @@ -1109,7 +1107,7 @@ Fl_Type *Fl_Comment_Type::make() { void Fl_Comment_Type::write_properties() { Fl_Type::write_properties(); - if (in_c_) write_string("in_source"); else write_string("not_in_source"); + if (in_c_) write_string("in_source"); else write_string("not_in_source"); if (in_h_) write_string("in_header"); else write_string("not_in_header"); } @@ -1133,11 +1131,11 @@ static void load_comments_preset(Fl_Preferences &menu) { static const char * const predefined_comment[] = { "GNU Public License/GPL Header", "GNU Public License/GPL Footer", "GNU Public License/LGPL Header", "GNU Public License/LGPL Footer", - "FLTK/Header", "FLTK/Footer" }; + "FLTK/Header" }; int i; - menu.set("n", 6); + menu.set("n", 5); Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); - for (i=0; i<6; i++) { + for (i=0; i<5; i++) { menu.set(Fl_Preferences::Name(i), predefined_comment[i]); db.set(predefined_comment[i], comment_text[i]); } @@ -1180,7 +1178,7 @@ void Fl_Comment_Type::open() { // add the current comment to the database const char *xname = fl_input( "Please enter a name to reference the current\ncomment in your database.\n\n" - "Use forward slashes '/' to create submenus.", + "Use forward slashes '/' to create submenus.", "My Comment"); if (xname) { char *name = strdup(xname); @@ -1200,8 +1198,8 @@ void Fl_Comment_Type::open() { if (itempath[0]==0 || last_selected_item==0) { fl_message("Please select an entry form this menu first."); } else if (fl_choice("Are you sure that you want to delete the entry\n" - "\"%s\"\nfrom the database?", "Cancel", "Delete", - NULL, itempath)) { + "\"%s\"\nfrom the database?", "Cancel", "Delete", + NULL, itempath)) { Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); db.deleteEntry(itempath); comment_predefined->remove(last_selected_item); @@ -1221,7 +1219,7 @@ void Fl_Comment_Type::open() { if (comment_predefined->item_pathname(itempath, 255)==0) { if (itempath[0]=='/') memmove(itempath, itempath+1, 255); Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); - char *text; + char *text; db.get(itempath, text, "(no text found in data base)"); comment_input->buffer()->text(text); free(text); @@ -1231,9 +1229,9 @@ void Fl_Comment_Type::open() { } else if (w == comment_load) { // load a comment from disk - fl_file_chooser_ok_label("Use File"); + fl_file_chooser_ok_label("Use File"); const char *fname = fl_file_chooser("Pick a comment", 0L, 0L); - fl_file_chooser_ok_label(NULL); + fl_file_chooser_ok_label(NULL); if (fname) { if (comment_input->buffer()->loadfile(fname)) { fl_alert("Error loading file\n%s", fname); @@ -1263,7 +1261,7 @@ BREAK2: } const char *Fl_Comment_Type::title() { - const char* n = name(); + const char* n = name(); if (!n || !*n) return type_name(); if (title_buf[0]==0) { const char *s = n; @@ -1338,11 +1336,11 @@ const char* Fl_Type::class_name(const int need_nest) const { const char* q = 0; if(need_nest) q=p->class_name(need_nest); if (q) { - static char s[256]; - if (q != s) strlcpy(s, q, sizeof(s)); - strlcat(s, "::", sizeof(s)); - strlcat(s, p->name(), sizeof(s)); - return s; + static char s[256]; + if (q != s) strlcpy(s, q, sizeof(s)); + strlcat(s, "::", sizeof(s)); + strlcat(s, p->name(), sizeof(s)); + return s; } return p->name(); } @@ -1412,9 +1410,9 @@ void Fl_Class_Type::read_property(const char *c) { void Fl_Class_Type::open() { if (!class_panel) make_class_panel(); char fullname[FL_PATH_MAX]=""; - if (prefix() && strlen(prefix())) + if (prefix() && strlen(prefix())) sprintf(fullname,"%s %s",prefix(),name()); - else + else strcpy(fullname, name()); c_name_input->static_value(fullname); c_subclass_input->static_value(subclass_of); @@ -1423,9 +1421,9 @@ void Fl_Class_Type::open() { c_comment_input->buffer()->text(c?c:""); class_panel->show(); const char* message = 0; - + char *na=0,*pr=0,*p=0; // name and prefix substrings - + for (;;) { // repeat as long as there are errors if (message) fl_alert("%s", message); for (;;) { @@ -1454,7 +1452,7 @@ void Fl_Class_Type::open() { if (p<s) p++; if (is_id(*p) && p<na) pr=p; // prefix detected c = c_subclass_input->value(); - message = c_check(c); + message = c_check(c); if (message) { free((void*)s);continue;} name(na); prefix(pr); @@ -1529,7 +1527,3 @@ int Fl_Class_Type::has_function(const char *rtype, const char *sig) const { } return 0; } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx index 6fa4cf867..cc6fb59a6 100644 --- a/fluid/Fl_Group_Type.cxx +++ b/fluid/Fl_Group_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Group object code for the Fast Light Tool Kit (FLTK). // // Object describing an Fl_Group and links to Fl_Window_Type.C and @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -33,7 +31,7 @@ void igroup::resize(int X, int Y, int W, int H) { redraw(); } -Fl_Group_Type Fl_Group_type; // the "factory" +Fl_Group_Type Fl_Group_type; // the "factory" Fl_Type *Fl_Group_Type::make() { return Fl_Widget_Type::make(); @@ -49,8 +47,8 @@ void fix_group_size(Fl_Type *tt) { for (Fl_Type *nn = t->next; nn && nn->level > t->level; nn = nn->next) { if (!nn->is_widget() || nn->is_menu_item()) continue; Fl_Widget_Type* n = (Fl_Widget_Type*)nn; - int x = n->o->x(); if (x < X) X = x; - int y = n->o->y(); if (y < Y) Y = y; + int x = n->o->x(); if (x < X) X = x; + int y = n->o->y(); if (y < Y) Y = y; int r = x+n->o->w();if (r > R) R = r; int b = y+n->o->h();if (b > B) B = b; } @@ -133,7 +131,7 @@ Fl_Menu_Item pack_type_menu[] = { {"VERTICAL", 0, 0, (void*)Fl_Pack::VERTICAL}, {0}}; -Fl_Pack_Type Fl_Pack_type; // the "factory" +Fl_Pack_Type Fl_Pack_type; // the "factory" //////////////////////////////////////////////////////////////// @@ -143,7 +141,7 @@ static const int MAX_COLS = 7; // this is a minimal table widget used as an example when adding tables in Fluid class Fluid_Table : public Fl_Table { int data[MAX_ROWS][MAX_COLS]; // data array for cells - + // Draw the row/col headings // Make this a dark thin upbox with the text inside. // @@ -153,7 +151,7 @@ class Fluid_Table : public Fl_Table { fl_color(FL_BLACK); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); fl_pop_clip(); - } + } // Draw the cell data // Dark gray text on white background with subtle border // @@ -166,7 +164,7 @@ class Fluid_Table : public Fl_Table { // Draw box border fl_color(color()); fl_rect(X,Y,W,H); fl_pop_clip(); - } + } // Handle drawing table's cells // Fl_Table calls this function to draw each visible cell in the table. // It's up to us to use FLTK's drawing functions to draw the cells the way we want. @@ -176,15 +174,15 @@ class Fluid_Table : public Fl_Table { switch ( context ) { case CONTEXT_STARTPAGE: // before page is drawn.. fl_font(FL_HELVETICA, 16); // set the font for our drawing operations - return; + return; case CONTEXT_COL_HEADER: // Draw column headers sprintf(s,"%c",'A'+COL); // "A", "B", "C", etc. DrawHeader(s,X,Y,W,H); - return; + return; case CONTEXT_ROW_HEADER: // Draw row headers sprintf(s,"%03d:",ROW); // "001:", "002:", etc DrawHeader(s,X,Y,W,H); - return; + return; case CONTEXT_CELL: // Draw data in cells sprintf(s,"%d",data[ROW][COL]); DrawData(s,X,Y,W,H); @@ -215,7 +213,7 @@ public: const char table_type_name[] = "Fl_Table"; -Fl_Table_Type Fl_Table_type; // the "factory" +Fl_Table_Type Fl_Table_type; // the "factory" Fl_Widget *Fl_Table_Type::widget(int X,int Y,int W,int H) { Fluid_Table *table = new Fluid_Table(X, Y, W, H); @@ -232,7 +230,7 @@ void itabs::resize(int X, int Y, int W, int H) { redraw(); } -Fl_Tabs_Type Fl_Tabs_type; // the "factory" +Fl_Tabs_Type Fl_Tabs_type; // the "factory" // This is called when user clicks on a widget in the window. See // if it is a tab title, and adjust visibility and return new selection: @@ -263,7 +261,7 @@ void iwizard::resize(int X, int Y, int W, int H) { redraw(); } -Fl_Wizard_Type Fl_Wizard_type; // the "factory" +Fl_Wizard_Type Fl_Wizard_type; // the "factory" // This is called when o is created. If it is in the tab group make // sure it is visible: @@ -409,7 +407,7 @@ Fl_Menu_Item scroll_type_menu[] = { {"BOTH_ALWAYS", 0, 0, (void*)Fl_Scroll::BOTH_ALWAYS}, {0}}; -Fl_Scroll_Type Fl_Scroll_type; // the "factory" +Fl_Scroll_Type Fl_Scroll_type; // the "factory" void Fl_Scroll_Type::copy_properties() { Fl_Group_Type::copy_properties(); @@ -424,13 +422,9 @@ void Fl_Scroll_Type::copy_properties() { const char tile_type_name[] = "Fl_Tile"; -Fl_Tile_Type Fl_Tile_type; // the "factory" +Fl_Tile_Type Fl_Tile_type; // the "factory" void Fl_Tile_Type::copy_properties() { Fl_Group_Type::copy_properties(); // no additional properties } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index 448b898e6..5c1a56f30 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu item code for the Fast Light Tool Kit (FLTK). // // Menu items are kludged by making a phony Fl_Box widget so the normal @@ -15,11 +13,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -90,7 +88,7 @@ void Fl_Input_Choice_Type::build_menu() { if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;} m++; int l1 = - (q->next && q->next->is_menu_item()) ? q->next->level : level; + (q->next && q->next->is_menu_item()) ? q->next->level : level; while (lvl > l1) {m->label(0); m++; lvl--;} lvl = l1; } @@ -226,7 +224,7 @@ void Fl_Menu_Item_Type::write_static() { // Go up one more level for Fl_Input_Choice, as these are groups themselves if (t && !strcmp(t->type_name(), "Fl_Input_Choice")) write_c("->parent()"); - for (t = t->parent; t && t->is_widget() && !is_class(); q = t, t = t->parent) + for (t = t->parent; t && t->is_widget() && !is_class(); q = t, t = t->parent) write_c("->parent()"); if (!q || strcmp(q->type_name(), "widget_class")) write_c("->user_data()"); @@ -244,11 +242,11 @@ void Fl_Menu_Item_Type::write_static() { // entire array out: const char* k = class_name(1); if (k) { - int i; + int i; if (i18n_type) write_c("\nunsigned char %s::%s_i18n_done = 0;", k, menu_name(i)); write_c("\nFl_Menu_Item %s::%s[] = {\n", k, menu_name(i)); } else { - int i; + int i; if (i18n_type) write_c("\nunsigned char %s_i18n_done = 0;", menu_name(i)); write_c("\nFl_Menu_Item %s[] = {\n", menu_name(i)); } @@ -271,11 +269,11 @@ void Fl_Menu_Item_Type::write_static() { if (c) { if (c==m->name()) { // assign a menu item address directly to a variable - int i; + int i; const char* n = ((Fl_Menu_Item_Type *)q)->menu_name(i); write_c("Fl_Menu_Item* %s::%s = %s::%s + %d;\n", k, c, k, n, i); } else { - // if the name is an array, only define the array. + // if the name is an array, only define the array. // The actual assignment is in write_code1() write_c("Fl_Menu_Item* %s::%s;\n", k, c); } @@ -315,12 +313,12 @@ void Fl_Menu_Item_Type::write_item() { else if (label()) write_cstring(label()); // we will call i18n when the widget is instantiated for the first time else write_c("\"\""); if (((Fl_Button*)o)->shortcut()) { - int s = ((Fl_Button*)o)->shortcut(); - if (use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { - write_c(", FL_COMMAND|0x%x, ", s & ~(FL_CTRL|FL_META)); - } else { - write_c(", 0x%x, ", s); - } + int s = ((Fl_Button*)o)->shortcut(); + if (use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { + write_c(", FL_COMMAND|0x%x, ", s & ~(FL_CTRL|FL_META)); + } else { + write_c(", 0x%x, ", s); + } } else write_c(", 0, "); if (callback()) { @@ -337,7 +335,7 @@ void Fl_Menu_Item_Type::write_item() { else write_c(" 0,"); write_c(" %d, (uchar)%s, %d, %d, %d", flags(), - labeltypes[o->labeltype()], o->labelfont(), o->labelsize(), o->labelcolor()); + labeltypes[o->labeltype()], o->labelfont(), o->labelsize(), o->labelcolor()); write_c("},\n"); } @@ -449,7 +447,7 @@ void Fl_Menu_Type::build_menu() { if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;} m++; int l1 = - (q->next && q->next->is_menu_item()) ? q->next->level : level; + (q->next && q->next->is_menu_item()) ? q->next->level : level; while (lvl > l1) {m->label(0); m++; lvl--;} lvl = l1; } @@ -484,10 +482,10 @@ void Fl_Menu_Type::write_code2() { const char *mName = mi->menu_name(i); for (Fl_Type* q = next; q && q->is_menu_item(); q = q->next) { if (((Fl_Menu_Item_Type*)q)->label()) nLabel++; - int thislevel = q->level; if (q->is_parent()) thislevel++; - int nextlevel = - (q->next && q->next->is_menu_item()) ? q->next->level : next->level+1; - nItem += 1 + ((thislevel > nextlevel) ? (thislevel-nextlevel) : 0); + int thislevel = q->level; if (q->is_parent()) thislevel++; + int nextlevel = + (q->next && q->next->is_menu_item()) ? q->next->level : next->level+1; + nItem += 1 + ((thislevel > nextlevel) ? (thislevel-nextlevel) : 0); } if (nLabel) { write_c("%sif (!%s_i18n_done) {\n", indent(), mName); @@ -501,7 +499,7 @@ void Fl_Menu_Type::write_code2() { break; case 2: write_c("%s %s[i].label(catgets(%s,%s,i+%d,%s[i].label()));\n", - indent(), mName, i18n_file[0] ? i18n_file : "_catalog", + indent(), mName, i18n_file[0] ? i18n_file : "_catalog", i18n_set, mi->msgnum(), mName); break; } @@ -510,7 +508,7 @@ void Fl_Menu_Type::write_code2() { } } write_c("%s%s->menu(%s);\n", indent(), name() ? name() : "o", - unique_id(this, "menu", name(), label())); + unique_id(this, "menu", name(), label())); } Fl_Widget_Type::write_code2(); } @@ -592,13 +590,13 @@ void Shortcut_Button::draw() { if (value()) draw_box(FL_DOWN_BOX, (Fl_Color)9); else draw_box(FL_UP_BOX, FL_WHITE); fl_font(FL_HELVETICA,14); fl_color(FL_FOREGROUND_COLOR); - if (use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) { - char buf[1024]; - fl_snprintf(buf, 1023, "Command+%s", fl_shortcut_label(svalue&~(FL_CTRL|FL_META))); - fl_draw(buf,x()+6,y(),w(),h(),FL_ALIGN_LEFT); - } else { - fl_draw(fl_shortcut_label(svalue),x()+6,y(),w(),h(),FL_ALIGN_LEFT); - } + if (use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) { + char buf[1024]; + fl_snprintf(buf, 1023, "Command+%s", fl_shortcut_label(svalue&~(FL_CTRL|FL_META))); + fl_draw(buf,x()+6,y(),w(),h(),FL_ALIGN_LEFT); + } else { + fl_draw(fl_shortcut_label(svalue),x()+6,y(),w(),h(),FL_ALIGN_LEFT); + } } int Shortcut_Button::handle(int e) { @@ -629,7 +627,7 @@ int Shortcut_Button::handle(int e) { return r; } } - + void shortcut_in_cb(Shortcut_Button* i, void* v) { if (v == LOAD) { if (current_widget->is_button()) @@ -650,27 +648,23 @@ void shortcut_in_cb(Shortcut_Button* i, void* v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_button()) { - Fl_Button* b = (Fl_Button*)(((Fl_Widget_Type*)o)->o); + Fl_Button* b = (Fl_Button*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); - if (o->is_menu_item()) ((Fl_Widget_Type*)o)->redraw(); + b->shortcut(i->svalue); + if (o->is_menu_item()) ((Fl_Widget_Type*)o)->redraw(); } else if (o->selected && o->is_input()) { - Fl_Input_* b = (Fl_Input_*)(((Fl_Widget_Type*)o)->o); + Fl_Input_* b = (Fl_Input_*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); + b->shortcut(i->svalue); } else if (o->selected && o->is_value_input()) { - Fl_Value_Input* b = (Fl_Value_Input*)(((Fl_Widget_Type*)o)->o); + Fl_Value_Input* b = (Fl_Value_Input*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); + b->shortcut(i->svalue); } else if (o->selected && o->is_text_display()) { - Fl_Text_Display* b = (Fl_Text_Display*)(((Fl_Widget_Type*)o)->o); + Fl_Text_Display* b = (Fl_Text_Display*)(((Fl_Widget_Type*)o)->o); if (b->shortcut()!=i->svalue) mod = 1; - b->shortcut(i->svalue); + b->shortcut(i->svalue); } if (mod) set_modflag(1); } } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index 33cec2609..12103d8f8 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type code for the Fast Light Tool Kit (FLTK). // // Each object described by Fluid is one of these objects. They @@ -21,11 +19,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -44,10 +42,10 @@ #include "pixmaps/invisible.xpm" //#include "pixmaps/unlock.xpm" -static Fl_Pixmap lock_pixmap(lock_xpm); +static Fl_Pixmap lock_pixmap(lock_xpm); static Fl_Pixmap protected_pixmap(protected_xpm); static Fl_Pixmap invisible_pixmap(invisible_xpm); -//static Fl_Pixmap unlock_pixmap(unlock_xpm); +//static Fl_Pixmap unlock_pixmap(unlock_xpm); #include "pixmaps/flWindow.xpm" #include "pixmaps/flButton.xpm" @@ -102,66 +100,66 @@ static Fl_Pixmap invisible_pixmap(invisible_xpm); #include "pixmaps/flTable.xpm" #include "pixmaps/flSimpleTerminal.xpm" -static Fl_Pixmap window_pixmap(flWindow_xpm); -static Fl_Pixmap button_pixmap(flButton_xpm); -static Fl_Pixmap checkbutton_pixmap(flCheckButton_xpm); -static Fl_Pixmap roundbutton_pixmap(flRoundButton_xpm); -static Fl_Pixmap box_pixmap(flBox_xpm); -static Fl_Pixmap group_pixmap(flGroup_xpm); -static Fl_Pixmap function_pixmap(flFunction_xpm); -static Fl_Pixmap code_pixmap(flCode_xpm); -static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm); -static Fl_Pixmap comment_pixmap(flComment_xpm); -static Fl_Pixmap declaration_pixmap(flDeclaration_xpm); -static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm); -static Fl_Pixmap class_pixmap(flClass_xpm); -static Fl_Pixmap tabs_pixmap(flTabs_xpm); -static Fl_Pixmap input_pixmap(flInput_xpm); -static Fl_Pixmap choice_pixmap(flChoice_xpm); -static Fl_Pixmap menuitem_pixmap(flMenuitem_xpm); -static Fl_Pixmap menubar_pixmap(flMenubar_xpm); -static Fl_Pixmap submenu_pixmap(flSubmenu_xpm); -static Fl_Pixmap scroll_pixmap(flScroll_xpm); -static Fl_Pixmap tile_pixmap(flTile_xpm); -static Fl_Pixmap wizard_pixmap(flWizard_xpm); -static Fl_Pixmap pack_pixmap(flPack_xpm); -static Fl_Pixmap returnbutton_pixmap(flReturnButton_xpm); -static Fl_Pixmap lightbutton_pixmap(flLightButton_xpm); -static Fl_Pixmap repeatbutton_pixmap(flRepeatButton_xpm); -static Fl_Pixmap menubutton_pixmap(flMenuButton_xpm); -static Fl_Pixmap output_pixmap(flOutput_xpm); -static Fl_Pixmap textdisplay_pixmap(flTextDisplay_xpm); -static Fl_Pixmap textedit_pixmap(flTextEdit_xpm); -static Fl_Pixmap fileinput_pixmap(flFileInput_xpm); -static Fl_Pixmap browser_pixmap(flBrowser_xpm); -static Fl_Pixmap checkbrowser_pixmap(flCheckBrowser_xpm); -static Fl_Pixmap filebrowser_pixmap(flFileBrowser_xpm); -static Fl_Pixmap clock_pixmap(flClock_xpm); -static Fl_Pixmap help_pixmap(flHelp_xpm); -static Fl_Pixmap progress_pixmap(flProgress_xpm); -static Fl_Pixmap slider_pixmap(flSlider_xpm); -static Fl_Pixmap scrollbar_pixmap(flScrollBar_xpm); -static Fl_Pixmap valueslider_pixmap(flValueSlider_xpm); -static Fl_Pixmap adjuster_pixmap(flAdjuster_xpm); -static Fl_Pixmap counter_pixmap(flCounter_xpm); -static Fl_Pixmap dial_pixmap(flDial_xpm); -static Fl_Pixmap roller_pixmap(flRoller_xpm); -static Fl_Pixmap valueinput_pixmap(flValueInput_xpm); -static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm); -static Fl_Pixmap spinner_pixmap(flSpinner_xpm); -static Fl_Pixmap widgetclass_pixmap(flWidgetClass_xpm); -static Fl_Pixmap data_pixmap(flData_xpm); -static Fl_Pixmap tree_pixmap(flTree_xpm); +static Fl_Pixmap window_pixmap(flWindow_xpm); +static Fl_Pixmap button_pixmap(flButton_xpm); +static Fl_Pixmap checkbutton_pixmap(flCheckButton_xpm); +static Fl_Pixmap roundbutton_pixmap(flRoundButton_xpm); +static Fl_Pixmap box_pixmap(flBox_xpm); +static Fl_Pixmap group_pixmap(flGroup_xpm); +static Fl_Pixmap function_pixmap(flFunction_xpm); +static Fl_Pixmap code_pixmap(flCode_xpm); +static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm); +static Fl_Pixmap comment_pixmap(flComment_xpm); +static Fl_Pixmap declaration_pixmap(flDeclaration_xpm); +static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm); +static Fl_Pixmap class_pixmap(flClass_xpm); +static Fl_Pixmap tabs_pixmap(flTabs_xpm); +static Fl_Pixmap input_pixmap(flInput_xpm); +static Fl_Pixmap choice_pixmap(flChoice_xpm); +static Fl_Pixmap menuitem_pixmap(flMenuitem_xpm); +static Fl_Pixmap menubar_pixmap(flMenubar_xpm); +static Fl_Pixmap submenu_pixmap(flSubmenu_xpm); +static Fl_Pixmap scroll_pixmap(flScroll_xpm); +static Fl_Pixmap tile_pixmap(flTile_xpm); +static Fl_Pixmap wizard_pixmap(flWizard_xpm); +static Fl_Pixmap pack_pixmap(flPack_xpm); +static Fl_Pixmap returnbutton_pixmap(flReturnButton_xpm); +static Fl_Pixmap lightbutton_pixmap(flLightButton_xpm); +static Fl_Pixmap repeatbutton_pixmap(flRepeatButton_xpm); +static Fl_Pixmap menubutton_pixmap(flMenuButton_xpm); +static Fl_Pixmap output_pixmap(flOutput_xpm); +static Fl_Pixmap textdisplay_pixmap(flTextDisplay_xpm); +static Fl_Pixmap textedit_pixmap(flTextEdit_xpm); +static Fl_Pixmap fileinput_pixmap(flFileInput_xpm); +static Fl_Pixmap browser_pixmap(flBrowser_xpm); +static Fl_Pixmap checkbrowser_pixmap(flCheckBrowser_xpm); +static Fl_Pixmap filebrowser_pixmap(flFileBrowser_xpm); +static Fl_Pixmap clock_pixmap(flClock_xpm); +static Fl_Pixmap help_pixmap(flHelp_xpm); +static Fl_Pixmap progress_pixmap(flProgress_xpm); +static Fl_Pixmap slider_pixmap(flSlider_xpm); +static Fl_Pixmap scrollbar_pixmap(flScrollBar_xpm); +static Fl_Pixmap valueslider_pixmap(flValueSlider_xpm); +static Fl_Pixmap adjuster_pixmap(flAdjuster_xpm); +static Fl_Pixmap counter_pixmap(flCounter_xpm); +static Fl_Pixmap dial_pixmap(flDial_xpm); +static Fl_Pixmap roller_pixmap(flRoller_xpm); +static Fl_Pixmap valueinput_pixmap(flValueInput_xpm); +static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm); +static Fl_Pixmap spinner_pixmap(flSpinner_xpm); +static Fl_Pixmap widgetclass_pixmap(flWidgetClass_xpm); +static Fl_Pixmap data_pixmap(flData_xpm); +static Fl_Pixmap tree_pixmap(flTree_xpm); static Fl_Pixmap table_pixmap(flTable_xpm); static Fl_Pixmap simple_terminal_pixmap(flSimpleTerminal_xpm); Fl_Pixmap *pixmap[] = { 0, &window_pixmap, &button_pixmap, &checkbutton_pixmap, &roundbutton_pixmap, /* 0..4 */ - &box_pixmap, &group_pixmap, &function_pixmap, &code_pixmap, &codeblock_pixmap, &declaration_pixmap, /* 5..10 */ + &box_pixmap, &group_pixmap, &function_pixmap, &code_pixmap, &codeblock_pixmap, &declaration_pixmap, /* 5..10 */ &declarationblock_pixmap, &class_pixmap, &tabs_pixmap, &input_pixmap, &choice_pixmap, /* 11..15 */ &menuitem_pixmap, &menubar_pixmap, &submenu_pixmap, &scroll_pixmap, &tile_pixmap, &wizard_pixmap, /* 16..21 */ &pack_pixmap, &returnbutton_pixmap, &lightbutton_pixmap, &repeatbutton_pixmap, &menubutton_pixmap, /* 22..26 */ &output_pixmap, &textdisplay_pixmap, &textedit_pixmap, &fileinput_pixmap, &browser_pixmap, /* 27..32 */ - &checkbrowser_pixmap, &filebrowser_pixmap, &clock_pixmap, &help_pixmap, &progress_pixmap, /* 33..36 */ + &checkbrowser_pixmap, &filebrowser_pixmap, &clock_pixmap, &help_pixmap, &progress_pixmap, /* 33..36 */ &slider_pixmap, &scrollbar_pixmap, &valueslider_pixmap, &adjuster_pixmap, &counter_pixmap, /* 37..41 */ &dial_pixmap, &roller_pixmap, &valueinput_pixmap, &valueoutput_pixmap, &comment_pixmap, /* 42..46 */ &spinner_pixmap, &widgetclass_pixmap, &data_pixmap, &tree_pixmap, &table_pixmap, /* 47..51 */ @@ -186,23 +184,23 @@ extern int show_comments; static char *copy_trunc(char *p, const char *str, int maxl, int quote) { - int size = 0; // truncated string size in characters - int bs; // size of UTF-8 character in bytes - const char *end = str + strlen(str); // end of input string - if (quote) *p++ = '"'; // opening quote - while (size < maxl) { // maximum <maxl> characters - if (!(*str & (-32))) break; // end of string (0 or control char) - bs = fl_utf8len(*str); // size of next character - if (bs <= 0) break; // some error - leave - if (str + bs > end) break; // UTF-8 sequence beyond end of string - while (bs--) *p++ = *str++; // copy that character into the buffer - size++; // count copied characters + int size = 0; // truncated string size in characters + int bs; // size of UTF-8 character in bytes + const char *end = str + strlen(str); // end of input string + if (quote) *p++ = '"'; // opening quote + while (size < maxl) { // maximum <maxl> characters + if (!(*str & (-32))) break; // end of string (0 or control char) + bs = fl_utf8len(*str); // size of next character + if (bs <= 0) break; // some error - leave + if (str + bs > end) break; // UTF-8 sequence beyond end of string + while (bs--) *p++ = *str++; // copy that character into the buffer + size++; // count copied characters } - if (*str) { // string was truncated + if (*str) { // string was truncated strcpy(p,"..."); p += 3; } - if (quote) *p++ = '"'; // closing quote - *p = 0; // terminating null byte + if (quote) *p++ = '"'; // closing quote + *p = 0; // terminating null byte return p; } @@ -222,7 +220,7 @@ class Widget_Browser : public Fl_Browser_ { void item_draw(void *,int,int,int,int) const ; int incr_height() const ; -public: +public: int handle(int); void callback(); @@ -320,10 +318,10 @@ extern const char* subclassname(Fl_Type*); followed by the name of the object. Other objects show their content as text, possibly abbreviated with an ellipsis. - \param v v is a pointer to the actual widget type and can be cast safely - to Fl_Type - \param X,Y these give the position in window coordinates of the top left - corner of this line + \param v v is a pointer to the actual widget type and can be cast safely + to Fl_Type + \param X,Y these give the position in window coordinates of the top left + corner of this line */ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { // cast to a more general type @@ -355,10 +353,10 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { Y += comment_incr/2; comment_incr -= comment_incr/2; } - + if (l->new_selected) fl_color(fl_contrast(FL_FOREGROUND_COLOR,FL_SELECTION_COLOR)); else fl_color(FL_FOREGROUND_COLOR); - + // Width=10: Draw the triangle that indicates possible children if (l->is_parent()) { X = X - 18 - 13; @@ -381,11 +379,11 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { } X = X + 13 + 18; } - + // Width=18: Draw the icon associated with the type. Fl_Pixmap *pm = pixmap[l->pixmapID()]; if (pm) pm->draw(X-18, Y); - + // Add tags on top of the icon for locked and protected types. switch (l->is_public()) { case 0: lock_pixmap.draw(X - 17, Y); break; @@ -395,7 +393,7 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { if (l->is_widget() && ((Fl_Widget_Type*)l)->o && !((Fl_Widget_Type*)l)->o->visible()) { invisible_pixmap.draw(X - 17, Y); } - + // Indent=12 per level: Now write the text that comes after the graphics representation Y += comment_incr; if (l->is_widget() || l->is_class()) { @@ -492,9 +490,9 @@ int Widget_Browser::handle(int e) { if (l) { X += 3 + 12*l->level - hposition(); if (l->is_parent() && Fl::event_x()>X && Fl::event_x()<X+13) { - title = pushedtitle = l; - redraw_line(l); - return 1; + title = pushedtitle = l; + redraw_line(l); + return 1; } } break; @@ -516,27 +514,27 @@ int Widget_Browser::handle(int e) { if (!title) { l = (Fl_Type*)find_item(Fl::event_y()); if (l && l->new_selected && (Fl::event_clicks() || Fl::event_state(FL_CTRL))) - l->open(); + l->open(); break; } l = pushedtitle; title = pushedtitle = 0; if (l) { if (l->open_) { - l->open_ = 0; - for (Fl_Type*k = l->next; k&&k->level>l->level; k = k->next) - k->visible = 0; + l->open_ = 0; + for (Fl_Type*k = l->next; k&&k->level>l->level; k = k->next) + k->visible = 0; } else { - l->open_ = 1; - for (Fl_Type*k=l->next; k&&k->level>l->level;) { - k->visible = 1; - if (k->is_parent() && !k->open_) { - Fl_Type *j; - for (j = k->next; j && j->level>k->level; j = j->next) {/*empty*/} - k = j; - } else - k = k->next; - } + l->open_ = 1; + for (Fl_Type*k=l->next; k&&k->level>l->level;) { + k->visible = 1; + if (k->is_parent() && !k->open_) { + Fl_Type *j; + for (j = k->next; j && j->level>k->level; j = j->next) {/*empty*/} + k = j; + } else + k = k->next; + } } redraw(); } @@ -640,8 +638,8 @@ void Fl_Type::insert(Fl_Type *g) { // Return message number for I18N... int Fl_Type::msgnum() { - int count; - Fl_Type *p; + int count; + Fl_Type *p; for (count = 0, p = this; p;) { if (p->label()) count ++; @@ -686,7 +684,7 @@ int storestring(const char *n, const char * & p, int nostrip) { if (!nostrip) while (e > n && isspace((int)(unsigned char)*(e-1))) e--; length = e-n; if (!length) n = 0; - } + } if (n == p) return 0; if (n && p && !strncmp(n,p,length) && !p[length]) return 0; if (p) free((void *)p); @@ -792,13 +790,13 @@ void select_all_cb(Fl_Widget *,void *) { if (p) { int foundany = 0; for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) { - if (!t->new_selected) {widget_browser->select(t,1,0); foundany = 1;} + if (!t->new_selected) {widget_browser->select(t,1,0); foundany = 1;} } if (foundany) break; p = p->parent; } else { for (Fl_Type *t = Fl_Type::first; t; t = t->next) - widget_browser->select(t,1,0); + widget_browser->select(t,1,0); break; } } @@ -816,13 +814,13 @@ void select_none_cb(Fl_Widget *,void *) { if (p) { int foundany = 0; for (Fl_Type *t = p->next; t && t->level>p->level; t = t->next) { - if (t->new_selected) {widget_browser->select(t,0,0); foundany = 1;} + if (t->new_selected) {widget_browser->select(t,0,0); foundany = 1;} } if (foundany) break; p = p->parent; } else { for (Fl_Type *t = Fl_Type::first; t; t = t->next) - widget_browser->select(t,0,0); + widget_browser->select(t,0,0); break; } } @@ -849,9 +847,9 @@ void delete_all(int selected_only) { } else f = f->next; } if(!selected_only) { - include_H_from_C=1; - use_FL_COMMAND=0; - } + include_H_from_C=1; + use_FL_COMMAND=0; + } selection_changed(0); } @@ -860,7 +858,7 @@ void delete_all(int selected_only) { // returns pointer to whatever is after f & children void Fl_Type::move_before(Fl_Type* g) { if (level != g->level) printf("move_before levels don't match! %d %d\n", - level, g->level); + level, g->level); Fl_Type* n; for (n = next; n && n->level > level; n = n->next) {/*empty*/} if (n == g) return; @@ -921,10 +919,10 @@ void later_cb(Fl_Widget*,void*) { void Fl_Type::write() { write_indent(level); write_word(type_name()); - + if (is_class()) { - const char * p = ((Fl_Class_Type*)this)->prefix(); - if (p && strlen(p)) + const char * p = ((Fl_Class_Type*)this)->prefix(); + if (p && strlen(p)) write_word(p); } @@ -937,7 +935,7 @@ void Fl_Type::write() { write_open(level); Fl_Type *child; for (child = next; child && child->level > level; child = child->next) - if (child->level == level+1) child->write(); + if (child->level == level+1) child->write(); write_close(level); } @@ -1141,8 +1139,3 @@ int Fl_Type::user_defined(const char* cbname) const { return 1; return 0; } - - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Type.h b/fluid/Fl_Type.h index 6794bef37..6512ae317 100644 --- a/fluid/Fl_Type.h +++ b/fluid/Fl_Type.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type header file for the Fast Light Tool Kit (FLTK). // // Each object described by Fluid is one of these objects. They @@ -18,11 +16,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Widget.H> @@ -58,17 +56,17 @@ protected: const char *user_data_type_; const char *comment_; -public: // things that should not be public: +public: // things that should not be public: Fl_Type *parent; // parent, which is previous in list char new_selected; // browser highlight char selected; // copied here by selection_changed() - char open_; // state of triangle in browser + char open_; // state of triangle in browser char visible; // true if all parents are open - char rtti; // hack because I have no rtti, this is 0 for base class - int level; // number of parents over this + char rtti; // hack because I have no rtti, this is 0 for base class + int level; // number of parents over this static Fl_Type *first, *last; // linked list of all objects - Fl_Type *next, *prev; // linked list of all objects + Fl_Type *next, *prev; // linked list of all objects Fl_Type *factory; const char *callback_name(); @@ -86,7 +84,7 @@ public: void add(Fl_Type *parent); // add as new child void insert(Fl_Type *n); // insert into list before n - Fl_Type* remove(); // remove from list + Fl_Type* remove(); // remove from list void move_before(Fl_Type*); // move before a sibling virtual const char *title(); // string for browser @@ -112,7 +110,7 @@ public: virtual void remove_child(Fl_Type*); static Fl_Type *current; // most recently picked object - virtual void open(); // what happens when you double-click + virtual void open(); // what happens when you double-click // read and write data to a saved file: virtual void write(); @@ -166,8 +164,8 @@ class Fl_Function_Type : public Fl_Type { const char* return_type; char public_, cdecl_, constructor, havewidgets; public: - Fl_Function_Type() : - Fl_Type(), + Fl_Function_Type() : + Fl_Type(), return_type(0L), public_(0), cdecl_(0), constructor(0), havewidgets(0) { } ~Fl_Function_Type() { @@ -228,7 +226,7 @@ public: // 1 -- file changed, internal records updated, 'code' has new content // -1 -- error getting file info (get_ms_errmsg() has reason) // - // TODO: Figure out how saving a fluid file can be intercepted to grab + // TODO: Figure out how saving a fluid file can be intercepted to grab // current contents of editor file.. // int handle_editor_changes() { @@ -346,7 +344,7 @@ public: ~Fl_Class_Type() { if (subclass_of) free((void*)subclass_of); } - + // state variables for output: char write_public_state; // true when public: has been printed Fl_Class_Type* parent_class; // save class if nested @@ -590,13 +588,13 @@ protected: Fl_Menu_Item* subtypes() {return window_type_menu;} friend class Overlay_Window; - int mx,my; // mouse position during dragging - int x1,y1; // initial position of selection box - int bx,by,br,bt; // bounding box of selection before snapping - int sx,sy,sr,st; // bounding box of selection after snapping to guides + int mx,my; // mouse position during dragging + int x1,y1; // initial position of selection box + int bx,by,br,bt; // bounding box of selection before snapping + int sx,sy,sr,st; // bounding box of selection after snapping to guides int dx,dy; - int drag; // which parts of bbox are being moved - int numselected; // number of children selected + int drag; // which parts of bbox are being moved + int numselected; // number of children selected enum {LEFT=1,RIGHT=2,BOTTOM=4,TOP=8,DRAG=16,BOX=32}; void draw_overlay(); void newdx(); @@ -607,7 +605,7 @@ protected: void write_code2(); Fl_Widget_Type *_make() {return 0;} // we don't call this Fl_Widget *widget(int,int,int,int) {return 0;} - int recalc; // set by fix_overlay() + int recalc; // set by fix_overlay() void moveallchildren(); int pixmapID() { return 1; } @@ -622,8 +620,8 @@ public: void open(); - void fix_overlay(); // Update the bounding box, etc - uchar *read_image(int &ww, int &hh); // Read an image of the window + void fix_overlay(); // Update the bounding box, etc + uchar *read_image(int &ww, int &hh); // Read an image of the window virtual void write_properties(); virtual void read_property(const char *); @@ -918,14 +916,9 @@ public: // handle a command and return the number of args used, or 0 virtual int arg(int argc, char **argv, int &i) = 0; // optional test the plugin - virtual int test(const char *a1=0L, const char *a2=0L, const char *a3=0L) { + virtual int test(const char *a1=0L, const char *a2=0L, const char *a3=0L) { return 0; } // show a GUI panel to edit some data virtual void show_panel() { } }; - - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index ca344170a..e63c299cd 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -118,12 +116,12 @@ Fl_Type *Fl_Widget_Type::make() { // Figure out a position and size for the widget int X,Y,W,H; - if (is_group()) { // fill the parent with the widget + if (is_group()) { // fill the parent with the widget X = ULX+B; W = p->o->w()-B; Y = ULY+B; H = p->o->h()-B; - } else if (q != p) { // copy position and size of current widget + } else if (q != p) { // copy position and size of current widget W = q->o->w(); H = q->o->h(); X = q->o->x()+W; @@ -133,7 +131,7 @@ Fl_Type *Fl_Widget_Type::make() { Y = q->o->y()+H; if (Y+H > ULY+p->o->h()) Y = ULY+B; } - } else { // just make it small and square... + } else { // just make it small and square... X = ULX+B; Y = ULY+B; W = H = B; @@ -345,7 +343,7 @@ void name_public_member_cb(Fl_Choice* i, void* v) { // if this is not in a class, it can be only private or public w->public_ = (i->value()>0); } - mod = 1; + mod = 1; } } if (mod) { @@ -353,7 +351,7 @@ void name_public_member_cb(Fl_Choice* i, void* v) { redraw_browser(); } } -} +} void name_public_cb(Fl_Choice* i, void* v) { if (v == LOAD) { @@ -363,8 +361,8 @@ void name_public_cb(Fl_Choice* i, void* v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - ((Fl_Widget_Type*)o)->public_ = i->value(); - mod = 1; + ((Fl_Widget_Type*)o)->public_ = i->value(); + mod = 1; } } if (mod) { @@ -372,7 +370,7 @@ void name_public_cb(Fl_Choice* i, void* v) { redraw_browser(); } } -} +} static char* oldlabel; static unsigned oldlabellen; @@ -390,7 +388,7 @@ void label_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { o->label(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -411,7 +409,7 @@ void image_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { ((Fl_Widget_Type*)o)->image_name(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -422,17 +420,17 @@ void image_browse_cb(Fl_Button* b, void *v) { if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_window()) b->activate(); - else + else b->deactivate(); } else { int mod = 0; if (ui_find_image(image_input->value())) { image_input->value(ui_find_image_name); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { - if (o->selected && o->is_widget()) { - ((Fl_Widget_Type*)o)->image_name(ui_find_image_name); - mod = 1; - } + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->image_name(ui_find_image_name); + mod = 1; + } } if (mod) set_modflag(1); } @@ -453,7 +451,7 @@ void inactive_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { ((Fl_Widget_Type*)o)->inactive_name(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -462,19 +460,19 @@ void inactive_cb(Fl_Input* i, void *v) { void inactive_browse_cb(Fl_Button* b, void *v) { if (v == LOAD) { - if (current_widget->is_widget() && !current_widget->is_window()) + if (current_widget->is_widget() && !current_widget->is_window()) b->activate(); - else + else b->deactivate(); } else { int mod = 0; if (ui_find_image(inactive_input->value())) { inactive_input->value(ui_find_image_name); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { - if (o->selected && o->is_widget()) { - ((Fl_Widget_Type*)o)->inactive_name(ui_find_image_name); - mod = 1; - } + if (o->selected && o->is_widget()) { + ((Fl_Widget_Type*)o)->inactive_name(ui_find_image_name); + mod = 1; + } } if (mod) set_modflag(1); } @@ -492,7 +490,7 @@ void tooltip_cb(Fl_Input* i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { ((Fl_Widget_Type*)o)->tooltip(i->value()); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -513,13 +511,13 @@ void x_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize((int)i->value(), w->y(), w->w(), w->h()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize((int)i->value(), w->y(), w->w(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -538,13 +536,13 @@ void y_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize(w->x(), (int)i->value(), w->w(), w->h()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize(w->x(), (int)i->value(), w->w(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -563,13 +561,13 @@ void w_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize(w->x(), w->y(), (int)i->value(), w->h()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize(w->x(), w->y(), (int)i->value(), w->h()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -588,13 +586,13 @@ void h_cb(Fl_Value_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - w->resize(w->x(), w->y(), w->w(), (int)i->value()); - if (w->window()) w->window()->redraw(); - if (o->is_window()) { + w->resize(w->x(), w->y(), w->w(), (int)i->value()); + if (w->window()) w->window()->redraw(); + if (o->is_window()) { ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -615,7 +613,7 @@ void wc_relative_cb(Fl_Light_Button *i, void *v) { if (o->selected && !strcmp(current_widget->type_name(), "widget_class")) { Fl_Widget_Class_Type *t = (Fl_Widget_Class_Type *)o; t->wc_relative = i->value(); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -746,10 +744,10 @@ void box_cb(Fl_Choice* i, void *v) { if (n == ZERO_ENTRY) n = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; q->o->box((Fl_Boxtype)n); q->redraw(); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -780,18 +778,18 @@ void down_box_cb(Fl_Choice* i, void *v) { if (n == ZERO_ENTRY) n = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected) { - if (o->is_button() && !o->is_menu_item()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (o->is_button() && !o->is_menu_item()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; ((Fl_Button*)(q->o))->down_box((Fl_Boxtype)n); if (((Fl_Button*)(q->o))->value()) q->redraw(); - } else if (!strcmp(o->type_name(), "Fl_Input_Choice")) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - ((Fl_Input_Choice*)(q->o))->down_box((Fl_Boxtype)n); - } else if (o->is_menu_button()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; + } else if (!strcmp(o->type_name(), "Fl_Input_Choice")) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + ((Fl_Input_Choice*)(q->o))->down_box((Fl_Boxtype)n); + } else if (o->is_menu_button()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; ((Fl_Menu_*)(q->o))->down_box((Fl_Boxtype)n); - } - mod = 1; + } + mod = 1; } } if (mod) set_modflag(1); @@ -832,9 +830,9 @@ void when_cb(Fl_Choice* i, void *v) { if (n == ZERO_ENTRY) n = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->when(n|(q->o->when()&FL_WHEN_NOT_CHANGED)); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->when(n|(q->o->when()&FL_WHEN_NOT_CHANGED)); + mod = 1; } } if (mod) set_modflag(1); @@ -850,9 +848,9 @@ void when_button_cb(Fl_Light_Button* i, void *v) { int n = i->value() ? FL_WHEN_NOT_CHANGED : 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->when(n|(q->o->when()&~FL_WHEN_NOT_CHANGED)); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->when(n|(q->o->when()&~FL_WHEN_NOT_CHANGED)); + mod = 1; } } if (mod) set_modflag(1); @@ -912,8 +910,8 @@ void hotspot_cb(Fl_Light_Button* i,void* v) { if (!p || !p->is_widget()) return; while (!p->is_window()) p = p->parent; for (Fl_Type *o = p->next; o && o->level > p->level; o = o->next) { - if (o->is_widget() && o != current_widget) - ((Fl_Widget_Type*)o)->hotspot(0); + if (o->is_widget() && o != current_widget) + ((Fl_Widget_Type*)o)->hotspot(0); } } set_modflag(1); @@ -930,17 +928,17 @@ void visible_cb(Fl_Light_Button* i, void* v) { int n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - n ? q->o->show() : q->o->hide(); - q->redraw(); - mod = 1; - if (n && q->parent && q->parent->type_name()) { - if (!strcmp(q->parent->type_name(), "Fl_Tabs")) { - ((Fl_Tabs *)q->o->parent())->value(q->o); - } else if (!strcmp(q->parent->type_name(), "Fl_Wizard")) { - ((Fl_Wizard *)q->o->parent())->value(q->o); - } - } + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + n ? q->o->show() : q->o->hide(); + q->redraw(); + mod = 1; + if (n && q->parent && q->parent->type_name()) { + if (!strcmp(q->parent->type_name(), "Fl_Tabs")) { + ((Fl_Tabs *)q->o->parent())->value(q->o); + } else if (!strcmp(q->parent->type_name(), "Fl_Wizard")) { + ((Fl_Wizard *)q->o->parent())->value(q->o); + } + } } } if (mod) { @@ -960,10 +958,10 @@ void active_cb(Fl_Light_Button* i, void* v) { int n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - n ? q->o->activate() : q->o->deactivate(); - q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + n ? q->o->activate() : q->o->deactivate(); + q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1001,10 +999,10 @@ void labelfont_cb(Fl_Choice* i, void *v) { int n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->labelfont(n); - q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelfont(n); + q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1021,10 +1019,10 @@ void labelsize_cb(Fl_Value_Input* i, void *v) { if (n <= 0) n = Fl_Widget_Type::default_size; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->labelsize(n); - q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelsize(n); + q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1056,10 +1054,10 @@ void labeltype_cb(Fl_Choice* i, void *v) { if (n<0) return; // should not happen for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* p = (Fl_Widget_Type*)o; - p->o->labeltype((Fl_Labeltype)n); - p->redraw(); - mod = 1; + Fl_Widget_Type* p = (Fl_Widget_Type*)o; + p->o->labeltype((Fl_Labeltype)n); + p->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1079,12 +1077,12 @@ void color_cb(Fl_Button* i, void *v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->color(c); q->o->redraw(); + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->color(c); q->o->redraw(); if (q->parent && q->parent->type_name() == tabs_type_name) { if (q->o->parent()) q->o->parent()->redraw(); } - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -1103,9 +1101,9 @@ void color2_cb(Fl_Button* i, void *v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->selection_color(c); q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->selection_color(c); q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1122,9 +1120,9 @@ void labelcolor_cb(Fl_Button* i, void *v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->o->labelcolor(c); q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->o->labelcolor(c); q->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1166,29 +1164,29 @@ void align_cb(Fl_Button* i, void *v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - Fl_Align x = q->o->align(); - Fl_Align y; - if (i->value()) { - y = x | b; - if (b == FL_ALIGN_LEFT || b == FL_ALIGN_TOP) { - Fl_Button *b1 = relative(i,+1); - b1->clear(); - y = y & ~(b1->argument()); - } - if (b == FL_ALIGN_RIGHT || b == FL_ALIGN_BOTTOM) { - Fl_Button *b1 = relative(i,-1); - b1->clear(); - y = y & ~(b1->argument()); - } - } else { - y = x & ~b; - } - if (x != y) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Align x = q->o->align(); + Fl_Align y; + if (i->value()) { + y = x | b; + if (b == FL_ALIGN_LEFT || b == FL_ALIGN_TOP) { + Fl_Button *b1 = relative(i,+1); + b1->clear(); + y = y & ~(b1->argument()); + } + if (b == FL_ALIGN_RIGHT || b == FL_ALIGN_BOTTOM) { + Fl_Button *b1 = relative(i,-1); + b1->clear(); + y = y & ~(b1->argument()); + } + } else { + y = x & ~b; + } + if (x != y) { q->o->align(y); - q->redraw(); - mod = 1; - } + q->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1210,14 +1208,14 @@ void align_position_cb(Fl_Choice *i, void *v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - Fl_Align x = q->o->align(); - Fl_Align y = (x & ~FL_ALIGN_POSITION_MASK) | b; - if (x != y) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Align x = q->o->align(); + Fl_Align y = (x & ~FL_ALIGN_POSITION_MASK) | b; + if (x != y) { q->o->align(y); - q->redraw(); - mod = 1; - } + q->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1239,14 +1237,14 @@ void align_text_image_cb(Fl_Choice *i, void *v) { int mod = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - Fl_Align x = q->o->align(); - Fl_Align y = (x & ~FL_ALIGN_IMAGE_MASK) | b; - if (x != y) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + Fl_Align x = q->o->align(); + Fl_Align y = (x & ~FL_ALIGN_IMAGE_MASK) | b; + if (x != y) { q->o->align(y); - q->redraw(); - mod = 1; - } + q->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1308,7 +1306,7 @@ void user_data_cb(Fl_Input *i, void *v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected) { o->user_data(c); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -1329,13 +1327,13 @@ void user_data_type_cb(Fl_Input *i, void *v) { else if (!strcmp(c,dflt)) c = 0; if (!d) { if (c && *c && c[strlen(c)-1] != '*' && strcmp(c,"long")) - d = "must be pointer or long"; + d = "must be pointer or long"; } if (d) {fl_message("Error in type: %s",d); haderror = 1; return;} for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected) { o->user_data_type(c); - mod = 1; + mod = 1; } } if (mod) set_modflag(1); @@ -1355,9 +1353,9 @@ void v_input_cb(Fl_Input* i, void* v) { if (d) {fl_message("Error in %s: %s",i->label(),d); haderror = 1; return;} for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type *t = (Fl_Widget_Type*)o; - t->extra_code(n,c); - mod = 1; + Fl_Widget_Type *t = (Fl_Widget_Type*)o; + t->extra_code(n,c); + mod = 1; } } if (mod) set_modflag(1); @@ -1373,9 +1371,9 @@ void subclass_cb(Fl_Input* i, void* v) { const char *c = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type *t = (Fl_Widget_Type*)o; - t->subclass(c); - mod = 1; + Fl_Widget_Type *t = (Fl_Widget_Type*)o; + t->subclass(c); + mod = 1; } } if (mod) set_modflag(1); @@ -1401,10 +1399,10 @@ void textfont_cb(Fl_Choice* i, void* v) { n = (Fl_Font)i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->textstuff(1,n,s,c); - q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(1,n,s,c); + q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1422,10 +1420,10 @@ void textsize_cb(Fl_Value_Input* i, void* v) { if (s <= 0) s = Fl_Widget_Type::default_size; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->textstuff(2,n,s,c); - q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(2,n,s,c); + q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1446,9 +1444,9 @@ void textcolor_cb(Fl_Button* i, void* v) { c = d; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - q->textstuff(3,n,s,c); q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + q->textstuff(3,n,s,c); q->o->redraw(); + mod = 1; } } if (mod) set_modflag(1); @@ -1564,8 +1562,8 @@ void set_max_size_cb(Fl_Button*, void* v) { void slider_size_cb(Fl_Value_Input* i, void* v) { if (v == LOAD) { - if (current_widget->is_window()) - i->parent()->hide(); + if (current_widget->is_window()) + i->parent()->hide(); else i->parent()->show(); if (current_widget->is_valuator()<2) {i->deactivate(); return;} @@ -1576,12 +1574,12 @@ void slider_size_cb(Fl_Value_Input* i, void* v) { double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()>=2) { - ((Fl_Slider*)(q->o))->slider_size(n); - q->o->redraw(); - mod = 1; - } + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()>=2) { + ((Fl_Slider*)(q->o))->slider_size(n); + q->o->redraw(); + mod = 1; + } } } if (mod) set_modflag(1); @@ -1605,12 +1603,12 @@ void min_cb(Fl_Value_Input* i, void* v) { double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()) { - ((Fl_Valuator*)(q->o))->minimum(n); - q->o->redraw(); - mod = 1; - } else if (q->is_spinner()) { + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->minimum(n); + q->o->redraw(); + mod = 1; + } else if (q->is_spinner()) { ((Fl_Spinner*)(q->o))->minimum(n); q->o->redraw(); mod = 1; @@ -1638,16 +1636,16 @@ void max_cb(Fl_Value_Input* i, void* v) { double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()) { - ((Fl_Valuator*)(q->o))->maximum(n); - q->o->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->maximum(n); + q->o->redraw(); + mod = 1; } else if (q->is_spinner()) { ((Fl_Spinner*)(q->o))->maximum(n); q->o->redraw(); mod = 1; - } + } } } if (mod) set_modflag(1); @@ -1698,25 +1696,25 @@ void value_cb(Fl_Value_Input* i, void* v) { } else if (current_widget->is_spinner()) { i->activate(); i->value(((Fl_Spinner*)(current_widget->o))->value()); - } else + } else i->deactivate(); } else { int mod = 0; double n = i->value(); for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { - Fl_Widget_Type* q = (Fl_Widget_Type*)o; - if (q->is_valuator()) { - ((Fl_Valuator*)(q->o))->value(n); - mod = 1; - } else if (q->is_button()) { - ((Fl_Button*)(q->o))->value(n != 0); - if (q->is_menu_item()) q->redraw(); - mod = 1; + Fl_Widget_Type* q = (Fl_Widget_Type*)o; + if (q->is_valuator()) { + ((Fl_Valuator*)(q->o))->value(n); + mod = 1; + } else if (q->is_button()) { + ((Fl_Button*)(q->o))->value(n != 0); + if (q->is_menu_item()) q->redraw(); + mod = 1; } else if (q->is_spinner()) { ((Fl_Spinner*)(q->o))->value(n); mod = 1; - } + } } } if (mod) set_modflag(1); @@ -1857,7 +1855,7 @@ void live_mode_cb(Fl_Button*o,void *) { Fl_Window_Type *w = (Fl_Window_Type*)current_widget; int mw = w->sr_min_w; if (mw>0) mw += 20; int mh = w->sr_min_h; if (mh>0) mh += 55; - int MW = w->sr_max_w; if (MW>0) MW += 20; + int MW = w->sr_max_w; if (MW>0) MW += 20; int MH = w->sr_max_h; if (MH>2) MH += 55; if (mw || mh || MW || MH) live_window->size_range(mw, mh, MW, MH); @@ -1890,8 +1888,8 @@ static void load_panel() { current_widget=(Fl_Widget_Type*)Fl_Type::current; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->is_widget() && o->selected) { - numselected++; - if (!current_widget) current_widget = (Fl_Widget_Type*)o; + numselected++; + if (!current_widget) current_widget = (Fl_Widget_Type*)o; } } } @@ -1926,8 +1924,8 @@ void selection_changed(Fl_Type *p) { if (haderror) { Fl_Type *q = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) { - o->new_selected = o->selected; - if (!q && o->selected) q = o; + o->new_selected = o->selected; + if (!q && o->selected) q = o; } if (!p || !p->selected) p = q; Fl_Type::current = p; @@ -2024,7 +2022,7 @@ void Fl_Widget_Type::write_static() { } if (write_extern_declaration) write_declare("extern void %s(%s*, %s);", callback(), t, - user_data_type() ? user_data_type() : "void*"); + user_data_type() ? user_data_type() : "void*"); } const char* k = class_name(1); const char* c = array_name(this); @@ -2071,7 +2069,7 @@ void Fl_Widget_Type::write_static() { write_c(" ((%s*)(o", k); Fl_Type *q = 0; for (Fl_Type* p = parent; p && p->is_widget(); q = p, p = p->parent) - write_c("->parent()"); + write_c("->parent()"); if (!q || strcmp(q->type_name(), "widget_class")) write_c("->user_data()"); write_c("))->%s_i(o,v);\n}\n", cn); @@ -2135,24 +2133,24 @@ void Fl_Widget_Type::write_code1() { if (extra_code(n) && !isdeclare(extra_code(n))) { int instring = 0; - int inname = 0; + int inname = 0; for (ptr = extra_code(n); *ptr; ptr ++) { - if (instring) { - if (*ptr == '\\') ptr++; - else if (*ptr == '\"') instring = 0; - } else if (inname && !isalnum(*ptr & 255)) inname = 0; + if (instring) { + if (*ptr == '\\') ptr++; + else if (*ptr == '\"') instring = 0; + } else if (inname && !isalnum(*ptr & 255)) inname = 0; else if (*ptr == '\"') instring = 1; - else if (isalnum(*ptr & 255) || *ptr == '_') { - size_t len = strspn(ptr, "0123456789_" - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + else if (isalnum(*ptr & 255) || *ptr == '_') { + size_t len = strspn(ptr, "0123456789_" + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); if (!strncmp(ptr, "o", len)) { - varused = 1; - break; - } else ptr += len - 1; + varused = 1; + break; + } else ptr += len - 1; } - } + } } } @@ -2179,13 +2177,13 @@ void Fl_Widget_Type::write_code1() { case 1 : /* GNU gettext */ write_c("%s(", i18n_function); write_cstring(label()); - write_c(")"); + write_c(")"); break; case 2 : /* POSIX catgets */ write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog", - i18n_set, msgnum()); + i18n_set, msgnum()); write_cstring(label()); - write_c(")"); + write_c(")"); break; } } @@ -2201,32 +2199,32 @@ void Fl_Widget_Type::write_code1() { void Fl_Widget_Type::write_color(const char* field, Fl_Color color) { const char* color_name = 0; switch (color) { - case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break; - case FL_BACKGROUND2_COLOR: color_name = "FL_BACKGROUND2_COLOR"; break; - case FL_INACTIVE_COLOR: color_name = "FL_INACTIVE_COLOR"; break; - case FL_SELECTION_COLOR: color_name = "FL_SELECTION_COLOR"; break; - case FL_GRAY0: color_name = "FL_GRAY0"; break; - case FL_DARK3: color_name = "FL_DARK3"; break; - case FL_DARK2: color_name = "FL_DARK2"; break; - case FL_DARK1: color_name = "FL_DARK1"; break; - case FL_BACKGROUND_COLOR: color_name = "FL_BACKGROUND_COLOR"; break; - case FL_LIGHT1: color_name = "FL_LIGHT1"; break; - case FL_LIGHT2: color_name = "FL_LIGHT2"; break; - case FL_LIGHT3: color_name = "FL_LIGHT3"; break; - case FL_BLACK: color_name = "FL_BLACK"; break; - case FL_RED: color_name = "FL_RED"; break; - case FL_GREEN: color_name = "FL_GREEN"; break; - case FL_YELLOW: color_name = "FL_YELLOW"; break; - case FL_BLUE: color_name = "FL_BLUE"; break; - case FL_MAGENTA: color_name = "FL_MAGENTA"; break; - case FL_CYAN: color_name = "FL_CYAN"; break; - case FL_DARK_RED: color_name = "FL_DARK_RED"; break; - case FL_DARK_GREEN: color_name = "FL_DARK_GREEN"; break; - case FL_DARK_YELLOW: color_name = "FL_DARK_YELLOW"; break; - case FL_DARK_BLUE: color_name = "FL_DARK_BLUE"; break; - case FL_DARK_MAGENTA: color_name = "FL_DARK_MAGENTA"; break; - case FL_DARK_CYAN: color_name = "FL_DARK_CYAN"; break; - case FL_WHITE: color_name = "FL_WHITE"; break; + case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break; + case FL_BACKGROUND2_COLOR: color_name = "FL_BACKGROUND2_COLOR"; break; + case FL_INACTIVE_COLOR: color_name = "FL_INACTIVE_COLOR"; break; + case FL_SELECTION_COLOR: color_name = "FL_SELECTION_COLOR"; break; + case FL_GRAY0: color_name = "FL_GRAY0"; break; + case FL_DARK3: color_name = "FL_DARK3"; break; + case FL_DARK2: color_name = "FL_DARK2"; break; + case FL_DARK1: color_name = "FL_DARK1"; break; + case FL_BACKGROUND_COLOR: color_name = "FL_BACKGROUND_COLOR"; break; + case FL_LIGHT1: color_name = "FL_LIGHT1"; break; + case FL_LIGHT2: color_name = "FL_LIGHT2"; break; + case FL_LIGHT3: color_name = "FL_LIGHT3"; break; + case FL_BLACK: color_name = "FL_BLACK"; break; + case FL_RED: color_name = "FL_RED"; break; + case FL_GREEN: color_name = "FL_GREEN"; break; + case FL_YELLOW: color_name = "FL_YELLOW"; break; + case FL_BLUE: color_name = "FL_BLUE"; break; + case FL_MAGENTA: color_name = "FL_MAGENTA"; break; + case FL_CYAN: color_name = "FL_CYAN"; break; + case FL_DARK_RED: color_name = "FL_DARK_RED"; break; + case FL_DARK_GREEN: color_name = "FL_DARK_GREEN"; break; + case FL_DARK_YELLOW: color_name = "FL_DARK_YELLOW"; break; + case FL_DARK_BLUE: color_name = "FL_DARK_BLUE"; break; + case FL_DARK_MAGENTA: color_name = "FL_DARK_MAGENTA"; break; + case FL_DARK_CYAN: color_name = "FL_DARK_CYAN"; break; + case FL_WHITE: color_name = "FL_WHITE"; break; } const char *var = is_class() ? "this" : name() ? name() : "o"; if (color_name) { @@ -2250,13 +2248,13 @@ void Fl_Widget_Type::write_widget_code() { case 1 : /* GNU gettext */ write_c("%s(", i18n_function); write_cstring(tooltip()); - write_c(")"); + write_c(")"); break; case 2 : /* POSIX catgets */ write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog", - i18n_set, msgnum() + 1); + i18n_set, msgnum() + 1); write_cstring(tooltip()); - write_c(")"); + write_c(")"); break; } write_c(");\n"); @@ -2286,16 +2284,16 @@ void Fl_Widget_Type::write_widget_code() { if (is_button()) { Fl_Button* b = (Fl_Button*)o; if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, - boxname(b->down_box())); + boxname(b->down_box())); if (b->value()) write_c("%s%s->value(1);\n", indent(), var); } else if (!strcmp(type_name(), "Fl_Input_Choice")) { Fl_Input_Choice* b = (Fl_Input_Choice*)o; if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, - boxname(b->down_box())); + boxname(b->down_box())); } else if (is_menu_button()) { Fl_Menu_* b = (Fl_Menu_*)o; if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var, - boxname(b->down_box())); + boxname(b->down_box())); } if (o->color() != tplate->color() || subclass()) write_color("color", o->color()); @@ -2305,7 +2303,7 @@ void Fl_Widget_Type::write_widget_code() { if (inactive) inactive->write_code(var, 1); if (o->labeltype() != tplate->labeltype() || subclass()) write_c("%s%s->labeltype(FL_%s);\n", indent(), var, - item_name(labeltypemenu, o->labeltype())); + item_name(labeltypemenu, o->labeltype())); if (o->labelfont() != tplate->labelfont() || subclass()) write_c("%s%s->labelfont(%d);\n", indent(), var, o->labelfont()); if (o->labelsize() != tplate->labelsize() || subclass()) @@ -2367,12 +2365,12 @@ void Fl_Widget_Type::write_widget_code() { if (o->align() != tplate->align() || subclass()) { int i = o->align(); write_c("%s%s->align(Fl_Align(%s", indent(), var, - item_name(alignmenu, i & ~FL_ALIGN_INSIDE)); + item_name(alignmenu, i & ~FL_ALIGN_INSIDE)); if (i & FL_ALIGN_INSIDE) write_c("|FL_ALIGN_INSIDE"); write_c("));\n"); } - // avoid the unsupported combination of flegs when user sets - // "when" to "FL_WHEN_NEVER", but keeps the "no change" set. + // avoid the unsupported combination of flegs when user sets + // "when" to "FL_WHEN_NEVER", but keeps the "no change" set. // FIXME: This could be reflected in the GUI by graying out the button. Fl_When ww = o->when(); if (ww==FL_WHEN_NOT_CHANGED) @@ -2560,7 +2558,7 @@ void Fl_Widget_Type::read_property(const char *c) { } else if (!strcmp(c,"deimage")) { inactive_name(read_word()); } else if (!strcmp(c,"type")) { - if (is_spinner()) + if (is_spinner()) ((Fl_Spinner*)o)->type(item_number(subtypes(), read_word())); else o->type(item_number(subtypes(), read_word())); @@ -2681,23 +2679,23 @@ void Fl_Widget_Type::read_property(const char *c) { Fl_Menu_Item boxmenu1[] = { // these extra ones are for looking up fdesign saved strings: - {"NO_FRAME", 0,0,(void *)FL_NO_BOX}, - {"ROUNDED3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, - {"ROUNDED3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, - {"OVAL3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, - {"OVAL3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, - {"0", 0,0,(void *)ZERO_ENTRY}, - {"1", 0,0,(void *)FL_UP_BOX}, - {"2", 0,0,(void *)FL_DOWN_BOX}, - {"3", 0,0,(void *)FL_FLAT_BOX}, - {"4", 0,0,(void *)FL_BORDER_BOX}, - {"5", 0,0,(void *)FL_SHADOW_BOX}, - {"6", 0,0,(void *)FL_FRAME_BOX}, - {"7", 0,0,(void *)FL_ROUNDED_BOX}, - {"8", 0,0,(void *)FL_RFLAT_BOX}, - {"9", 0,0,(void *)FL_RSHADOW_BOX}, - {"10", 0,0,(void *)FL_UP_FRAME}, - {"11", 0,0,(void *)FL_DOWN_FRAME}, + {"NO_FRAME", 0,0,(void *)FL_NO_BOX}, + {"ROUNDED3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, + {"ROUNDED3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, + {"OVAL3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX}, + {"OVAL3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX}, + {"0", 0,0,(void *)ZERO_ENTRY}, + {"1", 0,0,(void *)FL_UP_BOX}, + {"2", 0,0,(void *)FL_DOWN_BOX}, + {"3", 0,0,(void *)FL_FLAT_BOX}, + {"4", 0,0,(void *)FL_BORDER_BOX}, + {"5", 0,0,(void *)FL_SHADOW_BOX}, + {"6", 0,0,(void *)FL_FRAME_BOX}, + {"7", 0,0,(void *)FL_ROUNDED_BOX}, + {"8", 0,0,(void *)FL_RFLAT_BOX}, + {"9", 0,0,(void *)FL_RSHADOW_BOX}, + {"10", 0,0,(void *)FL_UP_FRAME}, + {"11", 0,0,(void *)FL_DOWN_FRAME}, {0}}; extern int fdesign_flip; @@ -2709,10 +2707,10 @@ int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) { float x,y,w,h; if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) { if (fdesign_flip) { - Fl_Type *p; - for (p = parent; p && !p->is_window(); p = p->parent) {/*empty*/} - if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h); - } + Fl_Type *p; + for (p = parent; p && !p->is_window(); p = p->parent) {/*empty*/} + if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h); + } x += pasteoffset; y += pasteoffset; o->resize(int(x),int(y),int(w),int(h)); @@ -2812,7 +2810,7 @@ void Fl_Widget_Type::leave_live_mode() { copy all properties from the edit widget to the live widget */ void Fl_Widget_Type::copy_properties() { - if (!live_widget) + if (!live_widget) return; // copy all attributes common to all widget types @@ -2876,7 +2874,7 @@ void Fl_Widget_Type::copy_properties() { d->step(s->step()); d->value(s->value()); } - + /* TODO: implement this {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) { Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c); @@ -2885,11 +2883,11 @@ void Fl_Widget_Type::copy_properties() { if (c != fc) write_string("textcolor %d", c); }}*/ - if (!o->visible()) + if (!o->visible()) w->hide(); - if (!o->active()) + if (!o->active()) w->deactivate(); - if (resizable() && w->parent()) + if (resizable() && w->parent()) w->parent()->resizable(o); } @@ -2899,7 +2897,3 @@ void Fl_Pack_Type::copy_properties() Fl_Pack *d = (Fl_Pack*)live_widget, *s =(Fl_Pack*)o; d->spacing(s->spacing()); } - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Widget_Type.h b/fluid/Fl_Widget_Type.h index 6103888d0..ab33f4e10 100644 --- a/fluid/Fl_Widget_Type.h +++ b/fluid/Fl_Widget_Type.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget type header file for the Fast Light Tool Kit (FLTK). // // Type for creating all subclasses of Fl_Widget @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_Type.h" @@ -27,7 +25,3 @@ class Fluid_Image; extern void* const LOAD; extern Fl_Widget_Type *current_widget; // one of the selected ones - -// -// End of "$Id$". -// diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index ac1f4dca2..8f0f39dc1 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Window type code for the Fast Light Tool Kit (FLTK). // // The widget describing an Fl_Window. This is also all the code @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -47,9 +45,9 @@ extern const char* i18n_function; extern const char* i18n_file; extern const char* i18n_set; -extern Fl_Preferences fluid_prefs; +extern Fl_Preferences fluid_prefs; -inline int fl_min(int a, int b) { return (a < b ? a : b); } +inline int fl_min(int a, int b) { return (a < b ? a : b); } #include "widget_panel.h" @@ -156,23 +154,23 @@ void i18n_type_cb(Fl_Choice *c, void *) { void i18n_text_cb(Fl_Input *i, void *) { undo_checkpoint(); - + if (i == i18n_function_input) i18n_function = i->value(); else if (i == i18n_file_input) i18n_file = i->value(); else if (i == i18n_include_input) i18n_include = i->value(); - + set_modflag(1); } void i18n_int_cb(Fl_Int_Input *i, void *) { undo_checkpoint(); - + if (i == i18n_set_input) i18n_set = i->value(); - + set_modflag(1); } @@ -294,11 +292,11 @@ void Overlay_Window::draw() { if ((damage()&FL_DAMAGE_ALL) && (!box() || (box()>=4&&!(box()&2)) || box()>=_FL_ROUNDED_BOX)) { // if so, draw checkerboard so user can see what areas are clear: - for (int Y = 0; Y < h(); Y += CHECKSIZE) + for (int Y = 0; Y < h(); Y += CHECKSIZE) for (int X = 0; X < w(); X += CHECKSIZE) { - fl_color(((Y/(2*CHECKSIZE))&1) != ((X/(2*CHECKSIZE))&1) ? - FL_WHITE : FL_BLACK); - fl_rectf(X,Y,CHECKSIZE,CHECKSIZE); + fl_color(((Y/(2*CHECKSIZE))&1) != ((X/(2*CHECKSIZE))&1) ? + FL_WHITE : FL_BLACK); + fl_rectf(X,Y,CHECKSIZE,CHECKSIZE); } } Fl_Overlay_Window::draw(); @@ -470,7 +468,7 @@ void border_cb(Fl_Light_Button* i, void* v) { void xclass_cb(Fl_Input* i, void* v) { if (v == LOAD) { if (!current_widget->is_window()) { - i->hide(); + i->hide(); i->parent()->hide(); // hides the "X Class:" label as well return; } @@ -482,11 +480,11 @@ void xclass_cb(Fl_Input* i, void* v) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { mod = 1; - Fl_Widget_Type* w = (Fl_Widget_Type*)o; - if (w->is_window() || w->is_button()) - storestring(i->value(),w->xclass); - if (w->is_window()) ((Fl_Window*)(w->o))->xclass(w->xclass); - else if (w->is_menu_item()) w->redraw(); + Fl_Widget_Type* w = (Fl_Widget_Type*)o; + if (w->is_window() || w->is_button()) + storestring(i->value(),w->xclass); + if (w->is_window()) ((Fl_Window*)(w->o))->xclass(w->xclass); + else if (w->is_menu_item()) w->redraw(); } } if (mod) set_modflag(1); @@ -534,7 +532,7 @@ void Fl_Window_Type::newdx() { if (mydx < 0) mydx = 0; } else if (dx0 < -snap) { if (mydx > 0) mydx = 0; - } else + } else mydx = 0; int dy0 = my-y1; int iy = (drag&BOTTOM) ? by : bt; @@ -543,7 +541,7 @@ void Fl_Window_Type::newdx() { if (mydy < 0) mydy = 0; } else if (dy0 < -snap) { if (mydy > 0) mydy = 0; - } else + } else mydy = 0; } @@ -578,7 +576,7 @@ void Fl_Window_Type::newposition(Fl_Widget_Type *myo,int &X,int &Y,int &R,int &T } else { if (drag&LEFT) { if (X==bx) { - X += dx; + X += dx; } else { if (X<bx+dx) X = bx+dx; } @@ -592,14 +590,14 @@ void Fl_Window_Type::newposition(Fl_Widget_Type *myo,int &X,int &Y,int &R,int &T } if (drag&RIGHT) { if (R==br) { - R += dx; + R += dx; } else { if (R>br+dx) R = br+dx; } } if (drag&BOTTOM) { if (T==bt) { - T += dy; + T += dy; } else { if (T>bt+dx) T = bt+dx; } @@ -727,12 +725,12 @@ void Fl_Window_Type::draw_overlay() { numselected = 0; for (Fl_Type *q=next; q && q->level>level; q=q->next) if (q->selected && q->is_widget() && !q->is_menu_item()) { - numselected++; - Fl_Widget_Type* myo = (Fl_Widget_Type*)q; - if (myo->o->x() < bx) bx = myo->o->x(); - if (myo->o->y() < by) by = myo->o->y(); - if (myo->o->x()+myo->o->w() > br) br = myo->o->x()+myo->o->w(); - if (myo->o->y()+myo->o->h() > bt) bt = myo->o->y()+myo->o->h(); + numselected++; + Fl_Widget_Type* myo = (Fl_Widget_Type*)q; + if (myo->o->x() < bx) bx = myo->o->x(); + if (myo->o->y() < by) by = myo->o->y(); + if (myo->o->x()+myo->o->w() > br) br = myo->o->x()+myo->o->w(); + if (myo->o->y()+myo->o->h() > bt) bt = myo->o->y()+myo->o->h(); } recalc = 0; sx = bx; sy = by; sr = br; st = bt; @@ -763,14 +761,14 @@ void Fl_Window_Type::draw_overlay() { if (t > myst) myst = t; if (!(myo->o->align() & FL_ALIGN_INSIDE)) { // Adjust left/right/top/bottom for top/bottom labels... - int ww, hh; - ww = (myo->o->align() & FL_ALIGN_WRAP) ? myo->o->w() : 0; - hh = myo->o->labelsize(); - myo->o->measure_label(ww, hh); - if (myo->o->align() & FL_ALIGN_TOP) y -= hh; - else if (myo->o->align() & FL_ALIGN_BOTTOM) t += hh; - else if (myo->o->align() & FL_ALIGN_LEFT) x -= ww + 4; - else if (myo->o->align() & FL_ALIGN_RIGHT) r += ww + 4; + int ww, hh; + ww = (myo->o->align() & FL_ALIGN_WRAP) ? myo->o->w() : 0; + hh = myo->o->labelsize(); + myo->o->measure_label(ww, hh); + if (myo->o->align() & FL_ALIGN_TOP) y -= hh; + else if (myo->o->align() & FL_ALIGN_BOTTOM) t += hh; + else if (myo->o->align() & FL_ALIGN_LEFT) x -= ww + 4; + else if (myo->o->align() & FL_ALIGN_RIGHT) r += ww + 4; } if (x < mybx) mybx = x; if (y < myby) myby = y; @@ -794,34 +792,34 @@ void Fl_Window_Type::draw_overlay() { if (drag) { // Check top spacing... if (abs(d = myby - ysp) < 3) { - dy -= d; - if (drag & DRAG) mybt -= d; - myby -= d; - draw_v_arrow(mybx+5, myby, 0); + dy -= d; + if (drag & DRAG) mybt -= d; + myby -= d; + draw_v_arrow(mybx+5, myby, 0); } // Check bottom spacing... if (abs(d = o->h() - mybt - ysp) < 3) { - dy += d; - if (drag & DRAG) myby += d; - mybt += d; - draw_v_arrow(mybx+5, mybt, o->h()); + dy += d; + if (drag & DRAG) myby += d; + mybt += d; + draw_v_arrow(mybx+5, mybt, o->h()); } // Check left spacing... if (abs(d = mybx - xsp) < 3) { dx -= d; - if (drag & DRAG) mybr -= d; - mybx -= d; - draw_h_arrow(mybx, myby+5, 0); + if (drag & DRAG) mybr -= d; + mybx -= d; + draw_h_arrow(mybx, myby+5, 0); } // Check right spacing... if (abs(d = o->w() - mybr - xsp) < 3) { - dx += d; - if (drag & DRAG) mybx += d; - mybr += d; - draw_h_arrow(mybr, myby+5, o->w()); + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; + draw_h_arrow(mybr, myby+5, o->w()); } } @@ -836,187 +834,187 @@ void Fl_Window_Type::draw_overlay() { mysel->ideal_size(iw, ih); if (drag & (TOP | BOTTOM)) { - // Check height - if (abs(d = ih - h) < 5) { + // Check height + if (abs(d = ih - h) < 5) { // Resize height - if (drag & TOP) { - myby -= d; - y -= d; - dy -= d; - } else { - mybt += d; - t += d; - dy += d; - } - } - - // Draw height guide - draw_height(x < 50 ? x+10 : x-10, y, t, - x < 50 ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT); + if (drag & TOP) { + myby -= d; + y -= d; + dy -= d; + } else { + mybt += d; + t += d; + dy += d; + } + } + + // Draw height guide + draw_height(x < 50 ? x+10 : x-10, y, t, + x < 50 ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT); } if (drag & (LEFT | RIGHT)) { - // Check width - if (abs(d = iw - w) < 5) { + // Check width + if (abs(d = iw - w) < 5) { // Resize width if (drag & LEFT) { - mybx -= d; - x -= d; - dx -= d; - } else { - mybr += d; - r += d; - dx += d; - } - } - - // Draw width guide - draw_width(x, y < 50 ? y+10 : y-10, r, - y < 50 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP); + mybx -= d; + x -= d; + dx -= d; + } else { + mybr += d; + r += d; + dx += d; + } + } + + // Draw width guide + draw_width(x, y < 50 ? y+10 : y-10, r, + y < 50 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP); } } // Check spacing and alignment between individual widgets if (drag && selection->is_widget()) { for (Fl_Type *q=next; q && q->level>level; q = q->next) - if (q != selection && q->is_widget()) { + if (q != selection && q->is_widget()) { Fl_Widget_Type *qw = (Fl_Widget_Type*)q; // Only check visible widgets... - if (!qw->o->visible_r()) continue; + if (!qw->o->visible_r()) continue; // Get bounding box of widget... - int qx = qw->o->x(); - int qr = qw->o->x() + qw->o->w(); - int qy = qw->o->y(); - int qt = qw->o->y() + qw->o->h(); + int qx = qw->o->x(); + int qr = qw->o->x() + qw->o->w(); + int qy = qw->o->y(); + int qt = qw->o->y() + qw->o->h(); - if (!(qw->o->align() & FL_ALIGN_INSIDE)) { + if (!(qw->o->align() & FL_ALIGN_INSIDE)) { // Adjust top/bottom for top/bottom labels... - int ww, hh; - ww = qw->o->w(); - hh = qw->o->labelsize(); - qw->o->measure_label(ww, hh); - if (qw->o->align() & FL_ALIGN_TOP) qy -= hh; - if (qw->o->align() & FL_ALIGN_BOTTOM) qt += hh; - } + int ww, hh; + ww = qw->o->w(); + hh = qw->o->labelsize(); + qw->o->measure_label(ww, hh); + if (qw->o->align() & FL_ALIGN_TOP) qy -= hh; + if (qw->o->align() & FL_ALIGN_BOTTOM) qt += hh; + } // Do horizontal alignment when the widget is within 25 - // pixels vertically... - if (fl_min(abs(qy - mysel->o->y() - mysel->o->h()), - abs(mysel->o->y() - qt)) < 25) { + // pixels vertically... + if (fl_min(abs(qy - mysel->o->y() - mysel->o->h()), + abs(mysel->o->y() - qt)) < 25) { // Align to left of other widget... if ((drag & (LEFT | DRAG)) && abs(d = mybx - qx) < 3) { - dx += d; + dx += d; mybx += d; - if (drag & DRAG) mybr += d; + if (drag & DRAG) mybr += d; - draw_left_brace(qw->o); - } + draw_left_brace(qw->o); + } // Align to right of other widget... if ((drag & (RIGHT | DRAG)) && - abs(d = qr - mybr) < 3) { - dx += d; + abs(d = qr - mybr) < 3) { + dx += d; if (drag & DRAG) mybx += d; - mybr += d; + mybr += d; - draw_right_brace(qw->o); - } + draw_right_brace(qw->o); + } } // Align to top of other widget... if ((drag & (TOP | DRAG)) && abs(d = myby - qy) < 3) { - dy += d; + dy += d; myby += d; - if (drag & DRAG) mybt += d; + if (drag & DRAG) mybt += d; - draw_top_brace(qw->o); - } + draw_top_brace(qw->o); + } // Align to bottom of other widget... if ((drag & (BOTTOM | DRAG)) && abs(d = qt - mybt) < 3) { - dy += d; + dy += d; if (drag & DRAG) myby += d; - mybt += d; + mybt += d; - draw_bottom_brace(qw->o); - } + draw_bottom_brace(qw->o); + } // Check spacing between widgets - if (mysel->is_group()) mysel->ideal_spacing(xsp, ysp); + if (mysel->is_group()) mysel->ideal_spacing(xsp, ysp); else qw->ideal_spacing(xsp, ysp); if ((qt)>=myby && qy<=mybt) { if (drag & (LEFT | DRAG)) { - // Compare left of selected to left of current - if (abs(d = qx - mybx - xsp) >= 3) - d = qx - mybx + xsp; + // Compare left of selected to left of current + if (abs(d = qx - mybx - xsp) >= 3) + d = qx - mybx + xsp; - if (abs(d) < 3) { - dx += d; - mybx += d; - if (drag & DRAG) mybr += d; + if (abs(d) < 3) { + dx += d; + mybx += d; + if (drag & DRAG) mybr += d; - // Draw left arrow - draw_h_arrow(mybx, (myby+mybt)/2, qx); + // Draw left arrow + draw_h_arrow(mybx, (myby+mybt)/2, qx); } - // Compare left of selected to right of current + // Compare left of selected to right of current if (abs(d = qr - mybx - xsp) >= 3) - d = qr - mybx + xsp; + d = qr - mybx + xsp; - if (abs(d) < 3) { - dx += d; - mybx += d; - if (drag & DRAG) mybr += d; + if (abs(d) < 3) { + dx += d; + mybx += d; + if (drag & DRAG) mybr += d; - // Draw left arrow - draw_h_arrow(mybx, (myby+mybt)/2, qr); + // Draw left arrow + draw_h_arrow(mybx, (myby+mybt)/2, qr); } - } + } if (drag & (RIGHT | DRAG)) { - // Compare right of selected to left of current - if (abs(d = qx - mybr - xsp) >= 3) - d = qx - mybr + xsp; + // Compare right of selected to left of current + if (abs(d = qx - mybr - xsp) >= 3) + d = qx - mybr + xsp; - if (abs(d) < 3) { - dx += d; - if (drag & DRAG) mybx += d; - mybr += d; + if (abs(d) < 3) { + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; - // Draw right arrow - draw_h_arrow(mybr, (myby+mybt)/2, qx); + // Draw right arrow + draw_h_arrow(mybr, (myby+mybt)/2, qx); } - // Compare right of selected to right of current + // Compare right of selected to right of current if (abs(d = qr - mybr + xsp) >= 3) - d = qr - mybr - xsp; + d = qr - mybr - xsp; if (abs(d) < 3) { - dx += d; - if (drag & DRAG) mybx += d; - mybr += d; + dx += d; + if (drag & DRAG) mybx += d; + mybr += d; - // Draw right arrow - draw_h_arrow(mybr, (myby+mybt)/2, qr); + // Draw right arrow + draw_h_arrow(mybr, (myby+mybt)/2, qr); } } - } + } if (qr>=mybx && qx<=mybr) { // Compare top of selected to top of current if (drag & (TOP | DRAG)) { - if (abs(d = qy - myby - ysp) >= 3) - d = qy - myby + ysp; + if (abs(d = qy - myby - ysp) >= 3) + d = qy - myby + ysp; - if (abs(d) < 3) { - dy += d; - myby += d; - if (drag & DRAG) mybt += d; + if (abs(d) < 3) { + dy += d; + myby += d; + if (drag & DRAG) mybt += d; - // Draw up arrow... - draw_v_arrow((mybx+mybr)/2, myby, qy); + // Draw up arrow... + draw_v_arrow((mybx+mybr)/2, myby, qy); } // Compare top of selected to bottom of current @@ -1024,44 +1022,44 @@ void Fl_Window_Type::draw_overlay() { d = qt - myby + ysp; if (abs(d) < 3) { - dy += d; - myby += d; - if (drag & DRAG) mybt += d; + dy += d; + myby += d; + if (drag & DRAG) mybt += d; - // Draw up arrow... - draw_v_arrow((mybx+mybr)/2, myby, qt); + // Draw up arrow... + draw_v_arrow((mybx+mybr)/2, myby, qt); } - } + } - // Compare bottom of selected to top of current + // Compare bottom of selected to top of current if (drag & (BOTTOM | DRAG)) { - if (abs(d = qy - mybt - ysp) >= 3) - d = qy - mybt + ysp; + if (abs(d = qy - mybt - ysp) >= 3) + d = qy - mybt + ysp; - if (abs(d) < 3) { - dy += d; - if (drag & DRAG) myby += d; - mybt += d; + if (abs(d) < 3) { + dy += d; + if (drag & DRAG) myby += d; + mybt += d; - // Draw down arrow... - draw_v_arrow((mybx+mybr)/2, mybt, qy); + // Draw down arrow... + draw_v_arrow((mybx+mybr)/2, mybt, qy); } - // Compare bottom of selected to bottom of current + // Compare bottom of selected to bottom of current if (abs(d = qt - mybt - ysp) >= 3) d = qt - mybt + ysp; if (abs(d) < 3) { - dy += d; - if (drag & DRAG) myby += d; - mybt += d; + dy += d; + if (drag & DRAG) myby += d; + mybt += d; - // Draw down arrow... - draw_v_arrow((mybx+mybr)/2, mybt, qt); + // Draw down arrow... + draw_v_arrow((mybx+mybr)/2, mybt, qt); } - } + } } - } + } } mysx += mybx-mybx_bak; mysr += mybr-mybr_bak; mysy += myby-myby_bak; myst += mybt-mybt_bak; @@ -1097,17 +1095,17 @@ void check_redraw_corresponding_parent(Fl_Type *s) { Fl_Widget_Type * prev_parent = 0; if( !s || !s->selected || !s->is_widget()) return; for (Fl_Type *i=s; i && i->parent; i=i->parent) { - if (i->is_group() && prev_parent && - (!strcmp(i->type_name(), "Fl_Tabs") || - !strcmp(i->type_name(), "Fl_Wizard"))) { - ((Fl_Tabs*)((Fl_Widget_Type*)i)->o)->value(prev_parent->o); - return; - } - if (i->is_group() && s->is_widget()) - prev_parent = (Fl_Widget_Type*)i; + if (i->is_group() && prev_parent && + (!strcmp(i->type_name(), "Fl_Tabs") || + !strcmp(i->type_name(), "Fl_Wizard"))) { + ((Fl_Tabs*)((Fl_Widget_Type*)i)->o)->value(prev_parent->o); + return; + } + if (i->is_group() && s->is_widget()) + prev_parent = (Fl_Widget_Type*)i; } } - + // do that for every window (when selected set changes): void redraw_overlays() { for (Fl_Type *o=Fl_Type::first; o; o=o->next) @@ -1150,18 +1148,18 @@ void Fl_Window_Type::moveallchildren() // move all the children, whether selected or not: Fl_Type* p; for (p = myo->next; p && p->level>myo->level; p = p->next) - if (p->is_widget() && !p->is_menu_item()) { - Fl_Widget_Type* myo2 = (Fl_Widget_Type*)p; - int X,Y,R,T; - newposition(myo2,X,Y,R,T); - myo2->o->resize(X,Y,R-X,T-Y); - } + if (p->is_widget() && !p->is_menu_item()) { + Fl_Widget_Type* myo2 = (Fl_Widget_Type*)p; + int X,Y,R,T; + newposition(myo2,X,Y,R,T); + myo2->o->resize(X,Y,R-X,T-Y); + } i = p; } else { i = i->next; } } - for (i=next; i && i->level>level; i=i->next) + for (i=next; i && i->level>level; i=i->next) fix_group_size(i); o->redraw(); recalc = 1; @@ -1194,7 +1192,7 @@ int Fl_Window_Type::handle(int event) { if (i->is_widget() && !i->is_menu_item()) { Fl_Widget_Type* myo = (Fl_Widget_Type*)i; for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) - if (!o1->visible()) goto CONTINUE2; + if (!o1->visible()) goto CONTINUE2; if (Fl::event_inside(myo->o)) { selection = myo; if (Fl::event_clicks()==1) @@ -1204,7 +1202,7 @@ int Fl_Window_Type::handle(int event) { }} // see if user grabs edges of selected region: if (numselected && !(Fl::event_state(FL_SHIFT)) && - mx<=br+snap && mx>=bx-snap && my<=bt+snap && my>=by-snap) { + mx<=br+snap && mx>=bx-snap && my<=bt+snap && my>=by-snap) { int snap1 = snap>5 ? snap : 5; int w1 = (br-bx)/4; if (w1 > snap1) w1 = snap1; if (mx>=br-w1) drag |= RIGHT; @@ -1219,12 +1217,12 @@ int Fl_Window_Type::handle(int event) { if (t) { //if (t == selection) return 1; // indicates mouse eaten w/o change if (Fl::event_state(FL_SHIFT)) { - Fl::event_is_click(0); - select(t, !t->selected); + Fl::event_is_click(0); + select(t, !t->selected); } else { - deselect(); - select(t, 1); - if (t->is_menu_item()) t->open(); + deselect(); + select(t, 1); + if (t->is_menu_item()) t->open(); } selection = t; drag = 0; @@ -1257,21 +1255,21 @@ int Fl_Window_Type::handle(int event) { if (!toggle) deselect(); else Fl::event_is_click(0); // select everything in box: for (Fl_Type*i=next; i&&i->level>level; i=i->next) - if (i->is_widget() && !i->is_menu_item()) { - Fl_Widget_Type* myo = (Fl_Widget_Type*)i; - for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) - if (!o1->visible()) goto CONTINUE; - if (Fl::event_inside(myo->o)) selection = myo; - if (myo->o->x()>=x1 && myo->o->y()>y1 && - myo->o->x()+myo->o->w()<mx && myo->o->y()+myo->o->h()<my) { - n++; - select(myo, toggle ? !myo->selected : 1); - } + if (i->is_widget() && !i->is_menu_item()) { + Fl_Widget_Type* myo = (Fl_Widget_Type*)i; + for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent()) + if (!o1->visible()) goto CONTINUE; + if (Fl::event_inside(myo->o)) selection = myo; + if (myo->o->x()>=x1 && myo->o->y()>y1 && + myo->o->x()+myo->o->w()<mx && myo->o->y()+myo->o->h()<my) { + n++; + select(myo, toggle ? !myo->selected : 1); + } CONTINUE:; } // if nothing in box, select what was clicked on: if (!n) { - select(selection, toggle ? !selection->selected : 1); + select(selection, toggle ? !selection->selected : 1); } } drag = 0; @@ -1296,13 +1294,13 @@ int Fl_Window_Type::handle(int event) { Fl_Type *p = i->parent; while (p && p != this) p = p->parent; if (!p || !p->is_widget()) { - i = next; if (!i || i->level <= level) return 0; + i = next; if (!i || i->level <= level) return 0; } p = i; for (;;) { - i = backtab ? i->prev : i->next; - if (!i || i->level <= level) {i = p; break;} - if (i->is_widget() && !i->is_menu_item()) break; + i = backtab ? i->prev : i->next; + if (!i || i->level <= level) {i = p; break;} + if (i->is_widget() && !i->is_menu_item()) break; } deselect(); select(i,1); return 1;} @@ -1521,7 +1519,7 @@ void Fl_Widget_Class_Type::write_code1() { write_c(" clear_flag(16);\n"); write_c(" _%s();\n", trimclassname(name())); write_c("}\n\n"); - + // a constructor that takes size and label from the Fluid database write_c("%s::%s()\n", name(), trimclassname(name())); write_c(" : %s(0, 0, %d, %d, ", c, o->w(), o->h()); @@ -1532,7 +1530,7 @@ void Fl_Widget_Class_Type::write_code1() { write_c(" clear_flag(16);\n"); write_c(" _%s();\n", trimclassname(name())); write_c("}\n\n"); - + write_c("void %s::_%s() {\n", name(), trimclassname(name())); // write_c(" %s *w = this;\n", name()); } else { @@ -1596,8 +1594,3 @@ void Fl_Window_Type::copy_properties() { Fl_Widget_Type::copy_properties(); /// \todo copy resizing constraints over } - - -// -// End of "$Id$". -// diff --git a/fluid/Fluid_Image.cxx b/fluid/Fluid_Image.cxx index d0572d8eb..19784e0e0 100644 --- a/fluid/Fluid_Image.cxx +++ b/fluid/Fluid_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pixmap (and other images) label support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -112,7 +110,7 @@ void Fluid_Image::write_static() { } fclose(f); } - + write_c(";\n"); write_initializer("Fl_JPEG_Image", "\"%s\", %s", fl_filename_name(name()), idata_name); } else { @@ -121,7 +119,7 @@ void Fluid_Image::write_static() { if (image_header_written != write_number) { write_c("#include <FL/Fl_Image.H>\n"); image_header_written = write_number; - } + } write_c("static const unsigned char %s[] =\n", idata_name); const int extra_data = img->ld() ? (img->ld()-img->w()*img->d()) : 0; write_cdata(img->data()[0], (img->w() * img->d() + extra_data) * img->h()); @@ -249,8 +247,3 @@ Fluid_Image *ui_find_image(const char *oldname) { leave_source_dir(); return ret; } - - -// -// End of "$Id$". -// diff --git a/fluid/Fluid_Image.h b/fluid/Fluid_Image.h index f36ec2b1e..7020c14f6 100644 --- a/fluid/Fluid_Image.h +++ b/fluid/Fluid_Image.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Image header file for the Fast Light Tool Kit (FLTK). // // This class stores the image labels for widgets in fluid. This is @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FLUID_IMAGE_H @@ -53,7 +51,3 @@ Fluid_Image *ui_find_image(const char *); extern const char *ui_find_image_name; #endif - -// -// End of "$Id$". -// diff --git a/fluid/Makefile b/fluid/Makefile index 0bb6f515b..ff191601b 100644 --- a/fluid/Makefile +++ b/fluid/Makefile @@ -1,6 +1,4 @@ # -# "$Id$" -# # FLUID makefile for the Fast Light Tool Kit (FLTK). # # Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # include ../makeinclude @@ -135,7 +133,3 @@ rebuild: ./fluid -u -c print_panel.fl ./fluid -u -c template_panel.fl ./fluid -u -c widget_panel.fl - -# -# End of "$Id$". -# diff --git a/fluid/Shortcut_Button.h b/fluid/Shortcut_Button.h index c8a79af37..8726fa654 100644 --- a/fluid/Shortcut_Button.h +++ b/fluid/Shortcut_Button.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Shortcut header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Button.H> @@ -26,7 +24,3 @@ public: Shortcut_Button(int X,int Y,int W,int H, const char* l = 0) : Fl_Button(X,Y,W,H,l) {svalue = 0;} }; - -// -// End of "$Id$". -// diff --git a/fluid/about_panel.cxx b/fluid/about_panel.cxx index d4ef95098..7dc5fadde 100644 --- a/fluid/about_panel.cxx +++ b/fluid/about_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // About dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,15 +9,15 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 #include "about_panel.h" -void show_help(const char *name); +void show_help(const char *name); Fl_Double_Window *about_panel=(Fl_Double_Window *)0; @@ -1563,7 +1561,3 @@ unsigned char fluid_org_png[27580] = /* data inlined from ../documentation/src/f 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,144,206, 240,255,228,188,96,226,178,174,58,106,0,0,0,0,73,69,78,68,174,66,96,130}; - -// -// End of "$Id$". -// diff --git a/fluid/about_panel.fl b/fluid/about_panel.fl index be0003c72..a0a302349 100644 --- a/fluid/about_panel.fl +++ b/fluid/about_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // About dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // } {in_source in_header } @@ -75,9 +73,3 @@ Version x.x.x} data fluid_org_png { comment {Embedded image for internal fluid.html web page.} public local filename {../documentation/src/fluid-org.png} } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/about_panel.h b/fluid/about_panel.h index 2a7c69903..effa7ccb4 100644 --- a/fluid/about_panel.h +++ b/fluid/about_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // About dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -22,7 +20,7 @@ #define about_panel_h #include <FL/Fl.H> #include <time.h> -extern void show_help(const char *name); +extern void show_help(const char *name); #include <FL/Fl_Double_Window.H> #include "../src/flstring.h" extern Fl_Double_Window *about_panel; @@ -32,7 +30,3 @@ extern Fl_Double_Window *about_panel; Fl_Double_Window* make_about_panel(); extern unsigned char fluid_org_png[27580]; #endif - -// -// End of "$Id$". -// diff --git a/fluid/align_widget.cxx b/fluid/align_widget.cxx index 5ba65ea39..7a05b6129 100644 --- a/fluid/align_widget.cxx +++ b/fluid/align_widget.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Alignment code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -29,7 +27,7 @@ #define BREAK_ON_FIRST break //#define BREAK_ON_FIRST -void align_widget_cb(Fl_Widget*, long how) +void align_widget_cb(Fl_Widget*, long how) { const int max = 32768, min = -32768; int left, right, top, bot, wdt, hgt, n; @@ -43,70 +41,70 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()<left) - left = w->x(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()<left) + left = w->x(); + BREAK_ON_FIRST; } if (left!=max) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(left, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(left, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 11: // align h.center left = max; right = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()<left) - left = w->x(); - if (w->x()+w->w()>right) - right = w->x()+w->w(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()<left) + left = w->x(); + if (w->x()+w->w()>right) + right = w->x()+w->w(); + BREAK_ON_FIRST; } if (left!=max) { int center2 = left+right; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } } break; case 12: // align right @@ -114,103 +112,103 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()+w->w()>right) - right = w->x()+w->w(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()+w->w()>right) + right = w->x()+w->w(); + BREAK_ON_FIRST; } if (right!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(right-w->w(), w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(right-w->w(), w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 13: // align top top = max; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()<top) - top = w->y(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()<top) + top = w->y(); + BREAK_ON_FIRST; } if (top!=max) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), top, w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), top, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 14: // align v.center top = max; bot = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()<top) - top = w->y(); - if (w->y()+w->h()>bot) - bot = w->y()+w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()<top) + top = w->y(); + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + BREAK_ON_FIRST; } if (top!=max) { int center2 = top+bot; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } } break; case 15: // align bottom @@ -218,33 +216,33 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()+w->h()>bot) - bot = w->y()+w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + BREAK_ON_FIRST; } if (bot!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), bot-w->h(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), bot-w->h(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; //---- space evently case 20: // space evenly across @@ -252,13 +250,13 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->x()<left) - left = w->x(); - if (w->x()+w->w()>right) - right = w->x()+w->w(); - wdt += w->w(); - n++; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->x()<left) + left = w->x(); + if (w->x()+w->w()>right) + right = w->x()+w->w(); + wdt += w->w(); + n++; } wdt = (right-left)-wdt; n--; @@ -266,28 +264,28 @@ void align_widget_cb(Fl_Widget*, long how) { int cnt = 0, wsum = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - cnt++; - wsum += w->w(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + cnt++; + wsum += w->w(); + } } break; case 21: // space evenly down @@ -295,13 +293,13 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->y()<top) - top = w->y(); - if (w->y()+w->h()>bot) - bot = w->y()+w->h(); - hgt += w->h(); - n++; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->y()<top) + top = w->y(); + if (w->y()+w->h()>bot) + bot = w->y()+w->h(); + hgt += w->h(); + n++; } hgt = (bot-top)-hgt; n--; @@ -309,28 +307,28 @@ void align_widget_cb(Fl_Widget*, long how) { int cnt = 0, hsum = 0; for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - cnt++; - hsum += w->h(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + cnt++; + hsum += w->h(); + } } break; //---- make same size @@ -339,160 +337,160 @@ void align_widget_cb(Fl_Widget*, long how) for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->w()>wdt) - wdt = w->w(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->w()>wdt) + wdt = w->w(); + BREAK_ON_FIRST; } if (wdt!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), w->y(), wdt, w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), w->y(), wdt, w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 31: // same height hgt = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->h()>hgt) - hgt = w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->h()>hgt) + hgt = w->h(); + BREAK_ON_FIRST; } if (hgt!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), w->y(), w->w(), hgt); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), w->y(), w->w(), hgt); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; case 32: // same size hgt = min; wdt = min; for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget()) { - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (w->w()>wdt) - wdt = w->w(); - if (w->h()>hgt) - hgt = w->h(); - BREAK_ON_FIRST; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (w->w()>wdt) + wdt = w->w(); + if (w->h()>hgt) + hgt = w->h(); + BREAK_ON_FIRST; } if (hgt!=min) for (Fl_Type *o = Fl_Type::first; o; o = o->next) - if (o->selected && o->is_widget()) - { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (o->selected && o->is_widget()) + { + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt); - } else { - // Otherwise, just do the widget... - w->resize( w->x(), w->y(), wdt, hgt); - } - w->redraw(); - if (w->window()) w->window()->redraw(); - } + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt); + } else { + // Otherwise, just do the widget... + w->resize( w->x(), w->y(), wdt, hgt); + } + w->redraw(); + if (w->window()) w->window()->redraw(); + } break; //---- center in group case 40: // center hor for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget() && o->parent) { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; - int center2; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; + int center2; - if (w->window() == p) center2 = p->w(); - else center2 = 2*p->x()+p->w(); + if (w->window() == p) center2 = p->w(); + else center2 = 2*p->x()+p->w(); - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button() && !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); - } - w->redraw(); - if (w->window()) w->window()->redraw(); + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button() && !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize((center2-w->w())/2, w->y(), w->w(), w->h()); + } + w->redraw(); + if (w->window()) w->window()->redraw(); } break; case 41: // center vert for (o = Fl_Type::first; o; o = o->next) if (o->selected && o->is_widget() && o->parent) { - if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); - } + if (!changed) { + changed = 1; + set_modflag(1); + undo_checkpoint(); + } - Fl_Widget *w = ((Fl_Widget_Type *)o)->o; - Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; - int center2; + Fl_Widget *w = ((Fl_Widget_Type *)o)->o; + Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o; + int center2; - if (w->window() == p) center2 = p->h(); - else center2 = 2*p->y()+p->h(); + if (w->window() == p) center2 = p->h(); + else center2 = 2*p->y()+p->h(); - if (o->next && o->next->level > o->level && !o->next->selected && - !o->is_menu_button()) { - // When resizing a group, make sure we also move the children... - ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } else { - // Otherwise, just do the widget... - w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); - } - set_modflag(1); - w->redraw(); - if (w->window()) w->window()->redraw(); + if (o->next && o->next->level > o->level && !o->next->selected && + !o->is_menu_button()) { + // When resizing a group, make sure we also move the children... + ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } else { + // Otherwise, just do the widget... + w->resize(w->x(), (center2-w->h())/2, w->w(), w->h()); + } + set_modflag(1); + w->redraw(); + if (w->window()) w->window()->redraw(); } break; } @@ -506,9 +504,9 @@ void widget_size_cb(Fl_Widget *, long size) { for (Fl_Type *o = Fl_Type::first; o; o = o->next) { if (o->selected && o->is_widget()) { if (!changed) { - changed = 1; - set_modflag(1); - undo_checkpoint(); + changed = 1; + set_modflag(1); + undo_checkpoint(); } Fl_Widget *w = ((Fl_Widget_Type *)o)->o; @@ -524,9 +522,3 @@ void widget_size_cb(Fl_Widget *, long size) { } } } - - -// -// End of "$Id$". -// - diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx index 1237f397c..280cec0b6 100644 --- a/fluid/alignment_panel.cxx +++ b/fluid/alignment_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Setting and shell dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -142,7 +140,7 @@ Fl_Double_Window* make_project_window() { } // Fl_Double_Window* project_window return project_window; } -void scheme_cb(Fl_Choice *, void *); +void scheme_cb(Fl_Choice *, void *); Fl_Double_Window *settings_window=(Fl_Double_Window *)0; @@ -543,7 +541,7 @@ Fl_Double_Window* make_layout_window() { /** Copy of all options in user and system mode */ -static int opt[10][2]; +static int opt[10][2]; /** Update the UI using the values in the opt array @@ -631,12 +629,12 @@ void show_global_settings_window() { readPrefs(); refreshUI(); fl_message( - "WARNING!\n\n" - "The following dialog changes the user interface behavior\n" - "of ALL FLTK applications, for the current user, or for \n" - "ALL users on this machine.\n\n" - "Please choose these settings carefully, or reset\n" - "user and system settings to \"default\"."); + "WARNING!\n\n" + "The following dialog changes the user interface behavior\n" + "of ALL FLTK applications, for the current user, or for \n" + "ALL users on this machine.\n\n" + "Please choose these settings carefully, or reset\n" + "user and system settings to \"default\"."); global_settings_window->show(); } @@ -808,11 +806,11 @@ dropping text from other applications still works.\n\nDefault is on."); o->labelfont(2); o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE)); { wGTKText = new Fl_Choice(245, 300, 100, 25, "Native File Chooser uses GTK:"); - wGTKText->tooltip("OPTION_FNFC_USES_GTK\n \nIf \'Native File Chooser uses GTK\' is enable\ -d, the Fl_Native_File_Chooser class\ncalls the GTK open/save file dialogs when\ - they are available on the platfom. If disabled, the Fl_Native_File_Chooser cl\ -ass\nalways uses FLTK\'s own file dialog (i.e., Fl_File_Chooser) even if GTK i\ -s available.\n\nDefault is on."); + wGTKText->tooltip("OPTION_FNFC_USES_GTK\n\nIf \'Native File Chooser uses GTK\' is enabled, the F\ +l_Native_File_Chooser class\ncalls the GTK open/save file dialogs when they ar\ +e available on the platfom. If disabled, the Fl_Native_File_Chooser class\nalw\ +ays uses FLTK\'s own file dialog (i.e., Fl_File_Chooser) even if GTK is availa\ +ble.\n\nDefault is on."); wGTKText->down_box(FL_BORDER_BOX); wGTKText->callback((Fl_Callback*)cb_wGTKText); wGTKText->menu(menu_wGTKText); @@ -854,7 +852,3 @@ ions to specific values (not \'default\')."); Fl::option(Fl::OPTION_SHOW_TOOLTIPS,1); // make sure tooltips are on ! return global_settings_window; } - -// -// End of "$Id$". -// diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl index 2652a451e..7d0300eb1 100644 --- a/fluid/alignment_panel.fl +++ b/fluid/alignment_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // Setting and shell dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // } {in_source in_header } @@ -560,12 +558,12 @@ Function {show_global_settings_window()} {open return_type void readPrefs(); refreshUI(); fl_message( - "WARNING!\\n\\n" - "The following dialog changes the user interface behavior\\n" - "of ALL FLTK applications, for the current user, or for \\n" - "ALL users on this machine.\\n\\n" - "Please choose these settings carefully, or reset\\n" - "user and system settings to \\"default\\"."); + "WARNING!\\n\\n" + "The following dialog changes the user interface behavior\\n" + "of ALL FLTK applications, for the current user, or for \\n" + "ALL users on this machine.\\n\\n" + "Please choose these settings carefully, or reset\\n" + "user and system settings to \\"default\\"."); global_settings_window->show();} {} } @@ -702,7 +700,7 @@ Default is on.} xywh {245 225 100 25} down_box BORDER_BOX callback {int mode = wUserOrSystem->value(); opt[Fl::OPTION_FNFC_USES_GTK ][mode] = wGTKText->value();} open tooltip {OPTION_FNFC_USES_GTK - + If 'Native File Chooser uses GTK' is enabled, the Fl_Native_File_Chooser class calls the GTK open/save file dialogs when they are available on the platfom. If disabled, the Fl_Native_File_Chooser class always uses FLTK's own file dialog (i.e., Fl_File_Chooser) even if GTK is available. @@ -789,9 +787,3 @@ global_settings_window->hide();} code {readPrefs(); Fl::option(Fl::OPTION_SHOW_TOOLTIPS,1); // make sure tooltips are on !} {} } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/alignment_panel.h b/fluid/alignment_panel.h index 5702267f5..c7f4549ae 100644 --- a/fluid/alignment_panel.h +++ b/fluid/alignment_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Setting and shell dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -63,7 +61,7 @@ extern Fl_Input *i18n_function_input; Fl_Double_Window* make_project_window(); extern Fl_Menu_Item menu_i18n_type_chooser[]; extern void i18n_cb(Fl_Choice *,void *); -extern void scheme_cb(Fl_Choice *, void *); +extern void scheme_cb(Fl_Choice *, void *); extern Fl_Double_Window *settings_window; extern void scheme_cb(Fl_Choice*, void*); extern Fl_Choice *scheme_choice; @@ -119,7 +117,3 @@ extern Fl_Menu_Item menu_wGTKText[]; extern Fl_Menu_Item menu_wPrintGTKText[]; extern Fl_Menu_Item menu_wUserOrSystem[]; #endif - -// -// End of "$Id$". -// diff --git a/fluid/code.cxx b/fluid/code.cxx index c9d63e1b5..b782ee35f 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code output routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -197,35 +195,35 @@ void write_cstring(const char *s, int length) { // else fall through: default: if (c >= ' ' && c < 127) { - // a legal ASCII character - if (linelength >= 78) {fputs("\\\n",code_file); linelength = 0;} - putc(c, code_file); - linelength++; - break; + // a legal ASCII character + if (linelength >= 78) {fputs("\\\n",code_file); linelength = 0;} + putc(c, code_file); + linelength++; + break; } // otherwise we must print it as an octal constant: c &= 255; if (c < 8) { - if (linelength >= 76) {fputs("\\\n",code_file); linelength = 0;} - fprintf(code_file, "\\%o",c); - linelength += 2; + if (linelength >= 76) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 2; } else if (c < 64) { - if (linelength >= 75) {fputs("\\\n",code_file); linelength = 0;} - fprintf(code_file, "\\%o",c); - linelength += 3; + if (linelength >= 75) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 3; } else { - if (linelength >= 74) {fputs("\\\n",code_file); linelength = 0;} - fprintf(code_file, "\\%o",c); - linelength += 4; + if (linelength >= 74) {fputs("\\\n",code_file); linelength = 0;} + fprintf(code_file, "\\%o",c); + linelength += 4; } // We must not put more numbers after it, because some C compilers // consume them as part of the quoted sequence. Use string constant // pasting to avoid this: c = *p; if (p < e && ( (c>='0'&&c<='9') || (c>='a'&&c<='f') || (c>='A'&&c<='F') )) { - putc('\"', code_file); linelength++; - if (linelength >= 79) {fputs("\n",code_file); linelength = 0;} - putc('\"', code_file); linelength++; + putc('\"', code_file); linelength++; + if (linelength >= 79) {fputs("\n",code_file); linelength = 0;} + putc('\"', code_file); linelength++; } break; } @@ -318,22 +316,22 @@ static Fl_Type* write_code(Fl_Type* p) { if (strcmp(q->type_name(), "Function")) q = write_code(q); else { int level = q->level; - do { - q = q->next; - } while (q && q->level > level); + do { + q = q->next; + } while (q && q->level > level); } } - // write all code that come after the children + // write all code that come after the children p->write_code2(); for (q = p->next; q && q->level > p->level;) { if (!strcmp(q->type_name(), "Function")) q = write_code(q); else { int level = q->level; - do { - q = q->next; - } while (q && q->level > level); + do { + q = q->next; + } while (q && q->level > level); } } @@ -341,7 +339,7 @@ static Fl_Type* write_code(Fl_Type* p) { current_widget_class = 0L; } else { for (q = p->next; q && q->level > p->level;) q = write_code(q); - // write all code that come after the children + // write all code that come after the children p->write_code2(); } if (write_sourceview) { @@ -357,7 +355,7 @@ extern Fl_Class_Type *current_class; int write_code(const char *s, const char *t) { const char *filemode = "w"; - if (write_sourceview) + if (write_sourceview) filemode = "wb"; write_number++; delete id_root; id_root = 0; @@ -376,7 +374,7 @@ int write_code(const char *s, const char *t) { if (!f) {fclose(code_file); return 0;} header_file = f; } - // if the first entry in the Type tree is a comment, then it is probably + // if the first entry in the Type tree is a comment, then it is probably // a copyright notice. We print that before anything else in the file! Fl_Type* first_type = Fl_Type::first; if (first_type && first_type->is_comment()) { @@ -406,7 +404,7 @@ int write_code(const char *s, const char *t) { *b = 0; fprintf(header_file, "#ifndef %s\n", define_name); fprintf(header_file, "#define %s\n", define_name); - } + } write_declare("#include <FL/Fl.H>"); if (i18n_type && i18n_include[0]) { @@ -420,7 +418,7 @@ int write_code(const char *s, const char *t) { else { write_c("// Initialize I18N stuff now for menus...\n"); write_c("#include <locale.h>\n"); - write_c("static char *_locale = setlocale(LC_MESSAGES, \"\");\n"); + write_c("static char *_locale = setlocale(LC_MESSAGES, \"\");\n"); write_c("static nl_catd _catalog = catopen(\"%s\", 0);\n", i18n_program); } @@ -490,110 +488,110 @@ int write_strings(const char *sfile) { switch (i18n_type) { case 0 : /* None, just put static text out */ fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", - FL_VERSION); + FL_VERSION); for (p = Fl_Type::first; p; p = p->next) { if (p->is_widget()) { - w = (Fl_Widget_Type *)p; - - if (w->label()) { - for (const char *s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + w = (Fl_Widget_Type *)p; + + if (w->label()) { + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); putc('\n', fp); - } - - if (w->tooltip()) { - for (const char *s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + } + + if (w->tooltip()) { + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); putc('\n', fp); - } - } + } + } } break; case 1 : /* GNU gettext, put a .po file out */ fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n", - FL_VERSION); + FL_VERSION); for (p = Fl_Type::first; p; p = p->next) { if (p->is_widget()) { - w = (Fl_Widget_Type *)p; + w = (Fl_Widget_Type *)p; - if (w->label()) { - const char *s; + if (w->label()) { + const char *s; - fputs("msgid \"", fp); - for (s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgid \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - fputs("msgstr \"", fp); - for (s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgstr \"", fp); + for (s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } + } - if (w->tooltip()) { - const char *s; + if (w->tooltip()) { + const char *s; - fputs("msgid \"", fp); - for (s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgid \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - fputs("msgstr \"", fp); - for (s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + fputs("msgstr \"", fp); + for (s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } - } + } + } } break; case 2 : /* POSIX catgets, put a .msg file out */ fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n", - FL_VERSION); + FL_VERSION); fprintf(fp, "$set %s\n", i18n_set); fputs("$quote \"\n", fp); for (i = 1, p = Fl_Type::first; p; p = p->next) { if (p->is_widget()) { - w = (Fl_Widget_Type *)p; - - if (w->label()) { - fprintf(fp, "%d \"", i ++); - for (const char *s = w->label(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + w = (Fl_Widget_Type *)p; + + if (w->label()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->label(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } - - if (w->tooltip()) { - fprintf(fp, "%d \"", i ++); - for (const char *s = w->tooltip(); *s; s ++) - if (*s < 32 || *s > 126 || *s == '\"') - fprintf(fp, "\\%03o", *s); - else - putc(*s, fp); + } + + if (w->tooltip()) { + fprintf(fp, "%d \"", i ++); + for (const char *s = w->tooltip(); *s; s ++) + if (*s < 32 || *s > 126 || *s == '\"') + fprintf(fp, "\\%03o", *s); + else + putc(*s, fp); fputs("\"\n", fp); - } - } + } + } } break; } @@ -609,7 +607,3 @@ void Fl_Type::write_code1() { write_c("// Code for %s\n", title()); } void Fl_Type::write_code2() {} - -// -// End of "$Id$". -// diff --git a/fluid/comments.h b/fluid/comments.h index fa9298b27..708089ed8 100644 --- a/fluid/comments.h +++ b/fluid/comments.h @@ -49,25 +49,19 @@ static const char * const comment_text[] = { "// Copyright (C) YYYY NameOfAuthor\n" "//", // FLTK/Header - "//\n" - "// \"$Id$\"\n" "//\n" "// ... for the Fast Light Tool Kit (FLTK).\n" "//\n" - "// Copyright 1998-2010 by Bill Spitzak and others.\n" + "// Copyright 1998-2020 by Bill Spitzak and others.\n" "//\n" "// This library is free software. Distribution and use rights are outlined in\n" "// the file \"COPYING\" which should have been included with this file. If this\n" "// file is missing or damaged, see the license at:\n" "//\n" - "// http://www.fltk.org/COPYING.php\n" + "// https://www.fltk.org/COPYING.php\n" "//\n" - "// Please report all bugs and problems on the following page:\n" + "// Please see the following page on how to report bugs and issues:\n" "//\n" - "// http://www.fltk.org/str.php\n" - "//\n", - // FLTK/Footer - "\n//\n" - "// End of \"$Id$\".\n" - "//", -}; + "// https://www.fltk.org/bugs.php\n" + "//\n" + }; diff --git a/fluid/factory.cxx b/fluid/factory.cxx index cd7c53c9e..23f903498 100644 --- a/fluid/factory.cxx +++ b/fluid/factory.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget factory code for the Fast Light Tool Kit (FLTK). // // Type classes for most of the fltk widgets. Most of the work @@ -17,11 +15,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -204,8 +202,8 @@ public: if (!batch_mode) { char buffer[20]; for (int i = 1; i <= 20; i++) { - sprintf(buffer,"Browser Line %d",i); - b->add(buffer); + sprintf(buffer,"Browser Line %d",i); + b->add(buffer); } } return b; @@ -252,8 +250,8 @@ public: if (!batch_mode) { char buffer[20]; for (int i = 1; i <= 20; i++) { - sprintf(buffer,"Browser Line %d",i); - b->add(buffer); + sprintf(buffer,"Browser Line %d",i); + b->add(buffer); } } return b; @@ -399,7 +397,7 @@ public: w -= Fl::box_dw(o->box()); int ww = (int)fl_width('m'); w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()) + h / 2; - if (w < 40) w = 40 ; + if (w < 40) w = 40 ; } virtual const char *type_name() {return "Fl_Spinner";} virtual const char *alt_type_name() {return "fltk::Spinner";} @@ -1145,125 +1143,125 @@ Fl_Type *Fl_Type_make(const char *tn) { struct symbol {const char *name; int value;}; static symbol table[] = { - {"BLACK", FL_BLACK}, - {"RED", FL_RED}, - {"GREEN", FL_GREEN}, - {"YELLOW", FL_YELLOW}, - {"BLUE", FL_BLUE}, - {"MAGENTA", FL_MAGENTA}, - {"CYAN", FL_CYAN}, - {"WHITE", FL_WHITE}, - - {"LCOL", FL_BLACK}, - {"COL1", FL_GRAY}, - {"MCOL", FL_LIGHT1}, - {"LEFT_BCOL", FL_LIGHT3}, - {"TOP_BCOL", FL_LIGHT2}, - {"BOTTOM_BCOL", FL_DARK2}, - {"RIGHT_BCOL", FL_DARK3}, - {"INACTIVE", FL_INACTIVE_COLOR}, - {"INACTIVE_COL", FL_INACTIVE_COLOR}, - {"FREE_COL1", FL_FREE_COLOR}, - {"FREE_COL2", FL_FREE_COLOR+1}, - {"FREE_COL3", FL_FREE_COLOR+2}, - {"FREE_COL4", FL_FREE_COLOR+3}, - {"FREE_COL5", FL_FREE_COLOR+4}, - {"FREE_COL6", FL_FREE_COLOR+5}, - {"FREE_COL7", FL_FREE_COLOR+6}, - {"FREE_COL8", FL_FREE_COLOR+7}, - {"FREE_COL9", FL_FREE_COLOR+8}, - {"FREE_COL10", FL_FREE_COLOR+9}, - {"FREE_COL11", FL_FREE_COLOR+10}, - {"FREE_COL12", FL_FREE_COLOR+11}, - {"FREE_COL13", FL_FREE_COLOR+12}, - {"FREE_COL14", FL_FREE_COLOR+13}, - {"FREE_COL15", FL_FREE_COLOR+14}, - {"FREE_COL16", FL_FREE_COLOR+15}, - {"TOMATO", 131}, - {"INDIANRED", 164}, - {"SLATEBLUE", 195}, - {"DARKGOLD", 84}, - {"PALEGREEN", 157}, - {"ORCHID", 203}, - {"DARKCYAN", 189}, - {"DARKTOMATO", 113}, - {"WHEAT", 174}, - {"ALIGN_CENTER", FL_ALIGN_CENTER}, - {"ALIGN_TOP", FL_ALIGN_TOP}, - {"ALIGN_BOTTOM", FL_ALIGN_BOTTOM}, - {"ALIGN_LEFT", FL_ALIGN_LEFT}, - {"ALIGN_RIGHT", FL_ALIGN_RIGHT}, - {"ALIGN_INSIDE", FL_ALIGN_INSIDE}, - {"ALIGN_TOP_LEFT", FL_ALIGN_TOP | FL_ALIGN_LEFT}, - {"ALIGN_TOP_RIGHT", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, - {"ALIGN_BOTTOM_LEFT", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, - {"ALIGN_BOTTOM_RIGHT", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, - {"ALIGN_CENTER|FL_ALIGN_INSIDE", FL_ALIGN_CENTER|FL_ALIGN_INSIDE}, - {"ALIGN_TOP|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_INSIDE}, - {"ALIGN_BOTTOM|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE}, - {"ALIGN_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, - {"ALIGN_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, - {"ALIGN_INSIDE|FL_ALIGN_INSIDE", FL_ALIGN_INSIDE|FL_ALIGN_INSIDE}, - {"ALIGN_TOP_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, - {"ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, - {"ALIGN_BOTTOM_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"BLACK", FL_BLACK}, + {"RED", FL_RED}, + {"GREEN", FL_GREEN}, + {"YELLOW", FL_YELLOW}, + {"BLUE", FL_BLUE}, + {"MAGENTA", FL_MAGENTA}, + {"CYAN", FL_CYAN}, + {"WHITE", FL_WHITE}, + + {"LCOL", FL_BLACK}, + {"COL1", FL_GRAY}, + {"MCOL", FL_LIGHT1}, + {"LEFT_BCOL", FL_LIGHT3}, + {"TOP_BCOL", FL_LIGHT2}, + {"BOTTOM_BCOL", FL_DARK2}, + {"RIGHT_BCOL", FL_DARK3}, + {"INACTIVE", FL_INACTIVE_COLOR}, + {"INACTIVE_COL", FL_INACTIVE_COLOR}, + {"FREE_COL1", FL_FREE_COLOR}, + {"FREE_COL2", FL_FREE_COLOR+1}, + {"FREE_COL3", FL_FREE_COLOR+2}, + {"FREE_COL4", FL_FREE_COLOR+3}, + {"FREE_COL5", FL_FREE_COLOR+4}, + {"FREE_COL6", FL_FREE_COLOR+5}, + {"FREE_COL7", FL_FREE_COLOR+6}, + {"FREE_COL8", FL_FREE_COLOR+7}, + {"FREE_COL9", FL_FREE_COLOR+8}, + {"FREE_COL10", FL_FREE_COLOR+9}, + {"FREE_COL11", FL_FREE_COLOR+10}, + {"FREE_COL12", FL_FREE_COLOR+11}, + {"FREE_COL13", FL_FREE_COLOR+12}, + {"FREE_COL14", FL_FREE_COLOR+13}, + {"FREE_COL15", FL_FREE_COLOR+14}, + {"FREE_COL16", FL_FREE_COLOR+15}, + {"TOMATO", 131}, + {"INDIANRED", 164}, + {"SLATEBLUE", 195}, + {"DARKGOLD", 84}, + {"PALEGREEN", 157}, + {"ORCHID", 203}, + {"DARKCYAN", 189}, + {"DARKTOMATO", 113}, + {"WHEAT", 174}, + {"ALIGN_CENTER", FL_ALIGN_CENTER}, + {"ALIGN_TOP", FL_ALIGN_TOP}, + {"ALIGN_BOTTOM", FL_ALIGN_BOTTOM}, + {"ALIGN_LEFT", FL_ALIGN_LEFT}, + {"ALIGN_RIGHT", FL_ALIGN_RIGHT}, + {"ALIGN_INSIDE", FL_ALIGN_INSIDE}, + {"ALIGN_TOP_LEFT", FL_ALIGN_TOP | FL_ALIGN_LEFT}, + {"ALIGN_TOP_RIGHT", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, + {"ALIGN_BOTTOM_LEFT", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, + {"ALIGN_BOTTOM_RIGHT", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, + {"ALIGN_CENTER|FL_ALIGN_INSIDE", FL_ALIGN_CENTER|FL_ALIGN_INSIDE}, + {"ALIGN_TOP|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_INSIDE}, + {"ALIGN_BOTTOM|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE}, + {"ALIGN_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"ALIGN_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, + {"ALIGN_INSIDE|FL_ALIGN_INSIDE", FL_ALIGN_INSIDE|FL_ALIGN_INSIDE}, + {"ALIGN_TOP_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, + {"ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, + {"ALIGN_BOTTOM_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_INSIDE}, {"ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE",FL_ALIGN_BOTTOM|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE}, - {"ALIGN_LEFT_TOP", FL_ALIGN_TOP | FL_ALIGN_LEFT}, - {"ALIGN_RIGHT_TOP", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, - {"ALIGN_LEFT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, - {"ALIGN_RIGHT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, - {"INVALID_STYLE", 255}, - {"NORMAL_STYLE", FL_HELVETICA}, - {"BOLD_STYLE", FL_HELVETICA|FL_BOLD}, - {"ITALIC_STYLE", FL_HELVETICA|FL_ITALIC}, - {"BOLDITALIC_STYLE", FL_HELVETICA|FL_BOLD|FL_ITALIC}, - {"FIXED_STYLE", FL_COURIER}, - {"FIXEDBOLD_STYLE", FL_COURIER|FL_BOLD}, - {"FIXEDITALIC_STYLE", FL_COURIER|FL_ITALIC}, - {"FIXEDBOLDITALIC_STYLE", FL_COURIER|FL_BOLD|FL_ITALIC}, - {"TIMES_STYLE", FL_TIMES}, - {"TIMESBOLD_STYLE", FL_TIMES|FL_BOLD}, - {"TIMESITALIC_STYLE", FL_TIMES|FL_ITALIC}, - {"TIMESBOLDITALIC_STYLE", FL_TIMES|FL_BOLD|FL_ITALIC}, - {"SHADOW_STYLE", (_FL_SHADOW_LABEL<<8)}, - {"ENGRAVED_STYLE", (_FL_ENGRAVED_LABEL<<8)}, - {"EMBOSSED_STYLE", (_FL_EMBOSSED_LABEL<<0)}, - {"TINY_SIZE", 8}, - {"SMALL_SIZE", 11}, - {"NORMAL_SIZE", FL_NORMAL_SIZE}, - {"MEDIUM_SIZE", 18}, - {"LARGE_SIZE", 24}, - {"HUGE_SIZE", 32}, - {"DEFAULT_SIZE", FL_NORMAL_SIZE}, - {"TINY_FONT", 8}, - {"SMALL_FONT", 11}, - {"NORMAL_FONT", FL_NORMAL_SIZE}, - {"MEDIUM_FONT", 18}, - {"LARGE_FONT", 24}, - {"HUGE_FONT", 32}, - {"NORMAL_FONT1", 11}, - {"NORMAL_FONT2", FL_NORMAL_SIZE}, - {"DEFAULT_FONT", 11}, - {"RETURN_END_CHANGED", 0}, - {"RETURN_CHANGED", 1}, - {"RETURN_END", 2}, - {"RETURN_ALWAYS", 3}, - {"PUSH_BUTTON", FL_TOGGLE_BUTTON}, - {"RADIO_BUTTON", FL_RADIO_BUTTON}, - {"HIDDEN_BUTTON", FL_HIDDEN_BUTTON}, - {"SELECT_BROWSER", FL_SELECT_BROWSER}, - {"HOLD_BROWSER", FL_HOLD_BROWSER}, - {"MULTI_BROWSER", FL_MULTI_BROWSER}, - {"SIMPLE_COUNTER", FL_SIMPLE_COUNTER}, - {"LINE_DIAL", FL_LINE_DIAL}, - {"FILL_DIAL", FL_FILL_DIAL}, - {"VERT_SLIDER", FL_VERT_SLIDER}, - {"HOR_SLIDER", FL_HOR_SLIDER}, - {"VERT_FILL_SLIDER", FL_VERT_FILL_SLIDER}, - {"HOR_FILL_SLIDER", FL_HOR_FILL_SLIDER}, - {"VERT_NICE_SLIDER", FL_VERT_NICE_SLIDER}, - {"HOR_NICE_SLIDER", FL_HOR_NICE_SLIDER}, + {"ALIGN_LEFT_TOP", FL_ALIGN_TOP | FL_ALIGN_LEFT}, + {"ALIGN_RIGHT_TOP", FL_ALIGN_TOP | FL_ALIGN_RIGHT}, + {"ALIGN_LEFT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT}, + {"ALIGN_RIGHT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT}, + {"INVALID_STYLE", 255}, + {"NORMAL_STYLE", FL_HELVETICA}, + {"BOLD_STYLE", FL_HELVETICA|FL_BOLD}, + {"ITALIC_STYLE", FL_HELVETICA|FL_ITALIC}, + {"BOLDITALIC_STYLE", FL_HELVETICA|FL_BOLD|FL_ITALIC}, + {"FIXED_STYLE", FL_COURIER}, + {"FIXEDBOLD_STYLE", FL_COURIER|FL_BOLD}, + {"FIXEDITALIC_STYLE", FL_COURIER|FL_ITALIC}, + {"FIXEDBOLDITALIC_STYLE", FL_COURIER|FL_BOLD|FL_ITALIC}, + {"TIMES_STYLE", FL_TIMES}, + {"TIMESBOLD_STYLE", FL_TIMES|FL_BOLD}, + {"TIMESITALIC_STYLE", FL_TIMES|FL_ITALIC}, + {"TIMESBOLDITALIC_STYLE", FL_TIMES|FL_BOLD|FL_ITALIC}, + {"SHADOW_STYLE", (_FL_SHADOW_LABEL<<8)}, + {"ENGRAVED_STYLE", (_FL_ENGRAVED_LABEL<<8)}, + {"EMBOSSED_STYLE", (_FL_EMBOSSED_LABEL<<0)}, + {"TINY_SIZE", 8}, + {"SMALL_SIZE", 11}, + {"NORMAL_SIZE", FL_NORMAL_SIZE}, + {"MEDIUM_SIZE", 18}, + {"LARGE_SIZE", 24}, + {"HUGE_SIZE", 32}, + {"DEFAULT_SIZE", FL_NORMAL_SIZE}, + {"TINY_FONT", 8}, + {"SMALL_FONT", 11}, + {"NORMAL_FONT", FL_NORMAL_SIZE}, + {"MEDIUM_FONT", 18}, + {"LARGE_FONT", 24}, + {"HUGE_FONT", 32}, + {"NORMAL_FONT1", 11}, + {"NORMAL_FONT2", FL_NORMAL_SIZE}, + {"DEFAULT_FONT", 11}, + {"RETURN_END_CHANGED", 0}, + {"RETURN_CHANGED", 1}, + {"RETURN_END", 2}, + {"RETURN_ALWAYS", 3}, + {"PUSH_BUTTON", FL_TOGGLE_BUTTON}, + {"RADIO_BUTTON", FL_RADIO_BUTTON}, + {"HIDDEN_BUTTON", FL_HIDDEN_BUTTON}, + {"SELECT_BROWSER", FL_SELECT_BROWSER}, + {"HOLD_BROWSER", FL_HOLD_BROWSER}, + {"MULTI_BROWSER", FL_MULTI_BROWSER}, + {"SIMPLE_COUNTER", FL_SIMPLE_COUNTER}, + {"LINE_DIAL", FL_LINE_DIAL}, + {"FILL_DIAL", FL_FILL_DIAL}, + {"VERT_SLIDER", FL_VERT_SLIDER}, + {"HOR_SLIDER", FL_HOR_SLIDER}, + {"VERT_FILL_SLIDER", FL_VERT_FILL_SLIDER}, + {"HOR_FILL_SLIDER", FL_HOR_FILL_SLIDER}, + {"VERT_NICE_SLIDER", FL_VERT_NICE_SLIDER}, + {"HOR_NICE_SLIDER", FL_HOR_NICE_SLIDER}, }; #include <stdlib.h> @@ -1275,7 +1273,3 @@ int lookup_symbol(const char *name, int &v, int numberok) { if (numberok && ((v = atoi(name)) || !strcmp(name,"0"))) return 1; return 0; } - -// -// End of "$Id$". -// diff --git a/fluid/file.cxx b/fluid/file.cxx index 65c4131bb..dd2ef345c 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fluid file routines for the Fast Light Tool Kit (FLTK). // // You may find the basic read_* and write_* routines to @@ -14,11 +12,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -171,7 +169,7 @@ static int hexdigit(int x) { } -static int read_quoted() { // read whatever character is after a \ . +static int read_quoted() { // read whatever character is after a \ . int c,d,x; switch(c = fgetc(fin)) { case '\n': lineno++; return -1; @@ -182,7 +180,7 @@ static int read_quoted() { // read whatever character is after a \ . case 'r' : return('\r'); case 't' : return('\t'); case 'v' : return('\v'); - case 'x' : /* read hex */ + case 'x' : /* read hex */ for (c=x=0; x<3; x++) { int ch = fgetc(fin); d = hexdigit(ch); @@ -190,7 +188,7 @@ static int read_quoted() { // read whatever character is after a \ . c = (c<<4)+d; } break; - default: /* read octal */ + default: /* read octal */ if (c<'0' || c>'7') break; c -= '0'; for (x=0; x<2; x++) { @@ -208,9 +206,9 @@ static int read_quoted() { // read whatever character is after a \ . // This will skip all comments (# to end of line), and evaluate // all \xxx sequences and use \ at the end of line to remove the newline. // A word is any one of: -// a continuous string of non-space chars except { and } and # -// everything between matching {...} (unless wantbrace != 0) -// the characters '{' and '}' +// a continuous string of non-space chars except { and } and # +// everything between matching {...} (unless wantbrace != 0) +// the characters '{' and '}' static char *buffer; static int buflen; @@ -233,9 +231,9 @@ const char *read_word(int wantbrace) { // skip all the whitespace before it: for (;;) { x = getc(fin); - if (x < 0 && feof(fin)) { // eof + if (x < 0 && feof(fin)) { // eof return 0; - } else if (x == '#') { // comment + } else if (x == '#') { // comment do x = getc(fin); while (x >= 0 && x != '\n'); lineno++; continue; @@ -257,9 +255,9 @@ const char *read_word(int wantbrace) { x = getc(fin); if (x<0) {read_error("Missing '}'"); break;} else if (x == '#') { // embedded comment - do x = getc(fin); while (x >= 0 && x != '\n'); - lineno++; - continue; + do x = getc(fin); while (x >= 0 && x != '\n'); + lineno++; + continue; } else if (x == '\n') lineno++; else if (x == '\\') {x = read_quoted(); if (x<0) continue;} else if (x == '{') nesting++; @@ -312,7 +310,7 @@ extern const char* code_file_name; int write_file(const char *filename, int selected_only) { if (!open_write(filename)) return 0; write_string("# data file for the Fltk User Interface Designer (fluid)\n" - "version %.4f",FL_VERSION); + "version %.4f",FL_VERSION); if(!include_H_from_C) write_string("\ndo_not_include_H_from_C"); if(use_FL_COMMAND) @@ -322,11 +320,11 @@ int write_file(const char *filename, int selected_only) { write_string("\ni18n_include %s", i18n_include); switch (i18n_type) { case 1 : /* GNU gettext */ - write_string("\ni18n_function %s", i18n_function); + write_string("\ni18n_function %s", i18n_function); break; case 2 : /* POSIX catgets */ if (i18n_file[0]) write_string("\ni18n_file %s", i18n_file); - write_string("\ni18n_set %s", i18n_set); + write_string("\ni18n_set %s", i18n_set); break; } } @@ -487,7 +485,7 @@ static void read_children(Fl_Type *p, int paste) { } Fl_Type::current = p; - + CONTINUE:; } } @@ -612,35 +610,31 @@ void read_fdesign() { } else if (!strcmp(name,"class")) { if (!strcmp(value,"FL_BEGIN_GROUP")) { - group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group"); - Fl_Type::current = group; + group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group"); + Fl_Type::current = group; } else if (!strcmp(value,"FL_END_GROUP")) { - if (group) { - Fl_Group* g = (Fl_Group*)(group->o); - g->begin(); - g->forms_end(); - Fl_Group::current(0); - } - group = widget = 0; - Fl_Type::current = window; + if (group) { + Fl_Group* g = (Fl_Group*)(group->o); + g->begin(); + g->forms_end(); + Fl_Group::current(0); + } + group = widget = 0; + Fl_Type::current = window; } else { - for (int i = 0; class_matcher[i]; i += 2) - if (!strcmp(value,class_matcher[i])) { - value = class_matcher[i+1]; break;} - widget = (Fl_Widget_Type*)Fl_Type_make(value); - if (!widget) { - printf("class %s not found, using Fl_Button\n", value); - widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button"); - } + for (int i = 0; class_matcher[i]; i += 2) + if (!strcmp(value,class_matcher[i])) { + value = class_matcher[i+1]; break;} + widget = (Fl_Widget_Type*)Fl_Type_make(value); + if (!widget) { + printf("class %s not found, using Fl_Button\n", value); + widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button"); + } } } else if (widget) { if (!widget->read_fdesign(name, value)) - printf("Ignoring \"%s: %s\"\n", name, value); + printf("Ignoring \"%s: %s\"\n", name, value); } } } - -// -// End of "$Id$". -// diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 8db15bfca..5155c7fd7 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID main entry for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -81,7 +79,7 @@ extern "C" // static Fl_Help_Dialog *help_dialog = 0; -Fl_Preferences fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid"); +Fl_Preferences fluid_prefs(Fl_Preferences::USER, "fltk.org", "fluid"); int gridx = 5; int gridy = 5; int snap = 1; @@ -93,14 +91,14 @@ char G_external_editor_command[512]; int show_coredevmenus = 1; // File history info... -char absolute_history[10][FL_PATH_MAX]; -char relative_history[10][FL_PATH_MAX]; +char absolute_history[10][FL_PATH_MAX]; +char relative_history[10][FL_PATH_MAX]; -void load_history(); -void update_history(const char *); +void load_history(); +void update_history(const char *); // Shell command support... -void show_shell_window(); +void show_shell_window(); Fl_Menu_Item *save_item = 0L; Fl_Menu_Item *history_item = 0L; @@ -201,7 +199,7 @@ static void external_editor_timer(void*) { if ( p->is_code() ) { Fl_Code_Type *code = (Fl_Code_Type*)p; // Code changed by external editor? - if ( code->handle_editor_changes() ) { // updates ram, file size/mtime + if ( code->handle_editor_changes() ) { // updates ram, file size/mtime modified++; } if ( code->is_editing() ) { // editor open? @@ -225,7 +223,7 @@ static void external_editor_timer(void*) { void save_cb(Fl_Widget *, void *v) { Fl_Native_File_Chooser fnfc; const char *c = filename; - if (v || !c || !*c) { + if (v || !c || !*c) { fnfc.title("Save To:"); fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); fnfc.filter("FLUID Files\t*.f[ld]"); @@ -244,7 +242,7 @@ void save_cb(Fl_Widget *, void *v) { if (fl_choice("The file \"%s\" already exists.\n" "Do you want to replace it?", "Cancel", - "Replace", NULL, basename) == 0) return; + "Replace", NULL, basename) == 0) return; } if (v != (void *)2) set_filename(c); @@ -318,7 +316,7 @@ void save_template_cb(Fl_Widget *, void *) { if (!fl_access(filename, 0)) { if (fl_choice("The template \"%s\" already exists.\n" "Do you want to replace it?", "Cancel", - "Replace", NULL, c) == 0) return; + "Replace", NULL, c) == 0) return; } if (!write_file(filename)) { @@ -417,7 +415,7 @@ void exit_cb(Fl_Widget *,void *) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } save_position(main_window,"main_window_pos"); @@ -464,7 +462,7 @@ apple_open_cb(const char *c) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } } const char *oldfilename; @@ -499,7 +497,7 @@ void open_cb(Fl_Widget *, void *v) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } } const char *c; @@ -547,7 +545,7 @@ void open_history_cb(Fl_Widget *, void *v) { return; case 1 : /* Save */ save_cb(NULL, NULL); - if (modflag) return; // Didn't save! + if (modflag) return; // Didn't save! } } const char *oldfilename = filename; @@ -643,30 +641,30 @@ void new_from_template_cb(Fl_Widget *w, void *v) { FILE *infile, *outfile; if ((infile = fl_fopen(tname, "r")) == NULL) { - fl_alert("Error reading template file \"%s\":\n%s", tname, - strerror(errno)); - set_modflag(0); - undo_clear(); - return; + fl_alert("Error reading template file \"%s\":\n%s", tname, + strerror(errno)); + set_modflag(0); + undo_clear(); + return; } if ((outfile = fl_fopen(cutfname(1), "w")) == NULL) { - fl_alert("Error writing buffer file \"%s\":\n%s", cutfname(1), - strerror(errno)); - fclose(infile); - set_modflag(0); - undo_clear(); - return; + fl_alert("Error writing buffer file \"%s\":\n%s", cutfname(1), + strerror(errno)); + fclose(infile); + set_modflag(0); + undo_clear(); + return; } while (fgets(line, sizeof(line), infile)) { - // Replace @INSTANCE@ with the instance name... - for (ptr = line; (next = strstr(ptr, "@INSTANCE@")) != NULL; ptr = next + 10) { - fwrite(ptr, next - ptr, 1, outfile); - fputs(iname, outfile); - } + // Replace @INSTANCE@ with the instance name... + for (ptr = line; (next = strstr(ptr, "@INSTANCE@")) != NULL; ptr = next + 10) { + fwrite(ptr, next - ptr, 1, outfile); + fputs(iname, outfile); + } - fputs(ptr, outfile); + fputs(ptr, outfile); } fclose(infile); @@ -689,10 +687,10 @@ void new_from_template_cb(Fl_Widget *w, void *v) { } int exit_early = 0; -int update_file = 0; // fluid -u -int compile_file = 0; // fluid -c -int compile_strings = 0; // fluic -cs -int batch_mode = 0; // if set (-c, -u) don't open display +int update_file = 0; // fluid -u +int compile_file = 0; // fluid -c +int compile_strings = 0; // fluic -cs +int batch_mode = 0; // if set (-c, -u) don't open display int header_file_set = 0; int code_file_set = 0; const char* header_file_name = ".h"; @@ -897,8 +895,8 @@ void about_cb(Fl_Widget *, void *) { } void show_help(const char *name) { - const char *docdir; - char helpname[FL_PATH_MAX]; + const char *docdir; + char helpname[FL_PATH_MAX]; if (!help_dialog) help_dialog = new Fl_Help_Dialog(); @@ -973,12 +971,12 @@ void manual_cb(Fl_Widget *, void *) { void print_menu_cb(Fl_Widget *, void *) { int w, h, ww, hh; int frompage, topage; - Fl_Type *t; // Current widget - int num_windows; // Number of windows - Fl_Window_Type *windows[1000]; // Windows to print - int winpage; // Current window page + Fl_Type *t; // Current widget + int num_windows; // Number of windows + Fl_Window_Type *windows[1000]; // Windows to print + int winpage; // Current window page Fl_Window *win; - + for (t = Fl_Type::first, num_windows = 0; t; t = t->next) { if (t->is_window()) { windows[num_windows] = (Fl_Window_Type *)t; @@ -986,7 +984,7 @@ void print_menu_cb(Fl_Widget *, void *) { num_windows ++; } } - + Fl_Printer printjob; if ( printjob.start_job(num_windows, &frompage, &topage) ) return; int pagecount = 0; @@ -1006,13 +1004,13 @@ void print_menu_cb(Fl_Widget *, void *) { sprintf(date, "%d/%d", ++pagecount, topage-frompage+1); fl_draw(date, w - (int)fl_width(date), fl_height()); // Get the base filename... - const char *basename = strrchr(filename, + const char *basename = strrchr(filename, #ifdef _WIN32 - '\\' + '\\' #else - '/' + '/' #endif - ); + ); if (basename) basename ++; else basename = filename; sprintf(date, "%s", basename); @@ -1257,8 +1255,8 @@ void make_main_window() { // Load file history from preferences... void load_history() { - int i; // Looping var - int max_files; + int i; // Looping var + int max_files; fluid_prefs.get("recent_files", max_files, 5); @@ -1284,9 +1282,9 @@ void load_history() { // Update file history from preferences... void update_history(const char *flname) { - int i; // Looping var - char absolute[FL_PATH_MAX]; - int max_files; + int i; // Looping var + char absolute[FL_PATH_MAX]; + int max_files; fluid_prefs.get("recent_files", max_files, 5); @@ -1343,8 +1341,8 @@ public: ~Fl_Process() {if (_fpt) close();} // FIXME: popen needs the UTF-8 equivalent fl_popen - FILE * popen (const char *cmd, const char *mode="r"); - //not necessary here: FILE * fl_fopen (const char *file, const char *mode="r"); + FILE * popen (const char *cmd, const char *mode="r"); + //not necessary here: FILE * fl_fopen (const char *file, const char *mode="r"); int close(); FILE * desc() const { return _fpt;} // non null if file is open @@ -1396,7 +1394,7 @@ FILE * Fl_Process::popen(const char *cmd, const char *mode) { // Create windows pipes if (!createPipe(pin) || !createPipe(pout) || (!fusion && !createPipe(perr) ) ) - return freeHandles(); // error + return freeHandles(); // error // Initialize Startup Info ZeroMemory(&si, sizeof(STARTUPINFO)); @@ -1407,7 +1405,7 @@ FILE * Fl_Process::popen(const char *cmd, const char *mode) { si.hStdError = fusion ? pout[1] : perr [1]; if ( CreateProcess(NULL, (LPTSTR) cmd,NULL,NULL,TRUE, - DETACHED_PROCESS,NULL,NULL, &si, &pi)) { + DETACHED_PROCESS,NULL,NULL, &si, &pi)) { // don't need theses handles inherited by child process: clean_close(pin[0]); clean_close(pout[1]); clean_close(perr[1]); HANDLE & h = *mode == 'r' ? pout[0] : pin[1]; @@ -1483,7 +1481,7 @@ static bool prepare_shell_command(const char * &command) { // common pre-shell // Support the full piped shell command... void shell_pipe_cb(FL_SOCKET, void*) { - char line[1024]=""; // Line from command output... + char line[1024]=""; // Line from command output... if (s_proc.get_line(line, sizeof(line)) != NULL) { // Add the line to the output list... @@ -1498,7 +1496,7 @@ shell_pipe_cb(FL_SOCKET, void*) { void do_shell_command(Fl_Return_Button*, void*) { - const char *command=NULL; // Command to run + const char *command=NULL; // Command to run if (!prepare_shell_command(command)) return; @@ -1663,8 +1661,8 @@ void update_sourceview_timer(void*) // Set the "modified" flag and update the title of the main window... void set_modflag(int mf) { - const char *basename; - static char title[FL_PATH_MAX]; + const char *basename; + static char title[FL_PATH_MAX]; modflag = mf; @@ -1749,9 +1747,9 @@ static void sigint(SIGARG) { int main(int argc,char **argv) { int i = 1; - + if (!Fl::args(argc,argv,i,arg) || i < argc-1) { - static const char *msg = + static const char *msg = "usage: %s <switches> name.fl\n" " -u : update .fl file and exit (may be combined with '-c' or '-cs')\n" " -c : write .cxx and .h and exit\n" @@ -1783,7 +1781,7 @@ int main(int argc,char **argv) { } if (exit_early) exit(0); - + const char *c = argv[i]; fl_register_images(); @@ -1818,13 +1816,13 @@ int main(int argc,char **argv) { } undo_resume(); - if (update_file) { // fluid -u + if (update_file) { // fluid -u write_file(c,0); if (!compile_file) exit(0); } - if (compile_file) { // fluid -c[s] + if (compile_file) { // fluid -c[s] if (compile_strings) write_strings_cb(0,0); write_cb(0,0); @@ -1853,7 +1851,3 @@ int main(int argc,char **argv) { return (0); } - -// -// End of "$Id$". -// diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx index 9004f2bea..72e795781 100644 --- a/fluid/function_panel.cxx +++ b/fluid/function_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -148,7 +146,7 @@ Fl_Double_Window* make_function_panel() { Fl_Double_Window *code_panel=(Fl_Double_Window *)0; static void cb_code_panel(Fl_Double_Window*, void*) { - if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) + if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) return; // ignore Escape code_panel->hide(); // otherwise hide..; } @@ -725,7 +723,7 @@ Fl_Window *widgetbin_panel=(Fl_Window *)0; static void cb_widgetbin_panel(Fl_Window* o, void* v) { if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) exit_cb((Fl_Widget*)o, v); -else +else toggle_widgetbin_cb((Fl_Widget*)o, v); } @@ -1174,5 +1172,3 @@ Fl_Double_Window* make_sourceview() { } // -// End of "$Id$". -// diff --git a/fluid/function_panel.fl b/fluid/function_panel.fl index 81dbfe4b4..f8187f56b 100644 --- a/fluid/function_panel.fl +++ b/fluid/function_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // Code dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // } {in_source in_header } @@ -136,7 +134,7 @@ Function {make_function_panel()} {} { Function {make_code_panel()} {} { Fl_Window code_panel { label {Code Properties} - callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) + callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) return; // ignore Escape code_panel->hide(); // otherwise hide..} open xywh {503 450 540 180} type Double labelsize 11 hide resizable @@ -541,7 +539,7 @@ Function {make_widgetbin()} {open label {Widget Bin} callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) exit_cb((Fl_Widget*)o, v); -else +else toggle_widgetbin_cb((Fl_Widget*)o, v);} open xywh {410 171 574 85} type Single align 80 hide non_modal } { @@ -963,7 +961,5 @@ Function {make_sourceview()} {} { } comment { -// -// End of "$Id$". //} {in_source in_header } diff --git a/fluid/function_panel.h b/fluid/function_panel.h index b66f5bf69..26f26c594 100644 --- a/fluid/function_panel.h +++ b/fluid/function_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Code dialogs for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -124,5 +122,3 @@ Fl_Double_Window* make_sourceview(); #endif // -// End of "$Id$". -// diff --git a/fluid/print_panel.cxx b/fluid/print_panel.cxx index 5587438bc..f41cae23d 100644 --- a/fluid/print_panel.cxx +++ b/fluid/print_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID print panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -505,25 +503,25 @@ Fl_Double_Window* make_print_panel() { } // Fl_Double_Window* print_properties_panel return print_properties_panel; } -void print_cb(Fl_Return_Button *, void *); +void print_cb(Fl_Return_Button *, void *); void print_load() { FILE *lpstat; char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024]; int i; - + if (print_choice->size() > 1) { for (i = 1; print_choice->text(i); i ++) { free(print_choice->menu()[i].user_data()); } } - + print_choice->clear(); print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER); print_choice->value(0); - + defname[0] = '\0'; - + if ((lpstat = popen("LC_MESSAGES=C LANG=C lpstat -p -d", "r")) != NULL) { while (fgets(line, sizeof(line), lpstat)) { if (!strncmp(line, "printer ", 8) && @@ -532,7 +530,7 @@ void print_load() { if (*nptr == '/') *qptr++ = '\\'; } *qptr = '\0'; - + print_choice->add(qname, 0, 0, (void *)strdup(name), 0); } else if (!strncmp(line, "system default destination: ", 28)) { if (sscanf(line + 28, "%s", defname) != 1) defname[0] = '\0'; @@ -540,7 +538,7 @@ void print_load() { } pclose(lpstat); } - + if (defname[0]) { for (i = 1; print_choice->text(i); i ++) { if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) { @@ -549,8 +547,8 @@ void print_load() { } } } else if (print_choice->size() > 2) print_choice->value(1); - - + + print_update_status(); } @@ -559,7 +557,7 @@ void print_update_status() { char command[1024]; static char status[1024]; const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); - + if (print_choice->value()) { snprintf(command, sizeof(command), "lpstat -p '%s'", printer); if ((lpstat = popen(command, "r")) != NULL) { @@ -567,21 +565,17 @@ void print_update_status() { pclose(lpstat); } else strcpy(status, "printer status unavailable"); } else status[0] = '\0'; - + print_status->label(status); - + char name[1024]; int val; - + snprintf(name, sizeof(name), "%s/page_size", printer); fluid_prefs.get(name, val, 0); print_page_size->value(val); - + snprintf(name, sizeof(name), "%s/output_mode", printer); fluid_prefs.get(name, val, 0); print_output_mode[val]->setonly(); } - -// -// End of "$Id$". -// diff --git a/fluid/print_panel.fl b/fluid/print_panel.fl index 48e2af8ad..1dd08615f 100644 --- a/fluid/print_panel.fl +++ b/fluid/print_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // FLUID print panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // } {in_source in_header } @@ -53,7 +51,7 @@ Function {make_print_panel()} {open } {} Fl_Button print_properties { label {Properties...} - callback {print_properties_panel->show();} selected + callback {print_properties_panel->show();} xywh {294 10 105 25} } Fl_Box print_status { @@ -358,9 +356,3 @@ snprintf(name, sizeof(name), "%s/output_mode", printer); fluid_prefs.get(name, val, 0); print_output_mode[val]->setonly();} {} } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/print_panel.h b/fluid/print_panel.h index 66b770caf..93f2095b6 100644 --- a/fluid/print_panel.h +++ b/fluid/print_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID print panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -52,11 +50,7 @@ extern Fl_Choice *print_page_size; extern Fl_Button *print_output_mode[4]; Fl_Double_Window* make_print_panel(); extern Fl_Menu_Item menu_print_page_size[]; -extern void print_cb(Fl_Return_Button *, void *); +extern void print_cb(Fl_Return_Button *, void *); void print_load(); void print_update_status(); #endif - -// -// End of "$Id$". -// diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx index 42edb4f69..f46b85d18 100644 --- a/fluid/template_panel.cxx +++ b/fluid/template_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID template support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -182,11 +180,11 @@ Fl_Double_Window* make_template_panel() { void template_clear() { int i; void *filename; - + for (i = 1; i <= template_browser->size(); i ++) { if ((filename = template_browser->data(i)) != NULL) free(filename); } - + template_browser->deselect(); template_browser->clear(); } @@ -194,19 +192,19 @@ void template_clear() { void template_delete_cb(Fl_Button *, void *) { int item = template_browser->value(); if (item < 1) return; - + const char *name = template_browser->text(item); const char *flfile = (const char *)template_browser->data(item); if (!flfile) return; - + if (!fl_choice("Are you sure you want to delete the template \"%s\"?", "Cancel", "Delete", 0, name)) return; - + if (fl_unlink(flfile)) { fl_alert("Unable to delete template \"%s\":\n%s", name, strerror(errno)); return; } - + template_browser->remove(item); template_browser->do_callback(); } @@ -216,13 +214,13 @@ void template_load() { char name[1024], filename[1400], path[1024], *ptr; struct dirent **files; int num_files; - + fluid_prefs.getUserdataPath(path, sizeof(path)); strlcat(path, "templates", sizeof(path)); - + int sample_templates_generated = 0; fluid_prefs.get("sample_templates_generated", sample_templates_generated, 0); - + if (!sample_templates_generated) { strcpy(filename, path); strcat(filename, "/FLTK_License.fl"); @@ -230,44 +228,40 @@ void template_load() { if (f) { fputs( "# data file for the Fltk User Interface Designer (fluid)\nversion 1.0400\nheader_name {.h}\n" - "code_name {.cxx}\ncomment {//\n// \"$Id$\"\n//\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" + "code_name {.cxx}\ncomment {//\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" "K).\n//\n// Copyright 1998-2020 by Bill Spitzak and others.\n//\n// This library is free sof" "tware. Distribution and use rights are outlined in\n// the file \"COPYING\" which should have " "been included with this file. If this\n// file is missing or damaged, see the license at:\n" - "//\n// https://www.fltk.org/COPYING.php\n//\n// Please report all bugs and problems on th" - "e following page:\n//\n// https://www.fltk.org/str.php\n//\n} {selected in_source in_head" - "er\n}\n\ncomment {\n//\n// End of \"$Id$\".\n//} {in_source in_header\n}\n", f); + "//\n// https://www.fltk.org/COPYING.php\n//\n// Please see the following page on how to report " + "bugs and issues:\n//\n// https://www.fltk.org/bugs.php\n//\n} {selected in_source in_head" + "er\n}\n", f); fclose(f); } sample_templates_generated = 1; fluid_prefs.set("sample_templates_generated", sample_templates_generated); fluid_prefs.flush(); } - + num_files = fl_filename_list(path, &files); - + for (i = 0; i < num_files; i ++) { if (fl_filename_match(files[i]->d_name, "*.fl")) { // Format the name as the filename with "_" replaced with " " // and without the trailing ".fl"... strlcpy(name, files[i]->d_name, sizeof(name)); *strstr(name, ".fl") = '\0'; - + for (ptr = name; *ptr; ptr ++) { if (*ptr == '_') *ptr = ' '; } - + // Add the template to the browser... snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name); template_browser->add(name, strdup(filename)); } - + free(files[i]); } - + if (num_files > 0) free(files); } - -// -// End of "$Id$". -// diff --git a/fluid/template_panel.fl b/fluid/template_panel.fl index 3346052c6..5da887495 100644 --- a/fluid/template_panel.fl +++ b/fluid/template_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // FLUID template support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // } {in_source in_header } @@ -226,13 +224,13 @@ if (!sample_templates_generated) { if (f) { fputs( "\# data file for the Fltk User Interface Designer (fluid)\\nversion 1.0400\\nheader_name {.h}\\n" -"code_name {.cxx}\\ncomment {//\\n// \\"$Id$\\"\\n//\\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" +"code_name {.cxx}\\ncomment {//\\n// @INSTANCE@ for the Fast Light Tool Kit (FLT" "K).\\n//\\n// Copyright 1998-2020 by Bill Spitzak and others.\\n//\\n// This library is free sof" "tware. Distribution and use rights are outlined in\\n// the file \\"COPYING\\" which should have " "been included with this file. If this\\n// file is missing or damaged, see the license at:\\n" -"//\\n// https://www.fltk.org/COPYING.php\\n//\\n// Please report all bugs and problems on th" -"e following page:\\n//\\n// https://www.fltk.org/str.php\\n//\\n} {selected in_source in_head" -"er\\n}\\n\\ncomment {\\n//\\n// End of \\"$Id$\\".\\n//} {in_source in_header\\n}\\n", f); +"//\\n// https://www.fltk.org/COPYING.php\\n//\\n// Please see the following page on how to report " +"bugs and issues:\\n//\\n// https://www.fltk.org/bugs.php\\n//\\n} {selected in_source in_head" +"er\\n}\\n", f); fclose(f); } sample_templates_generated = 1; @@ -264,9 +262,3 @@ for (i = 0; i < num_files; i ++) { if (num_files > 0) free(files);} {selected } } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/template_panel.h b/fluid/template_panel.h index 5b78eb3e2..5c754d77c 100644 --- a/fluid/template_panel.h +++ b/fluid/template_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID template support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -40,7 +38,3 @@ void template_clear(); void template_delete_cb(Fl_Button *, void *); void template_load(); #endif - -// -// End of "$Id$". -// diff --git a/fluid/undo.cxx b/fluid/undo.cxx index 1ffb41e8a..40b0f045b 100644 --- a/fluid/undo.cxx +++ b/fluid/undo.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID undo support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -32,9 +30,9 @@ #endif // _WIN32 && !__CYGWIN__ -extern Fl_Preferences fluid_prefs; // FLUID preferences -extern Fl_Menu_Item Main_Menu[]; // Main menu -extern Fl_Menu_Bar *main_menubar; // Main menubar +extern Fl_Preferences fluid_prefs; // FLUID preferences +extern Fl_Menu_Item Main_Menu[]; // Main menu +extern Fl_Menu_Bar *main_menubar; // Main menubar @@ -46,11 +44,11 @@ extern Fl_Menu_Bar *main_menubar; // Main menubar // -int undo_current = 0; // Current undo level in buffer -int undo_last = 0; // Last undo level in buffer -int undo_max = 0; // Maximum undo level used -int undo_save = -1; // Last undo level that was saved -static int undo_paused = 0; // Undo checkpointing paused? +int undo_current = 0; // Current undo level in buffer +int undo_last = 0; // Last undo level in buffer +int undo_max = 0; // Maximum undo level used +int undo_save = -1; // Last undo level that was saved +static int undo_paused = 0; // Undo checkpointing paused? // Return the undo filename. @@ -68,8 +66,8 @@ static char *undo_filename(int level) { // append filename: "undo_PID_LEVEL.fl" snprintf(undo_path + undo_path_len, - sizeof(undo_path) - undo_path_len - 1, - "undo_%d_%d.fl", getpid(), level); + sizeof(undo_path) - undo_path_len - 1, + "undo_%d_%d.fl", getpid(), level); return undo_path; } @@ -187,8 +185,3 @@ void undo_resume() { void undo_suspend() { undo_paused = 1; } - - -// -// End of "$Id$". -// diff --git a/fluid/undo.h b/fluid/undo.h index 6ce595581..c1d1aef44 100644 --- a/fluid/undo.h +++ b/fluid/undo.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLUID undo definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,29 +7,25 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef undo_h # define undo_h -extern int undo_current; // Current undo level in buffer -extern int undo_last; // Last undo level in buffer -extern int undo_save; // Last undo level that was saved +extern int undo_current; // Current undo level in buffer +extern int undo_last; // Last undo level in buffer +extern int undo_save; // Last undo level that was saved -void redo_cb(Fl_Widget *, void *); // Redo menu callback -void undo_cb(Fl_Widget *, void *); // Undo menu callback -void undo_checkpoint(); // Save current file to undo buffer -void undo_clear(); // Clear undo buffer -void undo_resume(); // Resume undo checkpoints -void undo_suspend(); // Suspend undo checkpoints +void redo_cb(Fl_Widget *, void *); // Redo menu callback +void undo_cb(Fl_Widget *, void *); // Undo menu callback +void undo_checkpoint(); // Save current file to undo buffer +void undo_clear(); // Clear undo buffer +void undo_resume(); // Resume undo checkpoints +void undo_suspend(); // Suspend undo checkpoints #endif // !undo_h - -// -// End of "$Id$". -// diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx index dfdacbe81..7ebb3c538 100644 --- a/fluid/widget_panel.cxx +++ b/fluid/widget_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -868,7 +866,3 @@ avior."); } // Fl_Double_Window* o return w; } - -// -// End of "$Id$". -// diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl index b870d39d7..0ccb9763e 100644 --- a/fluid/widget_panel.fl +++ b/fluid/widget_panel.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // Widget panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // } {in_source in_header } @@ -702,9 +700,3 @@ wCallback->do_callback(wCallback, v);} open } } } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h index 2cb59b4a4..3f7a1761b 100644 --- a/fluid/widget_panel.h +++ b/fluid/widget_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Widget panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // generated by Fast Light User Interface Designer (fluid) version 1.0400 @@ -115,7 +113,3 @@ extern Fl_Menu_Item menu_1[]; extern Fl_Menu_Item menu_2[]; extern Fl_Menu_Item menu_3[]; #endif - -// -// End of "$Id$". -// diff --git a/install-sh b/install-sh index ab74c882e..9fdd1a9f2 100755 --- a/install-sh +++ b/install-sh @@ -103,7 +103,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: else @@ -112,7 +112,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -122,7 +122,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -189,17 +189,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -230,7 +230,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/jpeg/Makefile b/jpeg/Makefile index d3fff5b03..9d0068fef 100644 --- a/jpeg/Makefile +++ b/jpeg/Makefile @@ -2,8 +2,6 @@ # FLTK - DO NOT CHANGE when upgrading the JPEG library, unless required. * # ************************************************************************* # -# "$Id$" -# # JPEG library makefile for the Fast Light Toolkit (FLTK). # # Copyright 1997-2011 by Bill Spitzak and others. @@ -12,11 +10,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # include ../makeinclude @@ -145,7 +143,3 @@ depend: $(OBJS:.o=.c) include makedepend $(OBJS): ../makeinclude - -# -# End of "$Id$". -# diff --git a/mac_endianness.h b/mac_endianness.h index dcb7ec570..5efb59602 100644 --- a/mac_endianness.h +++ b/mac_endianness.h @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Mac-specific configuration file for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2011 by Bill Spitzak and others. @@ -9,13 +7,13 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ - + #ifdef __APPLE__ # ifdef __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 @@ -23,7 +21,3 @@ # define WORDS_BIGENDIAN 0 # endif #endif - -/* - * End of "$Id$". - */ diff --git a/makeinclude.in b/makeinclude.in index 9069abb70..7980ac06b 100644 --- a/makeinclude.in +++ b/makeinclude.in @@ -1,6 +1,4 @@ # -# "$Id$" -# # Make include file for the Fast Light Tool Kit (FLTK). # # Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # FLTK version numbers @@ -140,7 +138,7 @@ CAT6EXT = @CAT6EXT@ INSTALL_BIN = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 -INSTALL_DIR = $(INSTALL) -d +INSTALL_DIR = $(INSTALL) -d INSTALL_LIB = $(INSTALL) -m 755 INSTALL_MAN = $(INSTALL) -m 644 INSTALL_SCRIPT = $(INSTALL) -m 755 @@ -167,7 +165,7 @@ UNINSTALL_DESKTOP = @UNINSTALL_DESKTOP@ .cxx.o: echo Compiling $<... $(CXX) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CXXFLAGS) -c $< -o $@ - + .mm.o: echo Compiling $<... $(CXX) -I.. $(ARCHFLAGS) $(CXXFLAGS) -x objective-c++ -c $< -o $@ @@ -184,7 +182,3 @@ UNINSTALL_DESKTOP = @UNINSTALL_DESKTOP@ $(NROFF) -man $< >t pack -f t mv t.z $@ - -# -# End of "$Id$". -# diff --git a/misc/MacRoman_utf-8.txt b/misc/MacRoman_utf-8.txt index 3b7f5ac7a..22cf29320 100644 --- a/misc/MacRoman_utf-8.txt +++ b/misc/MacRoman_utf-8.txt @@ -21,6 +21,6 @@ | 360 | 240 | F | Ò Ú Û Ù ı ˆ ˜ ¯ ˘ ˙ ˚ ¸ ˝ ˛ ˇ | +-----+-----+---+-------------------------------------------------+ -File: MacRoman_utf-8.txt -Encoding: UTF-8 -Note: 0xF0 (MacRoman) = U+F8FF (Unicode) = Apple logo +File: MacRoman_utf-8.txt +Encoding: UTF-8 +Note: 0xF0 (MacRoman) = U+F8FF (Unicode) = Apple logo diff --git a/misc/README.txt b/misc/README.txt index 189aaf9b8..3b1c18070 100644 --- a/misc/README.txt +++ b/misc/README.txt @@ -1,6 +1,4 @@ // -// $Id$ -// // Miscellaneous files for developers: // @@ -53,7 +51,7 @@ Special Notes: I saw the same effect with other Windows editors as well. The following characters may be displayed "shifted left" by one position. Seems to work correctly on Linux (with UTF-8 encoding). - + Mac OS Roman: 0xF0 (U+F8FF: "Apple logo") may not be printable, depending on installed fonts on other systems. @@ -71,39 +69,35 @@ Files: The first two files are images of how it should look: - cp1252.png full Windows Codepage 1252 (Western) - MacRoman_utf-8.png full Mac OS Roman character set (w/o Apple logo) + cp1252.png full Windows Codepage 1252 (Western) + MacRoman_utf-8.png full Mac OS Roman character set (w/o Apple logo) The following four files contain the full Windows Codepage 1252: - cp1252.txt native (Windows) encoding, suitable for FLTK 1.1 - cp1252_utf-8.txt UTF-8 encoding, suitable for FLTK 1.3 and greater - cp1252.html native (Windows) encoding, use with any browser - cp1252_utf-8.html UTF-8 encoding, use with any browser + cp1252.txt native (Windows) encoding, suitable for FLTK 1.1 + cp1252_utf-8.txt UTF-8 encoding, suitable for FLTK 1.3 and greater + cp1252.html native (Windows) encoding, use with any browser + cp1252_utf-8.html UTF-8 encoding, use with any browser The following two files contain only the ISO-8859-1 subset: - iso-8859-1.txt native (Windows) encoding, suitable for FLTK 1.1 - iso-8859-1_utf-8.txt UTF-8 encoding, suitable for FLTK 1.3 and greater + iso-8859-1.txt native (Windows) encoding, suitable for FLTK 1.1 + iso-8859-1_utf-8.txt UTF-8 encoding, suitable for FLTK 1.3 and greater The following file contains the full Mac OS Roman character set: - MacRoman_utf-8.txt UTF-8 encoding, suitable for FLTK 1.3 and greater - (use cp1252.txt with FLTK 1.1 on Mac OS instead) + MacRoman_utf-8.txt UTF-8 encoding, suitable for FLTK 1.3 and greater + (use cp1252.txt with FLTK 1.1 on Mac OS instead) Other developer support files: ================================================================================ - doxystar.cxx Use this to reformat doxygen comments (test only). + doxystar.cxx Use this to reformat doxygen comments (test only). - Compile with: g++ -o doxystar doxystar.cxx + Compile with: g++ -o doxystar doxystar.cxx - Usage: cat file | doxystar + Usage: cat file | doxystar DO NOT USE this for current code development! It is intended for testing of future code reformatting ! - -// -// End of $Id$. -// diff --git a/misc/abi-compliance-checker.txt b/misc/abi-compliance-checker.txt index 097daeedb..649878ecc 100644 --- a/misc/abi-compliance-checker.txt +++ b/misc/abi-compliance-checker.txt @@ -20,17 +20,17 @@ with the current version (1.3.5) before it will be released. (2) Use two different Git checkout (working) directories to build libs, for instance (as used in this example): - (new) /git/fltk-1.3 current version = 1.3.5 - (old) /git/fltk-1.3.4-1 previous version = 1.3.4-1 [1] + (new) /git/fltk-1.3 current version = 1.3.5 + (old) /git/fltk-1.3.4-1 previous version = 1.3.4-1 [1] [1] The second working directory can be created from the first - git working tree ( /git/fltk-1.3 ) with these commands: + git working tree ( /git/fltk-1.3 ) with these commands: - $ cd /git/fltk-1.3 - $ git worktree add /git/fltk-1.3.4-1 release-1.3.4-1 + $ cd /git/fltk-1.3 + $ git worktree add /git/fltk-1.3.4-1 release-1.3.4-1 - This creates the worktree in /git/fltk-1.3.4-1 and checks the - tag 'release-1.3.4-1' out. + This creates the worktree in /git/fltk-1.3.4-1 and checks the + tag 'release-1.3.4-1' out. (3) Create two xml descriptions to test library compatibility in @@ -94,31 +94,31 @@ with the current version (1.3.5) before it will be released. $ cd /git/workdir $ /git/abi-compliance-checker/abi-compliance-checker.pl \ -lib fltk -old fltk-1.3.4-1.xml -new fltk-1.3.5.xml - Preparing, please wait ... - Using GCC 7 (x86_64-linux-gnu, target: x86_64) - WARNING: May not work properly with GCC 4.8.[0-2], 6.* and higher - due to bug #78040 in GCC. Please try other GCC versions with the - help of --gcc-path=PATH option or create ABI dumps by ABI Dumper - tool instead to avoid using GCC. Test selected GCC version first - by -test option. - ------------------------------------------------------------------ - --> ignore warning (but run `abi-compliance-checker.pl -test') - ------------------------------------------------------------------ - Checking header(s) 1.3.4-1 ... - WARNING: can't find 'ctags' program - Checking header(s) 1.3.5 ... - WARNING: can't find 'ctags' program - ------------------------------------------------------------------ - --> ignore warning (or install 'ctags' and repeat) - ------------------------------------------------------------------ - Comparing ABIs ... - Comparing APIs ... - Creating compatibility report ... - Binary compatibility: 100% - Source compatibility: 100% - Total binary compatibility problems: 0, warnings: 0 - Total source compatibility problems: 0, warnings: 1 - Report: compat_reports/fltk/1.3.4-1_to_1.3.5/compat_report.html + Preparing, please wait ... + Using GCC 7 (x86_64-linux-gnu, target: x86_64) + WARNING: May not work properly with GCC 4.8.[0-2], 6.* and higher + due to bug #78040 in GCC. Please try other GCC versions with the + help of --gcc-path=PATH option or create ABI dumps by ABI Dumper + tool instead to avoid using GCC. Test selected GCC version first + by -test option. + ------------------------------------------------------------------ + --> ignore warning (but run `abi-compliance-checker.pl -test') + ------------------------------------------------------------------ + Checking header(s) 1.3.4-1 ... + WARNING: can't find 'ctags' program + Checking header(s) 1.3.5 ... + WARNING: can't find 'ctags' program + ------------------------------------------------------------------ + --> ignore warning (or install 'ctags' and repeat) + ------------------------------------------------------------------ + Comparing ABIs ... + Comparing APIs ... + Creating compatibility report ... + Binary compatibility: 100% + Source compatibility: 100% + Total binary compatibility problems: 0, warnings: 0 + Total source compatibility problems: 0, warnings: 1 + Report: compat_reports/fltk/1.3.4-1_to_1.3.5/compat_report.html (6) Check the generated report (last line above) with a browser: @@ -135,9 +135,9 @@ with the current version (1.3.5) before it will be released. (8) Done. -Note 1: The report as given above issued 100% ABI compatibility. The only - warning was the different patch version number. +Note 1: The report as given above issued 100% ABI compatibility. The only + warning was the different patch version number. -Note 2: There are other recommended methods to use abi-compliance-checker - together with abi-dumper, but this is not (yet) covered here (see - abi-compliance-checker documentation). +Note 2: There are other recommended methods to use abi-compliance-checker + together with abi-dumper, but this is not (yet) covered here (see + abi-compliance-checker documentation). diff --git a/misc/cp1252.html b/misc/cp1252.html index d844a002b..be5f418a5 100644 --- a/misc/cp1252.html +++ b/misc/cp1252.html @@ -30,9 +30,9 @@ | 360 | 240 | F | � � � � � � � � � � � � � � � � | +-----+-----+---+-------------------------------------------------+ -File: cp1252.html -Encoding: windows-1252 = Windows Code Page 1252 ("Western") -Meta tag: content='text/html; charset=windows-1252' +File: cp1252.html +Encoding: windows-1252 = Windows Code Page 1252 ("Western") +Meta tag: content='text/html; charset=windows-1252' </pre> </body> diff --git a/misc/cp1252.txt b/misc/cp1252.txt index 1e08316a4..211d27fce 100644 --- a/misc/cp1252.txt +++ b/misc/cp1252.txt @@ -21,5 +21,5 @@ | 360 | 240 | F | � � � � � � � � � � � � � � � � | +-----+-----+---+-------------------------------------------------+ -File: cp1252.txt -Encoding: Windows CP 1252 (aka "ansi", western, ...) +File: cp1252.txt +Encoding: Windows CP 1252 (aka "ansi", western, ...) diff --git a/misc/cp1252_utf-8.html b/misc/cp1252_utf-8.html index 66e6e4595..08752eb1e 100644 --- a/misc/cp1252_utf-8.html +++ b/misc/cp1252_utf-8.html @@ -30,9 +30,9 @@ | 360 | 240 | F | ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ | +-----+-----+---+-------------------------------------------------+ -File: cp1252_utf-8.html -Encoding: UTF-8 -Meta tag: content='text/html; charset=UTF-8' +File: cp1252_utf-8.html +Encoding: UTF-8 +Meta tag: content='text/html; charset=UTF-8' </pre> </body> diff --git a/misc/cp1252_utf-8.txt b/misc/cp1252_utf-8.txt index c42e6b89a..672015934 100644 --- a/misc/cp1252_utf-8.txt +++ b/misc/cp1252_utf-8.txt @@ -21,5 +21,5 @@ | 360 | 240 | F | ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ | +-----+-----+---+-------------------------------------------------+ -File: cp1252_utf-8.txt -Encoding: UTF-8 +File: cp1252_utf-8.txt +Encoding: UTF-8 diff --git a/misc/doxystar.cxx b/misc/doxystar.cxx index a73f46c85..3fa5c447b 100644 --- a/misc/doxystar.cxx +++ b/misc/doxystar.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Doxygen pre-formatting program for the Fast Light Tool Kit (FLTK). // // Copyright 2010 by Matthias Melcher. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -38,7 +36,7 @@ int main(int argc, char **argv) { if (!fgets(linebuf, 1020, stdin)) break; // EOF or error switch (state) { case 0: // line start is source code - commentStart = strstr(linebuf, "/*"); + commentStart = strstr(linebuf, "/*"); if (commentStart) { // check if this comment spans multiple lines if (strstr(commentStart, "*/")==0) { @@ -48,7 +46,7 @@ int main(int argc, char **argv) { } else { state = 1; // regular multiline comment } - } else { + } else { // single line comment, do nothing } } @@ -64,13 +62,13 @@ int main(int argc, char **argv) { break; case 2: // line start is inside a doxygen multiline comment for (i=0; i<commentCol; i++) fputc(' ', stdout); - fputs(" *", stdout); + fputs(" *", stdout); if (strstr(linebuf, "*/")) { state = 0; } else { // still inside comment } - for (i=0; i<commentCol+1; i++) + for (i=0; i<commentCol+1; i++) if (linebuf[i]!=' ') break; if (linebuf[i]=='*') { @@ -87,7 +85,3 @@ int main(int argc, char **argv) { return 0; } - -// -// End of "$Id$". -// diff --git a/misc/iso-8859-1.txt b/misc/iso-8859-1.txt index 41a041f94..e5c51c635 100644 --- a/misc/iso-8859-1.txt +++ b/misc/iso-8859-1.txt @@ -21,5 +21,5 @@ | 360 | 240 | F | � � � � � � � � � � � � � � � � | +-----+-----+---+-------------------------------------------------+ -File: iso-8859-1.txt -Encoding: Windows CP 1252 (aka "ansi", western, ISO-8859-1) +File: iso-8859-1.txt +Encoding: Windows CP 1252 (aka "ansi", western, ISO-8859-1) diff --git a/misc/iso-8859-1_utf-8.txt b/misc/iso-8859-1_utf-8.txt index 339f2370c..49e369cba 100644 --- a/misc/iso-8859-1_utf-8.txt +++ b/misc/iso-8859-1_utf-8.txt @@ -21,5 +21,5 @@ | 360 | 240 | F | ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ | +-----+-----+---+-------------------------------------------------+ -File: iso-8859-1_utf-8.txt -Encoding: UTF-8 +File: iso-8859-1_utf-8.txt +Encoding: UTF-8 diff --git a/misc/lorem_ipsum.txt b/misc/lorem_ipsum.txt index a7855dfa6..49b02acb7 100644 --- a/misc/lorem_ipsum.txt +++ b/misc/lorem_ipsum.txt @@ -21,16 +21,16 @@ Russian: Лорем ипсум долор сит амет, пер цлита поссит ех, ат мунере фабулас петентиум сит. Иус цу цибо саперет сцрипсерит, нец виси муциус лабитур ид. Ет хис нонумес нолуиссе дигниссим. Chinese: -側経意責家方家閉討店暖育田庁載社転線宇。得君新術治温抗添代話考振投員殴大闘北裁。品間識部案代学凰処済準世一戸刻法分。悼測済諏計飯利安凶断理資沢同岩面文認革。内警格化再薬方久化体教御決数詭芸得筆代。 +側経意責家方家閉討店暖育田庁載社転線宇。得君新術治温抗添代話考振投員殴大闘北裁。品間識部案代学凰処済準世一戸刻法分。悼測済諏計飯利安凶断理資沢同岩面文認革。内警格化再薬方久化体教御決数詭芸得筆代。 Indian: -पढाए हिंदी रहारुप अनुवाद कार्यलय मुख्य संस्था सोफ़तवेर निरपेक्ष उनका आपके बाटते आशाआपस मुख्यतह उशकी करता। शुरुआत संस्था कुशलता मेंभटृ अनुवाद गएआप विशेष सकते परिभाषित लाभान्वित प्रति देकर समजते दिशामे प्राप्त जैसे वर्णन संस्थान निर्माता प्रव्रुति भाति चुनने उपलब्ध बेंगलूर अर्थपुर्ण +पढाए हिंदी रहारुप अनुवाद कार्यलय मुख्य संस्था सोफ़तवेर निरपेक्ष उनका आपके बाटते आशाआपस मुख्यतह उशकी करता। शुरुआत संस्था कुशलता मेंभटृ अनुवाद गएआप विशेष सकते परिभाषित लाभान्वित प्रति देकर समजते दिशामे प्राप्त जैसे वर्णन संस्थान निर्माता प्रव्रुति भाति चुनने उपलब्ध बेंगलूर अर्थपुर्ण Armenian: լոռեմ իպսում դոլոռ սիթ ամեթ, լաբոռե մոդեռաթիուս եթ հաս, պեռ ոմնիս լաթինե դիսպութաթիոնի աթ, վիս ֆեուգաիթ ծիվիբուս եխ. վիվենդում լաբոռամուս ելաբոռառեթ նամ ին. Arab: -ينيا واستمر العصبة ضرب قد. وباءت الأمريكي الأوربيين هو به،, هو العالم، الثقيلة بال. مع وايرلندا الأوروبيّون كان, قد بحق أسابيع العظمى واعتلاء. انه كل وإقامة المواد. +ينيا واستمر العصبة ضرب قد. وباءت الأمريكي الأوربيين هو به،, هو العالم، الثقيلة بال. مع وايرلندا الأوروبيّون كان, قد بحق أسابيع العظمى واعتلاء. انه كل وإقامة المواد. Hebrew: כדי יסוד מונחים מועמדים של, דת דפים מאמרשיחהצפה זאת. אתה דת שונה כלשהו, גם אחר ליום בשפות, או ניווט פולנית לחיבור ארץ. ויש בקלות ואמנות אירועים או, אל אינו כלכלה שתי. diff --git a/misc/update_config_scripts b/misc/update_config_scripts index 2670b1847..ef9a1bfe2 100755 --- a/misc/update_config_scripts +++ b/misc/update_config_scripts @@ -1,7 +1,5 @@ #!/bin/sh # -# "$Id$" -# # Update the bundled scripts config.guess and config.sub # for the Fast Light Tool Kit (FLTK). # @@ -11,11 +9,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # diff --git a/nanosvg/nanosvgrast.h b/nanosvg/nanosvgrast.h index a84a54ee5..84a05a7f8 100644 --- a/nanosvg/nanosvgrast.h +++ b/nanosvg/nanosvgrast.h @@ -1474,8 +1474,3 @@ void nsvgRasterize(NSVGrasterizer* r, } #endif // NANOSVGRAST_IMPLEMENTATION - - -// -// End of "$Id$". -// diff --git a/png/CMakeLists.txt b/png/CMakeLists.txt index b9988695b..597f996e7 100644 --- a/png/CMakeLists.txt +++ b/png/CMakeLists.txt @@ -9,9 +9,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # source files for png diff --git a/png/Makefile b/png/Makefile index f444ebd36..c26f2a352 100644 --- a/png/Makefile +++ b/png/Makefile @@ -8,11 +8,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # include ../makeinclude @@ -95,8 +95,3 @@ depend: $(OBJS:.o=.c) include makedepend $(OBJS): ../makeinclude - - -# -# End of "$Id$". -# diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1d3017730..b7597f74c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,4 @@ # -# "$Id$" -# # CMakeLists.txt to build the FLTK library using CMake (www.cmake.org) # # Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # set (CPPFILES @@ -175,7 +173,7 @@ list (APPEND HEADER_FILES ${CMAKE_CURRENT_BINARY_DIR}/../config.h ) -set (GL_HEADER_FILES) # FIXME: not (yet?) defined +set (GL_HEADER_FILES) # FIXME: not (yet?) defined if ((USE_X11 OR USE_SDL) AND NOT OPTION_PRINT_SUPPORT) set (PSFILES @@ -221,7 +219,7 @@ if (USE_X11) else () set (DRIVER_FILES ${DRIVER_FILES} drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx - ) + ) endif (USE_XFT) set (DRIVER_HEADER_FILES drivers/Posix/Fl_Posix_System_Driver.H @@ -233,7 +231,7 @@ if (USE_X11) elseif (USE_SDL) - # SDL2 + # SDL2 set (DRIVER_FILES drivers/Pico/Fl_Pico_System_Driver.cxx @@ -531,14 +529,14 @@ endif (HAVE_XRENDER) if (USE_PANGO) list (APPEND OPTIONAL_LIBS ${HAVE_LIB_PANGO} ${HAVE_LIB_PANGOXFT}) if(NOT APPLE) - list (APPEND OPTIONAL_LIBS ${HAVE_LIB_GOBJECT} ) + list (APPEND OPTIONAL_LIBS ${HAVE_LIB_GOBJECT} ) endif(NOT APPLE) endif(USE_PANGO) if (USE_XFT) list (APPEND OPTIONAL_LIBS ${X11_Xft_LIB}) if (LIB_fontconfig) - list (APPEND OPTIONAL_LIBS ${LIB_fontconfig}) + list (APPEND OPTIONAL_LIBS ${LIB_fontconfig}) endif (LIB_fontconfig) endif (USE_XFT) diff --git a/src/Fl.cxx b/src/Fl.cxx index f6fef73e3..d034f91fb 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Main event handling code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file @@ -123,41 +121,41 @@ bool Fl::cfg_sys_win32 = 0; Fl_Widget *fl_selection_requestor; #ifndef FL_DOXYGEN -Fl_Widget *Fl::belowmouse_, - *Fl::pushed_, - *Fl::focus_, - *Fl::selection_owner_; -int Fl::damage_, - Fl::e_number, - Fl::e_x, - Fl::e_y, - Fl::e_x_root, - Fl::e_y_root, - Fl::e_dx, - Fl::e_dy, - Fl::e_state, - Fl::e_clicks, - Fl::e_is_click, - Fl::e_keysym, - Fl::e_original_keysym, - Fl::scrollbar_size_ = 16, - Fl::menu_linespacing_ = 4; // 4: was a local macro in Fl_Menu.cxx called "LEADING" - -char *Fl::e_text = (char *)""; -int Fl::e_length; -const char *Fl::e_clipboard_type = ""; -void *Fl::e_clipboard_data = NULL; +Fl_Widget *Fl::belowmouse_, + *Fl::pushed_, + *Fl::focus_, + *Fl::selection_owner_; +int Fl::damage_, + Fl::e_number, + Fl::e_x, + Fl::e_y, + Fl::e_x_root, + Fl::e_y_root, + Fl::e_dx, + Fl::e_dy, + Fl::e_state, + Fl::e_clicks, + Fl::e_is_click, + Fl::e_keysym, + Fl::e_original_keysym, + Fl::scrollbar_size_ = 16, + Fl::menu_linespacing_ = 4; // 4: was a local macro in Fl_Menu.cxx called "LEADING" + +char *Fl::e_text = (char *)""; +int Fl::e_length; +const char *Fl::e_clipboard_type = ""; +void *Fl::e_clipboard_data = NULL; Fl_Event_Dispatch Fl::e_dispatch = 0; -unsigned char Fl::options_[] = { 0, 0 }; -unsigned char Fl::options_read_ = 0; +unsigned char Fl::options_[] = { 0, 0 }; +unsigned char Fl::options_read_ = 0; -Fl_Window *fl_xfocus = NULL; // which window X thinks has focus -Fl_Window *fl_xmousewin; // which window X thinks has FL_ENTER -Fl_Window *Fl::grab_; // most recent Fl::grab() -Fl_Window *Fl::modal_; // topmost modal() window +Fl_Window *fl_xfocus = NULL; // which window X thinks has focus +Fl_Window *fl_xmousewin; // which window X thinks has FL_ENTER +Fl_Window *Fl::grab_; // most recent Fl::grab() +Fl_Window *Fl::modal_; // topmost modal() window #endif // FL_DOXYGEN @@ -191,7 +189,7 @@ Fl_System_Driver *Fl::system_driver() Returns the compiled-in value of the FL_VERSION constant. This is useful for checking the version of a shared library. - \deprecated Use int Fl::api_version() instead. + \deprecated Use int Fl::api_version() instead. */ double Fl::version() { return FL_VERSION; @@ -266,8 +264,8 @@ void Fl::menu_linespacing(int H) { To find out, whether the event is inside a child widget of the current window, you can use Fl::event_inside(const Fl_Widget *). - \param[in] xx,yy,ww,hh bounding box - \return non-zero, if mouse event is inside + \param[in] xx,yy,ww,hh bounding box + \return non-zero, if mouse event is inside */ int Fl::event_inside(int xx,int yy,int ww,int hh) /*const*/ { int mx = e_x - xx; @@ -299,8 +297,8 @@ int Fl::event_inside(int xx,int yy,int ww,int hh) /*const*/ { \see Fl::event_inside(int, int, int, int) - \param[in] o child widget to be tested - \return non-zero, if mouse event is inside the widget + \param[in] o child widget to be tested + \return non-zero, if mouse event is inside the widget */ int Fl::event_inside(const Fl_Widget *o) /*const*/ { int mx = e_x - o->x(); @@ -333,8 +331,8 @@ int Fl::has_timeout(Fl_Timeout_Handler cb, void *argp) { Removes a timeout callback. It is harmless to remove a timeout callback that no longer exists. - \note This version removes all matching timeouts, not just the first one. - This may change in the future. + \note This version removes all matching timeouts, not just the first one. + This may change in the future. */ void Fl::remove_timeout(Fl_Timeout_Handler cb, void *argp) { Fl::screen_driver()->remove_timeout(cb, argp); @@ -1778,7 +1776,7 @@ void Fl::release_widget_pointer(Fl_Widget *&w) #ifdef DEBUG_WATCH else { // found widget pointer printf("release_widget_pointer: (%d/%d) %8p => %8p\n", - i+1, num_widget_watch, wp, *wp); + i+1, num_widget_watch, wp, *wp); } #endif //DEBUG_WATCH } @@ -2182,7 +2180,3 @@ FL_EXPORT const char* fl_local_shift = Fl::system_driver()->shift_name(); FL_EXPORT const char* fl_local_meta = Fl::system_driver()->meta_name(); FL_EXPORT const char* fl_local_alt = Fl::system_driver()->alt_name(); FL_EXPORT const char* fl_local_ctrl = Fl::system_driver()->control_name(); - -// -// End of "$Id$". -// diff --git a/src/Fl_Adjuster.cxx b/src/Fl_Adjuster.cxx index b6ed2494f..94b57b861 100644 --- a/src/Fl_Adjuster.cxx +++ b/src/Fl_Adjuster.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Adjuster widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -48,11 +46,11 @@ void Fl_Adjuster::draw() { else fl_color(fl_inactive(selection_color())); fastarrow.draw(x()+(W-fastarrow_width)/2, - y()+2*dy+(H-fastarrow_height)/2, W, H); + y()+2*dy+(H-fastarrow_height)/2, W, H); mediumarrow.draw(x()+dx+(W-mediumarrow_width)/2, - y()+dy+(H-mediumarrow_height)/2, W, H); + y()+dy+(H-mediumarrow_height)/2, W, H); slowarrow.draw(x()+2*dx+(W-slowarrow_width)/2, - y()+(H-slowarrow_width)/2, W, H); + y()+(H-slowarrow_width)/2, W, H); if (Fl::focus() == this) draw_focus(); } @@ -66,51 +64,51 @@ int Fl_Adjuster::handle(int event) { if (Fl::visible_focus()) Fl::focus(this); ix = mx; if (w()>=h()) - drag = 3*(mx-x())/w() + 1; + drag = 3*(mx-x())/w() + 1; else - drag = 3-3*(Fl::event_y()-y()-1)/h(); + drag = 3-3*(Fl::event_y()-y()-1)/h(); { Fl_Widget_Tracker wp(this); - handle_push(); - if (wp.deleted()) return 1; + handle_push(); + if (wp.deleted()) return 1; } redraw(); return 1; case FL_DRAG: if (w() >= h()) { - delta = x()+(drag-1)*w()/3; // left edge of button - if (mx < delta) - delta = mx-delta; - else if (mx > (delta+w()/3)) // right edge of button - delta = mx-delta-w()/3; - else - delta = 0; + delta = x()+(drag-1)*w()/3; // left edge of button + if (mx < delta) + delta = mx-delta; + else if (mx > (delta+w()/3)) // right edge of button + delta = mx-delta-w()/3; + else + delta = 0; } else { - if (mx < x()) - delta = mx-x(); - else if (mx > (x()+w())) - delta = mx-x()-w(); - else - delta = 0; + if (mx < x()) + delta = mx-x(); + else if (mx > (x()+w())) + delta = mx-x()-w(); + else + delta = 0; } switch (drag) { - case 3: v = increment(previous_value(), delta); break; - case 2: v = increment(previous_value(), delta*10); break; - default:v = increment(previous_value(), delta*100); break; + case 3: v = increment(previous_value(), delta); break; + case 2: v = increment(previous_value(), delta*10); break; + default:v = increment(previous_value(), delta*100); break; } handle_drag(soft() ? softclamp(v) : clamp(v)); return 1; case FL_RELEASE: if (Fl::event_is_click()) { // detect click but no drag - if (Fl::event_state()&0xF0000) delta = -10; - else delta = 10; - switch (drag) { - case 3: v = increment(previous_value(), delta); break; - case 2: v = increment(previous_value(), delta*10); break; - default:v = increment(previous_value(), delta*100); break; - } - Fl_Widget_Tracker wp(this); - handle_drag(soft() ? softclamp(v) : clamp(v)); - if (wp.deleted()) return 1; + if (Fl::event_state()&0xF0000) delta = -10; + else delta = 10; + switch (drag) { + case 3: v = increment(previous_value(), delta); break; + case 2: v = increment(previous_value(), delta*10); break; + default:v = increment(previous_value(), delta*100); break; + } + Fl_Widget_Tracker wp(this); + handle_drag(soft() ? softclamp(v) : clamp(v)); + if (wp.deleted()) return 1; } drag = 0; redraw(); @@ -118,23 +116,23 @@ int Fl_Adjuster::handle(int event) { return 1; case FL_KEYBOARD : switch (Fl::event_key()) { - case FL_Up: + case FL_Up: if (w() > h()) return 0; - handle_drag(clamp(increment(value(),-1))); - return 1; - case FL_Down: + handle_drag(clamp(increment(value(),-1))); + return 1; + case FL_Down: if (w() > h()) return 0; - handle_drag(clamp(increment(value(),1))); - return 1; - case FL_Left: + handle_drag(clamp(increment(value(),1))); + return 1; + case FL_Left: if (w() < h()) return 0; - handle_drag(clamp(increment(value(),-1))); - return 1; - case FL_Right: + handle_drag(clamp(increment(value(),-1))); + return 1; + case FL_Right: if (w() < h()) return 0; - handle_drag(clamp(increment(value(),1))); - return 1; - default: + handle_drag(clamp(increment(value(),1))); + return 1; + default: return 0; } // break not required because of switch... @@ -167,7 +165,3 @@ Fl_Adjuster::Fl_Adjuster(int X, int Y, int W, int H, const char* l) drag = 0; soft_ = 1; } - -// -// End of "$Id$". -// diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx index da869f5a6..8fb4cdda5 100644 --- a/src/Fl_BMP_Image.cxx +++ b/src/Fl_BMP_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_BMP_Image class for the Fast Light Tool Kit (FLTK). // // Copyright 2011-2020 by Bill Spitzak and others. @@ -13,9 +11,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -129,15 +127,15 @@ void Fl_BMP_Image::load_bmp_(Fl_Image_Reader &rdr) // Reader is already open at this point. // Get the header... - byte = rdr.read_byte(); // Check "BM" sync chars + byte = rdr.read_byte(); // Check "BM" sync chars bit = rdr.read_byte(); if (byte != 'B' || bit != 'M') { ld(ERR_FORMAT); return; } - rdr.read_dword(); // Skip size - rdr.read_word(); // Skip reserved stuff + rdr.read_dword(); // Skip size + rdr.read_word(); // Skip reserved stuff rdr.read_word(); offbits = (long)rdr.read_dword();// Read offset to image data @@ -476,8 +474,3 @@ void Fl_BMP_Image::load_bmp_(Fl_Image_Reader &rdr) } // File is closed when returning... } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx index 4694d093e..bb6b21ae7 100644 --- a/src/Fl_Bitmap.cxx +++ b/src/Fl_Bitmap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Bitmap drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \fn Fl_Bitmap::Fl_Bitmap(const char *array, int W, int H) @@ -97,11 +95,11 @@ Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *array) for (dataptr = array + d - 1, y = 0; y < h; y ++, dataptr += ld) for (bitptr = bitmap + y * bmw, bit = 1, x = 0; x < w; x ++, dataptr += d) { if (*dataptr > dither[x & 15][y & 15]) - *bitptr |= bit; + *bitptr |= bit; if (bit < 128) bit <<= 1; else { - bit = 1; - bitptr ++; + bit = 1; + bitptr ++; } } @@ -140,8 +138,8 @@ void Fl_Bitmap::label(Fl_Menu_Item* m) { } Fl_Image *Fl_Bitmap::copy(int W, int H) { - Fl_Bitmap *new_image; // New RGB image - uchar *new_array; // New array for image data + Fl_Bitmap *new_image; // New RGB image + uchar *new_array; // New array for image data // Optimize the simple copy where the width and height are the same... if (W == data_w() && H == data_h()) { @@ -155,16 +153,16 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) { } if (W <= 0 || H <= 0) return 0; - // OK, need to resize the image data; allocate memory and - uchar *new_ptr, // Pointer into new array - new_bit, // Bit for new array - old_bit; // Bit for old array - const uchar *old_ptr; // Pointer into old array - int sx, sy, // Source coordinates - dx, dy, // Destination coordinates - xerr, yerr, // X & Y errors - xmod, ymod, // X & Y moduli - xstep, ystep; // X & Y step increments + // OK, need to resize the image data; allocate memory and + uchar *new_ptr, // Pointer into new array + new_bit, // Bit for new array + old_bit; // Bit for old array + const uchar *old_ptr; // Pointer into old array + int sx, sy, // Source coordinates + dx, dy, // Destination coordinates + xerr, yerr, // X & Y errors + xmod, ymod, // X & Y moduli + xstep, ystep; // X & Y step increments // Figure out Bresenham step/modulus values... @@ -183,23 +181,23 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) { // Scale the image using a nearest-neighbor algorithm... for (dy = H, sy = 0, yerr = H, new_ptr = new_array; dy > 0; dy --) { for (dx = W, xerr = W, old_ptr = array + sy * ((data_w() + 7) / 8), sx = 0, new_bit = 1; - dx > 0; - dx --) { + dx > 0; + dx --) { old_bit = (uchar)(1 << (sx & 7)); if (old_ptr[sx / 8] & old_bit) *new_ptr |= new_bit; if (new_bit < 128) new_bit <<= 1; else { new_bit = 1; - new_ptr ++; + new_ptr ++; } sx += xstep; xerr -= xmod; if (xerr <= 0) { - xerr += W; - sx ++; + xerr += W; + sx ++; } } @@ -215,7 +213,3 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) { return new_image; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Box.cxx b/src/Fl_Box.cxx index 1dbc40468..dbf9cd0e8 100644 --- a/src/Fl_Box.cxx +++ b/src/Fl_Box.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Box widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Widget.H> @@ -21,12 +19,12 @@ Fl_Box::Fl_Box(int X, int Y, int W, int H, const char *l) -: Fl_Widget(X,Y,W,H,l) +: Fl_Widget(X,Y,W,H,l) { } Fl_Box::Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l) -: Fl_Widget(X,Y,W,H,l) +: Fl_Widget(X,Y,W,H,l) { box(b); } @@ -40,8 +38,3 @@ int Fl_Box::handle(int event) { if (event == FL_ENTER || event == FL_LEAVE) return 1; else return 0; } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index 72aa8de37..4534729bc 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Browser widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -45,14 +43,14 @@ // Changes to FL_BLINE *must* be reflected in Fl_File_Chooser.cxx as well. // This hack in Fl_File_Chooser should be solved. // -struct FL_BLINE { // data is in a linked list of these +struct FL_BLINE { // data is in a linked list of these FL_BLINE* prev; FL_BLINE* next; void* data; Fl_Image* icon; - short length; // sizeof(txt)-1, may be longer than string - char flags; // selected, displayed - char txt[1]; // start of allocated array + short length; // sizeof(txt)-1, may be longer than string + char flags; // selected, displayed + char txt[1]; // start of allocated array }; /** @@ -124,7 +122,7 @@ void Fl_Browser::item_select(void *item, int val) { \param[in] item The item whose label text is returned. \returns The item's text string. (Can be NULL) */ -const char *Fl_Browser::item_text(void *item) const { +const char *Fl_Browser::item_text(void *item) const { return ((FL_BLINE*)item)->txt; } @@ -284,7 +282,7 @@ void Fl_Browser::insert(int line, FL_BLINE* item) { \param[in] d Optional pointer to user data to be associated with the new line. */ void Fl_Browser::insert(int line, const char* newtext, void* d) { - if (!newtext) newtext = ""; // STR #3269 + if (!newtext) newtext = ""; // STR #3269 int l = (int) strlen(newtext); FL_BLINE* t = (FL_BLINE*)malloc(sizeof(FL_BLINE)+l); t->length = (short)l; @@ -320,7 +318,7 @@ void Fl_Browser::move(int to, int from) { void Fl_Browser::text(int line, const char* newtext) { if (line < 1 || line > lines) return; FL_BLINE* t = find_line(line); - if (!newtext) newtext = ""; // STR #3269 + if (!newtext) newtext = ""; // STR #3269 int l = (int) strlen(newtext); if (l > t->length) { FL_BLINE* n = (FL_BLINE*)malloc(sizeof(FL_BLINE)+l); @@ -378,36 +376,36 @@ int Fl_Browser::item_height(void *item) const { Fl_Font font = textfont(); // default font int tsize = textsize(); // default size if ( format_char() ) { // can be NULL - while (*str==format_char() && *str++ && *str!=format_char()) { - switch (*str++) { - case 'l': case 'L': tsize = 24; break; - case 'm': case 'M': tsize = 18; break; - case 's': tsize = 11; break; - case 'b': font = (Fl_Font)(font|FL_BOLD); break; - case 'i': font = (Fl_Font)(font|FL_ITALIC); break; - case 'f': case 't': font = FL_COURIER; break; - case 'B': - case 'C': while (isdigit(*str & 255)) str++; break; // skip a color number - case 'F': font = (Fl_Font)strtol(str,&str,10); break; - case 'S': tsize = strtol(str,&str,10); break; - case '.': goto END_FORMAT; - } - } + while (*str==format_char() && *str++ && *str!=format_char()) { + switch (*str++) { + case 'l': case 'L': tsize = 24; break; + case 'm': case 'M': tsize = 18; break; + case 's': tsize = 11; break; + case 'b': font = (Fl_Font)(font|FL_BOLD); break; + case 'i': font = (Fl_Font)(font|FL_ITALIC); break; + case 'f': case 't': font = FL_COURIER; break; + case 'B': + case 'C': while (isdigit(*str & 255)) str++; break; // skip a color number + case 'F': font = (Fl_Font)strtol(str,&str,10); break; + case 'S': tsize = strtol(str,&str,10); break; + case '.': goto END_FORMAT; + } + } } END_FORMAT: char* ptr = str; if (ptr && *i++) str = strchr(str, column_char()); else str = NULL; if((!str && *ptr) || (str && ptr < str)) { - fl_font(font, tsize); int hh = fl_height(); - if (hh > hmax) hmax = hh; + fl_font(font, tsize); int hh = fl_height(); + if (hh > hmax) hmax = hh; } if (!str || !*str) break; } } if (l->icon && (l->icon->h()+2)>hmax) { - hmax = l->icon->h() + 2; // leave 2px above/below + hmax = l->icon->h() + 2; // leave 2px above/below } return hmax; // previous version returned hmax+2! } @@ -439,7 +437,7 @@ int Fl_Browser::item_width(void *item) const { Fl_Font font = textfont(); int done = 0; - if ( format_char() ) { // can be NULL + if ( format_char() ) { // can be NULL while (*str == format_char_ && str[1] && str[1] != format_char_) { str ++; switch (*str++) { @@ -454,8 +452,8 @@ int Fl_Browser::item_width(void *item) const { case 'F': font = (Fl_Font)strtol(str, &str, 10); break; case 'S': tsize = strtol(str, &str, 10); break; case '.': - done = 1; - break; + done = 1; + break; } if (done) @@ -506,9 +504,9 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const { char* str = l->txt; const int* i = column_widths(); - bool firstLoop = true; // for icon - while (W > 6) { // do each tab-separated field - int w1 = W; // width for this field + bool firstLoop = true; // for icon + while (W > 6) { // do each tab-separated field + int w1 = W; // width for this field char* e = 0; // pointer to end of field or null if none if (*i) { // find end of field and temporarily replace with 0 e = strchr(str, column_char()); @@ -518,9 +516,9 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const { if (firstLoop) { firstLoop = false; if (l->icon) { - l->icon->draw(X+2,Y+1); // leave 2px left, 1px above - int iconw = l->icon->w()+2; - X += iconw; W -= iconw; w1 -= iconw; + l->icon->draw(X+2,Y+1); // leave 2px left, 1px above + int iconw = l->icon->w()+2; + X += iconw; W -= iconw; w1 -= iconw; } } int tsize = textsize(); @@ -531,49 +529,49 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const { //#if defined(__GNUC__) //#warning FIXME This maybe needs to be more UTF8 aware now...? //#endif /*__GNUC__*/ - if ( format_char() ) { // can be NULL + if ( format_char() ) { // can be NULL while (*str == format_char() && *++str && *str != format_char()) { - switch (*str++) { - case 'l': case 'L': tsize = 24; break; - case 'm': case 'M': tsize = 18; break; - case 's': tsize = 11; break; - case 'b': font = (Fl_Font)(font|FL_BOLD); break; - case 'i': font = (Fl_Font)(font|FL_ITALIC); break; - case 'f': case 't': font = FL_COURIER; break; - case 'c': talign = FL_ALIGN_CENTER; break; - case 'r': talign = FL_ALIGN_RIGHT; break; - case 'B': - if (!(l->flags & SELECTED)) { - fl_color((Fl_Color)strtoul(str, &str, 10)); - fl_rectf(X, Y, w1, H); - } else while (isdigit(*str & 255)) str++; // skip digits - break; - case 'C': - lcol = (Fl_Color)strtoul(str, &str, 10); - break; - case 'F': - font = (Fl_Font)strtol(str, &str, 10); - break; - case 'N': - lcol = FL_INACTIVE_COLOR; - break; - case 'S': - tsize = strtol(str, &str, 10); - break; - case '-': - fl_color(FL_DARK3); - fl_line(X+3, Y+H/2, X+w1-3, Y+H/2); - fl_color(FL_LIGHT3); - fl_line(X+3, Y+H/2+1, X+w1-3, Y+H/2+1); - break; - case 'u': - case '_': - fl_color(lcol); - fl_line(X+3, Y+H-1, X+w1-3, Y+H-1); - break; - case '.': - goto BREAK; - } + switch (*str++) { + case 'l': case 'L': tsize = 24; break; + case 'm': case 'M': tsize = 18; break; + case 's': tsize = 11; break; + case 'b': font = (Fl_Font)(font|FL_BOLD); break; + case 'i': font = (Fl_Font)(font|FL_ITALIC); break; + case 'f': case 't': font = FL_COURIER; break; + case 'c': talign = FL_ALIGN_CENTER; break; + case 'r': talign = FL_ALIGN_RIGHT; break; + case 'B': + if (!(l->flags & SELECTED)) { + fl_color((Fl_Color)strtoul(str, &str, 10)); + fl_rectf(X, Y, w1, H); + } else while (isdigit(*str & 255)) str++; // skip digits + break; + case 'C': + lcol = (Fl_Color)strtoul(str, &str, 10); + break; + case 'F': + font = (Fl_Font)strtol(str, &str, 10); + break; + case 'N': + lcol = FL_INACTIVE_COLOR; + break; + case 'S': + tsize = strtol(str, &str, 10); + break; + case '-': + fl_color(FL_DARK3); + fl_line(X+3, Y+H/2, X+w1-3, Y+H/2); + fl_color(FL_LIGHT3); + fl_line(X+3, Y+H/2+1, X+w1-3, Y+H/2+1); + break; + case 'u': + case '_': + fl_color(lcol); + fl_line(X+3, Y+H-1, X+w1-3, Y+H-1); + break; + case '.': + goto BREAK; + } } } BREAK: @@ -634,7 +632,7 @@ void Fl_Browser::lineposition(int line, Fl_Line_Position pos) { case BOTTOM: final -= H; break; case MIDDLE: final -= H/2; break; } - + if (final > (full_height() - H)) final = full_height() -H; position(final); } @@ -839,21 +837,21 @@ void Fl_Browser::swap(FL_BLINE *a, FL_BLINE *b) { FL_BLINE *anext = a->next; FL_BLINE *bprev = b->prev; FL_BLINE *bnext = b->next; - if ( b->prev == a ) { // A ADJACENT TO B + if ( b->prev == a ) { // A ADJACENT TO B if ( aprev ) aprev->next = b; else first = b; b->next = a; a->next = bnext; b->prev = aprev; a->prev = b; if ( bnext ) bnext->prev = a; else last = a; - } else if ( a->prev == b ) { // B ADJACENT TO A + } else if ( a->prev == b ) { // B ADJACENT TO A if ( bprev ) bprev->next = a; else first = a; a->next = b; b->next = anext; a->prev = bprev; b->prev = a; if ( anext ) anext->prev = b; else last = b; - } else { // A AND B NOT ADJACENT + } else { // A AND B NOT ADJACENT // handle prev's b->prev = aprev; if ( anext ) anext->prev = b; else last = b; @@ -897,22 +895,22 @@ void Fl_Browser::icon(int line, Fl_Image* icon) { FL_BLINE* bl = find_line(line); - int old_h = bl->icon ? bl->icon->h()+2 : 0; // init with *old* icon height - bl->icon = 0; // remove icon, if any - int th = item_height(bl); // height of text only - int new_h = icon ? icon->h()+2 : 0; // init with *new* icon height + int old_h = bl->icon ? bl->icon->h()+2 : 0; // init with *old* icon height + bl->icon = 0; // remove icon, if any + int th = item_height(bl); // height of text only + int new_h = icon ? icon->h()+2 : 0; // init with *new* icon height if (th > old_h) old_h = th; if (th > new_h) new_h = th; int dh = new_h - old_h; - full_height_ += dh; // do this *always* + full_height_ += dh; // do this *always* - bl->icon = icon; // set new icon + bl->icon = icon; // set new icon if (dh>0) { - redraw(); // icon larger than item? must redraw widget + redraw(); // icon larger than item? must redraw widget } else { - redraw_line(bl); // icon same or smaller? can redraw just this line + redraw_line(bl); // icon same or smaller? can redraw just this line } - replacing(bl,bl); // recalc Fl_Browser_::max_width et al + replacing(bl,bl); // recalc Fl_Browser_::max_width et al } /** @@ -931,32 +929,27 @@ Fl_Image* Fl_Browser::icon(int line) const { It's ok to remove an icon if none has been defined. \param[in] line The line whose icon is to be removed. */ -void Fl_Browser::remove_icon(int line) { +void Fl_Browser::remove_icon(int line) { icon(line,0); } Fl_Hold_Browser::Fl_Hold_Browser(int X,int Y,int W,int H,const char *L) -: Fl_Browser(X,Y,W,H,L) +: Fl_Browser(X,Y,W,H,L) { type(FL_HOLD_BROWSER); } Fl_Multi_Browser::Fl_Multi_Browser(int X,int Y,int W,int H,const char *L) -: Fl_Browser(X,Y,W,H,L) +: Fl_Browser(X,Y,W,H,L) { type(FL_MULTI_BROWSER); } Fl_Select_Browser::Fl_Select_Browser(int X,int Y,int W,int H,const char *L) -: Fl_Browser(X,Y,W,H,L) +: Fl_Browser(X,Y,W,H,L) { type(FL_SELECT_BROWSER); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx index 492feb136..11c0b40ba 100644 --- a/src/Fl_Browser_.cxx +++ b/src/Fl_Browser_.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Base Browser widget class for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #define DISPLAY_SEARCH_BOTH_WAYS_AT_ONCE @@ -108,11 +106,11 @@ void Fl_Browser_::resize(int X, int Y, int W, int H) { // move the scrollbars so they can respond to events: bbox(X,Y,W,H); scrollbar.resize( - scrollbar.align()&FL_ALIGN_LEFT ? X-scrollsize : X+W, - Y, scrollsize, H); + scrollbar.align()&FL_ALIGN_LEFT ? X-scrollsize : X+W, + Y, scrollsize, H); hscrollbar.resize( - X, scrollbar.align()&FL_ALIGN_TOP ? Y-scrollsize : Y+H, - W, scrollsize); + X, scrollbar.align()&FL_ALIGN_TOP ? Y-scrollsize : Y+H, + W, scrollsize); max_width = 0; } @@ -152,27 +150,27 @@ void Fl_Browser_::update_top() { int hh = item_quick_height(l); // step through list until we find line containing this point: while (ly > yy) { - void* l1 = item_prev(l); - if (!l1) {ly = 0; break;} // hit the top - l = l1; - hh = item_quick_height(l); - ly -= hh; + void* l1 = item_prev(l); + if (!l1) {ly = 0; break;} // hit the top + l = l1; + hh = item_quick_height(l); + ly -= hh; } while ((ly+hh) <= yy) { - void* l1 = item_next(l); - if (!l1) {yy = ly+hh-1; break;} - l = l1; - ly += hh; - hh = item_quick_height(l); + void* l1 = item_next(l); + if (!l1) {yy = ly+hh-1; break;} + l = l1; + ly += hh; + hh = item_quick_height(l); } // top item must *really* be visible, use slow height: for (;;) { - hh = item_height(l); - if ((ly+hh) > yy) break; // it is big enough to see - // go up to top of previous item: - void* l1 = item_prev(l); - if (!l1) {ly = yy = 0; break;} // hit the top - l = l1; yy = position_ = ly = ly-item_quick_height(l); + hh = item_height(l); + if ((ly+hh) > yy) break; // it is big enough to see + // go up to top of previous item: + void* l1 = item_prev(l); + if (!l1) {ly = yy = 0; break;} // hit the top + l = l1; yy = position_ = ly = ly-item_quick_height(l); } // use it: top_ = l; @@ -268,13 +266,13 @@ void Fl_Browser_::display(void* item) { if (l) { h1 = item_quick_height(l); if (l == item) { - if (Y <= H) { // it is visible or right at bottom - Y = Y+h1-H; // find where bottom edge is - if (Y > 0) position(real_position_+Y); // scroll down a bit - } else { - position(real_position_+Y-(H-h1)/2); // center it - } - return; + if (Y <= H) { // it is visible or right at bottom + Y = Y+h1-H; // find where bottom edge is + if (Y > 0) position(real_position_+Y); // scroll down a bit + } else { + position(real_position_+Y-(H-h1)/2); // center it + } + return; } Y += h1; l = item_next(l); @@ -283,9 +281,9 @@ void Fl_Browser_::display(void* item) { h1 = item_quick_height(lp); Yp -= h1; if (lp == item) { - if ((Yp + h1) >= 0) position(real_position_+Yp); - else position(real_position_+Yp-(H-h1)/2); - return; + if ((Yp + h1) >= 0) position(real_position_+Yp); + else position(real_position_+Yp-(H-h1)/2); + return; } lp = item_prev(lp); } @@ -298,10 +296,10 @@ void Fl_Browser_::display(void* item) { h1 = item_quick_height(l); if (l == item) { if (Y <= H) { // it is visible or right at bottom - Y = Y+h1-H; // find where bottom edge is - if (Y > 0) position(real_position_+Y); // scroll down a bit + Y = Y+h1-H; // find where bottom edge is + if (Y > 0) position(real_position_+Y); // scroll down a bit } else { - position(real_position_+Y-(H-h1)/2); // center it + position(real_position_+Y-(H-h1)/2); // center it } return; } @@ -341,7 +339,7 @@ J1: } // see if scrollbar needs to be switched on/off: if ((has_scrollbar_ & VERTICAL) && ( - (has_scrollbar_ & ALWAYS_ON) || position_ || full_height_ > H)) { + (has_scrollbar_ & ALWAYS_ON) || position_ || full_height_ > H)) { if (!scrollbar.visible()) { scrollbar.set_visible(); drawsquare = 1; @@ -356,7 +354,7 @@ J1: } if ((has_scrollbar_ & HORIZONTAL) && ( - (has_scrollbar_ & ALWAYS_ON) || hposition_ || full_width_ > W)) { + (has_scrollbar_ & ALWAYS_ON) || hposition_ || full_width_ > W)) { if (!hscrollbar.visible()) { hscrollbar.set_visible(); drawsquare = 1; @@ -374,7 +372,7 @@ J1: // because the horizontal one is drawn. There should be a cleaner way // to do this besides copying the same code... if ((has_scrollbar_ & VERTICAL) && ( - (has_scrollbar_ & ALWAYS_ON) || position_ || full_height_ > H)) { + (has_scrollbar_ & ALWAYS_ON) || position_ || full_height_ > H)) { if (!scrollbar.visible()) { scrollbar.set_visible(); drawsquare = 1; @@ -400,17 +398,17 @@ J1: if (hh <= 0) continue; if ((damage()&(FL_DAMAGE_SCROLL|FL_DAMAGE_ALL)) || l == redraw1 || l == redraw2) { if (item_selected(l)) { - fl_color(active_r() ? selection_color() : fl_inactive(selection_color())); - fl_rectf(X, yy+Y, W, hh); + fl_color(active_r() ? selection_color() : fl_inactive(selection_color())); + fl_rectf(X, yy+Y, W, hh); } else if (!(damage()&FL_DAMAGE_ALL)) { - fl_push_clip(X, yy+Y, W, hh); - draw_box(box() ? box() : FL_DOWN_BOX, x(), y(), w(), h(), color()); - fl_pop_clip(); + fl_push_clip(X, yy+Y, W, hh); + draw_box(box() ? box() : FL_DOWN_BOX, x(), y(), w(), h(), color()); + fl_pop_clip(); } item_draw(l, X-hposition_, yy+Y, W+hposition_, hh); if (l == selection_ && Fl::focus() == this) { - draw_box(FL_BORDER_FRAME, X, yy+Y, W, hh, color()); - draw_focus(FL_NO_BOX, X, yy+Y, W+1, hh+1); + draw_box(FL_BORDER_FRAME, X, yy+Y, W, hh, color()); + draw_focus(FL_NO_BOX, X, yy+Y, W+1, hh+1); } int ww = item_width(l); if (ww > max_width) {max_width = ww; max_width_item = l;} @@ -425,7 +423,7 @@ J1: } fl_pop_clip(); - fl_push_clip(x(),y(),w(),h()); // STR# 2886 + fl_push_clip(x(),y(),w(),h()); // STR# 2886 redraw1 = redraw2 = 0; if (!dont_repeat) { dont_repeat = 1; @@ -434,13 +432,13 @@ J1: full_height_ = full_height(); full_width_ = full_width(); if ((has_scrollbar_ & VERTICAL) && - ((has_scrollbar_ & ALWAYS_ON) || position_ || full_height_>H)) { + ((has_scrollbar_ & ALWAYS_ON) || position_ || full_height_>H)) { if (!scrollbar.visible()) { damage(FL_DAMAGE_ALL); fl_pop_clip(); goto J1; } } else { if (scrollbar.visible()) { damage(FL_DAMAGE_ALL); fl_pop_clip(); goto J1; } } if ((has_scrollbar_ & HORIZONTAL) && - ((has_scrollbar_ & ALWAYS_ON) || hposition_ || full_width_>W)) { + ((has_scrollbar_ & ALWAYS_ON) || hposition_ || full_width_>W)) { if (!hscrollbar.visible()) { damage(FL_DAMAGE_ALL); fl_pop_clip(); goto J1; } } else { if (hscrollbar.visible()) { damage(FL_DAMAGE_ALL); fl_pop_clip(); goto J1; } @@ -452,8 +450,8 @@ J1: int dy = top_ ? item_quick_height(top_) : 0; if (dy < 10) dy = 10; if (scrollbar.visible()) { scrollbar.damage_resize( - scrollbar.align()&FL_ALIGN_LEFT ? X-scrollsize : X+W, - Y, scrollsize, H); + scrollbar.align()&FL_ALIGN_LEFT ? X-scrollsize : X+W, + Y, scrollsize, H); scrollbar.value(position_, H, 0, full_height_); scrollbar.linesize(dy); if (drawsquare) draw_child(scrollbar); @@ -461,8 +459,8 @@ J1: } if (hscrollbar.visible()) { hscrollbar.damage_resize( - X, scrollbar.align()&FL_ALIGN_TOP ? Y-scrollsize : Y+H, - W, scrollsize); + X, scrollbar.align()&FL_ALIGN_TOP ? Y-scrollsize : Y+H, + W, scrollsize); hscrollbar.value(hposition_, W, 0, full_width_); hscrollbar.linesize(dy); if (drawsquare) draw_child(hscrollbar); @@ -564,7 +562,7 @@ void Fl_Browser_::swapping(void* a, void* b) { being inserted into the list. It allows the Fl_Browser_ to update its cache data as needed, scheduling a redraw for the affected lines. - This method does not actually insert items, but handles the + This method does not actually insert items, but handles the follow up bookkeeping after items have been inserted. \param[in] a The starting item position \param[in] b The new item being inserted @@ -595,7 +593,7 @@ void* Fl_Browser_::find_item(int ypos) { /** Sets the selection state of \p item to \p val, and returns 1 if the state changed or 0 if it did not. - + If \p docallbacks is non-zero, select tries to call the callback function for the widget. @@ -629,7 +627,7 @@ int Fl_Browser_::select(void* item, int val, int docallbacks) { redraw_line(item); display(item); } - } + } if (docallbacks) { set_changed(); do_callback(); @@ -640,7 +638,7 @@ int Fl_Browser_::select(void* item, int val, int docallbacks) { /** Deselects all items in the list and returns 1 if the state changed or 0 if it did not. - + If the optional \p docallbacks parameter is non-zero, deselect tries to call the callback function for the widget. @@ -714,29 +712,29 @@ int Fl_Browser_::handle(int event) { if (type()==FL_HOLD_BROWSER) { switch (Fl::event_key()) { case FL_Down: - while ((l = item_next(l))) { + while ((l = item_next(l))) { if (item_height(l)>0) {select_only(l, when()); break;} - } + } return 1; case FL_Up: while ((l = item_prev(l))) { - if (item_height(l)>0) { - select_only(l, when()); - break; // no need to test wp (return 1) - } - } + if (item_height(l)>0) { + select_only(l, when()); + break; // no need to test wp (return 1) + } + } return 1; - } + } } else { switch (Fl::event_key()) { case FL_Enter: case FL_KP_Enter: select_only(l, when() & ~FL_WHEN_ENTER_KEY); - if (wp.deleted()) return 1; - if (when() & FL_WHEN_ENTER_KEY) { - set_changed(); - do_callback(); - } + if (wp.deleted()) return 1; + if (when() & FL_WHEN_ENTER_KEY) { + set_changed(); + do_callback(); + } return 1; case ' ': selection_ = l; @@ -746,7 +744,7 @@ int Fl_Browser_::handle(int event) { while ((l = item_next(l))) { if (Fl::event_state(FL_SHIFT|FL_CTRL)) select(l, l1 ? item_selected(l1) : 1, when()); - if (wp.deleted()) return 1; + if (wp.deleted()) return 1; if (item_height(l)>0) goto J1; } return 1; @@ -754,7 +752,7 @@ int Fl_Browser_::handle(int event) { while ((l = item_prev(l))) { if (Fl::event_state(FL_SHIFT|FL_CTRL)) select(l, l1 ? item_selected(l1) : 1, when()); - if (wp.deleted()) return 1; + if (wp.deleted()) return 1; if (item_height(l)>0) goto J1; } return 1; @@ -767,7 +765,7 @@ J1: } } } - + if (Fl_Group::handle(event)) return 1; if (wp.deleted()) return 1; @@ -779,7 +777,7 @@ J1: // we use the construct: // change = select_only(find_item(my), 0); // if (change && (when() & FL_WHEN_CHANGED)) { -// set_changed(); +// set_changed(); // do_callback(); // } // See str #834 @@ -808,62 +806,62 @@ J1: change = select_only(find_item(my), 0); if (wp.deleted()) return 1; if (change && (when() & FL_WHEN_CHANGED)) { - set_changed(); - do_callback(); - if (wp.deleted()) return 1; + set_changed(); + do_callback(); + if (wp.deleted()) return 1; } } else { void* l = find_item(my); whichway = 1; if (Fl::event_state(FL_COMMAND)) { // toggle selection: TOGGLE: - if (l) { - whichway = !item_selected(l); - change = select(l, whichway, 0); - if (wp.deleted()) return 1; - if (change && (when() & FL_WHEN_CHANGED)) { - set_changed(); - do_callback(); - if (wp.deleted()) return 1; - } - } + if (l) { + whichway = !item_selected(l); + change = select(l, whichway, 0); + if (wp.deleted()) return 1; + if (change && (when() & FL_WHEN_CHANGED)) { + set_changed(); + do_callback(); + if (wp.deleted()) return 1; + } + } } else if (Fl::event_state(FL_SHIFT)) { // extend selection: - if (l == selection_) goto TOGGLE; - // state of previous selection determines new value: - whichway = l ? !item_selected(l) : 1; - // see which of the new item or previous selection is earlier, - // by searching from the previous forward for this one: - int down; - if (!l) down = 1; - else {for (void* m = selection_; ; m = item_next(m)) { - if (m == l) {down = 1; break;} - if (!m) {down = 0; break;} - }} - if (down) { - for (void* m = selection_; m != l; m = item_next(m)) { - select(m, whichway, when() & FL_WHEN_CHANGED); - if (wp.deleted()) return 1; - } - } else { - void* e = selection_; - for (void* m = item_next(l); m; m = item_next(m)) { - select(m, whichway, when() & FL_WHEN_CHANGED); - if (wp.deleted()) return 1; - if (m == e) break; - } - } - // do the clicked item last so the select box is around it: - change = 1; - if (l) select(l, whichway, when() & FL_WHEN_CHANGED); - if (wp.deleted()) return 1; + if (l == selection_) goto TOGGLE; + // state of previous selection determines new value: + whichway = l ? !item_selected(l) : 1; + // see which of the new item or previous selection is earlier, + // by searching from the previous forward for this one: + int down; + if (!l) down = 1; + else {for (void* m = selection_; ; m = item_next(m)) { + if (m == l) {down = 1; break;} + if (!m) {down = 0; break;} + }} + if (down) { + for (void* m = selection_; m != l; m = item_next(m)) { + select(m, whichway, when() & FL_WHEN_CHANGED); + if (wp.deleted()) return 1; + } + } else { + void* e = selection_; + for (void* m = item_next(l); m; m = item_next(m)) { + select(m, whichway, when() & FL_WHEN_CHANGED); + if (wp.deleted()) return 1; + if (m == e) break; + } + } + // do the clicked item last so the select box is around it: + change = 1; + if (l) select(l, whichway, when() & FL_WHEN_CHANGED); + if (wp.deleted()) return 1; } else { // select only this item - change = select_only(l, 0); - if (wp.deleted()) return 1; - if (change && (when() & FL_WHEN_CHANGED)) { - set_changed(); - do_callback(); - if (wp.deleted()) return 1; - } + change = select_only(l, 0); + if (wp.deleted()) return 1; + if (change && (when() & FL_WHEN_CHANGED)) { + set_changed(); + do_callback(); + if (wp.deleted()) return 1; + } } } return 1; @@ -886,29 +884,29 @@ J1: void* l = find_item(my); void* t; void* b; // this will be the range to change if (my > py) { // go down - t = selection_ ? item_next(selection_) : 0; - b = l ? item_next(l) : 0; - } else { // go up - t = l; - b = selection_; + t = selection_ ? item_next(selection_) : 0; + b = l ? item_next(l) : 0; + } else { // go up + t = l; + b = selection_; } for (; t && t != b; t = item_next(t)) { - char change_t; - change_t = select(t, whichway, 0); - if (wp.deleted()) return 1; - change |= change_t; - if (change_t && (when() & FL_WHEN_CHANGED)) { - set_changed(); - do_callback(); - if (wp.deleted()) return 1; - } + char change_t; + change_t = select(t, whichway, 0); + if (wp.deleted()) return 1; + change |= change_t; + if (change_t && (when() & FL_WHEN_CHANGED)) { + set_changed(); + do_callback(); + if (wp.deleted()) return 1; + } } if (l) selection_ = l; } else { void* l1 = selection_; void* l = - (Fl::event_x()<x() || Fl::event_x()>x()+w()) ? selection_ : - find_item(my); + (Fl::event_x()<x() || Fl::event_x()>x()+w()) ? selection_ : + find_item(my); change = (l != l1); select_only(l, when() & FL_WHEN_CHANGED); if (wp.deleted()) return 1; @@ -986,8 +984,8 @@ Fl_Browser_::Fl_Browser_(int X, int Y, int W, int H, const char* L) item_swap(void*, void*) and item_text(void*) must be implemented for this call. \param[in] flags FL_SORT_ASCENDING -- sort in ascending order\n FL_SORT_DESCENDING -- sort in descending order\n - Values other than the above will cause undefined behavior\n - Other flags may appear in the future. + Values other than the above will cause undefined behavior\n + Other flags may appear in the future. \todo Add a flag to ignore case */ void Fl_Browser_::sort(int flags) { @@ -1032,10 +1030,10 @@ void Fl_Browser_::sort(int flags) { /** This method may be provided by the subclass to return the height of the - \p item, in pixels. + \p item, in pixels. Allow for two additional pixels for the list selection box. - This method differs from item_height in that it is only called for - selection and scrolling operations. + This method differs from item_height in that it is only called for + selection and scrolling operations. The default implementation calls item_height. \param[in] item The item whose height to return. \returns The height, in pixels. @@ -1046,7 +1044,7 @@ int Fl_Browser_::item_quick_height(void* item) const { /** This method may be provided to return the average height of all items - to be used for scrolling. + to be used for scrolling. The default implementation uses the height of the first item. \returns The average height of items, in pixels. */ @@ -1056,8 +1054,8 @@ int Fl_Browser_::incr_height() const { /** This method may be provided by the subclass to indicate the full height - of the item list, in pixels. - The default implementation computes the full height from the item heights. + of the item list, in pixels. + The default implementation computes the full height from the item heights. Includes the items that are scrolled off screen. \returns The height of the entire list, in pixels. */ @@ -1070,7 +1068,7 @@ int Fl_Browser_::full_height() const { /** This method may be provided by the subclass to indicate the full width - of the item list, in pixels. + of the item list, in pixels. The default implementation computes the full width from the item widths. \returns The maximum width of all the items, in pixels. */ @@ -1079,7 +1077,7 @@ int Fl_Browser_::full_width() const { } /** - This method must be implemented by the subclass if it supports + This method must be implemented by the subclass if it supports multiple selections; sets the selection state to \p val for the \p item. Sets the selection state for \p item, where optional \p val is 1 (select, the default) or 0 (de-select). @@ -1096,7 +1094,3 @@ void Fl_Browser_::item_select(void *item, int val) {} \param[in] item The item to test. */ int Fl_Browser_::item_selected(void* item) const { return item==selection_ ? 1 : 0; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Browser_load.cxx b/src/Fl_Browser_load.cxx index 890f3b940..a8ce2a6ea 100644 --- a/src/Fl_Browser_load.cxx +++ b/src/Fl_Browser_load.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // File loading routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -43,19 +41,15 @@ int Fl_Browser::load(const char *filename) { if (!fl) return 0; i = 0; do { - c = getc(fl); - if (c == '\n' || c <= 0 || i>=(MAXFL_BLINE-1)) { - newtext[i] = 0; - add(newtext); - i = 0; - } else { - newtext[i++] = c; - } + c = getc(fl); + if (c == '\n' || c <= 0 || i>=(MAXFL_BLINE-1)) { + newtext[i] = 0; + add(newtext); + i = 0; + } else { + newtext[i++] = c; + } } while (c >= 0); fclose(fl); return 1; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 8484db7d6..1651d08f5 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Button widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -117,7 +115,7 @@ int Fl_Button::handle(int event) { value(oldval); set_changed(); if (when() & FL_WHEN_CHANGED) { - Fl_Widget_Tracker wp(this); + Fl_Widget_Tracker wp(this); do_callback(); if (wp.deleted()) return 1; } @@ -126,19 +124,19 @@ int Fl_Button::handle(int event) { return 1; case FL_SHORTCUT: if (!(shortcut() ? - Fl::test_shortcut(shortcut()) : test_shortcut())) return 0; + Fl::test_shortcut(shortcut()) : test_shortcut())) return 0; if (Fl::visible_focus() && handle(FL_FOCUS)) Fl::focus(this); goto triggered_by_keyboard; case FL_FOCUS : case FL_UNFOCUS : if (Fl::visible_focus()) { if (box() == FL_NO_BOX) { - // Widgets with the FL_NO_BOX boxtype need a parent to - // redraw, since it is responsible for redrawing the - // background... - int X = x() > 0 ? x() - 1 : 0; - int Y = y() > 0 ? y() - 1 : 0; - if (window()) window()->damage(FL_DAMAGE_ALL, X, Y, w() + 2, h() + 2); + // Widgets with the FL_NO_BOX boxtype need a parent to + // redraw, since it is responsible for redrawing the + // background... + int X = x() > 0 ? x() - 1 : 0; + int Y = y() > 0 ? y() - 1 : 0; + if (window()) window()->damage(FL_DAMAGE_ALL, X, Y, w() + 2, h() + 2); } else redraw(); return 1; } else return 0; @@ -151,12 +149,12 @@ int Fl_Button::handle(int event) { Fl_Widget_Tracker wp(this); if (type() == FL_RADIO_BUTTON) { if (!value_) { - setonly(); - if (when() & FL_WHEN_CHANGED) do_callback(); + setonly(); + if (when() & FL_WHEN_CHANGED) do_callback(); } } else if (type() == FL_TOGGLE_BUTTON) { - value(!value()); - if (when() & FL_WHEN_CHANGED) do_callback(); + value(!value()); + if (when() & FL_WHEN_CHANGED) do_callback(); } else { simulate_key_action(); } @@ -246,8 +244,3 @@ Fl_Toggle_Button::Fl_Toggle_Button(int X,int Y,int W,int H,const char *L) { type(FL_TOGGLE_BUTTON); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Chart.cxx b/src/Fl_Chart.cxx index a381155bb..e7a30fc92 100644 --- a/src/Fl_Chart.cxx +++ b/src/Fl_Chart.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms-compatible chart widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/math.h> @@ -23,7 +21,7 @@ #include "flstring.h" #include <stdlib.h> -#define ARCINC (2.0*M_PI/360.0) +#define ARCINC (2.0*M_PI/360.0) // this function is in fl_boxtype.cxx: void fl_rectbound(int x,int y,int w,int h, Fl_Color color); @@ -31,9 +29,9 @@ void fl_rectbound(int x,int y,int w,int h, Fl_Color color); /* Widget specific information */ static void draw_barchart(int x,int y,int w,int h, - int numb, FL_CHART_ENTRY entries[], - double min, double max, int autosize, int maxnumb, - Fl_Color textcolor) + int numb, FL_CHART_ENTRY entries[], + double min, double max, int autosize, int maxnumb, + Fl_Color textcolor) /* Draws a bar chart. x,y,w,h is the bounding box, entries the array of numb entries and min and max the boundaries. */ { @@ -58,27 +56,27 @@ static void draw_barchart(int x,int y,int w,int h, for (i=0; i<numb; i++) { int hh = (int)rint(entries[i].val*incr); if (hh < 0) - fl_rectbound(x+i*bwidth,zeroh,bwidth+1,-hh+1, (Fl_Color)entries[i].col); + fl_rectbound(x+i*bwidth,zeroh,bwidth+1,-hh+1, (Fl_Color)entries[i].col); else if (hh > 0) - fl_rectbound(x+i*bwidth,zeroh-hh,bwidth+1,hh+1,(Fl_Color)entries[i].col); + fl_rectbound(x+i*bwidth,zeroh-hh,bwidth+1,hh+1,(Fl_Color)entries[i].col); } /* Draw the labels */ fl_color(textcolor); for (i=0; i<numb; i++) fl_draw(entries[i].str, - x+i*bwidth+bwidth/2,zeroh,0,0, - FL_ALIGN_TOP); + x+i*bwidth+bwidth/2,zeroh,0,0, + FL_ALIGN_TOP); } static void draw_horbarchart(int x,int y,int w,int h, - int numb, FL_CHART_ENTRY entries[], - double min, double max, int autosize, int maxnumb, - Fl_Color textcolor) + int numb, FL_CHART_ENTRY entries[], + double min, double max, int autosize, int maxnumb, + Fl_Color textcolor) /* Draws a horizontal bar chart. x,y,w,h is the bounding box, entries the array of numb entries and min and max the boundaries. */ { int i; - double lw = 0.0; /* Maximal label width */ + double lw = 0.0; /* Maximal label width */ /* Compute maximal label width */ for (i=0; i<numb; i++) { double w1 = fl_width(entries[i].str); @@ -104,22 +102,22 @@ static void draw_horbarchart(int x,int y,int w,int h, for (i=0; i<numb; i++) { int ww = (int)rint(entries[i].val*incr); if (ww > 0) - fl_rectbound(zeroh,y+i*bwidth,ww+1,bwidth+1, (Fl_Color)entries[i].col); + fl_rectbound(zeroh,y+i*bwidth,ww+1,bwidth+1, (Fl_Color)entries[i].col); else if (ww < 0) - fl_rectbound(zeroh+ww,y+i*bwidth,-ww+1,bwidth+1,(Fl_Color)entries[i].col); + fl_rectbound(zeroh+ww,y+i*bwidth,-ww+1,bwidth+1,(Fl_Color)entries[i].col); } /* Draw the labels */ fl_color(textcolor); for (i=0; i<numb; i++) fl_draw(entries[i].str, - zeroh-2,y+i*bwidth+bwidth/2,0,0, - FL_ALIGN_RIGHT); + zeroh-2,y+i*bwidth+bwidth/2,0,0, + FL_ALIGN_RIGHT); } static void draw_linechart(int type, int x,int y,int w,int h, - int numb, FL_CHART_ENTRY entries[], - double min, double max, int autosize, int maxnumb, - Fl_Color textcolor) + int numb, FL_CHART_ENTRY entries[], + double min, double max, int autosize, int maxnumb, + Fl_Color textcolor) /* Draws a line chart. x,y,w,h is the bounding box, entries the array of numb entries and min and max the boundaries. */ { @@ -137,23 +135,23 @@ static void draw_linechart(int type, int x,int y,int w,int h, int yy0 = i ? zeroh - (int)rint(entries[i-1].val*incr) : 0; int yy1 = zeroh - (int)rint(entries[i].val*incr); if (type == FL_SPIKE_CHART) { - fl_color((Fl_Color)entries[i].col); - fl_line(x1, zeroh, x1, yy1); + fl_color((Fl_Color)entries[i].col); + fl_line(x1, zeroh, x1, yy1); } else if (type == FL_LINE_CHART && i != 0) { - fl_color((Fl_Color)entries[i-1].col); - fl_line(x0,yy0,x1,yy1); + fl_color((Fl_Color)entries[i-1].col); + fl_line(x0,yy0,x1,yy1); } else if (type == FL_FILLED_CHART && i != 0) { - fl_color((Fl_Color)entries[i-1].col); - if ((entries[i-1].val>0.0)!=(entries[i].val>0.0)) { - double ttt = entries[i-1].val/(entries[i-1].val-entries[i].val); - int xt = x + (int)rint((i-.5+ttt)*bwidth); - fl_polygon(x0,zeroh, x0,yy0, xt,zeroh); - fl_polygon(xt,zeroh, x1,yy1, x1,zeroh); - } else { - fl_polygon(x0,zeroh, x0,yy0, x1,yy1, x1,zeroh); - } - fl_color(textcolor); - fl_line(x0,yy0,x1,yy1); + fl_color((Fl_Color)entries[i-1].col); + if ((entries[i-1].val>0.0)!=(entries[i].val>0.0)) { + double ttt = entries[i-1].val/(entries[i-1].val-entries[i].val); + int xt = x + (int)rint((i-.5+ttt)*bwidth); + fl_polygon(x0,zeroh, x0,yy0, xt,zeroh); + fl_polygon(xt,zeroh, x1,yy1, x1,zeroh); + } else { + fl_polygon(x0,zeroh, x0,yy0, x1,yy1, x1,zeroh); + } + fl_color(textcolor); + fl_line(x0,yy0,x1,yy1); } } /* Draw base line */ @@ -162,22 +160,22 @@ static void draw_linechart(int type, int x,int y,int w,int h, /* Draw the labels */ for (i=0; i<numb; i++) fl_draw(entries[i].str, - x+(int)rint((i+.5)*bwidth), zeroh - (int)rint(entries[i].val*incr),0,0, - entries[i].val>=0 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP); + x+(int)rint((i+.5)*bwidth), zeroh - (int)rint(entries[i].val*incr),0,0, + entries[i].val>=0 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP); } static void draw_piechart(int x,int y,int w,int h, - int numb, FL_CHART_ENTRY entries[], int special, - Fl_Color textcolor) + int numb, FL_CHART_ENTRY entries[], int special, + Fl_Color textcolor) /* Draws a pie chart. x,y,w,h is the bounding box, entries the array of numb entries */ { int i; - double xc,yc,rad; /* center and radius */ - double tot; /* sum of values */ - double incr; /* increment in angle */ - double curang; /* current angle we are drawing */ - double txc,tyc; /* temporary center */ + double xc,yc,rad; /* center and radius */ + double tot; /* sum of values */ + double incr; /* increment in angle */ + double curang; /* current angle we are drawing */ + double txc,tyc; /* temporary center */ double lh = fl_height(); /* compute center and radius */ double h_denom = (special ? 2.3 : 2.0); @@ -213,10 +211,10 @@ static void draw_piechart(int x,int y,int w,int h, /* draw the label */ double xl = txc + 1.1*rad*cos(ARCINC*curang); fl_draw(entries[i].str, - (int)rint(xl), - (int)rint(tyc - 1.1*rad*sin(ARCINC*curang)), - 0, 0, - xl<txc ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT); + (int)rint(xl), + (int)rint(tyc - 1.1*rad*sin(ARCINC*curang)), + 0, 0, + xl<txc ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT); curang += 0.5 * incr * entries[i].val; } } @@ -234,36 +232,36 @@ void Fl_Chart::draw() { ww--; hh--; // adjust for line thickness if (min >= max) { - min = max = 0.0; - for (int i=0; i<numb; i++) { - if (entries[i].val < min) min = entries[i].val; - if (entries[i].val > max) max = entries[i].val; - } + min = max = 0.0; + for (int i=0; i<numb; i++) { + if (entries[i].val < min) min = entries[i].val; + if (entries[i].val > max) max = entries[i].val; + } } fl_font(textfont(),textsize()); switch (type()) { case FL_BAR_CHART: - ww++; // makes the bars fill box correctly - draw_barchart(xx,yy,ww,hh, numb, entries, min, max, - autosize(), maxnumb, textcolor()); - break; + ww++; // makes the bars fill box correctly + draw_barchart(xx,yy,ww,hh, numb, entries, min, max, + autosize(), maxnumb, textcolor()); + break; case FL_HORBAR_CHART: - hh++; // makes the bars fill box correctly - draw_horbarchart(xx,yy,ww,hh, numb, entries, min, max, - autosize(), maxnumb, textcolor()); - break; + hh++; // makes the bars fill box correctly + draw_horbarchart(xx,yy,ww,hh, numb, entries, min, max, + autosize(), maxnumb, textcolor()); + break; case FL_PIE_CHART: - draw_piechart(xx,yy,ww,hh,numb,entries,0, textcolor()); - break; + draw_piechart(xx,yy,ww,hh,numb,entries,0, textcolor()); + break; case FL_SPECIALPIE_CHART: - draw_piechart(xx,yy,ww,hh,numb,entries,1,textcolor()); - break; + draw_piechart(xx,yy,ww,hh,numb,entries,1,textcolor()); + break; default: - draw_linechart(type(),xx,yy,ww,hh, numb, entries, min, max, - autosize(), maxnumb, textcolor()); - break; + draw_linechart(type(),xx,yy,ww,hh, numb, entries, min, max, + autosize(), maxnumb, textcolor()); + break; } draw_label(); fl_pop_clip(); @@ -271,10 +269,10 @@ void Fl_Chart::draw() { /*------------------------------*/ -#define FL_CHART_BOXTYPE FL_BORDER_BOX -#define FL_CHART_COL1 FL_COL1 -#define FL_CHART_LCOL FL_LCOL -#define FL_CHART_ALIGN FL_ALIGN_BOTTOM +#define FL_CHART_BOXTYPE FL_BORDER_BOX +#define FL_CHART_COL1 FL_COL1 +#define FL_CHART_LCOL FL_LCOL +#define FL_CHART_ALIGN FL_ALIGN_BOTTOM /** Create a new Fl_Chart widget using the given position, size and label string. @@ -334,9 +332,9 @@ void Fl_Chart::add(double val, const char *str, unsigned col) { entries[numb].val = float(val); entries[numb].col = col; if (str) { - strlcpy(entries[numb].str,str,FL_CHART_LABEL_MAX + 1); + strlcpy(entries[numb].str,str,FL_CHART_LABEL_MAX + 1); } else { - entries[numb].str[0] = 0; + entries[numb].str[0] = 0; } numb++; redraw(); @@ -416,12 +414,8 @@ void Fl_Chart::maxsize(int m) { /* Shift entries if required */ if (numb > maxnumb) { for (i = 0; i<maxnumb; i++) - entries[i] = entries[i+numb-maxnumb]; + entries[i] = entries[i+numb-maxnumb]; numb = maxnumb; redraw(); } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Check_Browser.cxx b/src/Fl_Check_Browser.cxx index dd9786091..6d802688c 100644 --- a/src/Fl_Check_Browser.cxx +++ b/src/Fl_Check_Browser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Check_Browser implementation for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -26,79 +24,79 @@ either forwards or backwards. */ Fl_Check_Browser::cb_item *Fl_Check_Browser::find_item(int n) const { - int i = n; - cb_item *p = first; - - if (n <= 0 || n > nitems_ || p == 0) { - return 0; - } - - if (n == cached_item) { - p = cache; - n = 1; - } else if (n == cached_item + 1) { - p = cache->next; - n = 1; - } else if (n == cached_item - 1) { - p = cache->prev; - n = 1; - } - - while (--n) { - p = p->next; - } - - /* Cast to not const and cache it. */ - - ((Fl_Check_Browser *)this)->cache = p; - ((Fl_Check_Browser *)this)->cached_item = i; - - return p; + int i = n; + cb_item *p = first; + + if (n <= 0 || n > nitems_ || p == 0) { + return 0; + } + + if (n == cached_item) { + p = cache; + n = 1; + } else if (n == cached_item + 1) { + p = cache->next; + n = 1; + } else if (n == cached_item - 1) { + p = cache->prev; + n = 1; + } + + while (--n) { + p = p->next; + } + + /* Cast to not const and cache it. */ + + ((Fl_Check_Browser *)this)->cache = p; + ((Fl_Check_Browser *)this)->cached_item = i; + + return p; } int Fl_Check_Browser::lineno(cb_item *p0) const { - cb_item *p = first; - - if (p == 0) { - return 0; - } - - int i = 1; - while (p) { - if (p == p0) { - return i; - } - i++; - p = p->next; - } - - return 0; + cb_item *p = first; + + if (p == 0) { + return 0; + } + + int i = 1; + while (p) { + if (p == p0) { + return i; + } + i++; + p = p->next; + } + + return 0; } Fl_Check_Browser::Fl_Check_Browser(int X, int Y, int W, int H, const char *l) /** The constructor makes an empty browser.*/ : Fl_Browser_(X, Y, W, H, l) { - type(FL_SELECT_BROWSER); - when(FL_WHEN_NEVER); - first = last = 0; - nitems_ = nchecked_ = 0; - cached_item = -1; + type(FL_SELECT_BROWSER); + when(FL_WHEN_NEVER); + first = last = 0; + nitems_ = nchecked_ = 0; + cached_item = -1; } void *Fl_Check_Browser::item_first() const { - return first; + return first; } void *Fl_Check_Browser::item_next(void *l) const { - return ((cb_item *)l)->next; + return ((cb_item *)l)->next; } void *Fl_Check_Browser::item_prev(void *l) const { - return ((cb_item *)l)->prev; + return ((cb_item *)l)->prev; } int Fl_Check_Browser::item_height(void *) const { - return textsize() + 2; + return textsize() + 2; } const char *Fl_Check_Browser::item_text(void *item) const { @@ -174,102 +172,102 @@ void Fl_Check_Browser::item_swap(void *a, void *b) { #define CHECK_SIZE (textsize()-2) int Fl_Check_Browser::item_width(void *v) const { - fl_font(textfont(), textsize()); - return int(fl_width(((cb_item *)v)->text)) + CHECK_SIZE + 8; + fl_font(textfont(), textsize()); + return int(fl_width(((cb_item *)v)->text)) + CHECK_SIZE + 8; } void Fl_Check_Browser::item_draw(void *v, int X, int Y, int, int) const { - cb_item *i = (cb_item *)v; - char *s = i->text; - int tsize = textsize(); - Fl_Color col = active_r() ? textcolor() : fl_inactive(textcolor()); - int cy = Y + (tsize + 1 - CHECK_SIZE) / 2; - X += 2; - - fl_color(active_r() ? FL_FOREGROUND_COLOR : fl_inactive(FL_FOREGROUND_COLOR)); - fl_loop(X, cy, X, cy + CHECK_SIZE, - X + CHECK_SIZE, cy + CHECK_SIZE, X + CHECK_SIZE, cy); - if (i->checked) { - int tx = X + 3; - int tw = CHECK_SIZE - 4; - int d1 = tw/3; - int d2 = tw-d1; - int ty = cy + (CHECK_SIZE+d2)/2-d1-2; - for (int n = 0; n < 3; n++, ty++) { - fl_line(tx, ty, tx+d1, ty+d1); - fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); - } - } - fl_font(textfont(), tsize); - if (i->selected) { - col = fl_contrast(col, selection_color()); - } - fl_color(col); - fl_draw(s, X + CHECK_SIZE + 8, Y + tsize - 1); + cb_item *i = (cb_item *)v; + char *s = i->text; + int tsize = textsize(); + Fl_Color col = active_r() ? textcolor() : fl_inactive(textcolor()); + int cy = Y + (tsize + 1 - CHECK_SIZE) / 2; + X += 2; + + fl_color(active_r() ? FL_FOREGROUND_COLOR : fl_inactive(FL_FOREGROUND_COLOR)); + fl_loop(X, cy, X, cy + CHECK_SIZE, + X + CHECK_SIZE, cy + CHECK_SIZE, X + CHECK_SIZE, cy); + if (i->checked) { + int tx = X + 3; + int tw = CHECK_SIZE - 4; + int d1 = tw/3; + int d2 = tw-d1; + int ty = cy + (CHECK_SIZE+d2)/2-d1-2; + for (int n = 0; n < 3; n++, ty++) { + fl_line(tx, ty, tx+d1, ty+d1); + fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); + } + } + fl_font(textfont(), tsize); + if (i->selected) { + col = fl_contrast(col, selection_color()); + } + fl_color(col); + fl_draw(s, X + CHECK_SIZE + 8, Y + tsize - 1); } void Fl_Check_Browser::item_select(void *v, int state) { - cb_item *i = (cb_item *)v; - - if (state) { - if (i->checked) { - i->checked = 0; - nchecked_--; - } else { - i->checked = 1; - nchecked_++; - } - } + cb_item *i = (cb_item *)v; + + if (state) { + if (i->checked) { + i->checked = 0; + nchecked_--; + } else { + i->checked = 1; + nchecked_++; + } + } } int Fl_Check_Browser::item_selected(void *v) const { - cb_item *i = (cb_item *)v; - return i->selected; + cb_item *i = (cb_item *)v; + return i->selected; } /** - Add a new unchecked line to the end of the browser. + Add a new unchecked line to the end of the browser. \see add(char *s, int b) */ int Fl_Check_Browser::add(char *s) { - return (add(s, 0)); + return (add(s, 0)); } -/** +/** Add a new line to the end of the browser. The text is copied using the strdup() function. It may also be NULL to make a blank line. It can set the item checked if \p b is not 0. */ int Fl_Check_Browser::add(char *s, int b) { - cb_item *p = (cb_item *)malloc(sizeof(cb_item)); - p->next = 0; - p->prev = 0; - p->checked = b; - p->selected = 0; + cb_item *p = (cb_item *)malloc(sizeof(cb_item)); + p->next = 0; + p->prev = 0; + p->checked = b; + p->selected = 0; p->text = strdup(s?s:""); - if (b) { - nchecked_++; - } + if (b) { + nchecked_++; + } - if (last == 0) { - first = last = p; - } else { - last->next = p; - p->prev = last; - last = p; - } - nitems_++; + if (last == 0) { + first = last = p; + } else { + last->next = p; + p->prev = last; + last = p; + } + nitems_++; - return (nitems_); + return (nitems_); } /** - Remove line n and make the browser one line shorter. Returns the + Remove line n and make the browser one line shorter. Returns the number of lines left in the browser. */ int Fl_Check_Browser::remove(int item) { cb_item *p = find_item(item); - + // line at item exists if(p) { // tell the Browser_ what we will do @@ -278,105 +276,105 @@ int Fl_Check_Browser::remove(int item) { // fix checked count if(p->checked) --nchecked_; - + // remove the node - if (p->prev) + if (p->prev) p->prev->next = p->next; - else + else first = p->next; - if (p->next) + if (p->next) p->next->prev = p->prev; - else + else last = p->prev; - + free(p->text); free(p); - + --nitems_; cached_item = -1; } - + return (nitems_); } /** Remove every item from the browser.*/ void Fl_Check_Browser::clear() { - cb_item *p = first; - cb_item *next; - - if (p == 0) { - return; - } - - new_list(); - do { - next = p->next; - free(p->text); - free(p); - p = next; - } while (p); - - first = last = 0; - nitems_ = nchecked_ = 0; - cached_item = -1; + cb_item *p = first; + cb_item *next; + + if (p == 0) { + return; + } + + new_list(); + do { + next = p->next; + free(p->text); + free(p); + p = next; + } while (p); + + first = last = 0; + nitems_ = nchecked_ = 0; + cached_item = -1; } /** Gets the current status of item item. */ int Fl_Check_Browser::checked(int i) const { - cb_item *p = find_item(i); + cb_item *p = find_item(i); - if (p) return p->checked; - return 0; + if (p) return p->checked; + return 0; } /** Sets the check status of item item to b. */ void Fl_Check_Browser::checked(int i, int b) { - cb_item *p = find_item(i); - - if (p && (p->checked ^ b)) { - p->checked = b; - if (b) { - nchecked_++; - } else { - nchecked_--; - } - redraw(); - } + cb_item *p = find_item(i); + + if (p && (p->checked ^ b)) { + p->checked = b; + if (b) { + nchecked_++; + } else { + nchecked_--; + } + redraw(); + } } /** Returns the index of the currently selected item.*/ int Fl_Check_Browser::value() const { - return lineno((cb_item *)selection()); + return lineno((cb_item *)selection()); } /** Return a pointer to an internal buffer holding item item's text.*/ char *Fl_Check_Browser::text(int i) const { - cb_item *p = find_item(i); + cb_item *p = find_item(i); - if (p) return p->text; - return 0; + if (p) return p->text; + return 0; } /** Sets all the items checked.*/ void Fl_Check_Browser::check_all() { - cb_item *p; + cb_item *p; - nchecked_ = nitems_; - for (p = first; p; p = p->next) { - p->checked = 1; - } - redraw(); + nchecked_ = nitems_; + for (p = first; p; p = p->next) { + p->checked = 1; + } + redraw(); } /** Sets all the items unchecked.*/ void Fl_Check_Browser::check_none() { - cb_item *p; + cb_item *p; - nchecked_ = 0; - for (p = first; p; p = p->next) { - p->checked = 0; - } - redraw(); + nchecked_ = 0; + for (p = first; p; p = p->next) { + p->checked = 0; + } + redraw(); } int Fl_Check_Browser::handle(int event) { @@ -388,7 +386,3 @@ int Fl_Check_Browser::handle(int event) { } return Fl_Browser_::handle(event); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Check_Button.cxx b/src/Fl_Check_Button.cxx index 56ef3160b..2aba43d0d 100644 --- a/src/Fl_Check_Button.cxx +++ b/src/Fl_Check_Button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Check button widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx index d12f473e3..20b374442 100644 --- a/src/Fl_Choice.cxx +++ b/src/Fl_Choice.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Choice widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -26,17 +24,17 @@ // button: it draws the text of the current pick and a down-arrow. void Fl_Choice::draw() { - Fl_Boxtype btype = Fl::scheme() ? FL_UP_BOX // non-default uses up box - : FL_DOWN_BOX; // default scheme uses down box + Fl_Boxtype btype = Fl::scheme() ? FL_UP_BOX // non-default uses up box + : FL_DOWN_BOX; // default scheme uses down box int dx = Fl::box_dx(btype); int dy = Fl::box_dy(btype); // Arrow area int H = h() - 2 * dy; - int W = Fl::is_scheme("gtk+") ? 20 : // gtk+ -- fixed size - Fl::is_scheme("gleam") ? 20 : // gleam -- fixed size - Fl::is_scheme("plastic") ? ((H > 20) ? 20 : H) // plastic: shrink if H<20 - : ((H > 20) ? 20 : H); // default: shrink if H<20 + int W = Fl::is_scheme("gtk+") ? 20 : // gtk+ -- fixed size + Fl::is_scheme("gleam") ? 20 : // gleam -- fixed size + Fl::is_scheme("plastic") ? ((H > 20) ? 20 : H) // plastic: shrink if H<20 + : ((H > 20) ? 20 : H); // default: shrink if H<20 int X = x() + w() - W - dx; int Y = y() + dy; @@ -186,7 +184,7 @@ int Fl_Choice::handle(int e) { if (Fl::visible_focus()) Fl::focus(this); J1: if (Fl::scheme() - || fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) != textcolor()) { + || fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) != textcolor()) { v = menu()->pulldown(x(), y(), w(), h(), mvalue(), this); if (wp.deleted()) return 1; } else { @@ -219,7 +217,3 @@ int Fl_Choice::handle(int e) { return 0; } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx index 4d7f21e47..15ac88d14 100644 --- a/src/Fl_Clock.cxx +++ b/src/Fl_Clock.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Clock widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -263,8 +261,3 @@ Fl_Round_Clock::Fl_Round_Clock(int X,int Y,int W,int H, const char *L) type(FL_ROUND_CLOCK); box(FL_NO_BOX); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Color_Chooser.cxx b/src/Fl_Color_Chooser.cxx index 283424fca..9111dba7e 100644 --- a/src/Fl_Color_Chooser.cxx +++ b/src/Fl_Color_Chooser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Color chooser for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -44,11 +42,11 @@ \param[out] R, G, B color components */ void Fl_Color_Chooser::hsv2rgb( - double H, double S, double V, double& R, double& G, double& B) { + double H, double S, double V, double& R, double& G, double& B) { if (S < 5.0e-6) { R = G = B = V; } else { - int i = (int)H; + int i = (int)H; double f = H - (float)i; double p1 = V*(1.0-S); double p2 = V*(1.0-S*f); @@ -70,7 +68,7 @@ void Fl_Color_Chooser::hsv2rgb( \param[out] H, S, V color components */ void Fl_Color_Chooser::rgb2hsv( - double R, double G, double B, double& H, double& S, double& V) { + double R, double G, double B, double& H, double& S, double& V) { double maxv = R > G ? R : G; if (B > maxv) maxv = B; V = maxv; if (maxv>0) { @@ -86,10 +84,10 @@ void Fl_Color_Chooser::rgb2hsv( /** Fl_Color_Chooser modes */ enum { - M_RGB, /**< mode() of Fl_Color_Chooser showing RGB values */ - M_BYTE, /**< mode() of Fl_Color_Chooser showing byte values */ - M_HEX, /**< mode() of Fl_Color_Chooser showing hex values */ - M_HSV /**< mode() of Fl_Color_Chooser showing HSV values */ + M_RGB, /**< mode() of Fl_Color_Chooser showing RGB values */ + M_BYTE, /**< mode() of Fl_Color_Chooser showing byte values */ + M_HEX, /**< mode() of Fl_Color_Chooser showing hex values */ + M_HSV /**< mode() of Fl_Color_Chooser showing HSV values */ }; static const Fl_Menu_Item mode_menu[] = { {"rgb"}, @@ -150,7 +148,7 @@ int Fl_Color_Chooser::rgb(double R, double G, double B) { #endif valuebox.damage(FL_DAMAGE_EXPOSE);} if (hue_ != ph || saturation_ != ps) { - huebox.damage(FL_DAMAGE_EXPOSE); + huebox.damage(FL_DAMAGE_EXPOSE); valuebox.damage(FL_DAMAGE_SCROLL); } return 1; @@ -178,7 +176,7 @@ int Fl_Color_Chooser::hsv(double H, double S, double V) { #endif valuebox.damage(FL_DAMAGE_EXPOSE);} if (hue_ != ph || saturation_ != ps) { - huebox.damage(FL_DAMAGE_EXPOSE); + huebox.damage(FL_DAMAGE_EXPOSE); valuebox.damage(FL_DAMAGE_SCROLL); } hsv2rgb(H,S,V,r_,g_,b_); @@ -490,7 +488,7 @@ static int copy_rgb(double r, double g, double b) { All other events are processed by the parent class \c Fl_Group. - This enables the \b user to choose a color value, press + This enables the \b user to choose a color value, press \p ctrl-c to copy the value to the clipboard and paste it into a color selection widget in another application window or any other text input (e.g. a preferences dialog or an editor). @@ -500,8 +498,8 @@ static int copy_rgb(double r, double g, double b) { selecting text in one of the input widgets effectively disables this special method. - \param[in] e current event - \returns 1 if event has been handled, 0 otherwise + \param[in] e current event + \returns 1 if event has been handled, 0 otherwise \see Fl_Group::handle(int) */ @@ -516,19 +514,19 @@ int Fl_Color_Chooser::handle(int e) { case FL_SHORTCUT: // ignore CTRL-SHIFT-C, CTRL-SHIFT-X and CTRL-SHIFT-Insert if (shift) - return Fl_Group::handle(e); + return Fl_Group::handle(e); switch (Fl::event_key()) { - case FL_Insert: - if (mods == FL_CTRL) - return copy_rgb(r_, g_, b_); - break; - case 'c': - case 'x': - if (mods == FL_COMMAND) - return copy_rgb(r_, g_, b_); - break; - default: - break; + case FL_Insert: + if (mods == FL_CTRL) + return copy_rgb(r_, g_, b_); + break; + case 'c': + case 'x': + if (mods == FL_COMMAND) + return copy_rgb(r_, g_, b_); + break; + default: + break; } default: break; @@ -592,9 +590,9 @@ public: void ColorChip::draw() { if (damage()&FL_DAMAGE_ALL) draw_box(); fl_rectf(x()+Fl::box_dx(box()), - y()+Fl::box_dy(box()), - w()-Fl::box_dw(box()), - h()-Fl::box_dh(box()),r,g,b); + y()+Fl::box_dy(box()), + w()-Fl::box_dw(box()), + h()-Fl::box_dh(box()),r,g,b); } static void chooser_cb(Fl_Widget* o, void* vv) { @@ -610,7 +608,7 @@ extern const char* fl_ok; extern const char* fl_cancel; // fl_color_chooser's callback for ok_button (below) -// [in] o is a pointer to okay_button (below) +// [in] o is a pointer to okay_button (below) // [in] p is a pointer to an int to receive the return value (1) // closes the fl_color_chooser window static void cc_ok_cb (Fl_Widget *o, void *p) { @@ -630,17 +628,17 @@ static void cc_cancel_cb (Fl_Widget *o, void *p) { o->hide(); } -/** \addtogroup group_comdlg +/** \addtogroup group_comdlg @{ */ /** \brief Pops up a window to let the user pick an arbitrary RGB color. \note \#include <FL/Fl_Color_Chooser.H> - \image html fl_color_chooser.jpg + \image html fl_color_chooser.jpg \image latex fl_color_chooser.jpg "fl_color_chooser" width=8cm \param[in] name Title label for the window \param[in,out] r, g, b Color components in the range 0.0 to 1.0. \param[in] cmode Optional mode for color chooser. See mode(int). Default -1 if none (rgb mode). - \retval 1 if user confirms the selection + \retval 1 if user confirms the selection \retval 0 if user cancels the dialog \relates Fl_Color_Chooser */ @@ -678,12 +676,12 @@ int fl_color_chooser(const char* name, double& r, double& g, double& b, int cmod /** \brief Pops up a window to let the user pick an arbitrary RGB color. \note \#include <FL/Fl_Color_Chooser.H> - \image html fl_color_chooser.jpg + \image html fl_color_chooser.jpg \image latex fl_color_chooser.jpg "fl_color_chooser" width=8cm \param[in] name Title label for the window \param[in,out] r, g, b Color components in the range 0 to 255. \param[in] cmode Optional mode for color chooser. See mode(int). Default -1 if none (rgb mode). - \retval 1 if user confirms the selection + \retval 1 if user confirms the selection \retval 0 if user cancels the dialog \relates Fl_Color_Chooser */ @@ -701,6 +699,3 @@ int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b, int cmode) } /** @} */ -// -// End of "$Id$". -// diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx index 0eecaf59b..5ef4ea4e3 100644 --- a/src/Fl_Copy_Surface.cxx +++ b/src/Fl_Copy_Surface.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Copy_Surface.H> @@ -81,7 +79,3 @@ int Fl_Copy_Surface_Driver::printable_rect(int *w, int *h) { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Counter.cxx b/src/Fl_Counter.cxx index f27743df3..992f0c2e9 100644 --- a/src/Fl_Counter.cxx +++ b/src/Fl_Counter.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Counter widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -37,18 +35,18 @@ void Fl_Counter::draw() { int xx[5], ww[5]; if (type() == FL_NORMAL_COUNTER) { int W = w()*15/100; - xx[1] = x(); ww[1] = W; + xx[1] = x(); ww[1] = W; xx[2] = x()+1*W; ww[2] = W; xx[0] = x()+2*W; ww[0] = w()-4*W; xx[3] = x()+w()-2*W; ww[3] = W; xx[4] = x()+w()-1*W; ww[4] = W; } else { int W = w()*20/100; - xx[1] = 0; ww[1] = 0; - xx[2] = x(); ww[2] = W; - xx[0] = x()+W; ww[0] = w()-2*W; + xx[1] = 0; ww[1] = 0; + xx[2] = x(); ww[2] = W; + xx[0] = x()+W; ww[0] = w()-2*W; xx[3] = x()+w()-1*W; ww[3] = W; - xx[4] = 0; ww[4] = 0; + xx[4] = 0; ww[4] = 0; } draw_box(boxtype[0], xx[0], y(), ww[0], h(), FL_BACKGROUND2_COLOR); @@ -148,11 +146,11 @@ int Fl_Counter::handle(int event) { case FL_KEYBOARD : switch (Fl::event_key()) { case FL_Left: - handle_drag(clamp(increment(value(),-1))); - return 1; + handle_drag(clamp(increment(value(),-1))); + return 1; case FL_Right: - handle_drag(clamp(increment(value(),1))); - return 1; + handle_drag(clamp(increment(value(),1))); + return 1; default: return 0; } @@ -203,8 +201,3 @@ Fl_Simple_Counter::Fl_Simple_Counter(int X,int Y,int W,int H, const char *L) : Fl_Counter(X,Y,W,H,L) { type(FL_SIMPLE_COUNTER); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx index 02e01f544..755e381e1 100644 --- a/src/Fl_Device.cxx +++ b/src/Fl_Device.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // implementation of classes Fl_Surface_Device and Fl_Display_Device for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -22,7 +20,7 @@ #include <FL/Fl_Graphics_Driver.H> /* Inheritance diagram. - + +- Fl_Surface_Device: any kind of surface that we can draw onto -> uses an Fl_Graphics_Driver | +- Fl_Display_Device: some kind of video device (one object per app) @@ -45,7 +43,7 @@ | +- Fl_Posix_Printer_Driver: Fl_Printer uses that under Posix platforms +- Fl_GTK_Printer_Driver: Fl_Printer uses that under Posix+GTK platforms - + +- Fl_Graphics_Driver -> directed to an Fl_Surface_Device object | +- Fl_PostScript_Graphics_Driver: platform-independent graphics driver for PostScript drawing @@ -60,7 +58,7 @@ */ /** Make this surface the current drawing surface. - This surface will receive all future graphics requests. + This surface will receive all future graphics requests. \p Starting from FLTK 1.4.0, another convenient API to set/unset the current drawing surface is Fl_Surface_Device::push_current( ) / Fl_Surface_Device::pop_current().*/ void Fl_Surface_Device::set_current(void) @@ -120,7 +118,7 @@ void Fl_Surface_Device::push_current(Fl_Surface_Device *new_current) } /** Removes the top element from the current drawing surface stack, and makes the new top element current. - \return A pointer to the new current drawing surface. + \return A pointer to the new current drawing surface. \version 1.4.0 */ Fl_Surface_Device *Fl_Surface_Device::pop_current() { @@ -136,7 +134,3 @@ Fl_Device_Plugin *Fl_Device_Plugin::opengl_plugin() { } return pi; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Dial.cxx b/src/Fl_Dial.cxx index 333c9d549..2a9df4769 100644 --- a/src/Fl_Dial.cxx +++ b/src/Fl_Dial.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Circular dial widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -166,8 +164,3 @@ Fl_Line_Dial::Fl_Line_Dial(int X,int Y,int W,int H, const char *L) : Fl_Dial(X,Y,W,H,L) { type(FL_LINE_DIAL); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx index 7188a320a..2af98b439 100644 --- a/src/Fl_Double_Window.cxx +++ b/src/Fl_Double_Window.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Double-buffered window code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file Fl_Double_Window implementation. @@ -82,7 +80,3 @@ void Fl_Double_Window::flush() Fl_Double_Window::~Fl_Double_Window() { hide(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_File_Browser.cxx b/src/Fl_File_Browser.cxx index 8956361da..e7a7ea8d4 100644 --- a/src/Fl_File_Browser.cxx +++ b/src/Fl_File_Browser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_File_Browser routines. // // Copyright 1999-2010 by Michael Sweet. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -36,7 +34,7 @@ #include "Fl_System_Driver.H" #include <FL/fl_draw.H> #include <FL/filename.H> -#include <FL/Fl_Image.H> // icon +#include <FL/Fl_Image.H> // icon #include <stdio.h> #include <stdlib.h> #include "flstring.h" @@ -53,15 +51,15 @@ // FL_BLINE should be private to Fl_Browser, and not re-defined here. // For now, make sure this struct is precisely consistent with Fl_Browser.cxx. // -struct FL_BLINE // data is in a linked list of these +struct FL_BLINE // data is in a linked list of these { - FL_BLINE *prev; // Previous item in list - FL_BLINE *next; // Next item in list - void *data; // Pointer to data (function) - Fl_Image *icon; // Pointer to optional icon - short length; // sizeof(txt)-1, may be longer than string - char flags; // selected, displayed - char txt[1]; // start of allocated array + FL_BLINE *prev; // Previous item in list + FL_BLINE *next; // Next item in list + void *data; // Pointer to data (function) + Fl_Image *icon; // Pointer to optional icon + short length; // sizeof(txt)-1, may be longer than string + char flags; // selected, displayed + char txt[1]; // start of allocated array }; @@ -69,11 +67,11 @@ struct FL_BLINE // data is in a linked list of these // 'Fl_File_Browser::full_height()' - Return the height of the list. // -int // O - Height in pixels +int // O - Height in pixels Fl_File_Browser::full_height() const { - int i, // Looping var - th; // Total height of list. + int i, // Looping var + th; // Total height of list. for (i = 0, th = 0; i < size(); i ++) @@ -87,13 +85,13 @@ Fl_File_Browser::full_height() const // 'Fl_File_Browser::item_height()' - Return the height of a list item. // -int // O - Height in pixels -Fl_File_Browser::item_height(void *p) const // I - List item data +int // O - Height in pixels +Fl_File_Browser::item_height(void *p) const // I - List item data { - FL_BLINE *line; // Pointer to line - char *t; // Pointer into text - int height; // Width of line - int textheight; // Height of text + FL_BLINE *line; // Pointer to line + char *t; // Pointer into text + int height; // Width of line + int textheight; // Height of text // Figure out the standard text height... @@ -109,7 +107,7 @@ Fl_File_Browser::item_height(void *p) const // I - List item data if (line != NULL) for (t = line->txt; *t != '\0'; t ++) if (*t == '\n') - height += textheight; + height += textheight; // If we have enabled icons then add space for them... if (Fl_File_Icon::first() != NULL && height < iconsize_) @@ -127,18 +125,18 @@ Fl_File_Browser::item_height(void *p) const // I - List item data // 'Fl_File_Browser::item_width()' - Return the width of a list item. // -int // O - Width in pixels -Fl_File_Browser::item_width(void *p) const // I - List item data +int // O - Width in pixels +Fl_File_Browser::item_width(void *p) const // I - List item data { - int i; // Looping var - FL_BLINE *line; // Pointer to line - char *t, // Pointer into text - *ptr, // Pointer into fragment - fragment[10240]; // Fragment of text - int width, // Width of line - tempwidth; // Width of fragment - int column; // Current column - const int *columns; // Columns + int i; // Looping var + FL_BLINE *line; // Pointer to line + char *t, // Pointer into text + *ptr, // Pointer into fragment + fragment[10240]; // Fragment of text + int width, // Width of line + tempwidth; // Width of fragment + int column; // Current column + const int *columns; // Columns // Scan for newlines... @@ -170,33 +168,33 @@ Fl_File_Browser::item_width(void *p) const // I - List item data // Newline - nul terminate this fragment and get the width... *ptr = '\0'; - tempwidth += (int)fl_width(fragment); + tempwidth += (int)fl_width(fragment); // Update the max width as needed... - if (tempwidth > width) - width = tempwidth; + if (tempwidth > width) + width = tempwidth; // Point back to the start of the fragment... - ptr = fragment; - tempwidth = 0; - column = 0; + ptr = fragment; + tempwidth = 0; + column = 0; } else if (*t == column_char()) { // Advance to the next column... column ++; - if (columns) - { - for (i = 0, tempwidth = 0; i < column && columns[i]; i ++) - tempwidth += columns[i]; - } - else + if (columns) + { + for (i = 0, tempwidth = 0; i < column && columns[i]; i ++) + tempwidth += columns[i]; + } + else tempwidth = column * (int)(fl_height() * 0.6 * 8.0); if (tempwidth > width) - width = tempwidth; + width = tempwidth; - ptr = fragment; + ptr = fragment; } else *ptr++ = *t; @@ -210,7 +208,7 @@ Fl_File_Browser::item_width(void *p) const // I - List item data // Update the max width as needed... if (tempwidth > width) - width = tempwidth; + width = tempwidth; } } @@ -231,22 +229,22 @@ Fl_File_Browser::item_width(void *p) const // I - List item data // void -Fl_File_Browser::item_draw(void *p, // I - List item data - int X, // I - Upper-lefthand X coordinate - int Y, // I - Upper-lefthand Y coordinate - int W, // I - Width of item - int) const // I - Height of item +Fl_File_Browser::item_draw(void *p, // I - List item data + int X, // I - Upper-lefthand X coordinate + int Y, // I - Upper-lefthand Y coordinate + int W, // I - Width of item + int) const // I - Height of item { - int i; // Looping var - FL_BLINE *line; // Pointer to line - Fl_Color c; // Text color - char *t, // Pointer into text - *ptr, // Pointer into fragment - fragment[10240]; // Fragment of text - int width, // Width of line - height; // Height of line - int column; // Current column - const int *columns; // Columns + int i; // Looping var + FL_BLINE *line; // Pointer to line + Fl_Color c; // Text color + char *t, // Pointer into text + *ptr, // Pointer into fragment + fragment[10240]; // Fragment of text + int width, // Width of line + height; // Height of line + int column; // Current column + const int *columns; // Columns // Draw the list item text... @@ -273,9 +271,9 @@ Fl_File_Browser::item_draw(void *p, // I - List item data // Draw the icon if it is set... if (line->data) ((Fl_File_Icon *)line->data)->draw(X, Y, iconsize_, iconsize_, - (line->flags & SELECTED) ? FL_YELLOW : - FL_LIGHT2, - active_r()); + (line->flags & SELECTED) ? FL_YELLOW : + FL_LIGHT2, + active_r()); // Draw the text offset to the right... X += iconsize_ + 9; @@ -286,7 +284,7 @@ Fl_File_Browser::item_draw(void *p, // I - List item data for (t = line->txt; *t != '\0'; t ++) if (*t == '\n') - height += fl_height(); + height += fl_height(); if (height < iconsize_) Y += (iconsize_ - height) / 2; @@ -323,11 +321,11 @@ Fl_File_Browser::item_draw(void *p, // I - List item data int cW = W - width; // Clip width... if (columns) { - // Try clipping inside this column... - for (i = 0; i < column && columns[i]; i ++) { ; } + // Try clipping inside this column... + for (i = 0; i < column && columns[i]; i ++) { ; } - if (columns[i]) - cW = columns[i]; + if (columns[i]) + cW = columns[i]; } fl_draw(fragment, X + width, Y, cW, fl_height(), @@ -336,11 +334,11 @@ Fl_File_Browser::item_draw(void *p, // I - List item data // Advance to the next column... column ++; if (columns) { - for (i = 0, width = 0; i < column && columns[i]; i ++) - width += columns[i]; + for (i = 0, width = 0; i < column && columns[i]; i ++) + width += columns[i]; } else - width = column * (int)(fl_height() * 0.6 * 8.0); + width = column * (int)(fl_height() * 0.6 * 8.0); ptr = fragment; } else @@ -361,10 +359,10 @@ Fl_File_Browser::item_draw(void *p, // I - List item data // Fl_File_Browser::Fl_File_Browser(int X, // I - Upper-lefthand X coordinate - int Y, // I - Upper-lefthand Y coordinate - int W, // I - Width in pixels - int H, // I - Height in pixels - const char *l) // I - Label text + int Y, // I - Upper-lefthand Y coordinate + int W, // I - Width in pixels + int H, // I - Height in pixels + const char *l) // I - Label text : Fl_Browser(X, Y, W, H, l) { // Initialize the filter pattern, current directory, and icon size... @@ -379,15 +377,15 @@ Fl_File_Browser::Fl_File_Browser(int X, // I - Upper-lefthand X coordina // 'Fl_File_Browser::load()' - Load a directory into the browser. // -int // O - Number of files loaded +int // O - Number of files loaded Fl_File_Browser::load(const char *directory,// I - Directory to load - Fl_File_Sort_F *sort) // I - Sort function to use + Fl_File_Sort_F *sort) // I - Sort function to use { - int i; // Looping var - int num_files; // Number of files in directory - int num_dirs; // Number of directories in list - char filename[4096]; // Current file - Fl_File_Icon *icon; // Icon to use + int i; // Looping var + int num_files; // Number of files in directory + int num_dirs; // Number of directories in list + char filename[4096]; // Current file + Fl_File_Icon *icon; // Icon to use // printf("Fl_File_Browser::load(\"%s\")\n", directory); @@ -411,7 +409,7 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load } else { - dirent **files; // Files in in directory + dirent **files; // Files in in directory // // Build the file list... // @@ -421,18 +419,18 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load for (i = 0, num_dirs = 0; i < num_files; i ++) { if (strcmp(files[i]->d_name, "./")) { - snprintf(filename, sizeof(filename), "%s/%s", directory_, - files[i]->d_name); + snprintf(filename, sizeof(filename), "%s/%s", directory_, + files[i]->d_name); icon = Fl_File_Icon::find(filename); - if ((icon && icon->type() == Fl_File_Icon::DIRECTORY) || + if ((icon && icon->type() == Fl_File_Icon::DIRECTORY) || Fl::system_driver()->filename_isdir_quick(filename)) { num_dirs ++; insert(num_dirs, files[i]->d_name, icon); - } else if (filetype_ == FILES && - fl_filename_match(files[i]->d_name, pattern_)) { + } else if (filetype_ == FILES && + fl_filename_match(files[i]->d_name, pattern_)) { add(files[i]->d_name, icon); - } + } } free(files[i]); @@ -450,7 +448,7 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load // void -Fl_File_Browser::filter(const char *pattern) // I - Pattern string +Fl_File_Browser::filter(const char *pattern) // I - Pattern string { // If pattern is NULL set the pattern to "*"... if (pattern) @@ -458,8 +456,3 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string else pattern_ = "*"; } - - -// -// End of "$Id$". -// diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx index 43bdc9733..8036ffaed 100644 --- a/src/Fl_File_Chooser.cxx +++ b/src/Fl_File_Chooser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // ======================================================================= // DO NOT EDIT FL/Fl_File_Chooser.H and src/Fl_File_Chooser.cxx !!! @@ -473,7 +471,3 @@ Fl_Widget* Fl_File_Chooser::add_extra(Fl_Widget* gr) { } return ret; } - -// -// End of "$Id$". -// diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl index 4cbf3a9fc..d222bd1c8 100644 --- a/src/Fl_File_Chooser.fl +++ b/src/Fl_File_Chooser.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {../FL/Fl_File_Chooser.H} code_name {.cxx} comment {// -// "$Id$" -// // Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -13,11 +11,11 @@ comment {// // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // ======================================================================= // DO NOT EDIT FL/Fl_File_Chooser.H and src/Fl_File_Chooser.cxx !!! @@ -490,9 +488,3 @@ decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public decl {FL_EXPORT void fl_file_chooser_ok_label(const char*l);} {public local } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 5ff8ac24e..de2b7c160 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // More Fl_File_Chooser routines. // // Copyright 1999-2007 by Michael Sweet. @@ -12,9 +10,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // The following documentation is placed here because the implementation and @@ -30,7 +28,7 @@ The Fl_File_Chooser widget displays a standard file selection dialog that supports various selection modes. - \image html Fl_File_Chooser.jpg + \image html Fl_File_Chooser.jpg \image latex Fl_File_Chooser.jpg "Fl_File_Chooser" width=12cm The Fl_File_Chooser widget transmits UTF-8 encoded filenames to its user. It is @@ -42,72 +40,72 @@ The Fl_File_Chooser class also exports several static values that may be used to localize or customize the appearance of all file chooser dialogs: - + <CENTER><TABLE BORDER="1"> <TR> - <TH>Member</TH> - <TH>Default value</TH> + <TH>Member</TH> + <TH>Default value</TH> </TR> <TR> - <TD>add_favorites_label</TD> - <TD>"Add to Favorites"</TD> + <TD>add_favorites_label</TD> + <TD>"Add to Favorites"</TD> </TR> <TR> - <TD>all_files_label</TD> - <TD>"All Files (*)"</TD> + <TD>all_files_label</TD> + <TD>"All Files (*)"</TD> </TR> <TR> - <TD>custom_filter_label</TD> - <TD>"Custom Filter"</TD> + <TD>custom_filter_label</TD> + <TD>"Custom Filter"</TD> </TR> <TR> - <TD>existing_file_label</TD> - <TD>"Please choose an existing file!"</TD> + <TD>existing_file_label</TD> + <TD>"Please choose an existing file!"</TD> </TR> <TR> - <TD>favorites_label</TD> - <TD>"Favorites"</TD> + <TD>favorites_label</TD> + <TD>"Favorites"</TD> </TR> <TR> - <TD>filename_label</TD> - <TD>"Filename:"</TD> + <TD>filename_label</TD> + <TD>"Filename:"</TD> </TR> <TR> - <TD>filesystems_label</TD> - <TD>"My Computer" (Windows)<BR> - "File Systems" (all others)</TD> + <TD>filesystems_label</TD> + <TD>"My Computer" (Windows)<BR> + "File Systems" (all others)</TD> </TR> <TR> - <TD>hidden_label</TD> - <TD>"Show hidden files:"</TD> + <TD>hidden_label</TD> + <TD>"Show hidden files:"</TD> </TR> <TR> - <TD>manage_favorites_label</TD> - <TD>"Manage Favorites"</TD> + <TD>manage_favorites_label</TD> + <TD>"Manage Favorites"</TD> </TR> <TR> - <TD>new_directory_label</TD> - <TD>"New Directory?"</TD> + <TD>new_directory_label</TD> + <TD>"New Directory?"</TD> </TR> <TR> - <TD>new_directory_tooltip</TD> - <TD>"Create a new directory."</TD> + <TD>new_directory_tooltip</TD> + <TD>"Create a new directory."</TD> </TR> <TR> - <TD>preview_label</TD> - <TD>"Preview"</TD> + <TD>preview_label</TD> + <TD>"Preview"</TD> </TR> <TR> - <TD>save_label</TD> - <TD>"Save"</TD> + <TD>save_label</TD> + <TD>"Save"</TD> </TR> <TR> - <TD>show_label</TD> - <TD>"Show:"</TD> + <TD>show_label</TD> + <TD>"Show:"</TD> </TR> <TR> - <TD>sort</TD> - <TD>fl_numericsort</TD> + <TD>sort</TD> + <TD>fl_numericsort</TD> </TR> </TABLE></CENTER> @@ -126,33 +124,33 @@ The pathname argument can be a directory name or a complete file name (in which case the corresponding file is highlighted in the list and in the filename input field.) - + The pattern argument can be a NULL string or "*" to list all files, or it can be a series of descriptions and filter strings separated by tab characters (\\t). The format of filters is either "Description text (patterns)" or just "patterns". A file chooser that provides filters for HTML and image files might look like: - + \code "HTML Files (*.html)\tImage Files (*.{bmp,gif,jpg,png})" \endcode - + The file chooser will automatically add the "All Files (*)" pattern to the end of the string you pass if you do not provide one. The first filter in the string is the default filter. - + See the FLTK documentation on fl_filename_match() for the kinds of pattern strings that are supported. - + The type argument can be one of the following: - + \li \c SINGLE - allows the user to select a single, existing file. \li \c MULTI - allows the user to select one or more existing files. \li \c CREATE - allows the user to select a single, existing file or specify a new filename. \li \c DIRECTORY - allows the user to select a single, existing directory. - + The title argument is used to set the title bar text for the Fl_File_Chooser window. */ @@ -169,7 +167,7 @@ /** \var Fl_File_Chooser::showHiddenButton When checked, hidden files (i.e., filename begins with dot) are displayed. - + The "showHiddenButton" button is exported so that application developers can control its appearance. */ @@ -337,39 +335,39 @@ // File chooser label strings and sort function... // -Fl_Preferences* Fl_File_Chooser::prefs_ = NULL; - -const char *Fl_File_Chooser::add_favorites_label = "Add to Favorites"; -const char *Fl_File_Chooser::all_files_label = "All Files (*)"; -const char *Fl_File_Chooser::custom_filter_label = "Custom Filter"; -const char *Fl_File_Chooser::existing_file_label = "Please choose an existing file!"; -const char *Fl_File_Chooser::favorites_label = "Favorites"; -const char *Fl_File_Chooser::filename_label = "Filename:"; -const char *Fl_File_Chooser::filesystems_label = Fl::system_driver()->filesystems_label(); -const char *Fl_File_Chooser::manage_favorites_label = "Manage Favorites"; -const char *Fl_File_Chooser::new_directory_label = "New Directory?"; -const char *Fl_File_Chooser::new_directory_tooltip = "Create a new directory."; -const char *Fl_File_Chooser::preview_label = "Preview"; -const char *Fl_File_Chooser::save_label = "Save"; -const char *Fl_File_Chooser::show_label = "Show:"; +Fl_Preferences* Fl_File_Chooser::prefs_ = NULL; + +const char *Fl_File_Chooser::add_favorites_label = "Add to Favorites"; +const char *Fl_File_Chooser::all_files_label = "All Files (*)"; +const char *Fl_File_Chooser::custom_filter_label = "Custom Filter"; +const char *Fl_File_Chooser::existing_file_label = "Please choose an existing file!"; +const char *Fl_File_Chooser::favorites_label = "Favorites"; +const char *Fl_File_Chooser::filename_label = "Filename:"; +const char *Fl_File_Chooser::filesystems_label = Fl::system_driver()->filesystems_label(); +const char *Fl_File_Chooser::manage_favorites_label = "Manage Favorites"; +const char *Fl_File_Chooser::new_directory_label = "New Directory?"; +const char *Fl_File_Chooser::new_directory_tooltip = "Create a new directory."; +const char *Fl_File_Chooser::preview_label = "Preview"; +const char *Fl_File_Chooser::save_label = "Save"; +const char *Fl_File_Chooser::show_label = "Show:"; const char *Fl_File_Chooser::hidden_label = "Show hidden files"; -Fl_File_Sort_F *Fl_File_Chooser::sort = fl_numericsort; +Fl_File_Sort_F *Fl_File_Chooser::sort = fl_numericsort; // // Local functions... // -static int compare_dirnames(const char *a, const char *b); -static void quote_pathname(char *, const char *, int); -static void unquote_pathname(char *, const char *, int); +static int compare_dirnames(const char *a, const char *b); +static void quote_pathname(char *, const char *, int); +static void unquote_pathname(char *, const char *, int); /** Returns the number of selected files.*/ -int // O - Number of selected files +int // O - Number of selected files Fl_File_Chooser::count() { - int i; // Looping var - int fcount; // Number of selected files - const char *filename; // Filename in input field or list + int i; // Looping var + int fcount; // Number of selected files + const char *filename; // Filename in input field or list filename = fileName->value(); @@ -389,7 +387,7 @@ Fl_File_Chooser::count() { //filename = (char *)fileList->text(i); //if (filename[strlen(filename) - 1] != '/') - fcount ++; + fcount ++; } if (fcount) return fcount; @@ -402,7 +400,7 @@ Fl_File_Chooser::count() { void Fl_File_Chooser::directory(const char *d)// I - Directory to change to { - char *dirptr; // Pointer into directory + char *dirptr; // Pointer into directory char fixpath[FL_PATH_MAX]; // Path with slashes converted @@ -414,7 +412,7 @@ Fl_File_Chooser::directory(const char *d)// I - Directory to change to if (Fl::system_driver()->backslash_as_slash()) { // See if the filename contains backslashes... - char *slash; // Pointer to slashes + char *slash; // Pointer to slashes if (strchr(d, '\\')) { // Convert backslashes to slashes... strlcpy(fixpath, d, sizeof(fixpath)); @@ -446,7 +444,7 @@ Fl_File_Chooser::directory(const char *d)// I - Directory to change to *dirptr = '\0'; while (dirptr > directory_) { if (*dirptr == '/') break; - dirptr --; + dirptr --; } if (dirptr >= directory_ && *dirptr == '/') @@ -473,9 +471,9 @@ Fl_File_Chooser::directory(const char *d)// I - Directory to change to void Fl_File_Chooser::favoritesButtonCB() { - int v; // Current selection - char pathname[FL_PATH_MAX], // Pathname - menuname[FL_PATH_MAX]; // Menu name + int v; // Current selection + char pathname[FL_PATH_MAX], // Pathname + menuname[FL_PATH_MAX]; // Menu name v = favoritesButton->value(); @@ -515,11 +513,11 @@ Fl_File_Chooser::favoritesButtonCB() void Fl_File_Chooser::favoritesCB(Fl_Widget *w) - // I - Widget + // I - Widget { - int i; // Looping var - char name[32], // Preference name - pathname[1024]; // Directory in list + int i; // Looping var + char name[32], // Preference name + pathname[1024]; // Directory in list if (!w) { @@ -640,8 +638,8 @@ Fl_File_Chooser::favoritesCB(Fl_Widget *w) void Fl_File_Chooser::fileListCB() { - char *filename, // New filename - pathname[FL_PATH_MAX + 4]; // Full pathname to file + char *filename, // New filename + pathname[FL_PATH_MAX + 4]; // Full pathname to file filename = (char *)fileList->text(fileList->value()); @@ -686,27 +684,27 @@ Fl_File_Chooser::fileListCB() if ((type_ & MULTI) && !(type_ & DIRECTORY)) { if (*filename == '/') { - // Clicked on a directory, deselect everything else... - int i = fileList->value(); - fileList->deselect(); - fileList->select(i); + // Clicked on a directory, deselect everything else... + int i = fileList->value(); + fileList->deselect(); + fileList->select(i); } else { // Clicked on a file - see if there are other directories selected... int i; - const char *temp; - for (i = 1; i <= fileList->size(); i ++) { - if (i != fileList->value() && fileList->selected(i)) { - temp = fileList->text(i); - temp += strlen(temp) - 1; - if (*temp == '/') break; // Yes, selected directory - } - } + const char *temp; + for (i = 1; i <= fileList->size(); i ++) { + if (i != fileList->value() && fileList->selected(i)) { + temp = fileList->text(i); + temp += strlen(temp) - 1; + if (*temp == '/') break; // Yes, selected directory + } + } if (i <= fileList->size()) { - i = fileList->value(); - fileList->deselect(); - fileList->select(i); - } + i = fileList->value(); + fileList->deselect(); + fileList->select(i); + } } } // Strip any trailing slash from the directory name... @@ -738,16 +736,16 @@ Fl_File_Chooser::fileListCB() void Fl_File_Chooser::fileNameCB() { - char *filename, // New filename - *slash, // Pointer to trailing slash - pathname[FL_PATH_MAX], // Full pathname to file - matchname[FL_PATH_MAX]; // Matching filename - int i, // Looping var - min_match, // Minimum number of matching chars - max_match, // Maximum number of matching chars - num_files, // Number of files in directory - first_line; // First matching line - const char *file; // File from directory + char *filename, // New filename + *slash, // Pointer to trailing slash + pathname[FL_PATH_MAX], // Full pathname to file + matchname[FL_PATH_MAX]; // Matching filename + int i, // Looping var + min_match, // Minimum number of matching chars + max_match, // Maximum number of matching chars + num_files, // Number of files in directory + first_line; // First matching line + const char *file; // File from directory // puts("fileNameCB()"); // printf("Event: %s\n", fl_eventnames[Fl::event()]); @@ -791,14 +789,14 @@ Fl_File_Chooser::fileNameCB() directory(pathname); } else if ((type_ & CREATE) || fl_access(pathname, 0) == 0) { if (!Fl::system_driver()->filename_isdir_quick(pathname) || (type_ & DIRECTORY)) { - // Update the preview box... - update_preview(); + // Update the preview box... + update_preview(); - // Do any callback that is registered... - if (callback_) (*callback_)(this, data_); + // Do any callback that is registered... + if (callback_) (*callback_)(this, data_); - // Hide the window to signal things are done... - window->hide(); + // Hide the window to signal things are done... + window->hide(); } } else { // File doesn't exist, so beep at and alert the user... @@ -826,11 +824,11 @@ Fl_File_Chooser::fileNameCB() directory(pathname); if (filename[0]) { - char tempname[FL_PATH_MAX + 4]; + char tempname[FL_PATH_MAX + 4]; - snprintf(tempname, sizeof(tempname), "%s/%s", directory_, filename); - fileName->value(tempname); - strlcpy(pathname, tempname, sizeof(pathname)); + snprintf(tempname, sizeof(tempname), "%s/%s", directory_, filename); + fileName->value(tempname); + strlcpy(pathname, tempname, sizeof(pathname)); } fileName->position(p, m); @@ -848,32 +846,32 @@ Fl_File_Chooser::fileNameCB() if ( (Fl::system_driver()->case_insensitive_filenames()? strncasecmp(filename, file, min_match) : strncmp(filename, file, min_match)) == 0) { // OK, this one matches; check against the previous match - if (!first_line) { - // First match; copy stuff over... - strlcpy(matchname, file, sizeof(matchname)); - max_match = (int) strlen(matchname); - - if (matchname[max_match - 1] == '/' && // Strip trailing /, if any... - matchname[1] != 0 ) { // unless entire path is root ("/") -- STR #3500 - max_match --; - matchname[max_match] = '\0'; - } - - // And then make sure that the item is visible + if (!first_line) { + // First match; copy stuff over... + strlcpy(matchname, file, sizeof(matchname)); + max_match = (int) strlen(matchname); + + if (matchname[max_match - 1] == '/' && // Strip trailing /, if any... + matchname[1] != 0 ) { // unless entire path is root ("/") -- STR #3500 + max_match --; + matchname[max_match] = '\0'; + } + + // And then make sure that the item is visible fileList->topline(i); - first_line = i; - } else { - // Succeeding match; compare to find maximum string match... - while (max_match > min_match) + first_line = i; + } else { + // Succeeding match; compare to find maximum string match... + while (max_match > min_match) if ( (Fl::system_driver()->case_insensitive_filenames()? strncasecmp(file, matchname, max_match) : strncmp(file, matchname, max_match)) == 0) - break; - else - max_match --; + break; + else + max_match --; // Truncate the string as needed... matchname[max_match] = '\0'; - } + } } } @@ -886,17 +884,17 @@ Fl_File_Chooser::fileNameCB() fileList->redraw(); } else if (max_match > min_match && first_line) { // Add the matching portion... - fileName->replace( - (int) (filename - pathname), - (int) (filename - pathname + min_match), - matchname); + fileName->replace( + (int) (filename - pathname), + (int) (filename - pathname + min_match), + matchname); // Highlight it with the cursor at the end of the selection so // s/he can press the right arrow to accept the selection // (Tab and End also do this for both cases.) fileName->position( - (int) (filename - pathname + max_match), - (int) (filename - pathname + min_match)); + (int) (filename - pathname + max_match), + (int) (filename - pathname + min_match)); } else if (max_match == 0) { fileList->deselect(0); fileList->redraw(); @@ -930,17 +928,17 @@ Fl_File_Chooser::fileNameCB() human-readable labels with the patterns inside parenthesis, like <tt>"JPEG Files (*.jpg)\tPNG Files (*.png)\tGIF Files (*.gif)\tAll Files (*)" </tt>. - + Use filter(NULL) to show all files. */ void -Fl_File_Chooser::filter(const char *p) // I - Pattern(s) +Fl_File_Chooser::filter(const char *p) // I - Pattern(s) { - char *copyp, // Copy of pattern - *start, // Start of pattern - *end; // End of pattern - int allfiles; // Do we have a "*" pattern? - char temp[FL_PATH_MAX]; // Temporary pattern string + char *copyp, // Copy of pattern + *start, // Start of pattern + *end; // End of pattern + int allfiles; // Do we have a "*" pattern? + char temp[FL_PATH_MAX]; // Temporary pattern string // Make sure we have a pattern... @@ -971,7 +969,7 @@ Fl_File_Chooser::filter(const char *p) // I - Pattern(s) if (!allfiles) showChoice->add(all_files_label); showChoice->add(custom_filter_label); - + showChoice->value(0); showChoiceCB(); } @@ -984,8 +982,8 @@ Fl_File_Chooser::filter(const char *p) // I - Pattern(s) void Fl_File_Chooser::newdir() { - const char *dir; // New directory name - char pathname[FL_PATH_MAX + 4]; // Full path of directory + const char *dir; // New directory name + char pathname[FL_PATH_MAX + 4]; // Full path of directory // Get a directory name from the user @@ -1046,7 +1044,7 @@ void Fl_File_Chooser::preview(int e) // void -Fl_File_Chooser::previewCB(Fl_File_Chooser *fc) { // I - File chooser +Fl_File_Chooser::previewCB(Fl_File_Chooser *fc) { // I - File chooser fc->update_preview(); } @@ -1055,7 +1053,7 @@ Fl_File_Chooser::previewCB(Fl_File_Chooser *fc) { // I - File chooser void Fl_File_Chooser::rescan() { - char pathname[FL_PATH_MAX]; // New pathname for filename field + char pathname[FL_PATH_MAX]; // New pathname for filename field // Clear the current filename @@ -1079,7 +1077,7 @@ Fl_File_Chooser::rescan() } /** - Rescan the current directory without clearing the filename, + Rescan the current directory without clearing the filename, then select the file if it is in the list */ void Fl_File_Chooser::rescan_keep_filename() @@ -1092,7 +1090,7 @@ void Fl_File_Chooser::rescan_keep_filename() } int i; - char pathname[FL_PATH_MAX]; // New pathname for filename field + char pathname[FL_PATH_MAX]; // New pathname for filename field strlcpy(pathname, fn, sizeof(pathname)); // Build the file list... @@ -1104,7 +1102,7 @@ void Fl_File_Chooser::rescan_keep_filename() // and select the chosen file char found = 0; char *slash = strrchr(pathname, '/'); - if (slash) + if (slash) slash++; else slash = pathname; @@ -1131,10 +1129,10 @@ void Fl_File_Chooser::rescan_keep_filename() void Fl_File_Chooser::showChoiceCB() { - const char *item, // Selected item - *patstart; // Start of pattern - char *patend; // End of pattern - char temp[FL_PATH_MAX]; // Temporary string for pattern + const char *item, // Selected item + *patstart; // Start of pattern + char *patend; // End of pattern + char temp[FL_PATH_MAX]; // Temporary string for pattern item = showChoice->text(showChoice->value()); @@ -1170,10 +1168,10 @@ Fl_File_Chooser::showChoiceCB() void Fl_File_Chooser::update_favorites() { - int i; // Looping var - char pathname[FL_PATH_MAX], // Pathname - menuname[2048]; // Menu name - const char *home; // Home directory + int i; // Looping var + char pathname[FL_PATH_MAX], // Pathname + menuname[2048]; // Menu name + const char *home; // Home directory favoritesButton->clear(); @@ -1210,12 +1208,12 @@ Fl_File_Chooser::update_favorites() void Fl_File_Chooser::update_preview() { - const char *filename; // Current filename + const char *filename; // Current filename const char *newlabel = 0; // New label text - Fl_Shared_Image *image = 0, // New image - *oldimage; // Old image - int pbw, pbh; // Width and height of preview box - int w, h; // Width and height of preview image + Fl_Shared_Image *image = 0, // New image + *oldimage; // Old image + int pbw, pbh; // Width and height of preview box + int w, h; // Width and height of preview image int set = 0; // Set this flag as soon as a decent preview is found if (!previewButton->value()) return; @@ -1243,9 +1241,9 @@ Fl_File_Chooser::update_preview() // if this file is an image, try to load it window->cursor(FL_CURSOR_WAIT); Fl::check(); - + image = Fl_Shared_Image::get(filename); - + if (image) { window->cursor(FL_CURSOR_DEFAULT); Fl::check(); @@ -1262,9 +1260,9 @@ Fl_File_Chooser::update_preview() previewBox->image(0); if (!set) { - FILE *fp; - int bytes; - char *ptr; + FILE *fp; + int bytes; + char *ptr; if (filename) fp = fl_fopen(filename, "rb"); else fp = NULL; @@ -1303,15 +1301,15 @@ Fl_File_Chooser::update_preview() if (ptr[1] && (ptr[1]&0xc0)!=0x80) break; ptr++; } - } + } // *ptr && (isprint(*ptr & 255) || isspace(*ptr & 255)); -// ptr ++); +// ptr ++); // Scan the buffer for printable characters in 8 bit if (*ptr || ptr == preview_text_) { for (ptr = preview_text_; *ptr && (isprint(*ptr & 255) || isspace(*ptr & 255)); - ptr ++) {/*empty*/} + ptr ++) {/*empty*/} } if (*ptr || ptr == preview_text_) { @@ -1352,8 +1350,8 @@ Fl_File_Chooser::update_preview() h = w * image->h() / image->w(); if (h > pbh) { - h = pbh; - w = h * image->w() / image->h(); + h = pbh; + w = h * image->w() / image->h(); } oldimage = (Fl_Shared_Image *)image->copy(w, h); @@ -1381,7 +1379,7 @@ Fl_File_Chooser::update_preview() \p f is a \c 1-based index into a list of file names. The number of selected files is returned by Fl_File_Chooser::count(). - + This sample code loops through all selected files: \code // Get list of filenames user selected from a MULTI chooser @@ -1391,13 +1389,13 @@ Fl_File_Chooser::update_preview() } \endcode */ -const char * // O - Filename or NULL -Fl_File_Chooser::value(int f) // I - File number +const char * // O - Filename or NULL +Fl_File_Chooser::value(int f) // I - File number { - int i; // Looping var - int fcount; // Number of selected files - const char *name; // Current filename - static char pathname[FL_PATH_MAX + 4]; // Filename + directory + int i; // Looping var + int fcount; // Number of selected files + const char *name; // Current filename + static char pathname[FL_PATH_MAX + 4]; // Filename + directory name = fileName->value(); @@ -1417,13 +1415,13 @@ Fl_File_Chooser::value(int f) // I - File number fcount ++; if (fcount == f) { - if (directory_[0]) { - snprintf(pathname, sizeof(pathname), "%s/%s", directory_, name); - } else { - strlcpy(pathname, name, sizeof(pathname)); - } + if (directory_[0]) { + snprintf(pathname, sizeof(pathname), "%s/%s", directory_, name); + } else { + strlcpy(pathname, name, sizeof(pathname)); + } - return pathname; + return pathname; } } @@ -1437,12 +1435,12 @@ Fl_File_Chooser::value(int f) // I - File number */ void Fl_File_Chooser::value(const char *filename) - // I - Filename + directory + // I - Filename + directory { - int i, // Looping var - fcount; // Number of items in list - char *slash; // Directory separator - char pathname[FL_PATH_MAX]; // Local copy of filename + int i, // Looping var + fcount; // Number of items in list + char *slash; // Directory separator + char pathname[FL_PATH_MAX]; // Local copy of filename // printf("Fl_File_Chooser::value(\"%s\")\n", filename == NULL ? "(null)" : filename); @@ -1458,7 +1456,7 @@ Fl_File_Chooser::value(const char *filename) if (Fl::system_driver()->backslash_as_slash()) { // See if the filename contains backslashes... - char fixpath[FL_PATH_MAX]; // Path with slashes converted + char fixpath[FL_PATH_MAX]; // Path with slashes converted if (strchr(filename, '\\')) { // Convert backslashes to slashes... strlcpy(fixpath, filename, sizeof(fixpath)); @@ -1474,7 +1472,7 @@ Fl_File_Chooser::value(const char *filename) fl_filename_absolute(pathname, sizeof(pathname), filename); if ((slash = strrchr(pathname, '/')) != NULL) { - // Yes, change the display to the directory... + // Yes, change the display to the directory... if (!fl_filename_isdir(pathname)) *slash++ = '\0'; directory(pathname); @@ -1505,7 +1503,7 @@ Fl_File_Chooser::value(const char *filename) break; } } - + /** Shows the Fl_File_Chooser window.*/ void Fl_File_Chooser::show() { @@ -1528,7 +1526,7 @@ void Fl_File_Chooser::showHidden(int value) fileList->redraw(); } } - + void Fl_File_Chooser::remove_hidden_files() { int count = fileList->size(); @@ -1539,7 +1537,7 @@ void Fl_File_Chooser::remove_hidden_files() fileList->topline(1); } - + // // 'compare_dirnames()' - Compare two directory names. // @@ -1571,9 +1569,9 @@ compare_dirnames(const char *a, const char *b) { // static void -quote_pathname(char *dst, // O - Destination string - const char *src, // I - Source string - int dstsize) // I - Size of destination string +quote_pathname(char *dst, // O - Destination string + const char *src, // I - Source string + int dstsize) // I - Size of destination string { dstsize--; // prepare for trailing zero @@ -1586,8 +1584,8 @@ quote_pathname(char *dst, // O - Destination string src ++; } else { if (*src == '/') { - *dst++ = '\\'; - dstsize--; + *dst++ = '\\'; + dstsize--; } *dst++ = *src++; dstsize--; @@ -1603,9 +1601,9 @@ quote_pathname(char *dst, // O - Destination string // static void -unquote_pathname(char *dst, // O - Destination string - const char *src, // I - Source string - int dstsize) // I - Size of destination string +unquote_pathname(char *dst, // O - Destination string + const char *src, // I - Source string + int dstsize) // I - Size of destination string { dstsize--; // prepare for trailing zero @@ -1617,7 +1615,3 @@ unquote_pathname(char *dst, // O - Destination string *dst = '\0'; } - -// -// End of "$Id$". -// diff --git a/src/Fl_File_Icon.cxx b/src/Fl_File_Icon.cxx index f95e9db25..66f656267 100644 --- a/src/Fl_File_Icon.cxx +++ b/src/Fl_File_Icon.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_File_Icon routines. // // KDE icon code donated by Maarten De Boer. @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -47,7 +45,7 @@ // Icon cache... // -Fl_File_Icon *Fl_File_Icon::first_ = (Fl_File_Icon *)0; +Fl_File_Icon *Fl_File_Icon::first_ = (Fl_File_Icon *)0; // Registers the FL_ICON_LABEL drawing function @@ -64,10 +62,10 @@ Fl_Labeltype fl_define_FL_ICON_LABEL() { \param[in] nd number of data values \param[in] d data values */ -Fl_File_Icon::Fl_File_Icon(const char *p, /* I - Filename pattern */ - int t, /* I - File type */ - int nd, /* I - Number of data values */ - short *d) /* I - Data values */ +Fl_File_Icon::Fl_File_Icon(const char *p, /* I - Filename pattern */ + int t, /* I - File type */ + int nd, /* I - Number of data values */ + short *d) /* I - Data values */ { // Initialize the pattern and type... pattern_ = p; @@ -98,8 +96,8 @@ Fl_File_Icon::Fl_File_Icon(const char *p, /* I - Filename pattern */ allocated for it. */ Fl_File_Icon::~Fl_File_Icon() { - Fl_File_Icon *current, // Current icon in list - *prev; // Previous icon in list + Fl_File_Icon *current, // Current icon in list + *prev; // Previous icon in list // Find the icon in the list... @@ -126,10 +124,10 @@ Fl_File_Icon::~Fl_File_Icon() { Adds a keyword value to the icon array, returning a pointer to it. \param[in] d data value */ -short * // O - Pointer to new data value -Fl_File_Icon::add(short d) // I - Data to add +short * // O - Pointer to new data value +Fl_File_Icon::add(short d) // I - Data to add { - short *dptr; // Pointer to new data value + short *dptr; // Pointer to new data value // Allocate/reallocate memory as needed @@ -162,12 +160,12 @@ Fl_File_Icon::add(short d) // I - Data to add \param[in] filetype enumerated file type \return matching file icon or NULL */ -Fl_File_Icon * // O - Matching file icon or NULL +Fl_File_Icon * // O - Matching file icon or NULL Fl_File_Icon::find(const char *filename,// I - Name of file */ - int filetype) // I - Enumerated file type + int filetype) // I - Enumerated file type { - Fl_File_Icon *current; // Current file in list - const char *name; // Base name of filename + Fl_File_Icon *current; // Current file in list + const char *name; // Base name of filename // Get file information if needed... @@ -183,7 +181,7 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */ for (current = first_; current != (Fl_File_Icon *)0; current = current->next_) if ((current->type_ == filetype || current->type_ == ANY) && (fl_filename_match(filename, current->pattern_) || - fl_filename_match(name, current->pattern_))) + fl_filename_match(name, current->pattern_))) break; // Return the match (if any)... @@ -197,19 +195,19 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */ \param[in] active status, default is active [non-zero] */ void -Fl_File_Icon::draw(int x, // I - Upper-lefthand X - int y, // I - Upper-lefthand Y - int w, // I - Width of bounding box - int h, // I - Height of bounding box - Fl_Color ic, // I - Icon color... - int active) // I - Active or inactive? +Fl_File_Icon::draw(int x, // I - Upper-lefthand X + int y, // I - Upper-lefthand Y + int w, // I - Width of bounding box + int h, // I - Height of bounding box + Fl_Color ic, // I - Icon color... + int active) // I - Active or inactive? { - Fl_Color c, // Current color - oc; // Outline color - short *d, // Pointer to data - *dend; // End of data... - short *prim; // Pointer to start of primitive... - double scale; // Scale of icon + Fl_Color c, // Current color + oc; // Outline color + short *d, // Pointer to data + *dend; // End of data... + short *prim; // Pointer to start of primitive... + double scale; // Scale of icon // Don't try to draw a NULL array! @@ -241,100 +239,100 @@ Fl_File_Icon::draw(int x, // I - Upper-lefthand X case END : if (prim) switch (*prim) - { - case LINE : - fl_end_line(); - break; + { + case LINE : + fl_end_line(); + break; - case CLOSEDLINE : - fl_end_loop(); - break; + case CLOSEDLINE : + fl_end_loop(); + break; - case POLYGON : - fl_end_complex_polygon(); - break; + case POLYGON : + fl_end_complex_polygon(); + break; - case OUTLINEPOLYGON : - fl_end_complex_polygon(); + case OUTLINEPOLYGON : + fl_end_complex_polygon(); - oc = (Fl_Color)((((unsigned short *)prim)[1] << 16) | - ((unsigned short *)prim)[2]); + oc = (Fl_Color)((((unsigned short *)prim)[1] << 16) | + ((unsigned short *)prim)[2]); if (active) - { + { if (oc == FL_ICON_COLOR) - fl_color(ic); - else - fl_color(oc); - } - else - { + fl_color(ic); + else + fl_color(oc); + } + else + { if (oc == FL_ICON_COLOR) - fl_color(fl_inactive(ic)); - else - fl_color(fl_inactive(oc)); - } + fl_color(fl_inactive(ic)); + else + fl_color(fl_inactive(oc)); + } - fl_begin_loop(); + fl_begin_loop(); - prim += 3; - while (*prim == VERTEX) - { - fl_vertex(prim[1] * 0.0001, prim[2] * 0.0001); - prim += 3; - } + prim += 3; + while (*prim == VERTEX) + { + fl_vertex(prim[1] * 0.0001, prim[2] * 0.0001); + prim += 3; + } - fl_end_loop(); - fl_color(c); - break; - } + fl_end_loop(); + fl_color(c); + break; + } prim = NULL; - d ++; - break; + d ++; + break; case COLOR : - c = (Fl_Color)((((unsigned short *)d)[1] << 16) | - ((unsigned short *)d)[2]); + c = (Fl_Color)((((unsigned short *)d)[1] << 16) | + ((unsigned short *)d)[2]); if (c == FL_ICON_COLOR) - c = ic; + c = ic; if (!active) - c = fl_inactive(c); + c = fl_inactive(c); fl_color(c); - d += 3; - break; + d += 3; + break; case LINE : prim = d; - d ++; - fl_begin_line(); - break; + d ++; + fl_begin_line(); + break; case CLOSEDLINE : prim = d; - d ++; - fl_begin_loop(); - break; + d ++; + fl_begin_loop(); + break; case POLYGON : prim = d; - d ++; - fl_begin_complex_polygon(); - break; + d ++; + fl_begin_complex_polygon(); + break; case OUTLINEPOLYGON : prim = d; - d += 3; - fl_begin_complex_polygon(); - break; + d += 3; + fl_begin_complex_polygon(); + break; case VERTEX : if (prim) - fl_vertex(d[1] * 0.0001, d[2] * 0.0001); - d += 3; - break; + fl_vertex(d[1] * 0.0001, d[2] * 0.0001); + d += 3; + break; default : // Ignore invalid data... d ++; @@ -345,49 +343,49 @@ Fl_File_Icon::draw(int x, // I - Upper-lefthand X switch (*prim) { case LINE : - fl_end_line(); - break; + fl_end_line(); + break; case CLOSEDLINE : - fl_end_loop(); - break; + fl_end_loop(); + break; case POLYGON : - fl_end_polygon(); - break; + fl_end_polygon(); + break; case OUTLINEPOLYGON : - fl_end_polygon(); + fl_end_polygon(); - oc = (Fl_Color)((((unsigned short *)prim)[1] << 16) | - ((unsigned short *)prim)[2]); + oc = (Fl_Color)((((unsigned short *)prim)[1] << 16) | + ((unsigned short *)prim)[2]); if (active) - { + { if (oc == FL_ICON_COLOR) - fl_color(ic); - else - fl_color(oc); - } - else - { + fl_color(ic); + else + fl_color(oc); + } + else + { if (oc == FL_ICON_COLOR) - fl_color(fl_inactive(ic)); - else - fl_color(fl_inactive(oc)); - } + fl_color(fl_inactive(ic)); + else + fl_color(fl_inactive(oc)); + } - fl_begin_loop(); + fl_begin_loop(); - prim += 3; - while (*prim == VERTEX) - { - fl_vertex(prim[1] * 0.0001, prim[2] * 0.0001); - prim += 3; - } + prim += 3; + while (*prim == VERTEX) + { + fl_vertex(prim[1] * 0.0001, prim[2] * 0.0001); + prim += 3; + } fl_end_loop(); - fl_color(c); - break; + fl_color(c); + break; } // Restore the transform matrix @@ -399,7 +397,7 @@ Fl_File_Icon::draw(int x, // I - Upper-lefthand X label type as needed. \param[in] w widget for which this icon will become the label */ -void Fl_File_Icon::label(Fl_Widget *w) // I - Widget to label +void Fl_File_Icon::label(Fl_Widget *w) // I - Widget to label { w->label(FL_ICON_LABEL, (const char*)this); } @@ -412,14 +410,14 @@ void Fl_File_Icon::label(Fl_Widget *w) // I - Widget to label \param[in] a label alignment [not used] */ void -Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data - int x, // I - X position of label - int y, // I - Y position of label - int w, // I - Width of label - int h, // I - Height of label - Fl_Align a) // I - Label alignment (not used) +Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data + int x, // I - X position of label + int y, // I - Y position of label + int w, // I - Width of label + int h, // I - Height of label + Fl_Align a) // I - Label alignment (not used) { - Fl_File_Icon *icon; // Pointer to icon data + Fl_File_Icon *icon; // Pointer to icon data (void)a; @@ -427,8 +425,3 @@ Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data icon = (Fl_File_Icon *)(o->value); if (icon) icon->draw(x, y, w, h, (Fl_Color)(o->color)); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx index f11a90831..ce0b78a46 100644 --- a/src/Fl_File_Icon2.cxx +++ b/src/Fl_File_Icon2.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_File_Icon system icon routines. // // KDE icon code donated by Maarten De Boer. @@ -12,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -47,17 +45,17 @@ #include <FL/fl_draw.H> #include <FL/filename.H> #ifndef F_OK -# define F_OK 0 +# define F_OK 0 #endif // // Local functions... // -static void load_kde_icons(const char *directory, const char *icondir); -static void load_kde_mimelnk(const char *filename, const char *icondir); -static char *kde_to_fltk_pattern(const char *kdepattern); -static char *get_kde_val(char *str, const char *key); +static void load_kde_icons(const char *directory, const char *icondir); +static void load_kde_mimelnk(const char *filename, const char *icondir); +static char *kde_to_fltk_pattern(const char *kdepattern); +static char *get_kde_val(char *str, const char *key); // @@ -72,10 +70,10 @@ static const char *kdedir = NULL; \param[in] f filename */ void -Fl_File_Icon::load(const char *f) // I - File to read from +Fl_File_Icon::load(const char *f) // I - File to read from { - int i; // Load status... - const char *ext; // File extension + int i; // Load status... + const char *ext; // File extension ext = fl_filename_ext(f); @@ -98,15 +96,15 @@ Fl_File_Icon::load(const char *f) // I - File to read from \param[in] fti icon filename \return 0 on success, non-zero on error */ -int // O - 0 on success, non-zero on error -Fl_File_Icon::load_fti(const char *fti) // I - File to read from +int // O - 0 on success, non-zero on error +Fl_File_Icon::load_fti(const char *fti) // I - File to read from { - FILE *fp; // File pointer - int ch; // Current character - char command[255], // Command string ("vertex", etc.) - params[255], // Parameter string ("10.0,20.0", etc.) - *ptr; // Pointer into strings - int outline; // Outline polygon + FILE *fp; // File pointer + int ch; // Current character + char command[255], // Command string ("vertex", etc.) + params[255], // Parameter string ("10.0,20.0", etc.) + *ptr; // Pointer into strings + int outline; // Outline polygon // Try to open the file... @@ -131,7 +129,7 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from { while ((ch = getc(fp)) != EOF) if (ch == '\n') - break; + break; if (ch == EOF) break; @@ -219,18 +217,18 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from add_color(FL_BLACK); else { - int c = atoi(params); // Color value + int c = atoi(params); // Color value if (c < 0) - { - // Composite color; compute average... - c = -c; - add_color(fl_color_average((Fl_Color)(c >> 4), - (Fl_Color)(c & 15), 0.5f)); - } - else - add_color((Fl_Color)c); + { + // Composite color; compute average... + c = -c; + add_color(fl_color_average((Fl_Color)(c >> 4), + (Fl_Color)(c & 15), 0.5f)); + } + else + add_color((Fl_Color)c); } } else if (strcmp(command, "bgnline") == 0) @@ -258,17 +256,17 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from cval = FL_BLACK; else { - int c = atoi(params); // Color value + int c = atoi(params); // Color value if (c < 0) - { - // Composite color; compute average... - c = -c; - cval = fl_color_average((Fl_Color)(c >> 4), (Fl_Color)(c & 15), 0.5f); - } - else - cval = c; + { + // Composite color; compute average... + c = -c; + cval = fl_color_average((Fl_Color)(c >> 4), (Fl_Color)(c & 15), 0.5f); + } + else + cval = c; } // Store outline color... @@ -282,7 +280,7 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from add(END); else if (strcmp(command, "vertex") == 0) { - float x, y; // Coordinates of vertex + float x, y; // Coordinates of vertex if (sscanf(params, "%f,%f", &x, &y) != 2) @@ -316,20 +314,20 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from \param[in] ifile image filename \return 0 on success, non-zero on error */ -int Fl_File_Icon::load_image(const char *ifile) // I - File to read from +int Fl_File_Icon::load_image(const char *ifile) // I - File to read from { - Fl_Shared_Image *img; // Image file + Fl_Shared_Image *img; // Image file img = Fl_Shared_Image::get(ifile); if (!img || !img->count() || !img->w() || !img->h()) return -1; if (img->count() == 1) { - int x, y; // X & Y in image - int startx; // Starting X coord - Fl_Color c, // Current color - temp; // Temporary color - const uchar *row; // Pointer into image + int x, y; // X & Y in image + int startx; // Starting X coord + Fl_Color c, // Current color + temp; // Temporary color + const uchar *row; // Pointer into image const int extra_data = img->ld() ? (img->ld()-img->w()*img->d()) : 0; @@ -338,73 +336,73 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from { for (x = 0, startx = 0, c = (Fl_Color)-1; x < img->w(); - x ++, row += img->d()) + x ++, row += img->d()) { - switch (img->d()) - { + switch (img->d()) + { case 1 : temp = fl_rgb_color(row[0], row[0], row[0]); - break; + break; case 2 : - if (row[1] > 127) - temp = fl_rgb_color(row[0], row[0], row[0]); - else - temp = (Fl_Color)-1; - break; - case 3 : + if (row[1] > 127) + temp = fl_rgb_color(row[0], row[0], row[0]); + else + temp = (Fl_Color)-1; + break; + case 3 : temp = fl_rgb_color(row[0], row[1], row[2]); - break; - default : - if (row[3] > 127) - temp = fl_rgb_color(row[0], row[1], row[2]); - else - temp = (Fl_Color)-1; - break; - } - - if (temp != c) - { - if (x > startx && c != (Fl_Color)-1) - { - add_color(c); - add(POLYGON); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add(END); - } + break; + default : + if (row[3] > 127) + temp = fl_rgb_color(row[0], row[1], row[2]); + else + temp = (Fl_Color)-1; + break; + } + + if (temp != c) + { + if (x > startx && c != (Fl_Color)-1) + { + add_color(c); + add(POLYGON); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add(END); + } c = temp; - startx = x; - } + startx = x; + } } if (x > startx && c != (Fl_Color)-1) { - add_color(c); - add(POLYGON); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add(END); + add_color(c); + add(POLYGON); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add(END); } } } else { - int i, j; // Looping vars - int ch; // Current character - int newch; // New character - int bg; // Background color - char val[16]; // Color value - const char *lineptr, // Pointer into line - *const*ptr; // Pointer into data array - int ncolors, // Number of colors - chars_per_color; // Characters per color - Fl_Color *colors; // Colors - int red, green, blue; // Red, green, and blue values - int x, y; // X & Y in image - int startx; // Starting X coord + int i, j; // Looping vars + int ch; // Current character + int newch; // New character + int bg; // Background color + char val[16]; // Color value + const char *lineptr, // Pointer into line + *const*ptr; // Pointer into data array + int ncolors, // Number of colors + chars_per_color; // Characters per color + Fl_Color *colors; // Colors + int red, green, blue; // Red, green, and blue values + int x, y; // X & Y in image + int startx; // Starting X coord // Get the pixmap data... ptr = img->data(); @@ -430,76 +428,76 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from ptr ++; } else { for (i = 0; i < ncolors; i ++, ptr ++) { - // Get the color's character - lineptr = *ptr; - ch = *lineptr++; + // Get the color's character + lineptr = *ptr; + ch = *lineptr++; if (chars_per_color > 1) ch = (ch << 8) | *lineptr++; - // Get the color value... - if ((lineptr = strstr(lineptr, "c ")) == NULL) { - // No color; make this black... - colors[ch] = FL_BLACK; - } else if (lineptr[2] == '#') { - // Read the RGB triplet... - lineptr += 3; - for (j = 0; j < 12; j ++) + // Get the color value... + if ((lineptr = strstr(lineptr, "c ")) == NULL) { + // No color; make this black... + colors[ch] = FL_BLACK; + } else if (lineptr[2] == '#') { + // Read the RGB triplet... + lineptr += 3; + for (j = 0; j < 12; j ++) if (!isxdigit(lineptr[j])) - break; + break; - switch (j) { + switch (j) { case 0 : - bg = ch; - default : - red = green = blue = 0; - break; + bg = ch; + default : + red = green = blue = 0; + break; case 3 : - val[0] = lineptr[0]; - val[1] = '\0'; - red = 255 * strtol(val, NULL, 16) / 15; + val[0] = lineptr[0]; + val[1] = '\0'; + red = 255 * strtol(val, NULL, 16) / 15; - val[0] = lineptr[1]; - val[1] = '\0'; - green = 255 * strtol(val, NULL, 16) / 15; + val[0] = lineptr[1]; + val[1] = '\0'; + green = 255 * strtol(val, NULL, 16) / 15; - val[0] = lineptr[2]; - val[1] = '\0'; - blue = 255 * strtol(val, NULL, 16) / 15; - break; + val[0] = lineptr[2]; + val[1] = '\0'; + blue = 255 * strtol(val, NULL, 16) / 15; + break; case 6 : case 9 : case 12 : - j /= 3; - - val[0] = lineptr[0]; - val[1] = lineptr[1]; - val[2] = '\0'; - red = strtol(val, NULL, 16); - - val[0] = lineptr[j + 0]; - val[1] = lineptr[j + 1]; - val[2] = '\0'; - green = strtol(val, NULL, 16); - - val[0] = lineptr[2 * j + 0]; - val[1] = lineptr[2 * j + 1]; - val[2] = '\0'; - blue = strtol(val, NULL, 16); - break; - } - - colors[ch] = fl_rgb_color((uchar)red, (uchar)green, (uchar)blue); - } else { - // Read a color name... - if (strncasecmp(lineptr + 2, "white", 5) == 0) colors[ch] = FL_WHITE; - else if (strncasecmp(lineptr + 2, "black", 5) == 0) colors[ch] = FL_BLACK; - else if (strncasecmp(lineptr + 2, "none", 4) == 0) { + j /= 3; + + val[0] = lineptr[0]; + val[1] = lineptr[1]; + val[2] = '\0'; + red = strtol(val, NULL, 16); + + val[0] = lineptr[j + 0]; + val[1] = lineptr[j + 1]; + val[2] = '\0'; + green = strtol(val, NULL, 16); + + val[0] = lineptr[2 * j + 0]; + val[1] = lineptr[2 * j + 1]; + val[2] = '\0'; + blue = strtol(val, NULL, 16); + break; + } + + colors[ch] = fl_rgb_color((uchar)red, (uchar)green, (uchar)blue); + } else { + // Read a color name... + if (strncasecmp(lineptr + 2, "white", 5) == 0) colors[ch] = FL_WHITE; + else if (strncasecmp(lineptr + 2, "black", 5) == 0) colors[ch] = FL_BLACK; + else if (strncasecmp(lineptr + 2, "none", 4) == 0) { colors[ch] = FL_BLACK; - bg = ch; - } else colors[ch] = FL_GRAY; - } + bg = ch; + } else colors[ch] = FL_GRAY; + } } } @@ -510,34 +508,34 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from ch = bg; for (x = 0; x < img->w(); x ++) { - newch = *lineptr++; + newch = *lineptr++; if (chars_per_color > 1) newch = (newch << 8) | *lineptr++; - if (newch != ch) { - if (ch != bg) { + if (newch != ch) { + if (ch != bg) { add_color(colors[ch]); - add(POLYGON); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add(END); + add(POLYGON); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add(END); } - ch = newch; - startx = x; - } + ch = newch; + startx = x; + } } if (ch != bg) { - add_color(colors[ch]); - add(POLYGON); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); - add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); - add(END); + add_color(colors[ch]); + add(POLYGON); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - y * 9000 / img->h()); + add_vertex(x * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add_vertex(startx * 9000 / img->w() + 1000, 9500 - (y + 1) * 9000 / img->h()); + add(END); } } @@ -572,79 +570,79 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from */ void Fl_File_Icon::load_system_icons(void) { - int i; // Looping var - Fl_File_Icon *icon; // New icons - char filename[FL_PATH_MAX + 60]; // Filename - char icondir[FL_PATH_MAX]; // Icon directory - static int init = 0; // Have the icons been initialized? + int i; // Looping var + Fl_File_Icon *icon; // New icons + char filename[FL_PATH_MAX + 60]; // Filename + char icondir[FL_PATH_MAX]; // Icon directory + static int init = 0; // Have the icons been initialized? const char * const icondirs[] = { - "Bluecurve", // Icon directories to look for, in order - "crystalsvg", - "default.kde", - "hicolor", - NULL - }; - static short plain[] = { // Plain file icon - COLOR, -1, -1, OUTLINEPOLYGON, 0, FL_GRAY, - VERTEX, 2000, 1000, VERTEX, 2000, 9000, - VERTEX, 6000, 9000, VERTEX, 8000, 7000, - VERTEX, 8000, 1000, END, OUTLINEPOLYGON, 0, FL_GRAY, - VERTEX, 6000, 9000, VERTEX, 6000, 7000, - VERTEX, 8000, 7000, END, - COLOR, 0, FL_BLACK, LINE, VERTEX, 6000, 7000, - VERTEX, 8000, 7000, VERTEX, 8000, 1000, - VERTEX, 2000, 1000, END, LINE, VERTEX, 3000, 7000, - VERTEX, 5000, 7000, END, LINE, VERTEX, 3000, 6000, - VERTEX, 5000, 6000, END, LINE, VERTEX, 3000, 5000, - VERTEX, 7000, 5000, END, LINE, VERTEX, 3000, 4000, - VERTEX, 7000, 4000, END, LINE, VERTEX, 3000, 3000, - VERTEX, 7000, 3000, END, LINE, VERTEX, 3000, 2000, - VERTEX, 7000, 2000, END, - END - }; - static short image[] = { // Image file icon - COLOR, -1, -1, OUTLINEPOLYGON, 0, FL_GRAY, - VERTEX, 2000, 1000, VERTEX, 2000, 9000, - VERTEX, 6000, 9000, VERTEX, 8000, 7000, - VERTEX, 8000, 1000, END, OUTLINEPOLYGON, 0, FL_GRAY, - VERTEX, 6000, 9000, VERTEX, 6000, 7000, - VERTEX, 8000, 7000, END, - COLOR, 0, FL_BLACK, LINE, VERTEX, 6000, 7000, - VERTEX, 8000, 7000, VERTEX, 8000, 1000, - VERTEX, 2000, 1000, END, - COLOR, 0, FL_RED, POLYGON, VERTEX, 3500, 2500, - VERTEX, 3000, 3000, VERTEX, 3000, 4000, - VERTEX, 3500, 4500, VERTEX, 4500, 4500, - VERTEX, 5000, 4000, VERTEX, 5000, 3000, - VERTEX, 4500, 2500, END, - COLOR, 0, FL_GREEN, POLYGON, VERTEX, 5500, 2500, - VERTEX, 5000, 3000, VERTEX, 5000, 4000, - VERTEX, 5500, 4500, VERTEX, 6500, 4500, - VERTEX, 7000, 4000, VERTEX, 7000, 3000, - VERTEX, 6500, 2500, END, - COLOR, 0, FL_BLUE, POLYGON, VERTEX, 4500, 3500, - VERTEX, 4000, 4000, VERTEX, 4000, 5000, - VERTEX, 4500, 5500, VERTEX, 5500, 5500, - VERTEX, 6000, 5000, VERTEX, 6000, 4000, - VERTEX, 5500, 3500, END, - END - }; - static short dir[] = { // Directory icon - COLOR, -1, -1, POLYGON, VERTEX, 1000, 1000, - VERTEX, 1000, 7500, VERTEX, 9000, 7500, - VERTEX, 9000, 1000, END, - POLYGON, VERTEX, 1000, 7500, VERTEX, 2500, 9000, - VERTEX, 5000, 9000, VERTEX, 6500, 7500, END, - COLOR, 0, FL_WHITE, LINE, VERTEX, 1500, 1500, - VERTEX, 1500, 7000, VERTEX, 9000, 7000, END, - COLOR, 0, FL_BLACK, LINE, VERTEX, 9000, 7500, - VERTEX, 9000, 1000, VERTEX, 1000, 1000, END, - COLOR, 0, FL_GRAY, LINE, VERTEX, 1000, 1000, - VERTEX, 1000, 7500, VERTEX, 2500, 9000, - VERTEX, 5000, 9000, VERTEX, 6500, 7500, - VERTEX, 9000, 7500, END, - END - }; + "Bluecurve", // Icon directories to look for, in order + "crystalsvg", + "default.kde", + "hicolor", + NULL + }; + static short plain[] = { // Plain file icon + COLOR, -1, -1, OUTLINEPOLYGON, 0, FL_GRAY, + VERTEX, 2000, 1000, VERTEX, 2000, 9000, + VERTEX, 6000, 9000, VERTEX, 8000, 7000, + VERTEX, 8000, 1000, END, OUTLINEPOLYGON, 0, FL_GRAY, + VERTEX, 6000, 9000, VERTEX, 6000, 7000, + VERTEX, 8000, 7000, END, + COLOR, 0, FL_BLACK, LINE, VERTEX, 6000, 7000, + VERTEX, 8000, 7000, VERTEX, 8000, 1000, + VERTEX, 2000, 1000, END, LINE, VERTEX, 3000, 7000, + VERTEX, 5000, 7000, END, LINE, VERTEX, 3000, 6000, + VERTEX, 5000, 6000, END, LINE, VERTEX, 3000, 5000, + VERTEX, 7000, 5000, END, LINE, VERTEX, 3000, 4000, + VERTEX, 7000, 4000, END, LINE, VERTEX, 3000, 3000, + VERTEX, 7000, 3000, END, LINE, VERTEX, 3000, 2000, + VERTEX, 7000, 2000, END, + END + }; + static short image[] = { // Image file icon + COLOR, -1, -1, OUTLINEPOLYGON, 0, FL_GRAY, + VERTEX, 2000, 1000, VERTEX, 2000, 9000, + VERTEX, 6000, 9000, VERTEX, 8000, 7000, + VERTEX, 8000, 1000, END, OUTLINEPOLYGON, 0, FL_GRAY, + VERTEX, 6000, 9000, VERTEX, 6000, 7000, + VERTEX, 8000, 7000, END, + COLOR, 0, FL_BLACK, LINE, VERTEX, 6000, 7000, + VERTEX, 8000, 7000, VERTEX, 8000, 1000, + VERTEX, 2000, 1000, END, + COLOR, 0, FL_RED, POLYGON, VERTEX, 3500, 2500, + VERTEX, 3000, 3000, VERTEX, 3000, 4000, + VERTEX, 3500, 4500, VERTEX, 4500, 4500, + VERTEX, 5000, 4000, VERTEX, 5000, 3000, + VERTEX, 4500, 2500, END, + COLOR, 0, FL_GREEN, POLYGON, VERTEX, 5500, 2500, + VERTEX, 5000, 3000, VERTEX, 5000, 4000, + VERTEX, 5500, 4500, VERTEX, 6500, 4500, + VERTEX, 7000, 4000, VERTEX, 7000, 3000, + VERTEX, 6500, 2500, END, + COLOR, 0, FL_BLUE, POLYGON, VERTEX, 4500, 3500, + VERTEX, 4000, 4000, VERTEX, 4000, 5000, + VERTEX, 4500, 5500, VERTEX, 5500, 5500, + VERTEX, 6000, 5000, VERTEX, 6000, 4000, + VERTEX, 5500, 3500, END, + END + }; + static short dir[] = { // Directory icon + COLOR, -1, -1, POLYGON, VERTEX, 1000, 1000, + VERTEX, 1000, 7500, VERTEX, 9000, 7500, + VERTEX, 9000, 1000, END, + POLYGON, VERTEX, 1000, 7500, VERTEX, 2500, 9000, + VERTEX, 5000, 9000, VERTEX, 6500, 7500, END, + COLOR, 0, FL_WHITE, LINE, VERTEX, 1500, 1500, + VERTEX, 1500, 7000, VERTEX, 9000, 7000, END, + COLOR, 0, FL_BLACK, LINE, VERTEX, 9000, 7500, + VERTEX, 9000, 1000, VERTEX, 1000, 1000, END, + COLOR, 0, FL_GRAY, LINE, VERTEX, 1000, 1000, + VERTEX, 1000, 7500, VERTEX, 2500, 9000, + VERTEX, 5000, 9000, VERTEX, 6500, 7500, + VERTEX, 9000, 7500, END, + END + }; // Add symbols if they haven't been added already... @@ -656,7 +654,7 @@ Fl_File_Icon::load_system_icons(void) { // Figure out where KDE is installed... if ((kdedir = fl_getenv("KDEDIR")) == NULL) { if (!fl_access("/opt/kde", F_OK)) kdedir = "/opt/kde"; - else if (!fl_access("/usr/local/share/mimelnk", F_OK)) kdedir = "/usr/local"; + else if (!fl_access("/usr/local/share/mimelnk", F_OK)) kdedir = "/usr/local"; else kdedir = "/usr"; } } @@ -668,18 +666,18 @@ Fl_File_Icon::load_system_icons(void) { icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN); for (i = 0; icondirs[i]; i ++) { - snprintf(icondir, sizeof(icondir), "%s/share/icons/%s", kdedir, - icondirs[i]); + snprintf(icondir, sizeof(icondir), "%s/share/icons/%s", kdedir, + icondirs[i]); if (!fl_access(icondir, F_OK)) break; } if (icondirs[i]) { snprintf(filename, sizeof(filename), "%s/16x16/mimetypes/unknown.png", - icondir); + icondir); } else { - snprintf(filename, sizeof(filename), "%s/share/icons/unknown.xpm", - kdedir); + snprintf(filename, sizeof(filename), "%s/share/icons/unknown.xpm", + kdedir); } if (!fl_access(filename, F_OK)) icon->load_image(filename); @@ -734,25 +732,25 @@ Fl_File_Icon::load_system_icons(void) { icon->load_fti("/usr/lib/filetype/system/iconlib/ImageFile.fti"); if (!fl_access("/usr/lib/filetype/install/iconlib/acroread.doc.fti", F_OK)) { - icon = new Fl_File_Icon("*.{eps|ps}", Fl_File_Icon::PLAIN); - icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti"); + icon = new Fl_File_Icon("*.{eps|ps}", Fl_File_Icon::PLAIN); + icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti"); - icon = new Fl_File_Icon("*.pdf", Fl_File_Icon::PLAIN); - icon->load_fti("/usr/lib/filetype/install/iconlib/acroread.doc.fti"); + icon = new Fl_File_Icon("*.pdf", Fl_File_Icon::PLAIN); + icon->load_fti("/usr/lib/filetype/install/iconlib/acroread.doc.fti"); } else { - icon = new Fl_File_Icon("*.{eps|pdf|ps}", Fl_File_Icon::PLAIN); - icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti"); + icon = new Fl_File_Icon("*.{eps|pdf|ps}", Fl_File_Icon::PLAIN); + icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti"); } if (!fl_access("/usr/lib/filetype/install/iconlib/html.fti", F_OK)) { - icon = new Fl_File_Icon("*.{htm|html|shtml}", Fl_File_Icon::PLAIN); + icon = new Fl_File_Icon("*.{htm|html|shtml}", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/iconlib/generic.doc.fti"); - icon->load_fti("/usr/lib/filetype/install/iconlib/html.fti"); + icon->load_fti("/usr/lib/filetype/install/iconlib/html.fti"); } if (!fl_access("/usr/lib/filetype/install/iconlib/color.ps.idle.fti", F_OK)) { - icon = new Fl_File_Icon("*.ppd", Fl_File_Icon::PLAIN); - icon->load_fti("/usr/lib/filetype/install/iconlib/color.ps.idle.fti"); + icon = new Fl_File_Icon("*.ppd", Fl_File_Icon::PLAIN); + icon->load_fti("/usr/lib/filetype/install/iconlib/color.ps.idle.fti"); } } else { // Create the default icons... @@ -780,12 +778,12 @@ Fl_File_Icon::load_system_icons(void) { // static void -load_kde_icons(const char *directory, // I - Directory to load - const char *icondir) { // I - Location of icons - int i; // Looping var - int n; // Number of entries in directory - dirent **entries; // Entries in directory - char full[FL_PATH_MAX]; // Full name of file +load_kde_icons(const char *directory, // I - Directory to load + const char *icondir) { // I - Location of icons + int i; // Looping var + int n; // Number of entries in directory + dirent **entries; // Entries in directory + char full[FL_PATH_MAX]; // Full name of file entries = (dirent **)0; @@ -811,16 +809,16 @@ load_kde_icons(const char *directory, // I - Directory to load // static void -load_kde_mimelnk(const char *filename, // I - mimelnk filename - const char *icondir) { // I - Location of icons - FILE *fp; - char tmp[1024]; - char iconfilename[FL_PATH_MAX]; - char pattern[1024]; - char mimetype[1024]; - char *val; - char full_iconfilename[2 * FL_PATH_MAX]; - Fl_File_Icon *icon; +load_kde_mimelnk(const char *filename, // I - mimelnk filename + const char *icondir) { // I - Location of icons + FILE *fp; + char tmp[1024]; + char iconfilename[FL_PATH_MAX]; + char pattern[1024]; + char mimetype[1024]; + char *val; + char full_iconfilename[2 * FL_PATH_MAX]; + Fl_File_Icon *icon; mimetype[0] = '\0'; @@ -830,11 +828,11 @@ load_kde_mimelnk(const char *filename, // I - mimelnk filename if ((fp = fl_fopen(filename, "rb")) != NULL) { while (fgets(tmp, sizeof(tmp), fp)) { if ((val = get_kde_val(tmp, "Icon")) != NULL) - strlcpy(iconfilename, val, sizeof(iconfilename)); + strlcpy(iconfilename, val, sizeof(iconfilename)); else if ((val = get_kde_val(tmp, "MimeType")) != NULL) - strlcpy(mimetype, val, sizeof(mimetype)); + strlcpy(mimetype, val, sizeof(mimetype)); else if ((val = get_kde_val(tmp, "Patterns")) != NULL) - strlcpy(pattern, val, sizeof(pattern)); + strlcpy(pattern, val, sizeof(pattern)); } fclose(fp); @@ -851,87 +849,87 @@ load_kde_mimelnk(const char *filename, // I - mimelnk filename strlcpy(full_iconfilename, iconfilename, sizeof(full_iconfilename)); } else if (!fl_access(icondir, F_OK)) { // KDE 3.x and 2.x icons - int i; // Looping var - static const char *paths[] = { // Subdirs to look in... - "16x16/actions", - "16x16/apps", - "16x16/devices", - "16x16/filesystems", - "16x16/mimetypes", + int i; // Looping var + static const char *paths[] = { // Subdirs to look in... + "16x16/actions", + "16x16/apps", + "16x16/devices", + "16x16/filesystems", + "16x16/mimetypes", /* - "20x20/actions", - "20x20/apps", - "20x20/devices", - "20x20/filesystems", - "20x20/mimetypes", - - "22x22/actions", - "22x22/apps", - "22x22/devices", - "22x22/filesystems", - "22x22/mimetypes", - - "24x24/actions", - "24x24/apps", - "24x24/devices", - "24x24/filesystems", - "24x24/mimetypes", + "20x20/actions", + "20x20/apps", + "20x20/devices", + "20x20/filesystems", + "20x20/mimetypes", + + "22x22/actions", + "22x22/apps", + "22x22/devices", + "22x22/filesystems", + "22x22/mimetypes", + + "24x24/actions", + "24x24/apps", + "24x24/devices", + "24x24/filesystems", + "24x24/mimetypes", */ - "32x32/actions", - "32x32/apps", - "32x32/devices", - "32x32/filesystems", - "32x32/mimetypes", + "32x32/actions", + "32x32/apps", + "32x32/devices", + "32x32/filesystems", + "32x32/mimetypes", /* - "36x36/actions", - "36x36/apps", - "36x36/devices", - "36x36/filesystems", - "36x36/mimetypes", - - "48x48/actions", - "48x48/apps", - "48x48/devices", - "48x48/filesystems", - "48x48/mimetypes", - - "64x64/actions", - "64x64/apps", - "64x64/devices", - "64x64/filesystems", - "64x64/mimetypes", - - "96x96/actions", - "96x96/apps", - "96x96/devices", - "96x96/filesystems", - "96x96/mimetypes" -*/ }; + "36x36/actions", + "36x36/apps", + "36x36/devices", + "36x36/filesystems", + "36x36/mimetypes", + + "48x48/actions", + "48x48/apps", + "48x48/devices", + "48x48/filesystems", + "48x48/mimetypes", + + "64x64/actions", + "64x64/apps", + "64x64/devices", + "64x64/filesystems", + "64x64/mimetypes", + + "96x96/actions", + "96x96/apps", + "96x96/devices", + "96x96/filesystems", + "96x96/mimetypes" +*/ }; for (i = 0; i < (int)(sizeof(paths) / sizeof(paths[0])); i ++) { snprintf(full_iconfilename, sizeof(full_iconfilename), - "%s/%s/%s.png", icondir, paths[i], iconfilename); + "%s/%s/%s.png", icondir, paths[i], iconfilename); if (!fl_access(full_iconfilename, F_OK)) break; - } + } if (i >= (int)(sizeof(paths) / sizeof(paths[0]))) return; } else { // KDE 1.x icons snprintf(full_iconfilename, sizeof(full_iconfilename), - "%s/%s", tmp, iconfilename); + "%s/%s", tmp, iconfilename); if (fl_access(full_iconfilename, F_OK)) return; } if (strncmp(mimetype, "inode/", 6) == 0) { - if (!strcmp(mimetype + 6, "directory")) - icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY); - else if (!strcmp(mimetype + 6, "blockdevice")) - icon = new Fl_File_Icon("*", Fl_File_Icon::DEVICE); - else if (!strcmp(mimetype + 6, "fifo")) - icon = new Fl_File_Icon("*", Fl_File_Icon::FIFO); - else return; + if (!strcmp(mimetype + 6, "directory")) + icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY); + else if (!strcmp(mimetype + 6, "blockdevice")) + icon = new Fl_File_Icon("*", Fl_File_Icon::DEVICE); + else if (!strcmp(mimetype + 6, "fifo")) + icon = new Fl_File_Icon("*", Fl_File_Icon::FIFO); + else return; } else { icon = new Fl_File_Icon(kde_to_fltk_pattern(pattern), Fl_File_Icon::PLAIN); @@ -949,8 +947,8 @@ load_kde_mimelnk(const char *filename, // I - mimelnk filename static char * kde_to_fltk_pattern(const char *kdepattern) { - char *pattern, - *patptr; + char *pattern, + *patptr; pattern = (char *)malloc(strlen(kdepattern) + 3); @@ -989,8 +987,3 @@ get_kde_val(char *str, return ((char *)0); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_File_Input.cxx b/src/Fl_File_Input.cxx index 201101809..75f40c98c 100644 --- a/src/Fl_File_Input.cxx +++ b/src/Fl_File_Input.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // File_Input header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -31,14 +29,14 @@ // Height of directory buttons... // -#define DIR_HEIGHT 10 +#define DIR_HEIGHT 10 // // Redraw bit for directory bar... // -#define FL_DAMAGE_BAR 0x10 +#define FL_DAMAGE_BAR 0x10 /** @@ -60,8 +58,8 @@ Fl_File_Input::Fl_File_Input(int X, int Y, int W, int H, const char *L) Draw directory buttons. */ void Fl_File_Input::draw_buttons() { - int i, // Looping var - X; // Current X position + int i, // Looping var + X; // Current X position if (damage() & (FL_DAMAGE_BAR | FL_DAMAGE_ALL)) { @@ -75,12 +73,12 @@ void Fl_File_Input::draw_buttons() { draw_box(pressed_ == i ? fl_down(down_box()) : down_box(), x(), y(), X + buttons_[i] - xscroll(), DIR_HEIGHT, FL_GRAY); } else if ((X + buttons_[i] - xscroll()) > w()) { - draw_box(pressed_ == i ? fl_down(down_box()) : down_box(), - x() + X - xscroll(), y(), w() - X + xscroll(), DIR_HEIGHT, - FL_GRAY); + draw_box(pressed_ == i ? fl_down(down_box()) : down_box(), + x() + X - xscroll(), y(), w() - X + xscroll(), DIR_HEIGHT, + FL_GRAY); } else { draw_box(pressed_ == i ? fl_down(down_box()) : down_box(), - x() + X - xscroll(), y(), buttons_[i], DIR_HEIGHT, FL_GRAY); + x() + X - xscroll(), y(), buttons_[i], DIR_HEIGHT, FL_GRAY); } } @@ -97,9 +95,9 @@ void Fl_File_Input::draw_buttons() { Update the sizes of the directory buttons. */ void Fl_File_Input::update_buttons() { - int i; // Looping var - const char *start, // Start of path component - *end; // End of path component + int i; // Looping var + const char *start, // Start of path component + *end; // End of path component // puts("update_buttons()"); @@ -133,9 +131,9 @@ void Fl_File_Input::update_buttons() { \param[in] str new string value \param[in] len lengh of value */ -int // O - TRUE on success -Fl_File_Input::value(const char *str, // I - New string value - int len) { // I - Length of value +int // O - TRUE on success +Fl_File_Input::value(const char *str, // I - New string value + int len) { // I - Length of value damage(FL_DAMAGE_BAR); return Fl_Input::value(str,len); } @@ -146,8 +144,8 @@ Fl_File_Input::value(const char *str, // I - New string value Returns non 0 on success. \param[in] str new string value */ -int // O - TRUE on success -Fl_File_Input::value(const char *str) { // I - New string value +int // O - TRUE on success +Fl_File_Input::value(const char *str) { // I - New string value damage(FL_DAMAGE_BAR); return Fl_Input::value(str); } @@ -160,13 +158,13 @@ void Fl_File_Input::draw() { Fl_Boxtype b = box(); if (damage() & (FL_DAMAGE_BAR | FL_DAMAGE_ALL)) draw_buttons(); // this flag keeps Fl_Input_::drawtext from drawing a bogus box! - char must_trick_fl_input_ = + char must_trick_fl_input_ = Fl::focus()!=this && !size() && !(damage()&FL_DAMAGE_ALL); - if ((damage() & FL_DAMAGE_ALL) || must_trick_fl_input_) + if ((damage() & FL_DAMAGE_ALL) || must_trick_fl_input_) draw_box(b,x(),y()+DIR_HEIGHT,w(),h()-DIR_HEIGHT,color()); - if (!must_trick_fl_input_) + if (!must_trick_fl_input_) Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b)+DIR_HEIGHT, - w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)-DIR_HEIGHT); + w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)-DIR_HEIGHT); } @@ -176,8 +174,8 @@ void Fl_File_Input::draw() { Return non zero if event is handled. \param[in] event */ -int // O - TRUE if we handled event -Fl_File_Input::handle(int event) // I - Event +int // O - TRUE if we handled event +Fl_File_Input::handle(int event) // I - Event { // printf("handle(event = %d)\n", event); static char inButtonBar = 0; @@ -186,9 +184,9 @@ Fl_File_Input::handle(int event) // I - Event case FL_MOVE : case FL_ENTER : if (active_r()) { - if (Fl::event_y() < (y() + DIR_HEIGHT)) + if (Fl::event_y() < (y() + DIR_HEIGHT)) window()->cursor(FL_CURSOR_DEFAULT); - else + else window()->cursor(FL_CURSOR_INSERT); } @@ -198,18 +196,18 @@ Fl_File_Input::handle(int event) // I - Event inButtonBar = (Fl::event_y() < (y() + DIR_HEIGHT)); case FL_RELEASE : case FL_DRAG : - if (inButtonBar) + if (inButtonBar) return handle_button(event); else return Fl_Input::handle(event); default : { Fl_Widget_Tracker wp(this); - if (Fl_Input::handle(event)) { - if (wp.exists()) - damage(FL_DAMAGE_BAR); - return 1; - } + if (Fl_Input::handle(event)) { + if (wp.exists()) + damage(FL_DAMAGE_BAR); + return 1; + } } return 0; } @@ -222,14 +220,14 @@ Fl_File_Input::handle(int event) // I - Event Return non zero if event is handled. \param[in] event */ -int // O - TRUE if we handled event -Fl_File_Input::handle_button(int event) // I - Event +int // O - TRUE if we handled event +Fl_File_Input::handle_button(int event) // I - Event { - int i, // Looping var - X; // Current X position - char *start, // Start of path component - *end; // End of path component - char newvalue[FL_PATH_MAX]; // New value + int i, // Looping var + X; // Current X position + char *start, // Start of path component + *end; // End of path component + char newvalue[FL_PATH_MAX]; // New value // Figure out which button is being pressed... @@ -276,8 +274,3 @@ Fl_File_Input::handle_button(int event) // I - Event return 1; } - - -// -// End of "$Id$". -// diff --git a/src/Fl_GIF_Image.cxx b/src/Fl_GIF_Image.cxx index 9036b6f6f..417fac49c 100644 --- a/src/Fl_GIF_Image.cxx +++ b/src/Fl_GIF_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_GIF_Image routines. // // Copyright 1997-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -146,7 +144,7 @@ Fl_GIF_Image::Fl_GIF_Image(const char *imagename, const unsigned char *data) : */ void Fl_GIF_Image::load_gif_(Fl_Image_Reader &rdr) { - char **new_data; // Data array + char **new_data; // Data array {char b[6] = { 0 }; for (int i=0; i<6; ++i) b[i] = rdr.read_byte(); @@ -188,7 +186,7 @@ void Fl_GIF_Image::load_gif_(Fl_Image_Reader &rdr) } } - int CodeSize; /* Code size, init from GIF header, increases... */ + int CodeSize; /* Code size, init from GIF header, increases... */ char Interlace; for (;;) { @@ -203,7 +201,7 @@ void Fl_GIF_Image::load_gif_(Fl_Image_Reader &rdr) // if (i == 0x3B) return 0; eof code - if (i == 0x21) { // a "gif extension" + if (i == 0x21) { // a "gif extension" ch = rdr.read_byte(); blocklen = rdr.read_byte(); @@ -223,7 +221,7 @@ void Fl_GIF_Image::load_gif_(Fl_Image_Reader &rdr) } else if (ch != 0xFE) { //Gif Comment Fl::warning("%s: unknown gif extension 0x%02x.", rdr.name(), ch); } - } else if (i == 0x2c) { // an image + } else if (i == 0x2c) { // an image ch = rdr.read_byte(); ch = rdr.read_byte(); // GETSHORT(x_position); ch = rdr.read_byte(); ch = rdr.read_byte(); // GETSHORT(y_position); @@ -266,8 +264,8 @@ void Fl_GIF_Image::load_gif_(Fl_Image_Reader &rdr) Fl::warning("%s does not have a color table, using default.\n", rdr.name()); BitsPerPixel = CodeSize - 1; ColorMapSize = 1 << BitsPerPixel; - Red[0] = Green[0] = Blue[0] = 0; // black - Red[1] = Green[1] = Blue[1] = 255; // white + Red[0] = Green[0] = Blue[0] = 0; // black + Red[1] = Green[1] = Blue[1] = 255; // white for (int i = 2; i < ColorMapSize; i++) { Red[i] = Green[i] = Blue[i] = (uchar)(255 * i / (ColorMapSize - 1)); } @@ -455,8 +453,3 @@ void Fl_GIF_Image::load_gif_(Fl_Image_Reader &rdr) delete[] Image; } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Gl_Choice.H b/src/Fl_Gl_Choice.H index 5c5b339ef..7c83170be 100644 --- a/src/Fl_Gl_Choice.H +++ b/src/Fl_Gl_Choice.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Internal interface to set up OpenGL. @@ -63,7 +61,7 @@ #ifdef FL_CFG_GFX_GDI # include <FL/gl.h> # define FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS \ - int pixelformat; /* the visual to use */ \ + int pixelformat; /* the visual to use */ \ PIXELFORMATDESCRIPTOR pfd; // some wgl calls need this thing #endif // FL_CFG_GFX_GDI @@ -82,7 +80,3 @@ public: #undef FL_GL_CHOICE_PLATFORM_SPECIFIC_MEMBERS #endif // Fl_Gl_Choice_H - -// -// End of "$Id$". -// diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx index d71156ac9..12bf46e85 100644 --- a/src/Fl_Gl_Choice.cxx +++ b/src/Fl_Gl_Choice.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL visual selection code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -44,7 +42,7 @@ static void add_context(GLContext ctx) { } static void del_context(GLContext ctx) { - int i; + int i; for (i=0; i<nContext; i++) { if (context_list[i]==ctx) { memmove(context_list+i, context_list+i+1, @@ -155,7 +153,7 @@ Fl_Gl_Choice *Fl_WinAPI_Gl_Window_Driver::find(int m, const int *alistp) { Fl_Gl_Choice *g = Fl_Gl_Window_Driver::find_begin(m, alistp); if (g) return g; - + // Replacement for ChoosePixelFormat() that finds one with an overlay if possible: HDC gc = (HDC)(fl_graphics_driver ? fl_graphics_driver->gc() : 0); if (!gc) gc = fl_GetDC(0); @@ -193,7 +191,7 @@ Fl_Gl_Choice *Fl_WinAPI_Gl_Window_Driver::find(int m, const int *alistp) else if (!(chosen_pfd.bReserved & 15) && (pfd.bReserved & 15)) {} // otherwise prefer a format that supports composition (STR #3119) else if ((chosen_pfd.dwFlags & PFD_SUPPORT_COMPOSITION) && - !(pfd.dwFlags & PFD_SUPPORT_COMPOSITION)) continue; + !(pfd.dwFlags & PFD_SUPPORT_COMPOSITION)) continue; // otherwise more bit planes is better, but no more than 32 (8 bits per channel): else if (pfd.cColorBits > 32 || chosen_pfd.cColorBits > pfd.cColorBits) continue; else if (chosen_pfd.cDepthBits > pfd.cDepthBits) continue; @@ -215,13 +213,13 @@ Fl_Gl_Choice *Fl_WinAPI_Gl_Window_Driver::find(int m, const int *alistp) #endif // DEBUG_PFD if (!pixelformat) return 0; - + g = new Fl_Gl_Choice(m, alistp, first); first = g; - + g->pixelformat = pixelformat; g->pfd = chosen_pfd; - + return g; } @@ -274,13 +272,13 @@ void Fl_WinAPI_Gl_Window_Driver::delete_gl_context(GLContext context) { static XVisualInfo *gl3_getvisual(const int *blist, GLXFBConfig *pbestFB) { int glx_major, glx_minor; - + // FBConfigs were added in GLX version 1.3. if ( !glXQueryVersion(fl_display, &glx_major, &glx_minor) || ( ( glx_major == 1 ) && ( glx_minor < 3 ) ) || ( glx_major < 1 ) ) { return NULL; } - + //printf( "Getting matching framebuffer configs\n" ); int fbcount; GLXFBConfig* fbc = glXChooseFBConfig(fl_display, DefaultScreen(fl_display), blist, &fbcount); @@ -289,7 +287,7 @@ static XVisualInfo *gl3_getvisual(const int *blist, GLXFBConfig *pbestFB) return NULL; } //printf( "Found %d matching FB configs.\n", fbcount ); - + // Pick the FB config/visual with the most samples per pixel int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999; for (int i = 0; i < fbcount; ++i) @@ -308,7 +306,7 @@ static XVisualInfo *gl3_getvisual(const int *blist, GLXFBConfig *pbestFB) } XFree(vi); } - + GLXFBConfig bestFbc = fbc[ best_fbc ]; // Be sure to free the FBConfig list allocated by glXChooseFBConfig() XFree(fbc); @@ -322,10 +320,10 @@ Fl_Gl_Choice *Fl_X11_Gl_Window_Driver::find(int m, const int *alistp) { Fl_Gl_Choice *g = Fl_Gl_Window_Driver::find_begin(m, alistp); if (g) return g; - + const int *blist; int list[32]; - + if (alistp) blist = alistp; else { @@ -371,7 +369,7 @@ Fl_Gl_Choice *Fl_X11_Gl_Window_Driver::find(int m, const int *alistp) list[n] = 0; blist = list; } - + fl_open_display(); XVisualInfo *visp = NULL; GLXFBConfig best_fb = NULL; @@ -387,13 +385,13 @@ Fl_Gl_Choice *Fl_X11_Gl_Window_Driver::find(int m, const int *alistp) return 0; } } - + g = new Fl_Gl_Choice(m, alistp, first); first = g; - + g->vis = visp; g->best_fb = best_fb; - + if (/*MaxCmapsOfScreen(ScreenOfDisplay(fl_display,fl_screen))==1 && */ visp->visualid == fl_visual->visualid && !fl_getenv("MESA_PRIVATE_CMAP")) @@ -414,7 +412,7 @@ static int ctxErrorHandler( Display *dpy, XErrorEvent *ev ) GLContext Fl_X11_Gl_Window_Driver::create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer) { GLContext shared_ctx = 0; if (context_list && nContext) shared_ctx = context_list[0]; - + typedef GLContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLContext, Bool, const int*); // It is not necessary to create or make current to a context before calling glXGetProcAddressARB static glXCreateContextAttribsARBProc glXCreateContextAttribsARB = @@ -423,7 +421,7 @@ GLContext Fl_X11_Gl_Window_Driver::create_gl_context(Fl_Window* window, const Fl #else NULL; #endif - + GLContext ctx = 0; // Check for the GLX_ARB_create_context extension string and the function. // If either is not present, use GLX 1.3 context creation method. @@ -483,7 +481,3 @@ void Fl_X11_Gl_Window_Driver::delete_gl_context(GLContext context) { #endif // FL_CFG_GFX_XLIB #endif // HAVE_GL - -// -// End of "$Id$". -// diff --git a/src/Fl_Gl_Device_Plugin.cxx b/src/Fl_Gl_Device_Plugin.cxx index ffc530a03..f2bdb4e78 100644 --- a/src/Fl_Gl_Device_Plugin.cxx +++ b/src/Fl_Gl_Device_Plugin.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // implementation of class Fl_Gl_Device_Plugin for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -51,7 +49,3 @@ static Fl_Gl_Device_Plugin Gl_Device_Plugin; // The purpose of this variable, used in Fl_Gl_Window.cxx, is only to force this file to be loaded // whenever Fl_Gl_Window.cxx is loaded, that is, whenever fltk_gl is. FL_EXPORT int fl_gl_load_plugin = 0; - -// -// End of "$Id$". -// diff --git a/src/Fl_Gl_Overlay.cxx b/src/Fl_Gl_Overlay.cxx index ab969d447..b03e13953 100644 --- a/src/Fl_Gl_Overlay.cxx +++ b/src/Fl_Gl_Overlay.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL overlay code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -302,7 +300,3 @@ int Fl_WinAPI_Gl_Window_Driver::can_do_overlay() { #endif // FL_CFG_GFX_GDI #endif // HAVE_GL - -// -// End of "$Id$". -// diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 30a950ea5..bc0d0d9e8 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL window code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -57,10 +55,10 @@ extern int fl_gl_load_plugin; // GL_SWAP_TYPE, it should be equal to one of these symbols: // contents of back buffer after glXSwapBuffers(): -#define UNDEFINED 1 // anything -#define SWAP 2 // former front buffer (same as unknown) -#define COPY 3 // unchanged -#define NODAMAGE 4 // unchanged even by X expose() events +#define UNDEFINED 1 // anything +#define SWAP 2 // former front buffer (same as unknown) +#define COPY 3 // unchanged +#define NODAMAGE 4 // unchanged even by X expose() events static char SWAP_TYPE = 0 ; // 0 = determine it from environment variable @@ -78,12 +76,12 @@ void Fl_Gl_Window::show() { g = pGlWindowDriver->find(mode_,alist); if (!g && (mode_ & FL_DOUBLE) == FL_SINGLE) { g = pGlWindowDriver->find(mode_ | FL_DOUBLE,alist); - if (g) mode_ |= FL_FAKE_SINGLE; + if (g) mode_ |= FL_FAKE_SINGLE; } if (!g) { Fl::error("Insufficient GL support"); - return; + return; } } pGlWindowDriver->before_show(need_after); @@ -138,7 +136,7 @@ void Fl_Gl_Window::make_current() { /** Sets the projection so 0,0 is in the lower left of the window and each - pixel is 1 unit wide/tall. If you are drawing 2D images, your + pixel is 1 unit wide/tall. If you are drawing 2D images, your draw() method may want to call this if valid() is false. */ void Fl_Gl_Window::ortho() { @@ -178,10 +176,10 @@ void Fl_Gl_Window::flush() { SWAP_TYPE = pGlWindowDriver->swap_type(); const char* c = fl_getenv("GL_SWAP_TYPE"); if (c) { - if (!strcmp(c,"COPY")) SWAP_TYPE = COPY; - else if (!strcmp(c, "NODAMAGE")) SWAP_TYPE = NODAMAGE; - else if (!strcmp(c, "SWAP")) SWAP_TYPE = SWAP; - else SWAP_TYPE = UNDEFINED; + if (!strcmp(c,"COPY")) SWAP_TYPE = COPY; + else if (!strcmp(c, "NODAMAGE")) SWAP_TYPE = NODAMAGE; + else if (!strcmp(c, "SWAP")) SWAP_TYPE = SWAP; + else SWAP_TYPE = UNDEFINED; } } @@ -189,14 +187,14 @@ void Fl_Gl_Window::flush() { // don't draw if only overlay damage or expose events: if ((damage()&~(FL_DAMAGE_OVERLAY|FL_DAMAGE_EXPOSE)) || !save_valid) - draw(); + draw(); swap_buffers(); } else if (SWAP_TYPE == COPY) { // don't draw if only the overlay is damaged: if (damage() != FL_DAMAGE_OVERLAY || !save_valid) draw(); - swap_buffers(); + swap_buffers(); } else if (SWAP_TYPE == SWAP){ damage(FL_DAMAGE_ALL); @@ -208,28 +206,28 @@ void Fl_Gl_Window::flush() { // If we are faking the overlay, use CopyPixels to act like // SWAP_TYPE == COPY. Otherwise overlay redraw is way too slow. if (overlay == this) { - // don't draw if only the overlay is damaged: - if (damage1_ || damage() != FL_DAMAGE_OVERLAY || !save_valid) draw(); - // we use a separate context for the copy because rasterpos must be 0 - // and depth test needs to be off: - static GLContext ortho_context = 0; - static Fl_Gl_Window* ortho_window = 0; - int orthoinit = !ortho_context; - if (orthoinit) ortho_context = pGlWindowDriver->create_gl_context(this, g); - pGlWindowDriver->set_gl_context(this, ortho_context); - if (orthoinit || !save_valid || ortho_window != this) { - glDisable(GL_DEPTH_TEST); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_FRONT); - glLoadIdentity(); - glViewport(0, 0, pixel_w(), pixel_h()); - glOrtho(0, pixel_w(), 0, pixel_h(), -1, 1); - glRasterPos2i(0,0); - ortho_window = this; - } - glCopyPixels(0,0,pixel_w(),pixel_h(),GL_COLOR); - make_current(); // set current context back to draw overlay - damage1_ = 0; + // don't draw if only the overlay is damaged: + if (damage1_ || damage() != FL_DAMAGE_OVERLAY || !save_valid) draw(); + // we use a separate context for the copy because rasterpos must be 0 + // and depth test needs to be off: + static GLContext ortho_context = 0; + static Fl_Gl_Window* ortho_window = 0; + int orthoinit = !ortho_context; + if (orthoinit) ortho_context = pGlWindowDriver->create_gl_context(this, g); + pGlWindowDriver->set_gl_context(this, ortho_context); + if (orthoinit || !save_valid || ortho_window != this) { + glDisable(GL_DEPTH_TEST); + glReadBuffer(GL_BACK); + glDrawBuffer(GL_FRONT); + glLoadIdentity(); + glViewport(0, 0, pixel_w(), pixel_h()); + glOrtho(0, pixel_w(), 0, pixel_h(), -1, 1); + glRasterPos2i(0,0); + ortho_window = this; + } + glCopyPixels(0,0,pixel_w(),pixel_h(),GL_COLOR); + make_current(); // set current context back to draw overlay + damage1_ = 0; } else { damage1_ = damage(); @@ -245,7 +243,7 @@ void Fl_Gl_Window::flush() { glFlush(); } - } else { // single-buffered context is simpler: + } else { // single-buffered context is simpler: draw(); if (overlay == this) draw_overlay(); @@ -273,9 +271,9 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) { 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 <i>destroy_flag</i> is true the context will be destroyed by - fltk when the window is destroyed, or when the mode() is changed, + fltk when the window is destroyed, or when the mode() is changed, or the next time context(x) is called. */ void Fl_Gl_Window::context(GLContext v, int destroy_flag) { @@ -283,7 +281,7 @@ void Fl_Gl_Window::context(GLContext v, int destroy_flag) { context_ = v; if (destroy_flag) mode_ &= ~NON_LOCAL_CONTEXT; else mode_ |= NON_LOCAL_CONTEXT; -} +} /** Hides the window and destroys the OpenGL context. @@ -327,13 +325,13 @@ void Fl_Gl_Window::init() { /** You must implement this virtual function if you want to draw into the overlay. The overlay is cleared before this is called. You should - draw anything that is not clear using OpenGL. You must use + draw anything that is not clear using OpenGL. You must use gl_color(i) to choose colors (it allocates them from the colormap using system-specific calls), and remember that you are in an indexed OpenGL mode and drawing anything other than flat-shaded will probably not work. - Both this function and Fl_Gl_Window::draw() should check + Both this function and Fl_Gl_Window::draw() should check Fl_Gl_Window::valid() and set the same transformation. If you don't your code may not work on other systems. Depending on the OS, and on whether overlays are real or simulated, the OpenGL context may @@ -343,11 +341,11 @@ void Fl_Gl_Window::draw_overlay() {} #endif // HAVE_GL -/** Draws the Fl_Gl_Window. - You \e \b must subclass Fl_Gl_Window and provide an implementation for +/** Draws the Fl_Gl_Window. + You \e \b must subclass Fl_Gl_Window and provide an implementation for draw(). You may also provide an implementation of draw_overlay() if you want to draw into the overlay planes. You can avoid - reinitializing the viewport and lights and other things by checking + reinitializing the viewport and lights and other things by checking valid() at the start of draw() and only doing the initialization if it is false. @@ -392,7 +390,7 @@ void Fl_Gl_Window::draw_overlay() {} glColor3f(1.0, 1.0, 1.0); glBegin(GL_LINE_STRIP); glVertex2f(w(), h()); glVertex2f(-w(),-h()); glEnd(); glBegin(GL_LINE_STRIP); glVertex2f(w(),-h()); glVertex2f(-w(), h()); glEnd(); - } + } \endcode */ @@ -413,7 +411,7 @@ void Fl_Gl_Window::draw() { glLineWidth((GLfloat)pixels_per_unit()); // should be 1 or 2 (2 if highres OpenGL) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // FIXME: push on state stack glEnable(GL_BLEND); // FIXME: push on state stack - + Fl_Window::draw(); glPopMatrix(); @@ -428,7 +426,7 @@ void Fl_Gl_Window::draw() { /** Handle some FLTK events as needed. */ -int Fl_Gl_Window::handle(int event) +int Fl_Gl_Window::handle(int event) { return Fl_Window::handle(event); } @@ -476,23 +474,23 @@ char Fl_Gl_Window_Driver::swap_type() {return UNDEFINED;} void* Fl_Gl_Window_Driver::GetProcAddress(const char *procName) { #if (HAVE_DLSYM && HAVE_DLFCN_H) char symbol[1024]; - + snprintf(symbol, sizeof(symbol), "_%s", procName); - + # ifdef RTLD_DEFAULT return dlsym(RTLD_DEFAULT, symbol); - + # else // No RTLD_DEFAULT support, so open the current a.out symbols... static void *rtld_default = dlopen(0, RTLD_LAZY); - + if (rtld_default) return dlsym(rtld_default, symbol); else return 0; - + # endif // RTLD_DEFAULT - + #elif defined(HAVE_GLXGETPROCADDRESSARB) return (void*)glXGetProcAddressARB((const GLubyte *)procName); - + #else return 0; #endif // HAVE_DLSYM @@ -570,7 +568,7 @@ void Fl_Cocoa_Gl_Window_Driver::swap_buffers() { GLfloat pos[4]; glGetIntegerv(GL_MATRIX_MODE, &matrixmode); glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); // save original glRasterPos - glMatrixMode(GL_PROJECTION); // save proj/model matrices + glMatrixMode(GL_PROJECTION); // save proj/model matrices glPushMatrix(); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); @@ -767,7 +765,3 @@ void Fl_X11_Gl_Window_Driver::waitGL() { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Gl_Window_Driver.H b/src/Fl_Gl_Window_Driver.H index 56dbbcf69..94a54b5d0 100644 --- a/src/Fl_Gl_Window_Driver.H +++ b/src/Fl_Gl_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of class Fl_Gl_Window_Driver, and of its platform-specific derived classes // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -202,7 +200,3 @@ class Fl_X11_Gl_Window_Driver : public Fl_Gl_Window_Driver { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index 0fbe80106..81b9f29ed 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Graphics_Driver class for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -43,11 +41,11 @@ Fl_Graphics_Driver::Fl_Graphics_Driver() { font_ = 0; size_ = 0; - sptr=0; rstackptr=0; + sptr=0; rstackptr=0; rstack[0] = NULL; fl_clip_state_number=0; - m = m0; - fl_matrix = &m; + m = m0; + fl_matrix = &m; font_descriptor_ = NULL; scale_ = 1; }; @@ -944,7 +942,3 @@ void Fl_Scalable_Graphics_Driver::draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void Fl_Scalable_Graphics_Driver::transformed_vertex0(float x, float y) {} #endif - -// -// End of "$Id$". -// diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index 2ec83d493..4a614e1e4 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Group widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // The Fl_Group is the only defined container type in FLTK. @@ -36,8 +34,8 @@ Fl_Group* Fl_Group::current_; /** Returns a pointer to the array of children. - \note This pointer is only valid until the next time a child - is added or removed. + \note This pointer is only valid until the next time a child + is added or removed. */ Fl_Widget*const* Fl_Group::array() const { return children_ <= 1 ? (Fl_Widget**)(&array_) : array_; @@ -177,12 +175,12 @@ int Fl_Group::handle(int event) { for (i = children(); i--;) { o = a[i]; if (o->takesevents() && Fl::event_inside(o) && send(o,FL_SHORTCUT)) - return 1; + return 1; } for (i = children(); i--;) { o = a[i]; if (o->takesevents() && !Fl::event_inside(o) && send(o,FL_SHORTCUT)) - return 1; + return 1; } if ((Fl::event_key() == FL_Enter || Fl::event_key() == FL_KP_Enter)) return navigation(FL_Down); return 0; @@ -192,12 +190,12 @@ int Fl_Group::handle(int event) { for (i = children(); i--;) { o = a[i]; if (o->visible() && Fl::event_inside(o)) { - if (o->contains(Fl::belowmouse())) { - return send(o,FL_MOVE); - } else { - Fl::belowmouse(o); - if (send(o,FL_ENTER)) return 1; - } + if (o->contains(Fl::belowmouse())) { + return send(o,FL_MOVE); + } else { + Fl::belowmouse(o); + if (send(o,FL_ENTER)) return 1; + } } } Fl::belowmouse(this); @@ -208,12 +206,12 @@ int Fl_Group::handle(int event) { for (i = children(); i--;) { o = a[i]; if (o->takesevents() && Fl::event_inside(o)) { - if (o->contains(Fl::belowmouse())) { - return send(o,FL_DND_DRAG); - } else if (send(o,FL_DND_ENTER)) { - if (!o->contains(Fl::belowmouse())) Fl::belowmouse(o); - return 1; - } + if (o->contains(Fl::belowmouse())) { + return send(o,FL_DND_DRAG); + } else if (send(o,FL_DND_ENTER)) { + if (!o->contains(Fl::belowmouse())) Fl::belowmouse(o); + return 1; + } } } Fl::belowmouse(this); @@ -223,11 +221,11 @@ int Fl_Group::handle(int event) { for (i = children(); i--;) { o = a[i]; if (o->takesevents() && Fl::event_inside(o)) { - Fl_Widget_Tracker wp(o); - if (send(o,FL_PUSH)) { - if (Fl::pushed() && wp.exists() && !o->contains(Fl::pushed())) Fl::pushed(o); - return 1; - } + Fl_Widget_Tracker wp(o); + if (send(o,FL_PUSH)) { + if (Fl::pushed() && wp.exists() && !o->contains(Fl::pushed())) Fl::pushed(o); + return 1; + } } } return 0; @@ -239,10 +237,10 @@ int Fl_Group::handle(int event) { else if (o) send(o,event); else { for (i = children(); i--;) { - o = a[i]; - if (o->takesevents() && Fl::event_inside(o)) { - if (send(o,event)) return 1; - } + o = a[i]; + if (o->takesevents() && Fl::event_inside(o)) { + if (send(o,event)) return 1; + } } } return 0; @@ -251,12 +249,12 @@ int Fl_Group::handle(int event) { for (i = children(); i--;) { o = a[i]; if (o->takesevents() && Fl::event_inside(o) && send(o,FL_MOUSEWHEEL)) - return 1; + return 1; } for (i = children(); i--;) { o = a[i]; if (o->takesevents() && !Fl::event_inside(o) && send(o,FL_MOUSEWHEEL)) - return 1; + return 1; } return 0; @@ -274,10 +272,10 @@ int Fl_Group::handle(int event) { o = *a++; if (event == FL_HIDE && o == Fl::focus()) { // Give up input focus... - int old_event = Fl::e_number; + int old_event = Fl::e_number; o->handle(Fl::e_number = FL_UNFOCUS); - Fl::e_number = old_event; - Fl::focus(0); + Fl::e_number = old_event; + Fl::focus(0); } if (o->visible()) o->handle(event); } @@ -329,16 +327,16 @@ int Fl_Group::navigation(int key) { case FL_Down: i++; if (i >= children_) { - if (parent()) return 0; - i = 0; + if (parent()) return 0; + i = 0; } break; case FL_Left: case FL_Up: if (i) i--; else { - if (parent()) return 0; - i = children_-1; + if (parent()) return 0; + i = children_-1; } break; default: @@ -351,7 +349,7 @@ int Fl_Group::navigation(int key) { case FL_Up: // for up/down, the widgets have to overlap horizontally: if (o->x() >= previous->x()+previous->w() || - o->x()+o->w() <= previous->x()) continue; + o->x()+o->w() <= previous->x()) continue; } if (o->take_focus()) return 1; } @@ -396,9 +394,9 @@ void Fl_Group::clear() { // the group's children. Otherwise fl_fix_focus() would send lots // of events to children that are about to be deleted anyway. - Fl_Widget *pushed = Fl::pushed(); // save pushed() widget - if (contains(pushed)) pushed = this; // set it to be the group, if it's a child - Fl::pushed(this); // for fl_fix_focus etc. + Fl_Widget *pushed = Fl::pushed(); // save pushed() widget + if (contains(pushed)) pushed = this; // set it to be the group, if it's a child + Fl::pushed(this); // for fl_fix_focus etc. // okay, now it is safe to destroy the children: @@ -417,19 +415,19 @@ void Fl_Group::clear() { } #endif // REVERSE_CHILDREN - while (children_) { // delete all children - int idx = children_-1; // last child's index - Fl_Widget* w = child(idx); // last child widget - if (w->parent()==this) { // should always be true - if (children_>2) { // optimized removal - w->parent_ = 0; // reset child's parent - children_--; // update counter - } else { // slow removal + while (children_) { // delete all children + int idx = children_-1; // last child's index + Fl_Widget* w = child(idx); // last child widget + if (w->parent()==this) { // should always be true + if (children_>2) { // optimized removal + w->parent_ = 0; // reset child's parent + children_--; // update counter + } else { // slow removal remove(idx); } - delete w; // delete the child - } else { // should never happen - remove(idx); // remove it anyway + delete w; // delete the child + } else { // should never happen + remove(idx); // remove it anyway } } @@ -484,7 +482,7 @@ void Fl_Group::insert(Fl_Widget &o, int index) { } else { if (!(children_ & (children_-1))) // double number of children array_ = (Fl_Widget**)realloc((void*)array_, - 2*children_*sizeof(Fl_Widget*)); + 2*children_*sizeof(Fl_Widget*)); int j; for (j = children_; j > index; j--) array_[j] = array_[j-1]; array_[j] = &o; } @@ -512,7 +510,7 @@ void Fl_Group::remove(int index) { if (index < 0 || index >= children_) return; Fl_Widget &o = *child(index); if (&o == savedfocus_) savedfocus_ = 0; - if (o.parent_ == this) { // this should always be true + if (o.parent_ == this) { // this should always be true o.parent_ = 0; } @@ -560,8 +558,8 @@ void Fl_Group::remove(Fl_Widget &o) { If you add or remove widgets, this will be done automatically. \note The internal array of widget sizes and positions will be allocated - and filled when the next resize() occurs. For more information on - the contents and structure of the bounds() array see bounds(). + and filled when the next resize() occurs. For more information on + the contents and structure of the bounds() array see bounds(). \see bounds() \see sizes() (deprecated) @@ -569,8 +567,8 @@ void Fl_Group::remove(Fl_Widget &o) { void Fl_Group::init_sizes() { delete[] bounds_; bounds_ = 0; - delete[] sizes_; // FLTK 1.3 compatibility - sizes_ = 0; // FLTK 1.3 compatibility + delete[] sizes_; // FLTK 1.3 compatibility + sizes_ = 0; // FLTK 1.3 compatibility } /** @@ -592,19 +590,19 @@ void Fl_Group::init_sizes() { the x() and y() coordinates of their respective Fl_Rect's are zero. \note You should never need to use this \e protected method directly, - unless you have special needs to rearrange the children of a - Fl_Group. Fl_Tile uses this to rearrange its widget positions. - The returned array should be considered read-only. Do not change - its contents. If you need to rearrange children in a group, do - so by resizing the children and call init_sizes(). + unless you have special needs to rearrange the children of a + Fl_Group. Fl_Tile uses this to rearrange its widget positions. + The returned array should be considered read-only. Do not change + its contents. If you need to rearrange children in a group, do + so by resizing the children and call init_sizes(). \#include \<FL/Fl_Rect.H\> if you want to access the bounds() array in your derived class. Fl_Rect.H is intentionally not included by Fl_Group.H to avoid unnecessary dependencies. \returns Array of Fl_Rect's with widget positions and sizes. The - returned array is only valid until init_sizes() is called - or widgets are added to or removed from the group. + returned array is only valid until init_sizes() is called + or widgets are added to or removed from the group. \see init_sizes() @@ -662,14 +660,14 @@ Fl_Rect* Fl_Group::bounds() { \note This method will be removed in a future FLTK version (1.5.0 or higher). - \returns Array of int's with widget positions and sizes. The returned - array is only valid until init_sizes() is called or widgets - are added to or removed from the group. + \returns Array of int's with widget positions and sizes. The returned + array is only valid until init_sizes() is called or widgets + are added to or removed from the group. - \note Since FLTK 1.4.0 the returned array is a \b read-only and re-ordered - copy of the internal bounds() array. Do not change its contents. - If you need to rearrange children in a group, do so by resizing - the children and call init_sizes(). + \note Since FLTK 1.4.0 the returned array is a \b read-only and re-ordered + copy of the internal bounds() array. Do not change its contents. + If you need to rearrange children in a group, do so by resizing + the children and call init_sizes(). \see bounds() */ @@ -715,8 +713,8 @@ void Fl_Group::resize(int X, int Y, int W, int H) { if (!as_window()) { Fl_Widget*const* a = array(); for (int i=children_; i--;) { - Fl_Widget* o = *a++; - o->resize(o->x() + dx, o->y() + dy, o->w(), o->h()); + Fl_Widget* o = *a++; + o->resize(o->x() + dx, o->y() + dy, o->w(), o->h()); } } @@ -799,8 +797,8 @@ void Fl_Group::draw_children() { if (clip_children()) { fl_push_clip(x() + Fl::box_dx(box()), y() + Fl::box_dy(box()), - w() - Fl::box_dw(box()), - h() - Fl::box_dh(box())); + w() - Fl::box_dw(box()), + h() - Fl::box_dh(box())); } if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing: @@ -809,7 +807,7 @@ void Fl_Group::draw_children() { draw_child(o); draw_outside_label(o); } - } else { // only redraw the children that need it: + } else { // only redraw the children that need it: for (int i=children_; i--;) update_child(**a++); } @@ -911,8 +909,3 @@ void Fl_Group::draw_outside_label(const Fl_Widget& widget) const { } widget.draw_label(X,Y,W,H,(Fl_Align)a); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Help_Dialog.cxx b/src/Fl_Help_Dialog.cxx index 7e016e2d3..580812818 100644 --- a/src/Fl_Help_Dialog.cxx +++ b/src/Fl_Help_Dialog.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // ======================================================================== // DO NOT EDIT FL/Fl_Help_Dialog.H and src/Fl_Help_Dialog.cxx !!! @@ -201,11 +199,11 @@ Fl_Help_Dialog::Fl_Help_Dialog() { } // Fl_Double_Window* window_ back_->deactivate(); forward_->deactivate(); - + index_ = -1; max_ = 0; find_pos_ = 0; - + fl_register_images(); } @@ -246,12 +244,12 @@ void Fl_Help_Dialog::show(int argc, char **argv) { void Fl_Help_Dialog::textsize(Fl_Fontsize s) { view_->textsize(s); - + if (s <= 8) smaller_->deactivate(); else smaller_->activate(); - + if (s >= 18) larger_->deactivate(); else @@ -295,7 +293,3 @@ int Fl_Help_Dialog::x() { int Fl_Help_Dialog::y() { return (window_->y()); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Help_Dialog.fl b/src/Fl_Help_Dialog.fl index 66462a904..08ceef804 100644 --- a/src/Fl_Help_Dialog.fl +++ b/src/Fl_Help_Dialog.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {../FL/Fl_Help_Dialog.H} code_name {.cxx} comment {// -// "$Id$" -// // Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -13,11 +11,11 @@ comment {// // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // ======================================================================== // DO NOT EDIT FL/Fl_Help_Dialog.H and src/Fl_Help_Dialog.cxx !!! @@ -266,9 +264,3 @@ window_->label(view_->title());} {} code {return (window_->y());} {} } } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/src/Fl_Help_Dialog_Dox.cxx b/src/Fl_Help_Dialog_Dox.cxx index aa88f30a6..9461d9e23 100644 --- a/src/Fl_Help_Dialog_Dox.cxx +++ b/src/Fl_Help_Dialog_Dox.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Fl_Help_Dialog (autogenerated class) doxygen documentation placeholder @@ -24,8 +22,8 @@ The Fl_Help_Dialog class is not part of the FLTK core library, but instead of \em fltk_images. Use \c --use-images when compiling with \c fltk-config . - - <P ALIGN=CENTER> \image html Fl_Help_Dialog.png </P> + + <P ALIGN=CENTER> \image html Fl_Help_Dialog.png </P> \image latex Fl_Help_Dialog.png "Fl_Help_Dialog" width=8cm */ @@ -113,7 +111,3 @@ /** \fn void Fl_Help_Dialog::textsize(Fl_Fontsize s) Sets the internal Fl_Help_View instance text size. Delegates call to encapsulated view_ void Fl_Help_View::textsize(Fl_Fontsize s) instance method */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index fc0dd409d..f6c6407c1 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Help_View widget routines. // // Copyright 1997-2010 by Easy Software Products. @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -57,13 +55,13 @@ #include <stdio.h> #include <stdlib.h> #include <FL/fl_utf8.h> -#include <FL/filename.H> // fl_open_uri() +#include <FL/filename.H> // fl_open_uri() #include "flstring.h" #include <ctype.h> #include <errno.h> #include <math.h> -#define MAX_COLUMNS 200 +#define MAX_COLUMNS 200 // // Typedef the C API sort function type the only way I know how... @@ -79,9 +77,9 @@ extern "C" // Local functions... // -static int quote_char(const char *); -static void scrollbar_callback(Fl_Widget *s, void *); -static void hscrollbar_callback(Fl_Widget *s, void *); +static int quote_char(const char *); +static void scrollbar_callback(Fl_Widget *s, void *); +static void hscrollbar_callback(Fl_Widget *s, void *); // // global flag for image loading (see get_image). @@ -94,39 +92,39 @@ static char initial_load = 0; // static const char * const broken_xpm[] = - { - "16 24 4 1", - "@ c #000000", - " c #ffffff", - "+ c none", - "x c #ff0000", - // pixels - "@@@@@@@+++++++++", - "@ @++++++++++", - "@ @+++++++++++", - "@ @++@++++++++", - "@ @@+++++++++", - "@ @+++@+++++", - "@ @++@@++++@", - "@ xxx @@ @++@@", - "@ xxx xx@@ @", - "@ xxx xxx @", - "@ xxxxxx @", - "@ xxxx @", - "@ xxxxxx @", - "@ xxx xxx @", - "@ xxx xxx @", - "@ xxx xxx @", - "@ @", - "@ @", - "@ @", - "@ @", - "@ @", - "@ @", - "@ @", - "@@@@@@@@@@@@@@@@", - NULL - }; + { + "16 24 4 1", + "@ c #000000", + " c #ffffff", + "+ c none", + "x c #ff0000", + // pixels + "@@@@@@@+++++++++", + "@ @++++++++++", + "@ @+++++++++++", + "@ @++@++++++++", + "@ @@+++++++++", + "@ @+++@+++++", + "@ @++@@++++@", + "@ xxx @@ @++@@", + "@ xxx xx@@ @", + "@ xxx xxx @", + "@ xxxxxx @", + "@ xxxx @", + "@ xxxxxx @", + "@ xxx xxx @", + "@ xxx xxx @", + "@ xxx xxx @", + "@ @", + "@ @", + "@ @", + "@ @", + "@ @", + "@ @", + "@ @", + "@@@@@@@@@@@@@@@@", + NULL + }; static Fl_Pixmap broken_image(broken_xpm); @@ -292,16 +290,16 @@ void Fl_Help_View::hv_draw(const char *t, int x, int y, int entity_extra_length) class HV_Edit_Buffer { - int size_; // actually used text size w/o nul - int allocated_; // allocated buffer size - int extend_; // extend size (must be a power of 2) + int size_; // actually used text size w/o nul + int allocated_; // allocated buffer size + int extend_; // extend size (must be a power of 2) - char *buf_; // internal buffer + char *buf_; // internal buffer public: - HV_Edit_Buffer (int alloc = 1024, int ext = 1024); // c'tor - ~HV_Edit_Buffer (); // d'tor + HV_Edit_Buffer (int alloc = 1024, int ext = 1024); // c'tor + ~HV_Edit_Buffer (); // d'tor char *c_str() { return buf_; } void clear(); @@ -326,10 +324,10 @@ public: Edit buffer constructor. */ HV_Edit_Buffer::HV_Edit_Buffer( - int alloc, - int ext) + int alloc, + int ext) { - alloc = (alloc + ext-1) & (~(ext-1)); // round to chunk size + alloc = (alloc + ext-1) & (~(ext-1)); // round to chunk size size_ = 0; allocated_ = alloc; @@ -352,9 +350,9 @@ void HV_Edit_Buffer::clear() /* Adds text to the buffer. - \param[in] text text to be added - \param[in] size text size, default: -1 => strlen(text) - \returns new input text pointer, i.e. points beyond inserted text + \param[in] text text to be added + \param[in] size text size, default: -1 => strlen(text) + \returns new input text pointer, i.e. points beyond inserted text */ const char *HV_Edit_Buffer::add(const char *text, int size) { @@ -365,7 +363,7 @@ const char *HV_Edit_Buffer::add(const char *text, int size) { #if (DEBUG_EDIT_BUFFER > 1) printf("HV_Edit_Buffer::add(text,%d), allocated=%d, size=%d\n", - size, allocated_, size_+size); + size, allocated_, size_+size); fflush(stdout); #endif @@ -382,7 +380,7 @@ const char *HV_Edit_Buffer::add(const char *text, int size) { \note It is possible to add partial UTF-8 sequences. - \param[in] c byte (char) to be added + \param[in] c byte (char) to be added */ void HV_Edit_Buffer::add(char c) { @@ -390,7 +388,7 @@ void HV_Edit_Buffer::add(char c) { #if (DEBUG_EDIT_BUFFER > 1) printf("HV_Edit_Buffer::add(char = '%c'), allocated=%d, size=%d\n", - c, allocated_, size_+1); + c, allocated_, size_+1); fflush(stdout); #endif @@ -405,7 +403,7 @@ void HV_Edit_Buffer::add(char c) { The Unicode character \p ucs is converted to UTF-8 and appended to the buffer. - \param[in] ucs Unicode character (code point) to be added + \param[in] ucs Unicode character (code point) to be added */ void HV_Edit_Buffer::add(int ucs) { @@ -429,7 +427,7 @@ void HV_Edit_Buffer::add(int ucs) { If the requested \p size doesn't fit in the allocated buffer size, the buffer is extended. - \param[in] size requested text size to be added (w/o trailing nul) + \param[in] size requested text size to be added (w/o trailing nul) */ void HV_Edit_Buffer::check(int size) { @@ -441,7 +439,7 @@ void HV_Edit_Buffer::check(int size) { #if (DEBUG_EDIT_BUFFER) printf("HV_Edit_Buffer::check(%d), allocated: %d ->%d\n", - size, allocated_, new_size); + size, allocated_, new_size); fflush(stdout); #endif @@ -472,22 +470,22 @@ HV_Edit_Buffer::~HV_Edit_Buffer() { #if (DEBUG_EDIT_BUFFER) void HV_Edit_Buffer::print(const char *text) { printf("HV_Edit_Buffer::print(%s), allocated=%d, size=%d\n", - text, allocated_, size_); + text, allocated_, size_); printf(" \"%s\"\n", buf_ && size_ ? buf_ : ""); fflush(stdout); } // print() #endif /** Adds a text block to the list. */ -Fl_Help_Block * // O - Pointer to new block -Fl_Help_View::add_block(const char *s, // I - Pointer to start of block text - int xx, // I - X position of block - int yy, // I - Y position of block - int ww, // I - Right margin of block - int hh, // I - Height of block - unsigned char border) // I - Draw border? +Fl_Help_Block * // O - Pointer to new block +Fl_Help_View::add_block(const char *s, // I - Pointer to start of block text + int xx, // I - X position of block + int yy, // I - Y position of block + int ww, // I - Right margin of block + int hh, // I - Height of block + unsigned char border) // I - Draw border? { - Fl_Help_Block *temp; // New block + Fl_Help_Block *temp; // New block // printf("add_block(s = %p, xx = %d, yy = %d, ww = %d, hh = %d, border = %d)\n", @@ -520,14 +518,14 @@ Fl_Help_View::add_block(const char *s, // I - Pointer to start of block text /** Adds a new link to the list. */ -void Fl_Help_View::add_link(const char *n, // I - Name of link - int xx, // I - X position of link - int yy, // I - Y position of link - int ww, // I - Width of link text - int hh) // I - Height of link text +void Fl_Help_View::add_link(const char *n, // I - Name of link + int xx, // I - X position of link + int yy, // I - Y position of link + int ww, // I - Width of link text + int hh) // I - Height of link text { - Fl_Help_Link *temp; // New link - char *target; // Pointer to target name + Fl_Help_Link *temp; // New link + char *target; // Pointer to target name if (nlinks_ >= alinks_) @@ -562,10 +560,10 @@ void Fl_Help_View::add_link(const char *n, // I - Name of link /** Adds a new target to the list. */ -void Fl_Help_View::add_target(const char *n, // I - Name of target - int yy) // I - Y position of target +void Fl_Help_View::add_target(const char *n, // I - Name of target + int yy) // I - Y position of target { - Fl_Help_Target *temp; // New target + Fl_Help_Target *temp; // New target if (ntargets_ >= atargets_) @@ -587,35 +585,35 @@ void Fl_Help_View::add_target(const char *n, // I - Name of target } /** Compares two targets.*/ -int // O - Result of comparison -Fl_Help_View::compare_targets(const Fl_Help_Target *t0, // I - First target - const Fl_Help_Target *t1) // I - Second target +int // O - Result of comparison +Fl_Help_View::compare_targets(const Fl_Help_Target *t0, // I - First target + const Fl_Help_Target *t1) // I - Second target { return (strcasecmp(t0->name, t1->name)); } /** Computes the alignment for a line in a block.*/ -int // O - New line -Fl_Help_View::do_align(Fl_Help_Block *block, // I - Block to add to - int line, // I - Current line - int xx, // I - Current X position - int a, // I - Current alignment - int &l) // IO - Starting link +int // O - New line +Fl_Help_View::do_align(Fl_Help_Block *block, // I - Block to add to + int line, // I - Current line + int xx, // I - Current X position + int a, // I - Current alignment + int &l) // IO - Starting link { - int offset; // Alignment offset + int offset; // Alignment offset switch (a) { - case RIGHT : // Right align - offset = block->w - xx; - break; - case CENTER : // Center - offset = (block->w - xx) / 2; - break; - default : // Left align - offset = 0; - break; + case RIGHT : // Right align + offset = block->w - xx; + break; + case CENTER : // Center + offset = (block->w - xx) / 2; + break; + default : // Left align + offset = 0; + break; } block->line[line] = block->x + offset; @@ -637,22 +635,22 @@ Fl_Help_View::do_align(Fl_Help_Block *block, // I - Block to add to void Fl_Help_View::draw() { - int i; // Looping var - const Fl_Help_Block *block; // Pointer to current block - const char *ptr, // Pointer to text in block - *attrs; // Pointer to start of element attributes - HV_Edit_Buffer buf; // Text buffer - char attr[1024]; // Attribute buffer - int xx, yy, ww, hh; // Current positions and sizes - int line; // Current line + int i; // Looping var + const Fl_Help_Block *block; // Pointer to current block + const char *ptr, // Pointer to text in block + *attrs; // Pointer to start of element attributes + HV_Edit_Buffer buf; // Text buffer + char attr[1024]; // Attribute buffer + int xx, yy, ww, hh; // Current positions and sizes + int line; // Current line Fl_Font font; Fl_Fontsize fsize; // Current font and size Fl_Color fcolor; // current font color - int head, pre, // Flags for text - needspace; // Do we need whitespace? - Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; - // Box to draw... - int underline, // Underline text? + int head, pre, // Flags for text + needspace; // Do we need whitespace? + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; + // Box to draw... + int underline, // Underline text? xtra_ww; // Extra width for underlined space between words DEBUG_FUNCTION(__LINE__,__FUNCTION__); @@ -672,17 +670,17 @@ Fl_Help_View::draw() int scorn_x = x() + ww - (ver_vis?scrollsize:0) - Fl::box_dw(b) + Fl::box_dx(b); int scorn_y = y() + hh - (hor_vis?scrollsize:0) - Fl::box_dh(b) + Fl::box_dy(b); if ( hor_vis ) { - if ( hscrollbar_.h() != scrollsize ) { // scrollsize changed? - hscrollbar_.resize(x(), scorn_y, scorn_x - x(), scrollsize); - init_sizes(); + if ( hscrollbar_.h() != scrollsize ) { // scrollsize changed? + hscrollbar_.resize(x(), scorn_y, scorn_x - x(), scrollsize); + init_sizes(); } draw_child(hscrollbar_); hh -= scrollsize; } if ( ver_vis ) { - if ( scrollbar_.w() != scrollsize ) { // scrollsize changed? - scrollbar_.resize(scorn_x, y(), scrollsize, scorn_y - y()); - init_sizes(); + if ( scrollbar_.w() != scrollsize ) { // scrollsize changed? + scrollbar_.resize(scorn_x, y(), scrollsize, scorn_y - y()); + init_sizes(); } draw_child(scrollbar_); ww -= scrollsize; @@ -727,449 +725,449 @@ Fl_Help_View::draw() int entity_extra_length = 0; for (ptr = block->start, buf.clear(); ptr < block->end;) { - if ((*ptr == '<' || isspace((*ptr)&255)) && buf.size() > 0) - { - if (!head && !pre) - { + if ((*ptr == '<' || isspace((*ptr)&255)) && buf.size() > 0) + { + if (!head && !pre) + { // Check width... ww = buf.width(); if (needspace && xx > block->x) - xx += (int)fl_width(' '); + xx += (int)fl_width(' '); if ((xx + ww) > block->w) - { - if (line < 31) - line ++; - xx = block->line[line]; - yy += hh; - hh = 0; - } + { + if (line < 31) + line ++; + xx = block->line[line]; + yy += hh; + hh = 0; + } hv_draw(buf.c_str(), xx + x() - leftline_, yy + y(), entity_extra_length); - buf.clear(); + buf.clear(); entity_extra_length = 0; - if (underline) { + if (underline) { xtra_ww = isspace((*ptr)&255)?(int)fl_width(' '):0; fl_xyline(xx + x() - leftline_, yy + y() + 1, - xx + x() - leftline_ + ww + xtra_ww); + xx + x() - leftline_ + ww + xtra_ww); } current_pos = (int) (ptr-value_); xx += ww; - if ((fsize + 2) > hh) - hh = fsize + 2; - - needspace = 0; - } - else if (pre) - { - while (isspace((*ptr)&255)) - { - if (*ptr == '\n') - { - hv_draw(buf.c_str(), xx + x() - leftline_, yy + y()); - if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1, - xx + x() - leftline_ + buf.width()); - buf.clear(); - current_pos = (int) (ptr-value_); - if (line < 31) - line ++; - xx = block->line[line]; - yy += hh; - hh = fsize + 2; - } - else if (*ptr == '\t') - { - // Do tabs every 8 columns... - buf.add(' '); // add at least one space - while (buf.size() & 7) - buf.add(' '); - } - else { - buf.add(' '); - } + if ((fsize + 2) > hh) + hh = fsize + 2; + + needspace = 0; + } + else if (pre) + { + while (isspace((*ptr)&255)) + { + if (*ptr == '\n') + { + hv_draw(buf.c_str(), xx + x() - leftline_, yy + y()); + if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1, + xx + x() - leftline_ + buf.width()); + buf.clear(); + current_pos = (int) (ptr-value_); + if (line < 31) + line ++; + xx = block->line[line]; + yy += hh; + hh = fsize + 2; + } + else if (*ptr == '\t') + { + // Do tabs every 8 columns... + buf.add(' '); // add at least one space + while (buf.size() & 7) + buf.add(' '); + } + else { + buf.add(' '); + } if ((fsize + 2) > hh) - hh = fsize + 2; + hh = fsize + 2; ptr ++; - } + } if (buf.size() > 0) - { + { hv_draw(buf.c_str(), xx + x() - leftline_, yy + y()); - ww = buf.width(); - buf.clear(); - if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1, - xx + x() - leftline_ + ww); + ww = buf.width(); + buf.clear(); + if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1, + xx + x() - leftline_ + ww); xx += ww; current_pos = (int) (ptr-value_); - } + } - needspace = 0; - } - else - { - buf.clear(); + needspace = 0; + } + else + { + buf.clear(); - while (isspace((*ptr)&255)) + while (isspace((*ptr)&255)) ptr ++; current_pos = (int) (ptr-value_); - } - } + } + } - if (*ptr == '<') - { - ptr ++; + if (*ptr == '<') + { + ptr ++; if (strncmp(ptr, "!--", 3) == 0) - { - // Comment... - ptr += 3; - if ((ptr = strstr(ptr, "-->")) != NULL) - { - ptr += 3; - continue; - } - else - break; - } - - while (*ptr && *ptr != '>' && !isspace((*ptr)&255)) - buf.add(*ptr++); - - attrs = ptr; - while (*ptr && *ptr != '>') + { + // Comment... + ptr += 3; + if ((ptr = strstr(ptr, "-->")) != NULL) + { + ptr += 3; + continue; + } + else + break; + } + + while (*ptr && *ptr != '>' && !isspace((*ptr)&255)) + buf.add(*ptr++); + + attrs = ptr; + while (*ptr && *ptr != '>') ptr ++; - if (*ptr == '>') + if (*ptr == '>') ptr ++; // end of command reached, set the supposed start of printed eord here current_pos = (int) (ptr-value_); - if (buf.cmp("HEAD")) + if (buf.cmp("HEAD")) head = 1; - else if (buf.cmp("BR")) - { - if (line < 31) - line ++; - xx = block->line[line]; + else if (buf.cmp("BR")) + { + if (line < 31) + line ++; + xx = block->line[line]; yy += hh; - hh = 0; - } - else if (buf.cmp("HR")) - { - fl_line(block->x + x(), yy + y(), block->w + x(), - yy + y()); - - if (line < 31) - line ++; - xx = block->line[line]; + hh = 0; + } + else if (buf.cmp("HR")) + { + fl_line(block->x + x(), yy + y(), block->w + x(), + yy + y()); + + if (line < 31) + line ++; + xx = block->line[line]; yy += 2 * fsize;//hh; - hh = 0; - } - else if (buf.cmp("CENTER") || - buf.cmp("P") || - buf.cmp("H1") || - buf.cmp("H2") || - buf.cmp("H3") || - buf.cmp("H4") || - buf.cmp("H5") || - buf.cmp("H6") || - buf.cmp("UL") || - buf.cmp("OL") || - buf.cmp("DL") || - buf.cmp("LI") || - buf.cmp("DD") || - buf.cmp("DT") || - buf.cmp("PRE")) - { + hh = 0; + } + else if (buf.cmp("CENTER") || + buf.cmp("P") || + buf.cmp("H1") || + buf.cmp("H2") || + buf.cmp("H3") || + buf.cmp("H4") || + buf.cmp("H5") || + buf.cmp("H6") || + buf.cmp("UL") || + buf.cmp("OL") || + buf.cmp("DL") || + buf.cmp("LI") || + buf.cmp("DD") || + buf.cmp("DT") || + buf.cmp("PRE")) + { if (tolower(buf[0]) == 'h') - { - font = FL_HELVETICA_BOLD; - fsize = textsize_ + '7' - buf[1]; - } - else if (buf.cmp("DT")) - { - font = textfont_ | FL_ITALIC; - fsize = textsize_; - } - else if (buf.cmp("PRE")) - { - font = FL_COURIER; - fsize = textsize_; - pre = 1; - } + { + font = FL_HELVETICA_BOLD; + fsize = textsize_ + '7' - buf[1]; + } + else if (buf.cmp("DT")) + { + font = textfont_ | FL_ITALIC; + fsize = textsize_; + } + else if (buf.cmp("PRE")) + { + font = FL_COURIER; + fsize = textsize_; + pre = 1; + } if (buf.cmp("LI")) - { - // draw bullet (•) Unicode: U+2022, UTF-8 (hex): e2 80 a2 + { + // draw bullet (•) Unicode: U+2022, UTF-8 (hex): e2 80 a2 unsigned char bullet[4] = { 0xe2, 0x80, 0xa2, 0x00 }; hv_draw((char *)bullet, xx - fsize + x() - leftline_, yy + y()); - } - - pushfont(font, fsize); - buf.clear(); - } - else if (buf.cmp("A") && - get_attr(attrs, "HREF", attr, sizeof(attr)) != NULL) - { - fl_color(linkcolor_); - underline = 1; - } - else if (buf.cmp("/A")) - { - fl_color(textcolor_); - underline = 0; - } - else if (buf.cmp("FONT")) - { - if (get_attr(attrs, "COLOR", attr, sizeof(attr)) != NULL) { - textcolor_ = get_color(attr, textcolor_); - } + } + + pushfont(font, fsize); + buf.clear(); + } + else if (buf.cmp("A") && + get_attr(attrs, "HREF", attr, sizeof(attr)) != NULL) + { + fl_color(linkcolor_); + underline = 1; + } + else if (buf.cmp("/A")) + { + fl_color(textcolor_); + underline = 0; + } + else if (buf.cmp("FONT")) + { + if (get_attr(attrs, "COLOR", attr, sizeof(attr)) != NULL) { + textcolor_ = get_color(attr, textcolor_); + } if (get_attr(attrs, "FACE", attr, sizeof(attr)) != NULL) { - if (!strncasecmp(attr, "helvetica", 9) || - !strncasecmp(attr, "arial", 5) || - !strncasecmp(attr, "sans", 4)) font = FL_HELVETICA; + if (!strncasecmp(attr, "helvetica", 9) || + !strncasecmp(attr, "arial", 5) || + !strncasecmp(attr, "sans", 4)) font = FL_HELVETICA; else if (!strncasecmp(attr, "times", 5) || - !strncasecmp(attr, "serif", 5)) font = FL_TIMES; + !strncasecmp(attr, "serif", 5)) font = FL_TIMES; else if (!strncasecmp(attr, "symbol", 6)) font = FL_SYMBOL; - else font = FL_COURIER; + else font = FL_COURIER; } if (get_attr(attrs, "SIZE", attr, sizeof(attr)) != NULL) { if (isdigit(attr[0] & 255)) { - // Absolute size - fsize = (int)(textsize_ * pow(1.2, atof(attr) - 3.0)); - } else { - // Relative size - fsize = (int)(fsize * pow(1.2, atof(attr) - 3.0)); - } - } + // Absolute size + fsize = (int)(textsize_ * pow(1.2, atof(attr) - 3.0)); + } else { + // Relative size + fsize = (int)(fsize * pow(1.2, atof(attr) - 3.0)); + } + } pushfont(font, fsize); - } - else if (buf.cmp("/FONT")) - { - popfont(font, fsize, textcolor_); - } - else if (buf.cmp("U")) - underline = 1; - else if (buf.cmp("/U")) - underline = 0; - else if (buf.cmp("B") || - buf.cmp("STRONG")) - pushfont(font |= FL_BOLD, fsize); - else if (buf.cmp("TD") || - buf.cmp("TH")) + } + else if (buf.cmp("/FONT")) + { + popfont(font, fsize, textcolor_); + } + else if (buf.cmp("U")) + underline = 1; + else if (buf.cmp("/U")) + underline = 0; + else if (buf.cmp("B") || + buf.cmp("STRONG")) + pushfont(font |= FL_BOLD, fsize); + else if (buf.cmp("TD") || + buf.cmp("TH")) { - int tx, ty, tw, th; + int tx, ty, tw, th; - if (tolower(buf[1]) == 'h') - pushfont(font |= FL_BOLD, fsize); - else - pushfont(font = textfont_, fsize); + if (tolower(buf[1]) == 'h') + pushfont(font |= FL_BOLD, fsize); + else + pushfont(font = textfont_, fsize); tx = block->x - 4 - leftline_; - ty = block->y - topline_ - fsize - 3; + ty = block->y - topline_ - fsize - 3; tw = block->w - block->x + 7; - th = block->h + fsize - 5; + th = block->h + fsize - 5; if (tx < 0) - { - tw += tx; - tx = 0; - } + { + tw += tx; + tx = 0; + } - if (ty < 0) - { - th += ty; - ty = 0; - } + if (ty < 0) + { + th += ty; + ty = 0; + } tx += x(); - ty += y(); + ty += y(); if (block->bgcolor != bgcolor_) - { - fl_color(block->bgcolor); + { + fl_color(block->bgcolor); fl_rectf(tx, ty, tw, th); fl_color(textcolor_); - } + } if (block->border) fl_rect(tx, ty, tw, th); - } - else if (buf.cmp("I") || + } + else if (buf.cmp("I") || buf.cmp("EM")) - pushfont(font |= FL_ITALIC, fsize); - else if (buf.cmp("CODE") || - buf.cmp("TT")) - pushfont(font = FL_COURIER, fsize); - else if (buf.cmp("KBD")) - pushfont(font = FL_COURIER_BOLD, fsize); - else if (buf.cmp("VAR")) - pushfont(font = FL_COURIER_ITALIC, fsize); - else if (buf.cmp("/HEAD")) + pushfont(font |= FL_ITALIC, fsize); + else if (buf.cmp("CODE") || + buf.cmp("TT")) + pushfont(font = FL_COURIER, fsize); + else if (buf.cmp("KBD")) + pushfont(font = FL_COURIER_BOLD, fsize); + else if (buf.cmp("VAR")) + pushfont(font = FL_COURIER_ITALIC, fsize); + else if (buf.cmp("/HEAD")) head = 0; - else if (buf.cmp("/H1") || - buf.cmp("/H2") || - buf.cmp("/H3") || - buf.cmp("/H4") || - buf.cmp("/H5") || - buf.cmp("/H6") || - buf.cmp("/B") || - buf.cmp("/STRONG") || - buf.cmp("/I") || - buf.cmp("/EM") || - buf.cmp("/CODE") || - buf.cmp("/TT") || - buf.cmp("/KBD") || - buf.cmp("/VAR")) - popfont(font, fsize, fcolor); - else if (buf.cmp("/PRE")) - { - popfont(font, fsize, fcolor); - pre = 0; - } - else if (buf.cmp("IMG")) - { - Fl_Shared_Image *img = 0; - int width, height; - char wattr[8], hattr[8]; + else if (buf.cmp("/H1") || + buf.cmp("/H2") || + buf.cmp("/H3") || + buf.cmp("/H4") || + buf.cmp("/H5") || + buf.cmp("/H6") || + buf.cmp("/B") || + buf.cmp("/STRONG") || + buf.cmp("/I") || + buf.cmp("/EM") || + buf.cmp("/CODE") || + buf.cmp("/TT") || + buf.cmp("/KBD") || + buf.cmp("/VAR")) + popfont(font, fsize, fcolor); + else if (buf.cmp("/PRE")) + { + popfont(font, fsize, fcolor); + pre = 0; + } + else if (buf.cmp("IMG")) + { + Fl_Shared_Image *img = 0; + int width, height; + char wattr[8], hattr[8]; get_attr(attrs, "WIDTH", wattr, sizeof(wattr)); get_attr(attrs, "HEIGHT", hattr, sizeof(hattr)); - width = get_length(wattr); - height = get_length(hattr); + width = get_length(wattr); + height = get_length(hattr); - if (get_attr(attrs, "SRC", attr, sizeof(attr))) { - img = get_image(attr, width, height); - if (!width) width = img->w(); - if (!height) height = img->h(); - } + if (get_attr(attrs, "SRC", attr, sizeof(attr))) { + img = get_image(attr, width, height); + if (!width) width = img->w(); + if (!height) height = img->h(); + } - if (!width || !height) { + if (!width || !height) { if (get_attr(attrs, "ALT", attr, sizeof(attr)) == NULL) { - strcpy(attr, "IMG"); + strcpy(attr, "IMG"); } - } - - ww = width; - - if (needspace && xx > block->x) - xx += (int)fl_width(' '); - - if ((xx + ww) > block->w) - { - if (line < 31) - line ++; - - xx = block->line[line]; - yy += hh; - hh = 0; - } - - if (img) { - img->draw(xx + x() - leftline_, - yy + y() - fl_height() + fl_descent() + 2); - } - - xx += ww; - if ((height + 2) > hh) - hh = height + 2; - - needspace = 0; - } - buf.clear(); - } - else if (*ptr == '\n' && pre) - { + } + + ww = width; + + if (needspace && xx > block->x) + xx += (int)fl_width(' '); + + if ((xx + ww) > block->w) + { + if (line < 31) + line ++; + + xx = block->line[line]; + yy += hh; + hh = 0; + } + + if (img) { + img->draw(xx + x() - leftline_, + yy + y() - fl_height() + fl_descent() + 2); + } + + xx += ww; + if ((height + 2) > hh) + hh = height + 2; + + needspace = 0; + } + buf.clear(); + } + else if (*ptr == '\n' && pre) + { hv_draw(buf.c_str(), xx + x() - leftline_, yy + y()); - buf.clear(); + buf.clear(); - if (line < 31) - line ++; - xx = block->line[line]; - yy += hh; - hh = fsize + 2; - needspace = 0; + if (line < 31) + line ++; + xx = block->line[line]; + yy += hh; + hh = fsize + 2; + needspace = 0; - ptr ++; + ptr ++; current_pos = (int) (ptr-value_); - } - else if (isspace((*ptr)&255)) - { - if (pre) - { - if (*ptr == ' ') - buf.add(' '); - else - { - // Do tabs every 8 columns... - buf.add(' '); // at least one space - while (buf.size() & 7) - buf.add(' '); + } + else if (isspace((*ptr)&255)) + { + if (pre) + { + if (*ptr == ' ') + buf.add(' '); + else + { + // Do tabs every 8 columns... + buf.add(' '); // at least one space + while (buf.size() & 7) + buf.add(' '); } - } + } ptr ++; if (!pre) current_pos = (int) (ptr-value_); - needspace = 1; - } - else if (*ptr == '&') // process html entity - { - ptr ++; + needspace = 1; + } + else if (*ptr == '&') // process html entity + { + ptr ++; int qch = quote_char(ptr); - if (qch < 0) - buf.add('&'); - else { + if (qch < 0) + buf.add('&'); + else { int utf8l = buf.size(); - buf.add(qch); + buf.add(qch); utf8l = buf.size() - utf8l; // length of added UTF-8 text const char *oldptr = ptr; - ptr = strchr(ptr, ';') + 1; + ptr = strchr(ptr, ';') + 1; entity_extra_length += ptr - (oldptr-1) - utf8l; // extra length between html entity and UTF-8 - } + } if ((fsize + 2) > hh) - hh = fsize + 2; - } - else - { - buf.add(*ptr++); + hh = fsize + 2; + } + else + { + buf.add(*ptr++); if ((fsize + 2) > hh) - hh = fsize + 2; + hh = fsize + 2; } } if (buf.size() > 0 && !pre && !head) { - ww = buf.width(); + ww = buf.width(); if (needspace && xx > block->x) - xx += (int)fl_width(' '); - - if ((xx + ww) > block->w) - { - if (line < 31) - line ++; - xx = block->line[line]; - yy += hh; - hh = 0; - } + xx += (int)fl_width(' '); + + if ((xx + ww) > block->w) + { + if (line < 31) + line ++; + xx = block->line[line]; + yy += hh; + hh = 0; + } } if (buf.size() > 0 && !head) { hv_draw(buf.c_str(), xx + x() - leftline_, yy + y()); - if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1, - xx + x() - leftline_ + ww); + if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1, + xx + x() - leftline_ + ww); current_pos = (int) (ptr-value_); } } @@ -1183,16 +1181,16 @@ Fl_Help_View::draw() \return the matching position or -1 if not found */ -int // O - Matching position or -1 if not found -Fl_Help_View::find(const char *s, // I - String to find - int p) // I - Starting position +int // O - Matching position or -1 if not found +Fl_Help_View::find(const char *s, // I - String to find + int p) // I - Starting position { - int i, // Looping var - c; // Current character - Fl_Help_Block *b; // Current block - const char *bp, // Block matching pointer - *bs, // Start of current comparison - *sp; // Search string pointer + int i, // Looping var + c; // Current character + Fl_Help_Block *b; // Current block + const char *bp, // Block matching pointer + *bs, // Start of current comparison + *sp; // Search string pointer DEBUG_FUNCTION(__LINE__,__FUNCTION__); @@ -1214,12 +1212,12 @@ Fl_Help_View::find(const char *s, // I - String to find for (sp = s, bs = bp; *sp && *bp && bp < b->end; bp ++) { if (*bp == '<') { // skip to end of element... - while (*bp && bp < b->end && *bp != '>') bp ++; - continue; + while (*bp && bp < b->end && *bp != '>') bp ++; + continue; } else if (*bp == '&') { // decode HTML entity... - if ((c = quote_char(bp + 1)) < 0) c = '&'; // *FIXME* UTF-8, see below - else bp = strchr(bp + 1, ';') + 1; + if ((c = quote_char(bp + 1)) < 0) c = '&'; // *FIXME* UTF-8, see below + else bp = strchr(bp + 1, ';') + 1; } else c = *bp; // *FIXME* *UTF-8* (A.S. 02/14/2016) @@ -1233,9 +1231,9 @@ Fl_Help_View::find(const char *s, // I - String to find if (tolower(*sp) == tolower(c)) sp ++; else { // No match, so reset to start of search... - sp = s; - bs ++; - bp = bs; + sp = s; + bs ++; + bp = bs; } } @@ -1252,42 +1250,42 @@ Fl_Help_View::find(const char *s, // I - String to find /** Formats the help text. */ void Fl_Help_View::format() { - int i; // Looping var - int done; // Are we done yet? - Fl_Help_Block *block, // Current block - *cell; // Current table cell - int cells[MAX_COLUMNS], - // Cells in the current row... - row; // Current table row (block number) - const char *ptr, // Pointer into block - *start, // Pointer to start of element - *attrs; // Pointer to start of element attributes - HV_Edit_Buffer buf; // Text buffer - char attr[1024], // Attribute buffer - wattr[1024], // Width attribute buffer - hattr[1024], // Height attribute buffer - linkdest[1024]; // Link destination - int xx, yy, ww, hh; // Size of current text fragment - int line; // Current line in block - int links; // Links for current line + int i; // Looping var + int done; // Are we done yet? + Fl_Help_Block *block, // Current block + *cell; // Current table cell + int cells[MAX_COLUMNS], + // Cells in the current row... + row; // Current table row (block number) + const char *ptr, // Pointer into block + *start, // Pointer to start of element + *attrs; // Pointer to start of element attributes + HV_Edit_Buffer buf; // Text buffer + char attr[1024], // Attribute buffer + wattr[1024], // Width attribute buffer + hattr[1024], // Height attribute buffer + linkdest[1024]; // Link destination + int xx, yy, ww, hh; // Size of current text fragment + int line; // Current line in block + int links; // Links for current line Fl_Font font; Fl_Fontsize fsize; // Current font and size Fl_Color fcolor; // Current font color - unsigned char border; // Draw border? - int talign, // Current alignment - newalign, // New alignment - head, // In the <HEAD> section? - pre, // <PRE> text? - needspace; // Do we need whitespace? - int table_width, // Width of table - table_offset; // Offset of table - int column, // Current table column number - columns[MAX_COLUMNS]; - // Column widths - Fl_Color tc, rc; // Table/row background color - Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; - // Box to draw... - fl_margins margins; // Left margin stack... + unsigned char border; // Draw border? + int talign, // Current alignment + newalign, // New alignment + head, // In the <HEAD> section? + pre, // <PRE> text? + needspace; // Do we need whitespace? + int table_width, // Width of table + table_offset; // Offset of table + int column, // Current table column number + columns[MAX_COLUMNS]; + // Column widths + Fl_Color tc, rc; // Table/row background color + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; + // Box to draw... + fl_margins margins; // Left margin stack... DEBUG_FUNCTION(__LINE__,__FUNCTION__); @@ -1345,328 +1343,328 @@ void Fl_Help_View::format() { // Get width of word parsed so far... ww = buf.width(); - if (!head && !pre) - { + if (!head && !pre) + { // Check width... if (ww > hsize_) { - hsize_ = ww; - done = 0; - break; - } + hsize_ = ww; + done = 0; + break; + } if (needspace && xx > block->x) - ww += (int)fl_width(' '); + ww += (int)fl_width(' '); // printf("line = %d, xx = %d, ww = %d, block->x = %d, block->w = %d\n", - // line, xx, ww, block->x, block->w); + // line, xx, ww, block->x, block->w); if ((xx + ww) > block->w) - { + { line = do_align(block, line, xx, newalign, links); - xx = block->x; - yy += hh; - block->h += hh; - hh = 0; - } + xx = block->x; + yy += hh; + block->h += hh; + hh = 0; + } if (linkdest[0]) - add_link(linkdest, xx, yy - fsize, ww, fsize); + add_link(linkdest, xx, yy - fsize, ww, fsize); - xx += ww; - if ((fsize + 2) > hh) - hh = fsize + 2; + xx += ww; + if ((fsize + 2) > hh) + hh = fsize + 2; - needspace = 0; - } - else if (pre) - { + needspace = 0; + } + else if (pre) + { // Add a link as needed... if (linkdest[0]) - add_link(linkdest, xx, yy - hh, ww, hh); + add_link(linkdest, xx, yy - hh, ww, hh); - xx += ww; - if ((fsize + 2) > hh) - hh = fsize + 2; + xx += ww; + if ((fsize + 2) > hh) + hh = fsize + 2; // Handle preformatted text... - while (isspace((*ptr)&255)) - { - if (*ptr == '\n') - { + while (isspace((*ptr)&255)) + { + if (*ptr == '\n') + { if (xx > hsize_) break; line = do_align(block, line, xx, newalign, links); xx = block->x; - yy += hh; - block->h += hh; - hh = fsize + 2; - } - else + yy += hh; + block->h += hh; + hh = fsize + 2; + } + else xx += (int)fl_width(' '); if ((fsize + 2) > hh) - hh = fsize + 2; + hh = fsize + 2; ptr ++; - } + } if (xx > hsize_) { - hsize_ = xx; - done = 0; - break; - } - - needspace = 0; - } - else - { + hsize_ = xx; + done = 0; + break; + } + + needspace = 0; + } + else + { // Handle normal text or stuff in the <HEAD> section... - while (isspace((*ptr)&255)) + while (isspace((*ptr)&255)) ptr ++; - } + } - buf.clear(); + buf.clear(); } if (*ptr == '<') { - // Handle html tags.. - start = ptr; - ptr ++; + // Handle html tags.. + start = ptr; + ptr ++; if (strncmp(ptr, "!--", 3) == 0) - { - // Comment... - ptr += 3; - if ((ptr = strstr(ptr, "-->")) != NULL) - { - ptr += 3; - continue; - } - else - break; - } - - while (*ptr && *ptr != '>' && !isspace((*ptr)&255)) - buf.add(*ptr++); - - attrs = ptr; - while (*ptr && *ptr != '>') + { + // Comment... + ptr += 3; + if ((ptr = strstr(ptr, "-->")) != NULL) + { + ptr += 3; + continue; + } + else + break; + } + + while (*ptr && *ptr != '>' && !isspace((*ptr)&255)) + buf.add(*ptr++); + + attrs = ptr; + while (*ptr && *ptr != '>') ptr ++; - if (*ptr == '>') + if (*ptr == '>') ptr ++; - if (buf.cmp("HEAD")) + if (buf.cmp("HEAD")) head = 1; - else if (buf.cmp("/HEAD")) + else if (buf.cmp("/HEAD")) head = 0; - else if (buf.cmp("TITLE")) - { + else if (buf.cmp("TITLE")) + { // Copy the title in the document... - char *st; + char *st; for (st = title_; - *ptr != '<' && *ptr && st < (title_ + sizeof(title_) - 1); - *st++ = *ptr++) {/*empty*/} - - *st = '\0'; - buf.clear(); - } - else if (buf.cmp("A")) - { + *ptr != '<' && *ptr && st < (title_ + sizeof(title_) - 1); + *st++ = *ptr++) {/*empty*/} + + *st = '\0'; + buf.clear(); + } + else if (buf.cmp("A")) + { if (get_attr(attrs, "NAME", attr, sizeof(attr)) != NULL) - add_target(attr, yy - fsize - 2); + add_target(attr, yy - fsize - 2); - if (get_attr(attrs, "HREF", attr, sizeof(attr)) != NULL) - strlcpy(linkdest, attr, sizeof(linkdest)); - } - else if (buf.cmp("/A")) + if (get_attr(attrs, "HREF", attr, sizeof(attr)) != NULL) + strlcpy(linkdest, attr, sizeof(linkdest)); + } + else if (buf.cmp("/A")) linkdest[0] = '\0'; - else if (buf.cmp("BODY")) - { + else if (buf.cmp("BODY")) + { bgcolor_ = get_color(get_attr(attrs, "BGCOLOR", attr, sizeof(attr)), - color()); + color()); textcolor_ = get_color(get_attr(attrs, "TEXT", attr, sizeof(attr)), - textcolor()); + textcolor()); linkcolor_ = get_color(get_attr(attrs, "LINK", attr, sizeof(attr)), - fl_contrast(FL_BLUE, color())); - } - else if (buf.cmp("BR")) - { + fl_contrast(FL_BLUE, color())); + } + else if (buf.cmp("BR")) + { line = do_align(block, line, xx, newalign, links); xx = block->x; - block->h += hh; + block->h += hh; yy += hh; - hh = 0; - } - else if (buf.cmp("CENTER") || - buf.cmp("P") || - buf.cmp("H1") || - buf.cmp("H2") || - buf.cmp("H3") || - buf.cmp("H4") || - buf.cmp("H5") || - buf.cmp("H6") || - buf.cmp("UL") || - buf.cmp("OL") || - buf.cmp("DL") || - buf.cmp("LI") || - buf.cmp("DD") || - buf.cmp("DT") || - buf.cmp("HR") || - buf.cmp("PRE") || - buf.cmp("TABLE")) - { + hh = 0; + } + else if (buf.cmp("CENTER") || + buf.cmp("P") || + buf.cmp("H1") || + buf.cmp("H2") || + buf.cmp("H3") || + buf.cmp("H4") || + buf.cmp("H5") || + buf.cmp("H6") || + buf.cmp("UL") || + buf.cmp("OL") || + buf.cmp("DL") || + buf.cmp("LI") || + buf.cmp("DD") || + buf.cmp("DT") || + buf.cmp("HR") || + buf.cmp("PRE") || + buf.cmp("TABLE")) + { block->end = start; line = do_align(block, line, xx, newalign, links); - newalign = buf.cmp("CENTER") ? CENTER : LEFT; + newalign = buf.cmp("CENTER") ? CENTER : LEFT; xx = block->x; block->h += hh; if (buf.cmp("UL") || - buf.cmp("OL") || - buf.cmp("DL")) + buf.cmp("OL") || + buf.cmp("DL")) { - block->h += fsize + 2; - xx = margins.push(4 * fsize); - } + block->h += fsize + 2; + xx = margins.push(4 * fsize); + } else if (buf.cmp("TABLE")) - { - if (get_attr(attrs, "BORDER", attr, sizeof(attr))) - border = (uchar)atoi(attr); - else - border = 0; + { + if (get_attr(attrs, "BORDER", attr, sizeof(attr))) + border = (uchar)atoi(attr); + else + border = 0; tc = rc = get_color(get_attr(attrs, "BGCOLOR", attr, sizeof(attr)), bgcolor_); - block->h += fsize + 2; + block->h += fsize + 2; format_table(&table_width, columns, start); if ((xx + table_width) > hsize_) { #ifdef DEBUG printf("xx=%d, table_width=%d, hsize_=%d\n", xx, table_width, - hsize_); + hsize_); #endif // DEBUG - hsize_ = xx + table_width; - done = 0; - break; - } + hsize_ = xx + table_width; + done = 0; + break; + } switch (get_align(attrs, talign)) - { - default : - table_offset = 0; - break; - - case CENTER : - table_offset = (hsize_ - table_width) / 2 - textsize_; - break; - - case RIGHT : - table_offset = hsize_ - table_width - textsize_; - break; - } + { + default : + table_offset = 0; + break; + + case CENTER : + table_offset = (hsize_ - table_width) / 2 - textsize_; + break; + + case RIGHT : + table_offset = hsize_ - table_width - textsize_; + break; + } - column = 0; - } + column = 0; + } if (tolower(buf[0]) == 'h' && isdigit(buf[1])) - { - font = FL_HELVETICA_BOLD; - fsize = textsize_ + '7' - buf[1]; - } - else if (buf.cmp("DT")) - { - font = textfont_ | FL_ITALIC; - fsize = textsize_; - } - else if (buf.cmp("PRE")) - { - font = FL_COURIER; - fsize = textsize_; - pre = 1; - } - else - { - font = textfont_; - fsize = textsize_; - } - - pushfont(font, fsize); + { + font = FL_HELVETICA_BOLD; + fsize = textsize_ + '7' - buf[1]; + } + else if (buf.cmp("DT")) + { + font = textfont_ | FL_ITALIC; + fsize = textsize_; + } + else if (buf.cmp("PRE")) + { + font = FL_COURIER; + fsize = textsize_; + pre = 1; + } + else + { + font = textfont_; + fsize = textsize_; + } + + pushfont(font, fsize); yy = block->y + block->h; hh = 0; if ((tolower(buf[0]) == 'h' && isdigit(buf[1])) || - buf.cmp("DD") || - buf.cmp("DT") || - buf.cmp("P")) + buf.cmp("DD") || + buf.cmp("DT") || + buf.cmp("P")) yy += fsize + 2; - else if (buf.cmp("HR")) - { - hh += 2 * fsize; - yy += fsize; - } + else if (buf.cmp("HR")) + { + hh += 2 * fsize; + yy += fsize; + } if (row) - block = add_block(start, xx, yy, block->w, 0); - else - block = add_block(start, xx, yy, hsize_, 0); - - needspace = 0; - line = 0; - - if (buf.cmp("CENTER")) - newalign = talign = CENTER; - else - newalign = get_align(attrs, talign); - } - else if (buf.cmp("/CENTER") || - buf.cmp("/P") || - buf.cmp("/H1") || - buf.cmp("/H2") || - buf.cmp("/H3") || - buf.cmp("/H4") || - buf.cmp("/H5") || - buf.cmp("/H6") || - buf.cmp("/PRE") || - buf.cmp("/UL") || - buf.cmp("/OL") || - buf.cmp("/DL") || - buf.cmp("/TABLE")) - { + block = add_block(start, xx, yy, block->w, 0); + else + block = add_block(start, xx, yy, hsize_, 0); + + needspace = 0; + line = 0; + + if (buf.cmp("CENTER")) + newalign = talign = CENTER; + else + newalign = get_align(attrs, talign); + } + else if (buf.cmp("/CENTER") || + buf.cmp("/P") || + buf.cmp("/H1") || + buf.cmp("/H2") || + buf.cmp("/H3") || + buf.cmp("/H4") || + buf.cmp("/H5") || + buf.cmp("/H6") || + buf.cmp("/PRE") || + buf.cmp("/UL") || + buf.cmp("/OL") || + buf.cmp("/DL") || + buf.cmp("/TABLE")) + { line = do_align(block, line, xx, newalign, links); xx = block->x; block->end = ptr; if (buf.cmp("/UL") || - buf.cmp("/OL") || - buf.cmp("/DL")) - { - xx = margins.pop(); - block->h += fsize + 2; - } - else if (buf.cmp("/TABLE")) + buf.cmp("/OL") || + buf.cmp("/DL")) { - block->h += fsize + 2; + xx = margins.pop(); + block->h += fsize + 2; + } + else if (buf.cmp("/TABLE")) + { + block->h += fsize + 2; xx = margins.current(); } - else if (buf.cmp("/PRE")) - { - pre = 0; - hh = 0; - } - else if (buf.cmp("/CENTER")) - talign = LEFT; + else if (buf.cmp("/PRE")) + { + pre = 0; + hh = 0; + } + else if (buf.cmp("/CENTER")) + talign = LEFT; popfont(font, fsize, fcolor); - //#if defined(__GNUC__) + //#if defined(__GNUC__) //#warning FIXME this isspace & 255 test will probably not work on a utf8 stream... And we use it everywhere! - //#endif /*__GNUC__*/ + //#endif /*__GNUC__*/ while (isspace((*ptr)&255)) - ptr ++; + ptr ++; block->h += hh; yy += hh; @@ -1675,292 +1673,292 @@ void Fl_Help_View::format() { yy += fsize + 2; if (row) - block = add_block(ptr, xx, yy, block->w, 0); - else - block = add_block(ptr, xx, yy, hsize_, 0); - - needspace = 0; - hh = 0; - line = 0; - newalign = talign; - } - else if (buf.cmp("TR")) - { + block = add_block(ptr, xx, yy, block->w, 0); + else + block = add_block(ptr, xx, yy, hsize_, 0); + + needspace = 0; + hh = 0; + line = 0; + newalign = talign; + } + else if (buf.cmp("TR")) + { block->end = start; line = do_align(block, line, xx, newalign, links); xx = block->x; block->h += hh; if (row) - { + { yy = blocks_[row].y + blocks_[row].h; - for (cell = blocks_ + row + 1; cell <= block; cell ++) - if ((cell->y + cell->h) > yy) - yy = cell->y + cell->h; + for (cell = blocks_ + row + 1; cell <= block; cell ++) + if ((cell->y + cell->h) > yy) + yy = cell->y + cell->h; block = blocks_ + row; block->h = yy - block->y + 2; - for (i = 0; i < column; i ++) - if (cells[i]) - { - cell = blocks_ + cells[i]; - cell->h = block->h; - } - } + for (i = 0; i < column; i ++) + if (cells[i]) + { + cell = blocks_ + cells[i]; + cell->h = block->h; + } + } memset(cells, 0, sizeof(cells)); - yy = block->y + block->h - 4; - hh = 0; + yy = block->y + block->h - 4; + hh = 0; block = add_block(start, xx, yy, hsize_, 0); - row = (int) (block - blocks_); - needspace = 0; - column = 0; - line = 0; + row = (int) (block - blocks_); + needspace = 0; + column = 0; + line = 0; rc = get_color(get_attr(attrs, "BGCOLOR", attr, sizeof(attr)), tc); - } - else if (buf.cmp("/TR") && row) - { + } + else if (buf.cmp("/TR") && row) + { line = do_align(block, line, xx, newalign, links); block->end = start; - block->h += hh; - talign = LEFT; + block->h += hh; + talign = LEFT; xx = blocks_[row].x; yy = blocks_[row].y + blocks_[row].h; - for (cell = blocks_ + row + 1; cell <= block; cell ++) - if ((cell->y + cell->h) > yy) - yy = cell->y + cell->h; + for (cell = blocks_ + row + 1; cell <= block; cell ++) + if ((cell->y + cell->h) > yy) + yy = cell->y + cell->h; block = blocks_ + row; block->h = yy - block->y + 2; - for (i = 0; i < column; i ++) - if (cells[i]) - { - cell = blocks_ + cells[i]; - cell->h = block->h; - } + for (i = 0; i < column; i ++) + if (cells[i]) + { + cell = blocks_ + cells[i]; + cell->h = block->h; + } - yy = block->y + block->h /*- 4*/; + yy = block->y + block->h /*- 4*/; block = add_block(start, xx, yy, hsize_, 0); - needspace = 0; - row = 0; - line = 0; - } - else if ((buf.cmp("TD") || + needspace = 0; + row = 0; + line = 0; + } + else if ((buf.cmp("TD") || buf.cmp("TH")) && row) - { - int colspan; // COLSPAN attribute + { + int colspan; // COLSPAN attribute line = do_align(block, line, xx, newalign, links); block->end = start; - block->h += hh; + block->h += hh; if (buf.cmp("TH")) - font = textfont_ | FL_BOLD; - else - font = textfont_; + font = textfont_ | FL_BOLD; + else + font = textfont_; fsize = textsize_; xx = blocks_[row].x + fsize + 3 + table_offset; - for (i = 0; i < column; i ++) - xx += columns[i] + 6; + for (i = 0; i < column; i ++) + xx += columns[i] + 6; margins.push(xx - margins.current()); if (get_attr(attrs, "COLSPAN", attr, sizeof(attr)) != NULL) - colspan = atoi(attr); - else - colspan = 1; + colspan = atoi(attr); + else + colspan = 1; for (i = 0, ww = -6; i < colspan; i ++) - ww += columns[column + i] + 6; + ww += columns[column + i] + 6; if (block->end == block->start && nblocks_ > 1) - { - nblocks_ --; - block --; - } + { + nblocks_ --; + block --; + } - pushfont(font, fsize); + pushfont(font, fsize); - yy = blocks_[row].y; - hh = 0; + yy = blocks_[row].y; + hh = 0; block = add_block(start, xx, yy, xx + ww, 0, border); - needspace = 0; - line = 0; - newalign = get_align(attrs, tolower(buf[1]) == 'h' ? CENTER : LEFT); - talign = newalign; + needspace = 0; + line = 0; + newalign = get_align(attrs, tolower(buf[1]) == 'h' ? CENTER : LEFT); + talign = newalign; cells[column] = (int) (block - blocks_); - column += colspan; + column += colspan; block->bgcolor = get_color(get_attr(attrs, "BGCOLOR", attr, - sizeof(attr)), rc); - } - else if ((buf.cmp("/TD") || + sizeof(attr)), rc); + } + else if ((buf.cmp("/TD") || buf.cmp("/TH")) && row) - { + { line = do_align(block, line, xx, newalign, links); popfont(font, fsize, fcolor); - xx = margins.pop(); - talign = LEFT; - } - else if (buf.cmp("FONT")) - { + xx = margins.pop(); + talign = LEFT; + } + else if (buf.cmp("FONT")) + { if (get_attr(attrs, "FACE", attr, sizeof(attr)) != NULL) { - if (!strncasecmp(attr, "helvetica", 9) || - !strncasecmp(attr, "arial", 5) || - !strncasecmp(attr, "sans", 4)) font = FL_HELVETICA; + if (!strncasecmp(attr, "helvetica", 9) || + !strncasecmp(attr, "arial", 5) || + !strncasecmp(attr, "sans", 4)) font = FL_HELVETICA; else if (!strncasecmp(attr, "times", 5) || - !strncasecmp(attr, "serif", 5)) font = FL_TIMES; + !strncasecmp(attr, "serif", 5)) font = FL_TIMES; else if (!strncasecmp(attr, "symbol", 6)) font = FL_SYMBOL; - else font = FL_COURIER; + else font = FL_COURIER; } if (get_attr(attrs, "SIZE", attr, sizeof(attr)) != NULL) { if (isdigit(attr[0] & 255)) { - // Absolute size - fsize = (int)(textsize_ * pow(1.2, atoi(attr) - 3.0)); - } else { - // Relative size - fsize = (int)(fsize * pow(1.2, atoi(attr))); - } - } + // Absolute size + fsize = (int)(textsize_ * pow(1.2, atoi(attr) - 3.0)); + } else { + // Relative size + fsize = (int)(fsize * pow(1.2, atoi(attr))); + } + } pushfont(font, fsize); - } - else if (buf.cmp("/FONT")) - popfont(font, fsize, fcolor); - else if (buf.cmp("B") || - buf.cmp("STRONG")) - pushfont(font |= FL_BOLD, fsize); - else if (buf.cmp("I") || - buf.cmp("EM")) - pushfont(font |= FL_ITALIC, fsize); - else if (buf.cmp("CODE") || - buf.cmp("TT")) - pushfont(font = FL_COURIER, fsize); - else if (buf.cmp("KBD")) - pushfont(font = FL_COURIER_BOLD, fsize); - else if (buf.cmp("VAR")) - pushfont(font = FL_COURIER_ITALIC, fsize); - else if (buf.cmp("/B") || - buf.cmp("/STRONG") || - buf.cmp("/I") || - buf.cmp("/EM") || - buf.cmp("/CODE") || - buf.cmp("/TT") || - buf.cmp("/KBD") || - buf.cmp("/VAR")) - popfont(font, fsize, fcolor); - else if (buf.cmp("IMG")) - { - Fl_Shared_Image *img = 0; - int width; - int height; - - - get_attr(attrs, "WIDTH", wattr, sizeof(wattr)); - get_attr(attrs, "HEIGHT", hattr, sizeof(hattr)); - width = get_length(wattr); - height = get_length(hattr); - - if (get_attr(attrs, "SRC", attr, sizeof(attr))) { - img = get_image(attr, width, height); - width = img->w(); - height = img->h(); - } - - ww = width; + } + else if (buf.cmp("/FONT")) + popfont(font, fsize, fcolor); + else if (buf.cmp("B") || + buf.cmp("STRONG")) + pushfont(font |= FL_BOLD, fsize); + else if (buf.cmp("I") || + buf.cmp("EM")) + pushfont(font |= FL_ITALIC, fsize); + else if (buf.cmp("CODE") || + buf.cmp("TT")) + pushfont(font = FL_COURIER, fsize); + else if (buf.cmp("KBD")) + pushfont(font = FL_COURIER_BOLD, fsize); + else if (buf.cmp("VAR")) + pushfont(font = FL_COURIER_ITALIC, fsize); + else if (buf.cmp("/B") || + buf.cmp("/STRONG") || + buf.cmp("/I") || + buf.cmp("/EM") || + buf.cmp("/CODE") || + buf.cmp("/TT") || + buf.cmp("/KBD") || + buf.cmp("/VAR")) + popfont(font, fsize, fcolor); + else if (buf.cmp("IMG")) + { + Fl_Shared_Image *img = 0; + int width; + int height; + + + get_attr(attrs, "WIDTH", wattr, sizeof(wattr)); + get_attr(attrs, "HEIGHT", hattr, sizeof(hattr)); + width = get_length(wattr); + height = get_length(hattr); + + if (get_attr(attrs, "SRC", attr, sizeof(attr))) { + img = get_image(attr, width, height); + width = img->w(); + height = img->h(); + } + + ww = width; if (ww > hsize_) { - hsize_ = ww; - done = 0; - break; - } - - if (needspace && xx > block->x) - ww += (int)fl_width(' '); - - if ((xx + ww) > block->w) - { - line = do_align(block, line, xx, newalign, links); - xx = block->x; - yy += hh; - block->h += hh; - hh = 0; - } - - if (linkdest[0]) - add_link(linkdest, xx, yy-fsize, ww, height); - - xx += ww; - if ((height + 2) > hh) - hh = height + 2; - - needspace = 0; - } - buf.clear(); + hsize_ = ww; + done = 0; + break; + } + + if (needspace && xx > block->x) + ww += (int)fl_width(' '); + + if ((xx + ww) > block->w) + { + line = do_align(block, line, xx, newalign, links); + xx = block->x; + yy += hh; + block->h += hh; + hh = 0; + } + + if (linkdest[0]) + add_link(linkdest, xx, yy-fsize, ww, height); + + xx += ww; + if ((height + 2) > hh) + hh = height + 2; + + needspace = 0; + } + buf.clear(); } else if (*ptr == '\n' && pre) { - if (linkdest[0]) - add_link(linkdest, xx, yy - hh, ww, hh); + if (linkdest[0]) + add_link(linkdest, xx, yy - hh, ww, hh); if (xx > hsize_) { - hsize_ = xx; + hsize_ = xx; done = 0; - break; - } - - line = do_align(block, line, xx, newalign, links); - xx = block->x; - yy += hh; - block->h += hh; - needspace = 0; - ptr ++; + break; + } + + line = do_align(block, line, xx, newalign, links); + xx = block->x; + yy += hh; + block->h += hh; + needspace = 0; + ptr ++; } else if (isspace((*ptr)&255)) { - needspace = 1; - if ( pre ) { - xx += (int)fl_width(' '); + needspace = 1; + if ( pre ) { + xx += (int)fl_width(' '); } - ptr ++; + ptr ++; } else if (*ptr == '&') { // Handle html '&' codes, eg. "&" - ptr ++; + ptr ++; int qch = quote_char(ptr); - if (qch < 0) - buf.add('&'); - else { - buf.add(qch); - ptr = strchr(ptr, ';') + 1; - } + if (qch < 0) + buf.add('&'); + else { + buf.add(qch); + ptr = strchr(ptr, ';') + 1; + } - if ((fsize + 2) > hh) + if ((fsize + 2) > hh) hh = fsize + 2; } else { buf.add(*ptr++); - if ((fsize + 2) > hh) + if ((fsize + 2) > hh) hh = fsize + 2; } } @@ -1970,28 +1968,28 @@ void Fl_Help_View::format() { ww = buf.width(); // printf("line = %d, xx = %d, ww = %d, block->x = %d, block->w = %d\n", - // line, xx, ww, block->x, block->w); + // line, xx, ww, block->x, block->w); if (ww > hsize_) { - hsize_ = ww; - done = 0; - break; + hsize_ = ww; + done = 0; + break; } if (needspace && xx > block->x) - ww += (int)fl_width(' '); + ww += (int)fl_width(' '); if ((xx + ww) > block->w) { - line = do_align(block, line, xx, newalign, links); - xx = block->x; - yy += hh; - block->h += hh; - hh = 0; + line = do_align(block, line, xx, newalign, links); + xx = block->x; + yy += hh; + block->h += hh; + hh = 0; } if (linkdest[0]) - add_link(linkdest, xx, yy - fsize, ww, fsize); + add_link(linkdest, xx, yy - fsize, ww, fsize); xx += ww; } @@ -2059,29 +2057,29 @@ void Fl_Help_View::format() { /** Formats a table */ void -Fl_Help_View::format_table(int *table_width, // O - Total table width - int *columns, // O - Column widths - const char *table) // I - Pointer to start of table +Fl_Help_View::format_table(int *table_width, // O - Total table width + int *columns, // O - Column widths + const char *table) // I - Pointer to start of table { - int column, // Current column - num_columns, // Number of columns - colspan, // COLSPAN attribute - width, // Current width - temp_width, // Temporary width - max_width, // Maximum width - incell, // In a table cell? - pre, // <PRE> text? - needspace; // Need whitespace? - HV_Edit_Buffer buf; // Text buffer - char attr[1024], // Other attribute - wattr[1024], // WIDTH attribute - hattr[1024]; // HEIGHT attribute - const char *ptr, // Pointer into table - *attrs, // Pointer to attributes - *start; // Start of element - int minwidths[MAX_COLUMNS]; // Minimum widths for each column + int column, // Current column + num_columns, // Number of columns + colspan, // COLSPAN attribute + width, // Current width + temp_width, // Temporary width + max_width, // Maximum width + incell, // In a table cell? + pre, // <PRE> text? + needspace; // Need whitespace? + HV_Edit_Buffer buf; // Text buffer + char attr[1024], // Other attribute + wattr[1024], // WIDTH attribute + hattr[1024]; // HEIGHT attribute + const char *ptr, // Pointer into table + *attrs, // Pointer to attributes + *start; // Start of element + int minwidths[MAX_COLUMNS]; // Minimum widths for each column Fl_Font font; - Fl_Fontsize fsize; // Current font and size + Fl_Fontsize fsize; // Current font and size Fl_Color fcolor; // Currrent font color DEBUG_FUNCTION(__LINE__,__FUNCTION__); @@ -2109,8 +2107,8 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width // Check width... if (needspace) { - buf.add(' '); - needspace = 0; + buf.add(' '); + needspace = 0; } temp_width = buf.width(); @@ -2130,7 +2128,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width start = ptr; for (buf.clear(), ptr ++; *ptr && *ptr != '>' && !isspace((*ptr)&255);) - buf.add(*ptr++); + buf.add(*ptr++); attrs = ptr; while (*ptr && *ptr != '>') @@ -2140,77 +2138,77 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width ptr ++; if (buf.cmp("BR") || - buf.cmp("HR")) + buf.cmp("HR")) { width = 0; - needspace = 0; + needspace = 0; } else if (buf.cmp("TABLE") && start > table) break; else if (buf.cmp("CENTER") || buf.cmp("P") || buf.cmp("H1") || - buf.cmp("H2") || - buf.cmp("H3") || - buf.cmp("H4") || - buf.cmp("H5") || - buf.cmp("H6") || - buf.cmp("UL") || - buf.cmp("OL") || - buf.cmp("DL") || - buf.cmp("LI") || - buf.cmp("DD") || - buf.cmp("DT") || - buf.cmp("PRE")) + buf.cmp("H2") || + buf.cmp("H3") || + buf.cmp("H4") || + buf.cmp("H5") || + buf.cmp("H6") || + buf.cmp("UL") || + buf.cmp("OL") || + buf.cmp("DL") || + buf.cmp("LI") || + buf.cmp("DD") || + buf.cmp("DT") || + buf.cmp("PRE")) { width = 0; - needspace = 0; + needspace = 0; if (tolower(buf[0]) == 'h' && isdigit(buf[1])) - { - font = FL_HELVETICA_BOLD; - fsize = textsize_ + '7' - buf[1]; - } - else if (buf.cmp("DT")) - { - font = textfont_ | FL_ITALIC; - fsize = textsize_; - } - else if (buf.cmp("PRE")) - { - font = FL_COURIER; - fsize = textsize_; - pre = 1; - } - else if (buf.cmp("LI")) - { - width += 4 * fsize; - font = textfont_; - fsize = textsize_; - } - else - { - font = textfont_; - fsize = textsize_; - } - - pushfont(font, fsize); + { + font = FL_HELVETICA_BOLD; + fsize = textsize_ + '7' - buf[1]; + } + else if (buf.cmp("DT")) + { + font = textfont_ | FL_ITALIC; + fsize = textsize_; + } + else if (buf.cmp("PRE")) + { + font = FL_COURIER; + fsize = textsize_; + pre = 1; + } + else if (buf.cmp("LI")) + { + width += 4 * fsize; + font = textfont_; + fsize = textsize_; + } + else + { + font = textfont_; + fsize = textsize_; + } + + pushfont(font, fsize); } else if (buf.cmp("/CENTER") || - buf.cmp("/P") || - buf.cmp("/H1") || - buf.cmp("/H2") || - buf.cmp("/H3") || - buf.cmp("/H4") || - buf.cmp("/H5") || - buf.cmp("/H6") || - buf.cmp("/PRE") || - buf.cmp("/UL") || - buf.cmp("/OL") || - buf.cmp("/DL")) + buf.cmp("/P") || + buf.cmp("/H1") || + buf.cmp("/H2") || + buf.cmp("/H3") || + buf.cmp("/H4") || + buf.cmp("/H5") || + buf.cmp("/H6") || + buf.cmp("/PRE") || + buf.cmp("/UL") || + buf.cmp("/OL") || + buf.cmp("/DL")) { width = 0; - needspace = 0; + needspace = 0; popfont(font, fsize, fcolor); } @@ -2218,142 +2216,142 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width buf.cmp("/TABLE")) { // printf("%s column = %d, colspan = %d, num_columns = %d\n", -// buf.c_str(), column, colspan, num_columns); +// buf.c_str(), column, colspan, num_columns); if (column >= 0) - { - // This is a hack to support COLSPAN... - max_width /= colspan; - - while (colspan > 0) - { - if (max_width > columns[column]) - columns[column] = max_width; - - column ++; - colspan --; - } - } - - if (buf.cmp("/TABLE")) - break; - - needspace = 0; - column = -1; - width = 0; - max_width = 0; - incell = 0; + { + // This is a hack to support COLSPAN... + max_width /= colspan; + + while (colspan > 0) + { + if (max_width > columns[column]) + columns[column] = max_width; + + column ++; + colspan --; + } + } + + if (buf.cmp("/TABLE")) + break; + + needspace = 0; + column = -1; + width = 0; + max_width = 0; + incell = 0; } else if (buf.cmp("TD") || buf.cmp("TH")) { // printf("BEFORE column = %d, colspan = %d, num_columns = %d\n", -// column, colspan, num_columns); +// column, colspan, num_columns); if (column >= 0) - { - // This is a hack to support COLSPAN... - max_width /= colspan; - - while (colspan > 0) - { - if (max_width > columns[column]) - columns[column] = max_width; - - column ++; - colspan --; - } - } - else - column ++; + { + // This is a hack to support COLSPAN... + max_width /= colspan; + + while (colspan > 0) + { + if (max_width > columns[column]) + columns[column] = max_width; + + column ++; + colspan --; + } + } + else + column ++; if (get_attr(attrs, "COLSPAN", attr, sizeof(attr)) != NULL) - colspan = atoi(attr); - else - colspan = 1; + colspan = atoi(attr); + else + colspan = 1; // printf("AFTER column = %d, colspan = %d, num_columns = %d\n", -// column, colspan, num_columns); +// column, colspan, num_columns); if ((column + colspan) >= num_columns) - num_columns = column + colspan; + num_columns = column + colspan; - needspace = 0; - width = 0; - incell = 1; + needspace = 0; + width = 0; + incell = 1; if (buf.cmp("TH")) - font = textfont_ | FL_BOLD; - else - font = textfont_; + font = textfont_ | FL_BOLD; + else + font = textfont_; fsize = textsize_; - pushfont(font, fsize); + pushfont(font, fsize); if (get_attr(attrs, "WIDTH", attr, sizeof(attr)) != NULL) - max_width = get_length(attr); - else - max_width = 0; + max_width = get_length(attr); + else + max_width = 0; // printf("max_width = %d\n", max_width); } else if (buf.cmp("/TD") || buf.cmp("/TH")) { - incell = 0; + incell = 0; popfont(font, fsize, fcolor); } else if (buf.cmp("B") || buf.cmp("STRONG")) - pushfont(font |= FL_BOLD, fsize); + pushfont(font |= FL_BOLD, fsize); else if (buf.cmp("I") || buf.cmp("EM")) - pushfont(font |= FL_ITALIC, fsize); + pushfont(font |= FL_ITALIC, fsize); else if (buf.cmp("CODE") || buf.cmp("TT")) - pushfont(font = FL_COURIER, fsize); + pushfont(font = FL_COURIER, fsize); else if (buf.cmp("KBD")) - pushfont(font = FL_COURIER_BOLD, fsize); + pushfont(font = FL_COURIER_BOLD, fsize); else if (buf.cmp("VAR")) - pushfont(font = FL_COURIER_ITALIC, fsize); + pushfont(font = FL_COURIER_ITALIC, fsize); else if (buf.cmp("/B") || - buf.cmp("/STRONG") || - buf.cmp("/I") || - buf.cmp("/EM") || - buf.cmp("/CODE") || - buf.cmp("/TT") || - buf.cmp("/KBD") || - buf.cmp("/VAR")) - popfont(font, fsize, fcolor); + buf.cmp("/STRONG") || + buf.cmp("/I") || + buf.cmp("/EM") || + buf.cmp("/CODE") || + buf.cmp("/TT") || + buf.cmp("/KBD") || + buf.cmp("/VAR")) + popfont(font, fsize, fcolor); else if (buf.cmp("IMG") && incell) { - Fl_Shared_Image *img = 0; - int iwidth, iheight; + Fl_Shared_Image *img = 0; + int iwidth, iheight; get_attr(attrs, "WIDTH", wattr, sizeof(wattr)); get_attr(attrs, "HEIGHT", hattr, sizeof(hattr)); - iwidth = get_length(wattr); - iheight = get_length(hattr); + iwidth = get_length(wattr); + iheight = get_length(hattr); if (get_attr(attrs, "SRC", attr, sizeof(attr))) { - img = get_image(attr, iwidth, iheight); - iwidth = img->w(); - iheight = img->h(); - } + img = get_image(attr, iwidth, iheight); + iwidth = img->w(); + iheight = img->h(); + } - if (iwidth > minwidths[column]) + if (iwidth > minwidths[column]) minwidths[column] = iwidth; width += iwidth; - if (needspace) - width += (int)fl_width(' '); + if (needspace) + width += (int)fl_width(' '); - if (width > max_width) + if (width > max_width) max_width = width; - needspace = 0; + needspace = 0; } buf.clear(); } @@ -2376,10 +2374,10 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width int qch = quote_char(ptr); if (qch < 0) - buf.add('&'); + buf.add('&'); else { - buf.add(qch); - ptr = strchr(ptr, ';') + 1; + buf.add(qch); + ptr = strchr(ptr, ';') + 1; } } else @@ -2457,9 +2455,9 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width if (width > 0) { for (column = 0; column < num_columns; column ++) { - columns[column] -= minwidths[column]; - columns[column] = scale_width * columns[column] / width; - columns[column] += minwidths[column]; + columns[column] -= minwidths[column]; + columns[column] = scale_width * columns[column] / width; + columns[column] += minwidths[column]; } } @@ -2484,12 +2482,12 @@ void Fl_Help_View::free_data() { // Release all images... if (value_) { - const char *ptr, // Pointer into block - *attrs; // Pointer to start of element attributes - HV_Edit_Buffer buf; // Text buffer - char attr[1024], // Attribute buffer - wattr[1024], // Width attribute buffer - hattr[1024]; // Height attribute buffer + const char *ptr, // Pointer into block + *attrs; // Pointer to start of element attributes + HV_Edit_Buffer buf; // Text buffer + char attr[1024], // Attribute buffer + wattr[1024], // Width attribute buffer + hattr[1024]; // Height attribute buffer DEBUG_FUNCTION(__LINE__,__FUNCTION__); @@ -2497,52 +2495,52 @@ Fl_Help_View::free_data() { { if (*ptr == '<') { - ptr ++; + ptr ++; if (strncmp(ptr, "!--", 3) == 0) - { - // Comment... - ptr += 3; - if ((ptr = strstr(ptr, "-->")) != NULL) - { - ptr += 3; - continue; - } - else - break; - } + { + // Comment... + ptr += 3; + if ((ptr = strstr(ptr, "-->")) != NULL) + { + ptr += 3; + continue; + } + else + break; + } buf.clear(); - while (*ptr && *ptr != '>' && !isspace((*ptr)&255)) - buf.add(*ptr++); + while (*ptr && *ptr != '>' && !isspace((*ptr)&255)) + buf.add(*ptr++); - attrs = ptr; - while (*ptr && *ptr != '>') + attrs = ptr; + while (*ptr && *ptr != '>') ptr ++; - if (*ptr == '>') + if (*ptr == '>') ptr ++; - if (buf.cmp("IMG")) - { - Fl_Shared_Image *img; - int width; - int height; + if (buf.cmp("IMG")) + { + Fl_Shared_Image *img; + int width; + int height; get_attr(attrs, "WIDTH", wattr, sizeof(wattr)); get_attr(attrs, "HEIGHT", hattr, sizeof(hattr)); - width = get_length(wattr); - height = get_length(hattr); - - if (get_attr(attrs, "SRC", attr, sizeof(attr))) { - // Get and release the image to free it from memory... - img = get_image(attr, width, height); - if ((void*)img != &broken_image) { - img->release(); - } - } - } + width = get_length(wattr); + height = get_length(hattr); + + if (get_attr(attrs, "SRC", attr, sizeof(attr))) { + // Get and release the image to free it from memory... + img = get_image(attr, width, height); + if ((void*)img != &broken_image) { + img->release(); + } + } + } } else ptr ++; @@ -2579,11 +2577,11 @@ Fl_Help_View::free_data() { } // free_data() /** Gets an alignment attribute. */ -int // O - Alignment -Fl_Help_View::get_align(const char *p, // I - Pointer to start of attrs - int a) // I - Default alignment +int // O - Alignment +Fl_Help_View::get_align(const char *p, // I - Pointer to start of attrs + int a) // I - Default alignment { - char buf[255]; // Alignment value + char buf[255]; // Alignment value if (get_attr(p, "ALIGN", buf, sizeof(buf)) == NULL) @@ -2599,15 +2597,15 @@ Fl_Help_View::get_align(const char *p, // I - Pointer to start of attrs /** Gets an attribute value from the string. */ -const char * // O - Pointer to buf or NULL -Fl_Help_View::get_attr(const char *p, // I - Pointer to start of attributes - const char *n, // I - Name of attribute - char *buf, // O - Buffer for attribute value - int bufsize) // I - Size of buffer +const char * // O - Pointer to buf or NULL +Fl_Help_View::get_attr(const char *p, // I - Pointer to start of attributes + const char *n, // I - Name of attribute + char *buf, // O - Buffer for attribute value + int bufsize) // I - Size of buffer { - char name[255], // Name from string - *ptr, // Pointer into name or value - quote; // Quote + char name[255], // Name from string + *ptr, // Pointer into name or value + quote; // Quote buf[0] = '\0'; @@ -2637,22 +2635,22 @@ Fl_Help_View::get_attr(const char *p, // I - Pointer to start of attributes for (ptr = buf; *p && !isspace((*p)&255) && *p != '>';) if (*p == '\'' || *p == '\"') - { - quote = *p++; + { + quote = *p++; - while (*p && *p != quote) - if ((ptr - buf + 1) < bufsize) - *ptr++ = *p++; - else - p ++; + while (*p && *p != quote) + if ((ptr - buf + 1) < bufsize) + *ptr++ = *p++; + else + p ++; if (*p == quote) - p ++; - } - else if ((ptr - buf + 1) < bufsize) - *ptr++ = *p++; - else - p ++; + p ++; + } + else if ((ptr - buf + 1) < bufsize) + *ptr++ = *p++; + else + p ++; *ptr = '\0'; } @@ -2671,35 +2669,35 @@ Fl_Help_View::get_attr(const char *p, // I - Pointer to start of attributes /** Gets a color attribute. */ -Fl_Color // O - Color value -Fl_Help_View::get_color(const char *n, // I - Color name - Fl_Color c) // I - Default color value +Fl_Color // O - Color value +Fl_Help_View::get_color(const char *n, // I - Color name + Fl_Color c) // I - Default color value { - int i; // Looping var - int rgb, r, g, b; // RGB values - static const struct { // Color name table + int i; // Looping var + int rgb, r, g, b; // RGB values + static const struct { // Color name table const char *name; int r, g, b; - } colors[] = { - { "black", 0x00, 0x00, 0x00 }, - { "red", 0xff, 0x00, 0x00 }, - { "green", 0x00, 0x80, 0x00 }, - { "yellow", 0xff, 0xff, 0x00 }, - { "blue", 0x00, 0x00, 0xff }, - { "magenta", 0xff, 0x00, 0xff }, - { "fuchsia", 0xff, 0x00, 0xff }, - { "cyan", 0x00, 0xff, 0xff }, - { "aqua", 0x00, 0xff, 0xff }, - { "white", 0xff, 0xff, 0xff }, - { "gray", 0x80, 0x80, 0x80 }, - { "grey", 0x80, 0x80, 0x80 }, - { "lime", 0x00, 0xff, 0x00 }, - { "maroon", 0x80, 0x00, 0x00 }, - { "navy", 0x00, 0x00, 0x80 }, - { "olive", 0x80, 0x80, 0x00 }, - { "purple", 0x80, 0x00, 0x80 }, - { "silver", 0xc0, 0xc0, 0xc0 }, - { "teal", 0x00, 0x80, 0x80 } + } colors[] = { + { "black", 0x00, 0x00, 0x00 }, + { "red", 0xff, 0x00, 0x00 }, + { "green", 0x00, 0x80, 0x00 }, + { "yellow", 0xff, 0xff, 0x00 }, + { "blue", 0x00, 0x00, 0xff }, + { "magenta", 0xff, 0x00, 0xff }, + { "fuchsia", 0xff, 0x00, 0xff }, + { "cyan", 0x00, 0xff, 0xff }, + { "aqua", 0x00, 0xff, 0xff }, + { "white", 0xff, 0xff, 0xff }, + { "gray", 0x80, 0x80, 0x80 }, + { "grey", 0x80, 0x80, 0x80 }, + { "lime", 0x00, 0xff, 0x00 }, + { "maroon", 0x80, 0x00, 0x00 }, + { "navy", 0x00, 0x00, 0x80 }, + { "olive", 0x80, 0x80, 0x00 }, + { "purple", 0x80, 0x00, 0x80 }, + { "silver", 0xc0, 0xc0, 0xc0 }, + { "teal", 0x00, 0x80, 0x80 } }; @@ -2735,7 +2733,7 @@ Fl_Help_View::get_color(const char *n, // I - Color name the image can be released exactly once when the document is closed. \return a pointer to a cached Fl_Shared_Image, if the image can be loaded, - otherwise a pointer to an internal Fl_Pixmap (broken_image). + otherwise a pointer to an internal Fl_Pixmap (broken_image). \todo Fl_Help_View::get_image() returns a pointer to the internal Fl_Pixmap broken_image, but this is _not_ compatible with the @@ -2773,11 +2771,11 @@ Fl_Help_View::get_color(const char *n, // I - Color name Fl_Shared_Image * Fl_Help_View::get_image(const char *name, int W, int H) { - const char *localname; // Local filename - char dir[FL_PATH_MAX]; // Current directory - char temp[2 * FL_PATH_MAX], // Temporary filename - *tempptr; // Pointer into temporary name - Fl_Shared_Image *ip; // Image pointer... + const char *localname; // Local filename + char dir[FL_PATH_MAX]; // Current directory + char temp[2 * FL_PATH_MAX], // Temporary filename + *tempptr; // Pointer into temporary name + Fl_Shared_Image *ip; // Image pointer... // See if the image can be found... if (strchr(directory_, ':') != NULL && strchr(name, ':') == NULL) { @@ -2829,8 +2827,8 @@ Fl_Help_View::get_image(const char *name, int W, int H) { /** Gets a length value, either absolute or %. */ int -Fl_Help_View::get_length(const char *l) { // I - Value - int val; // Integer value +Fl_Help_View::get_length(const char *l) { // I - Value + int val; // Integer value if (!l[0]) return 0; @@ -2849,8 +2847,8 @@ Fl_Help_View::get_length(const char *l) { // I - Value Fl_Help_Link *Fl_Help_View::find_link(int xx, int yy) { - int i; - Fl_Help_Link *linkp; + int i; + Fl_Help_Link *linkp; for (i = nlinks_, linkp = links_; i > 0; i --, linkp ++) { if (xx >= linkp->x && xx < linkp->w && yy >= linkp->y && yy < linkp->h) @@ -2861,7 +2859,7 @@ Fl_Help_Link *Fl_Help_View::find_link(int xx, int yy) void Fl_Help_View::follow_link(Fl_Help_Link *linkp) { - char target[32]; // Current target + char target[32]; // Current target clear_selection(); @@ -2871,9 +2869,9 @@ void Fl_Help_View::follow_link(Fl_Help_Link *linkp) if (strcmp(linkp->filename, filename_) != 0 && linkp->filename[0]) { - char dir[FL_PATH_MAX]; // Current directory - char temp[2 * FL_PATH_MAX], // Temporary filename - *tempptr; // Pointer into temporary filename + char dir[FL_PATH_MAX]; // Current directory + char temp[2 * FL_PATH_MAX], // Temporary filename + *tempptr; // Pointer into temporary filename if (strchr(directory_, ':') != NULL && @@ -2883,21 +2881,21 @@ void Fl_Help_View::follow_link(Fl_Help_Link *linkp) { strlcpy(temp, directory_, sizeof(temp)); if ((tempptr = strrchr(strchr(directory_, ':') + 3, '/')) != NULL) - strlcpy(tempptr, linkp->filename, sizeof(temp)); - else - strlcat(temp, linkp->filename, sizeof(temp)); + strlcpy(tempptr, linkp->filename, sizeof(temp)); + else + strlcat(temp, linkp->filename, sizeof(temp)); } else - snprintf(temp, sizeof(temp), "%s/%s", directory_, linkp->filename); + snprintf(temp, sizeof(temp), "%s/%s", directory_, linkp->filename); } else if (linkp->filename[0] != '/' && strchr(linkp->filename, ':') == NULL) { if (directory_[0]) - snprintf(temp, sizeof(temp), "%s/%s", directory_, linkp->filename); + snprintf(temp, sizeof(temp), "%s/%s", directory_, linkp->filename); else { - fl_getcwd(dir, sizeof(dir)); - snprintf(temp, sizeof(temp), "file:%s/%s", dir, linkp->filename); + fl_getcwd(dir, sizeof(dir)); + snprintf(temp, sizeof(temp), "file:%s/%s", dir, linkp->filename); } } else @@ -2905,7 +2903,7 @@ void Fl_Help_View::follow_link(Fl_Help_Link *linkp) if (linkp->name[0]) snprintf(temp + strlen(temp), sizeof(temp) - strlen(temp), "#%s", - linkp->name); + linkp->name); load(temp); } @@ -3118,8 +3116,8 @@ void Fl_Help_View::end_selection(int clipboard) } /** Handles events in the widget. */ -int // O - 1 if we handled it, 0 otherwise -Fl_Help_View::handle(int event) // I - Event to handle +int // O - 1 if we handled it, 0 otherwise +Fl_Help_View::handle(int event) // I - Event to handle { static Fl_Help_Link *linkp; // currently clicked link @@ -3191,11 +3189,11 @@ Fl_Help_View::handle(int event) // I - Event to handle case FL_SHORTCUT: { int mods = Fl::event_state() & (FL_META|FL_CTRL|FL_ALT|FL_SHIFT); if ( mods == FL_COMMAND) { - switch ( Fl::event_key() ) { - case 'a': select_all(); redraw(); return 1; - case 'c': - case 'x': end_selection(1); return 1; - } + switch ( Fl::event_key() ) { + case 'a': select_all(); redraw(); return 1; + case 'c': + case 'x': end_selection(1); return 1; + } } break; } } @@ -3206,11 +3204,11 @@ Fl_Help_View::handle(int event) // I - Event to handle The constructor creates the Fl_Help_View widget at the specified position and size. */ -Fl_Help_View::Fl_Help_View(int xx, // I - Left position - int yy, // I - Top position - int ww, // I - Width in pixels - int hh, // I - Height in pixels - const char *l) +Fl_Help_View::Fl_Help_View(int xx, // I - Left position + int yy, // I - Top position + int ww, // I - Width in pixels + int hh, // I - Height in pixels + const char *l) : Fl_Group(xx, yy, ww, hh, l), scrollbar_(xx + ww - Fl::scrollbar_size(), yy, Fl::scrollbar_size(), hh - Fl::scrollbar_size()), @@ -3300,13 +3298,13 @@ Fl_Help_View::~Fl_Help_View() */ int Fl_Help_View::load(const char *f) { - FILE *fp; // File to read from - long len; // Length of file - char *target; // Target in file - char *slash; // Directory separator - const char *localname; // Local filename - char error[2 * FL_PATH_MAX]; // Error buffer - char newname[FL_PATH_MAX]; // New filename buffer + FILE *fp; // File to read from + long len; // Length of file + char *target; // Target in file + char *slash; // Directory separator + const char *localname; // Local filename + char error[2 * FL_PATH_MAX]; // Error buffer + char newname[FL_PATH_MAX]; // New filename buffer // printf("load(%s)\n",f); fflush(stdout); @@ -3323,15 +3321,15 @@ int Fl_Help_View::load(const char *f) strlcpy(newname, f, sizeof(newname)); if ((target = strrchr(newname, '#')) != NULL) - *target++ = '\0'; + *target++ = '\0'; if (link_) - localname = (*link_)(this, newname); + localname = (*link_)(this, newname); else - localname = filename_; + localname = filename_; if (!localname) - return (0); + return (0); free_data(); @@ -3341,16 +3339,16 @@ int Fl_Help_View::load(const char *f) // Note: We do not support Windows backslashes, since they are illegal // in URLs... if ((slash = strrchr(directory_, '/')) == NULL) - directory_[0] = '\0'; + directory_[0] = '\0'; else if (slash > directory_ && slash[-1] != '/') - *slash = '\0'; + *slash = '\0'; snprintf(error, sizeof(error), - "<HTML><HEAD><TITLE>Error</TITLE></HEAD>" - "<BODY><H1>Error</H1>" - "<P>Unable to follow the link \"%s\" - " - "%s.</P></BODY>", - f, urimsg); + "<HTML><HEAD><TITLE>Error</TITLE></HEAD>" + "<BODY><H1>Error</H1>" + "<P>Unable to follow the link \"%s\" - " + "%s.</P></BODY>", + f, urimsg); value(error); return -1; } else { @@ -3385,7 +3383,7 @@ int Fl_Help_View::load(const char *f) *slash = '\0'; if (strncmp(localname, "file:", 5) == 0) - localname += 5; // Adjust for local filename... + localname += 5; // Adjust for local filename... int ret = 0; if ((fp = fl_fopen(localname, "rb")) != NULL) @@ -3401,11 +3399,11 @@ int Fl_Help_View::load(const char *f) else { snprintf(error, sizeof(error), - "<HTML><HEAD><TITLE>Error</TITLE></HEAD>" - "<BODY><H1>Error</H1>" - "<P>Unable to follow the link \"%s\" - " - "%s.</P></BODY>", - localname, strerror(errno)); + "<HTML><HEAD><TITLE>Error</TITLE></HEAD>" + "<BODY><H1>Error</H1>" + "<P>Unable to follow the link \"%s\" - " + "%s.</P></BODY>", + localname, strerror(errno)); value_ = strdup(error); ret = -1; } @@ -3426,13 +3424,13 @@ int Fl_Help_View::load(const char *f) /** Resizes the help widget. */ void -Fl_Help_View::resize(int xx, // I - New left position - int yy, // I - New top position - int ww, // I - New width - int hh) // I - New height +Fl_Help_View::resize(int xx, // I - New left position + int yy, // I - New top position + int ww, // I - New width + int hh) // I - New height { - Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; - // Box to draw... + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; + // Box to draw... Fl_Widget::resize(xx, yy, ww, hh); @@ -3453,10 +3451,10 @@ Fl_Help_View::resize(int xx, // I - New left position \param[in] n target name */ void -Fl_Help_View::topline(const char *n) // I - Target name +Fl_Help_View::topline(const char *n) // I - Target name { - Fl_Help_Target key, // Target name key - *target; // Pointer to matching target + Fl_Help_Target key, // Target name key + *target; // Pointer to matching target if (ntargets_ == 0) @@ -3480,7 +3478,7 @@ Fl_Help_View::topline(const char *n) // I - Target name \param[in] top top line number in pixels (0 = start of document) */ void -Fl_Help_View::topline(int top) // I - Top line number +Fl_Help_View::topline(int top) // I - Top line number { if (!value_) return; @@ -3509,7 +3507,7 @@ Fl_Help_View::topline(int top) // I - Top line number \param[in] left left column number in pixels (0 = left side) */ void -Fl_Help_View::leftline(int left) // I - Left position +Fl_Help_View::leftline(int left) // I - Left position { if (!value_) return; @@ -3536,7 +3534,7 @@ Fl_Help_View::leftline(int left) // I - Left position If \p val is NULL, then the widget is cleared. */ void -Fl_Help_View::value(const char *val) // I - Text to view +Fl_Help_View::value(const char *val) // I - Text to view { clear_selection(); free_data(); @@ -3560,10 +3558,10 @@ Fl_Help_View::value(const char *val) // I - Text to view (aka "HTML Entity"). Possible encoding formats: - - &name; named entity - - &#nn..; numeric (decimal) Unicode Code Point - - &#xnn..; numeric (hexadecimal) Unicode Code Point - - &#Xnn..; numeric (hexadecimal) Unicode Code Point + - &name; named entity + - &#nn..; numeric (decimal) Unicode Code Point + - &#xnn..; numeric (hexadecimal) Unicode Code Point + - &#Xnn..; numeric (hexadecimal) Unicode Code Point 'nn..' = decimal or hexadecimal number, resp. Contents of the table names[] below: @@ -3580,15 +3578,15 @@ Fl_Help_View::value(const char *val) // I - Text to view Note to devs: if you add or remove items to/from this list, please update the documentation in FL/Fl_Help_View.H. */ -static int // O - Code or -1 on error -quote_char(const char *p) { // I - Quoted string - int i; // Looping var +static int // O - Code or -1 on error +quote_char(const char *p) { // I - Quoted string + int i; // Looping var static const struct { - const char *name; - int namelen; - int code; - } *nameptr, // Pointer into name array - names[] = { // Quoting names + const char *name; + int namelen; + int code; + } *nameptr, // Pointer into name array + names[] = { // Quoting names { "Aacute;", 7, 193 }, { "aacute;", 7, 225 }, { "Acirc;", 6, 194 }, @@ -3724,8 +3722,3 @@ hscrollbar_callback(Fl_Widget *s, void *) { ((Fl_Help_View *)(s->parent()))->leftline(int(((Fl_Scrollbar*)s)->value())); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index dcffe3561..c09a77f3a 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Image drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -93,7 +91,7 @@ Fl_Image *Fl_Image::copy(int W, int H) { argument specifies the amount of the original image to combine with the color, so a value of 1.0 results in no color blend, and a value of 0.0 results in a constant image of the specified - color. + color. An internal copy is made of the original image before changes are applied, to avoid modifying the original image. @@ -105,7 +103,7 @@ void Fl_Image::color_average(Fl_Color, float) { The desaturate() method converts an image to grayscale. If the image contains an alpha channel (depth = 4), the alpha channel is preserved. - + An internal copy is made of the original image before changes are applied, to avoid modifying the original image. */ @@ -183,14 +181,14 @@ int Fl_Image::fail() } void -Fl_Image::labeltype(const Fl_Label *lo, // I - Label - int lx, // I - X position - int ly, // I - Y position - int lw, // I - Width of label - int lh, // I - Height of label - Fl_Align la) { // I - Alignment - Fl_Image *img; // Image pointer - int cx, cy; // Image position +Fl_Image::labeltype(const Fl_Label *lo, // I - Label + int lx, // I - X position + int ly, // I - Y position + int lw, // I - Width of label + int lh, // I - Height of label + Fl_Align la) { // I - Alignment + Fl_Image *img; // Image pointer + int cx, cy; // Image position img = (Fl_Image *)(lo->value); @@ -208,10 +206,10 @@ Fl_Image::labeltype(const Fl_Label *lo, // I - Label } void -Fl_Image::measure(const Fl_Label *lo, // I - Label - int &lw, // O - Width of image - int &lh) { // O - Height of image - Fl_Image *img; // Image pointer +Fl_Image::measure(const Fl_Label *lo, // I - Label + int &lw, // O - Width of image + int &lh) { // O - Height of image + Fl_Image *img; // Image pointer img = (Fl_Image *)(lo->value); @@ -239,7 +237,7 @@ Fl_RGB_Scaling Fl_Image::RGB_scaling() { This can make a difference if the drawing surface has more than 1 pixel per FLTK unit because the image can be drawn at the full resolution of the drawing surface. Examples of such drawing surfaces: HiDPI displays, laser printers, PostScript files, PDF printers. - + \param width,height maximum values, in FLTK units, that w() and h() should return \param proportional if not null, keep the values returned by w() and h() proportional to data_w() and data_h() @@ -248,7 +246,7 @@ Fl_RGB_Scaling Fl_Image::RGB_scaling() { \note This function generally changes the values returned by the w() and h() member functions. In contrast, the values returned by data_w() and data_h() remain unchanged. \version 1.4 (1.3.4 and FL_ABI_VERSION for Fl_Shared_Image only) - + Example code: scale an image to fit in a box \code Fl_Box *b = ... // a box @@ -355,7 +353,7 @@ Fl_RGB_Image::Fl_RGB_Image(const uchar *bits, int W, int H, int D, int LD) : } -/** +/** The constructor creates a new RGBA image from the specified Fl_Pixmap. The RGBA image is built fully opaque except for the transparent area @@ -397,8 +395,8 @@ void Fl_RGB_Image::uncache() { } Fl_Image *Fl_RGB_Image::copy(int W, int H) { - Fl_RGB_Image *new_image; // New RGB image - uchar *new_array; // New array for image data + Fl_RGB_Image *new_image; // New RGB image + uchar *new_array; // New array for image data // Optimize the simple copy where the width and height are the same, // or when we are copying an empty image... @@ -430,10 +428,10 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) { if (W <= 0 || H <= 0) return 0; // OK, need to resize the image data; allocate memory and create new image - uchar *new_ptr; // Pointer into new array - const uchar *old_ptr; // Pointer into old array - int dx, dy, // Destination coordinates - line_d; // stride from line to line + uchar *new_ptr; // Pointer into new array + const uchar *old_ptr; // Pointer into old array + int dx, dy, // Destination coordinates + line_d; // stride from line to line // Allocate memory for the new image... new_array = new uchar [W * H * d()]; @@ -444,11 +442,11 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) { if (Fl_Image::RGB_scaling() == FL_RGB_SCALING_NEAREST) { - int c, // Channel number - sy, // Source coordinate - xerr, yerr, // X & Y errors - xmod, ymod, // X & Y moduli - xstep, ystep; // X & Y step increments + int c, // Channel number + sy, // Source coordinate + xerr, yerr, // X & Y errors + xmod, ymod, // X & Y moduli + xstep, ystep; // X & Y step increments // Figure out Bresenham step/modulus values... xmod = data_w() % W; @@ -466,7 +464,7 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) { if (xerr <= 0) { xerr += W; - old_ptr += d(); + old_ptr += d(); } } @@ -520,10 +518,10 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) { } } - const float leftf = 1 - xfract; - const float rightf = xfract; - const float upf = 1 - yfract; - const float downf = yfract; + const float leftf = 1 - xfract; + const float rightf = xfract; + const float upf = 1 - yfract; + const float downf = yfract; for (i = 0; i < d(); i++) { new_ptr[i] = (uchar)((left[i] * leftf + @@ -552,15 +550,15 @@ void Fl_RGB_Image::color_average(Fl_Color c, float i) { uncache(); // Allocate memory as needed... - uchar *new_array, - *new_ptr; + uchar *new_array, + *new_ptr; if (!alloc_array) new_array = new uchar[h() * w() * d()]; else new_array = (uchar *)array; // Get the color to blend with... - uchar r, g, b; - unsigned ia, ir, ig, ib; + uchar r, g, b; + unsigned ia, ir, ig, ib; Fl::get_color(c, r, g, b); if (i < 0.0f) i = 0.0f; @@ -572,8 +570,8 @@ void Fl_RGB_Image::color_average(Fl_Color c, float i) { ib = b * (256 - ia); // Update the image data to do the blend... - const uchar *old_ptr; - int x, y; + const uchar *old_ptr; + int x, y; int line_i = ld() ? ld() - (w()*d()) : 0; // increment from line end to beginning of next line if (d() < 3) { @@ -581,16 +579,16 @@ void Fl_RGB_Image::color_average(Fl_Color c, float i) { for (new_ptr = new_array, old_ptr = array, y = 0; y < h(); y ++, old_ptr += line_i) for (x = 0; x < w(); x ++) { - *new_ptr++ = (*old_ptr++ * ia + ig) >> 8; - if (d() > 1) *new_ptr++ = *old_ptr++; + *new_ptr++ = (*old_ptr++ * ia + ig) >> 8; + if (d() > 1) *new_ptr++ = *old_ptr++; } } else { for (new_ptr = new_array, old_ptr = array, y = 0; y < h(); y ++, old_ptr += line_i) for (x = 0; x < w(); x ++) { - *new_ptr++ = (*old_ptr++ * ia + ir) >> 8; - *new_ptr++ = (*old_ptr++ * ia + ig) >> 8; - *new_ptr++ = (*old_ptr++ * ia + ib) >> 8; - if (d() > 3) *new_ptr++ = *old_ptr++; + *new_ptr++ = (*old_ptr++ * ia + ir) >> 8; + *new_ptr++ = (*old_ptr++ * ia + ig) >> 8; + *new_ptr++ = (*old_ptr++ * ia + ib) >> 8; + if (d() > 3) *new_ptr++ = *old_ptr++; } } @@ -614,16 +612,16 @@ void Fl_RGB_Image::desaturate() { uncache(); // Allocate memory for a grayscale image... - uchar *new_array, - *new_ptr; - int new_d; + uchar *new_array, + *new_ptr; + int new_d; new_d = d() - 2; new_array = new uchar[h() * w() * new_d]; // Copy the image data, converting to grayscale... - const uchar *old_ptr; - int x, y; + const uchar *old_ptr; + int x, y; int line_i = ld() ? ld() - (w()*d()) : 0; // increment from line end to beginning of next line for (new_ptr = new_array, old_ptr = array, y = 0; y < h(); y ++, old_ptr += line_i) @@ -653,7 +651,3 @@ void Fl_RGB_Image::label(Fl_Widget* widget) { void Fl_RGB_Image::label(Fl_Menu_Item* m) { m->label(FL_IMAGE_LABEL, (const char*)this); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Image_Reader.cxx b/src/Fl_Image_Reader.cxx index 083efb471..1f19379a0 100644 --- a/src/Fl_Image_Reader.cxx +++ b/src/Fl_Image_Reader.cxx @@ -9,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // diff --git a/src/Fl_Image_Reader.h b/src/Fl_Image_Reader.h index 83d9c366e..b013dc481 100644 --- a/src/Fl_Image_Reader.h +++ b/src/Fl_Image_Reader.h @@ -9,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx index e0c5fe1fc..75de6c790 100644 --- a/src/Fl_Image_Surface.cxx +++ b/src/Fl_Image_Surface.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Image_Surface.H> @@ -23,7 +21,7 @@ /** Constructor with optional high resolution. \param w and \param h set the size of the resulting image. The value of the \p high_res parameter controls whether \p w and \p h are interpreted as pixel or FLTK units. - + \param high_res If zero, the created image surface is sized at \p w x \p h pixels. If non-zero, the pixel size of the created image surface depends on the value of the display scale factor (see Fl_Graphics_Driver::scale()): @@ -73,7 +71,7 @@ void Fl_Image_Surface::untranslate() { The returned Fl_Offscreen object is deleted when the Fl_Image_Surface object is deleted, unless the Fl_Image_Surface was constructed with non-null Fl_Offscreen argument. */ -Fl_Offscreen Fl_Image_Surface::offscreen() { +Fl_Offscreen Fl_Image_Surface::offscreen() { return platform_surface ? platform_surface->offscreen : (Fl_Offscreen)0; } @@ -108,7 +106,7 @@ Fl_RGB_Image *Fl_Image_Surface::image() { /** Returns a possibly high resolution image made of all drawings sent to the Fl_Image_Surface object. The Fl_Image_Surface object should have been constructed with Fl_Image_Surface(W, H, 1). - The returned Fl_Shared_Image object is scaled to a size of WxH FLTK units and may have a + The returned Fl_Shared_Image object is scaled to a size of WxH FLTK units and may have a pixel size larger than these values. The returned object should be deallocated with Fl_Shared_Image::release() after use. \deprecated Use image() instead. @@ -173,7 +171,7 @@ static int find_slot(void) { // return an available slot to memorize an Fl_Image Creation of an offscreen graphics buffer. \param w,h width and height in FLTK units of the buffer. \return the created graphics buffer. - + The pixel size of the created graphics buffer is equal to the number of pixels in an area of the screen containing the current window sized at \p w,h FLTK units. This pixel size varies with the value of the scale factor of this screen. @@ -249,8 +247,3 @@ void fl_rescale_offscreen(Fl_Offscreen &ctx) { } /** @} */ - - -// -// End of "$Id$". -// diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 96dfc0105..9a3342eb2 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Input widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // This is the "user interface", it decodes user actions into what to @@ -32,7 +30,7 @@ #include <FL/Fl_Input.H> #include <FL/fl_draw.H> #include <FL/fl_ask.H> -#include "flstring.h" // this #includes "<config.h>" ! +#include "flstring.h" // this #includes "<config.h>" ! #include <FL/Fl_Float_Input.H> #include <FL/Fl_Int_Input.H> @@ -51,7 +49,7 @@ void Fl_Input::draw() { Fl_Boxtype b = box(); if (damage() & FL_DAMAGE_ALL) draw_box(b, color()); Fl_Input_::drawtext(x()+Fl::box_dx(b), y()+Fl::box_dy(b), - w()-Fl::box_dw(b), h()-Fl::box_dh(b)); + w()-Fl::box_dw(b), h()-Fl::box_dh(b)); } // kludge so shift causes selection to extend: @@ -82,13 +80,13 @@ int Fl_Input::shift_up_down_position(int p) { // List of characters that are legal in a floating point input field. // This text string is created at run-time to take the current locale // into account (for example, continental Europe uses a comma instead -// of a decimal point). For back compatibility reasons, we always +// of a decimal point). For back compatibility reasons, we always // allow the decimal point. #ifdef HAVE_LOCALECONV -static const char *standard_fp_chars = ".eE+-"; +static const char *standard_fp_chars = ".eE+-"; static const char *legal_fp_chars = 0L; #else -static const char *legal_fp_chars = ".eE+-"; +static const char *legal_fp_chars = ".eE+-"; #endif // Move cursor up specified #lines @@ -118,7 +116,7 @@ int Fl_Input::kf_lines_down(int repeat_num) { //UNNEEDED if (input_type()==FL_MULTILINE_INPUT && !Fl::option(Fl::OPTION_ARROW_FOCUS)) return 1; return NORMAL_INPUT_MOVE; } - while (repeat_num--) { + while (repeat_num--) { i = line_end(i); if (i >= size()) break; i++; @@ -140,7 +138,7 @@ int Fl_Input::kf_page_down() { // Toggle insert mode int Fl_Input::kf_insert_toggle() { if (readonly()) { fl_beep(); return 1; } - return 1; // \todo: needs insert mode + return 1; // \todo: needs insert mode } // Delete word right @@ -228,7 +226,7 @@ int Fl_Input::kf_move_char_right() { // Move cursor word-left int Fl_Input::kf_move_word_left() { shift_position(word_start(position())); - return 1; + return 1; } // Move cursor word-right @@ -262,7 +260,7 @@ int Fl_Input::kf_top() { // Move to bottom of document int Fl_Input::kf_bottom() { shift_position(size()); - return 1; + return 1; } // Select all text in the widget @@ -280,7 +278,7 @@ int Fl_Input::kf_undo() { // Redo. (currently unimplemented.. toggles undo() instead) int Fl_Input::kf_redo() { if (readonly()) { fl_beep(); return 1; } - return kf_undo(); // currently we don't support multilevel undo + return kf_undo(); // currently we don't support multilevel undo } // Do a copy operation @@ -306,16 +304,16 @@ int Fl_Input::kf_copy_cut() { // Returns 1 if handled by us, 0 if not. // int Fl_Input::handle_key() { - + char ascii = Fl::event_text()[0]; - + int del; if (Fl::compose(del)) { - + // Insert characters into numeric fields after checking for legality: if (input_type() == FL_FLOAT_INPUT || input_type() == FL_INT_INPUT) { Fl::compose_reset(); // ignore any composed characters... - + // initialize the list of legal characters inside a floating point number #if defined(HAVE_LOCALECONV) if (!legal_fp_chars) { @@ -330,7 +328,7 @@ int Fl_Input::handle_key() { // the following line is not a true memory leak because the array is only // allocated once if required, and automatically freed when the program quits char *chars = (char*)malloc(len+1); - legal_fp_chars = chars; + legal_fp_chars = chars; strcpy(chars, standard_fp_chars); if (lc) { if (lc->decimal_point) strcat(chars, lc->decimal_point); @@ -340,34 +338,34 @@ int Fl_Input::handle_key() { } } #endif // HAVE_LOCALECONV - + // find the insert position int ip = position()<mark() ? position() : mark(); // This is complex to allow "0xff12" hex to be typed: - if ( (!ip && (ascii == '+' || ascii == '-')) - || (ascii >= '0' && ascii <= '9') - || (ip==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) - || (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') - && ((ascii>='A'&& ascii<='F') || (ascii>='a'&& ascii<='f'))) - || (input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii))) + if ( (!ip && (ascii == '+' || ascii == '-')) + || (ascii >= '0' && ascii <= '9') + || (ip==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) + || (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') + && ((ascii>='A'&& ascii<='F') || (ascii>='a'&& ascii<='f'))) + || (input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii))) { - if (readonly()) fl_beep(); - else replace(position(), mark(), &ascii, 1); + if (readonly()) fl_beep(); + else replace(position(), mark(), &ascii, 1); } return 1; } - + if (del || Fl::event_length()) { if (readonly()) fl_beep(); else replace(position(), del ? position()-del : mark(), - Fl::event_text(), Fl::event_length()); + Fl::event_text(), Fl::event_length()); } if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) { this->mark( this->position() - Fl::compose_state ); } return 1; } - + unsigned int mods = Fl::event_state() & (FL_META|FL_CTRL|FL_ALT); unsigned int shift = Fl::event_state() & FL_SHIFT; unsigned int multiline = (input_type() == FL_MULTILINE_INPUT) ? 1 : 0; @@ -375,7 +373,7 @@ int Fl_Input::handle_key() { // The following lists apps that support these keypresses. // Prefixes: '!' indicates NOT supported, '?' indicates un-verified. // - // HIG=Human Interface Guide, + // HIG=Human Interface Guide, // TE=TextEdit.app, SA=Safari.app, WOX=MS Word/OSX -- OSX 10.4.x // NP=Notepad, WP=WordPad, WOW=MS Word/Windows -- WinXP // GE=gedit, KE=kedit -- Ubuntu8.04 @@ -387,17 +385,17 @@ int Fl_Input::handle_key() { // handle keypresses that can have a platform-dependent processing int retval = Fl::screen_driver()->input_widget_handle_key(Fl::event_key(), mods, shift, this); if (retval >= 0) return retval; - + switch (Fl::event_key()) { case FL_Insert: // Note: Mac has no "Insert" key; it's the "Help" key. // This keypress is apparently not possible on macs. // - if (mods==0 && shift) return kf_paste(); // Shift-Insert (WP,NP,WOW,GE,KE,OF) - if (mods==0) return kf_insert_toggle(); // Insert (Standard) - if (mods==FL_CTRL) return kf_copy(); // Ctrl-Insert (WP,NP,WOW,GE,KE,OF) - return 0; // ignore other combos, pass to parent + if (mods==0 && shift) return kf_paste(); // Shift-Insert (WP,NP,WOW,GE,KE,OF) + if (mods==0) return kf_insert_toggle(); // Insert (Standard) + if (mods==FL_CTRL) return kf_copy(); // Ctrl-Insert (WP,NP,WOW,GE,KE,OF) + return 0; // ignore other combos, pass to parent case FL_Enter: case FL_KP_Enter: @@ -407,53 +405,53 @@ int Fl_Input::handle_key() { return 1; } else if (multiline && !readonly()) { return replace(position(), mark(), "\n", 1); - } return 0; // reserved for shortcuts + } return 0; // reserved for shortcuts case FL_Tab: // Handle special case for multiline input with 'old tab behavior'; // tab handled as a normal insertable character. // - if (mods==0 && !shift // Tab? - && !tab_nav() // old tab behavior enabled? - && multiline) { // multiline input? - break; // insert tab character + if (mods==0 && !shift // Tab? + && !tab_nav() // old tab behavior enabled? + && multiline) { // multiline input? + break; // insert tab character } - if (mods==0) return 0; // Tab, Shift-Tab? nav focus (Standard/OSX-HIG) - return 0; // ignore other combos, pass to parent + if (mods==0) return 0; // Tab, Shift-Tab? nav focus (Standard/OSX-HIG) + return 0; // ignore other combos, pass to parent case 'a': - if (mods==FL_COMMAND) return kf_select_all(); // Ctrl-A, Mac:Meta-A (Standard/OSX-HIG) - break; // handle other combos elsewhere + if (mods==FL_COMMAND) return kf_select_all(); // Ctrl-A, Mac:Meta-A (Standard/OSX-HIG) + break; // handle other combos elsewhere case 'c': - if (mods==FL_COMMAND) return kf_copy(); // Ctrl-C, Mac:Meta-C (Standard/OSX-HIG) - break; // handle other combos elsewhere + if (mods==FL_COMMAND) return kf_copy(); // Ctrl-C, Mac:Meta-C (Standard/OSX-HIG) + break; // handle other combos elsewhere case 'v': - if (mods==FL_COMMAND) return kf_paste(); // Ctrl-V, Mac:Meta-V (Standard/OSX-HIG) - break; // handle other combos elsewhere + if (mods==FL_COMMAND) return kf_paste(); // Ctrl-V, Mac:Meta-V (Standard/OSX-HIG) + break; // handle other combos elsewhere case 'x': - if (mods==FL_COMMAND) return kf_copy_cut(); // Ctrl-X, Mac:Meta-X (Standard/OSX-HIG) + if (mods==FL_COMMAND) return kf_copy_cut(); // Ctrl-X, Mac:Meta-X (Standard/OSX-HIG) break; case 'z': - if (mods==FL_COMMAND && !shift) return kf_undo(); // Ctrl-Z, Mac:Meta-Z (Standard/OSX-HIG) - if (mods==FL_COMMAND && shift) return kf_redo(); // Shift-Ctrl-Z, Mac:Shift-Meta-Z (Standard/OSX-HIG) - break; // handle other combos elsewhere + if (mods==FL_COMMAND && !shift) return kf_undo(); // Ctrl-Z, Mac:Meta-Z (Standard/OSX-HIG) + if (mods==FL_COMMAND && shift) return kf_redo(); // Shift-Ctrl-Z, Mac:Shift-Meta-Z (Standard/OSX-HIG) + break; // handle other combos elsewhere } - + switch (ascii) { case ctrl('H'): - return kf_delete_char_left(); // Ctrl-H (!WP,!NP,!WOW,!WOX,TE,SA,GE,KE,OF) - case ctrl('I'): // Ctrl-I (literal Tab) (!WP,NP,!WOW,!GE,KE,OF) - case ctrl('J'): // Ctrl-J (literal Line Feed/Enter) (Standard) - case ctrl('L'): // Ctrl-L (literal Form Feed) (Standard) - case ctrl('M'): // Ctrl-M (literal Cr) (Standard) + return kf_delete_char_left(); // Ctrl-H (!WP,!NP,!WOW,!WOX,TE,SA,GE,KE,OF) + case ctrl('I'): // Ctrl-I (literal Tab) (!WP,NP,!WOW,!GE,KE,OF) + case ctrl('J'): // Ctrl-J (literal Line Feed/Enter) (Standard) + case ctrl('L'): // Ctrl-L (literal Form Feed) (Standard) + case ctrl('M'): // Ctrl-M (literal Cr) (Standard) if (readonly()) { fl_beep(); return 1; } // insert a few selected control characters literally: if (input_type() != FL_FLOAT_INPUT && input_type() != FL_INT_INPUT) return replace(position(), mark(), &ascii, 1); break; } - - return 0; // ignored + + return 0; // ignored } int Fl_Input::handle(int event) { @@ -462,8 +460,8 @@ int Fl_Input::handle(int event) { switch (event) { case FL_UNFOCUS: if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) { - this->mark( this->position() ); - Fl::reset_marked_text(); + this->mark( this->position() ); + Fl::reset_marked_text(); } break; case FL_FOCUS: @@ -488,17 +486,17 @@ int Fl_Input::handle(int event) { break; } break; - + case FL_KEYBOARD: // Handle special case for multiline input with 'old tab behavior' // where tab is entered as a character: make sure user attempt to 'tab over' // widget doesn't destroy the field, replacing it with a tab character. // - if (Fl::event_key() == FL_Tab // Tab key? - && !Fl::event_state(FL_SHIFT) // no shift? - && !tab_nav() // with tab navigation disabled? - && input_type() == FL_MULTILINE_INPUT // with a multiline input? - && size() > 0 // non-empty field? + if (Fl::event_key() == FL_Tab // Tab key? + && !Fl::event_state(FL_SHIFT) // no shift? + && !tab_nav() // with tab navigation disabled? + && input_type() == FL_MULTILINE_INPUT // with a multiline input? + && size() > 0 // non-empty field? && ((mark()==0 && position()==size()) || (position()==0 && mark()==size()))) {// while entire field selected? // Set cursor to the end of the selection... if (mark() > position()) @@ -507,22 +505,22 @@ int Fl_Input::handle(int event) { position(position()); return (1); } else { - if (active_r() && window() && this == Fl::belowmouse()) + if (active_r() && window() && this == Fl::belowmouse()) window()->cursor(FL_CURSOR_NONE); return handle_key(); } //NOTREACHED - + case FL_PUSH: if (Fl::dnd_text_ops()) { int oldpos = position(), oldmark = mark(); Fl_Boxtype b = box(); Fl_Input_::handle_mouse(x()+Fl::box_dx(b), y()+Fl::box_dy(b), w()-Fl::box_dw(b), h()-Fl::box_dh(b), 0); - newpos = position(); + newpos = position(); position( oldpos, oldmark ); if (Fl::focus()==this && !Fl::event_state(FL_SHIFT) && input_type()!=FL_SECRET_INPUT && - ( (newpos >= mark() && newpos < position()) || + ( (newpos >= mark() && newpos < position()) || (newpos >= position() && newpos < mark()) ) ) { // user clicked in the selection, may be trying to drag drag_start = newpos; @@ -530,13 +528,13 @@ int Fl_Input::handle(int event) { } drag_start = -1; } - + if (Fl::focus() != this) { Fl::focus(this); handle(FL_FOCUS); } break; - + case FL_DRAG: if (Fl::dnd_text_ops()) { if (drag_start >= 0) { @@ -544,7 +542,7 @@ int Fl_Input::handle(int event) { // save the position because sometimes we don't get DND_ENTER: dnd_save_position = position(); dnd_save_mark = mark(); - dnd_save_focus = this; + dnd_save_focus = this; // drag the data: copy(0); Fl::screen_driver()->dnd(1); @@ -552,7 +550,7 @@ int Fl_Input::handle(int event) { } } break; - + case FL_RELEASE: if (Fl::event_button() == 2) { Fl::event_is_click(0); // stop double click from picking a word @@ -568,24 +566,24 @@ int Fl_Input::handle(int event) { // user double or triple clicked to select word or whole text copy(0); } - + // For output widgets, do the callback so the app knows the user // did something with the mouse... if (readonly()) do_callback(); - + return 1; - + case FL_DND_ENTER: Fl::belowmouse(this); // send the leave events first if (dnd_save_focus != this) { - dnd_save_position = position(); - dnd_save_mark = mark(); - dnd_save_focus = Fl::focus(); + dnd_save_position = position(); + dnd_save_mark = mark(); + dnd_save_focus = Fl::focus(); Fl::focus(this); handle(FL_FOCUS); } // fall through: - case FL_DND_DRAG: + case FL_DND_DRAG: //int p = mouse_position(X, Y, W, H); #ifdef DND_OUT_XXXX if (Fl::focus()==this && (p>=dnd_save_position && p<=dnd_save_mark || @@ -600,7 +598,7 @@ int Fl_Input::handle(int event) { w()-Fl::box_dw(b), h()-Fl::box_dh(b), 0); } return 1; - + case FL_DND_LEAVE: position(dnd_save_position, dnd_save_mark); #ifdef DND_OUT_XXXX @@ -616,30 +614,30 @@ int Fl_Input::handle(int event) { case FL_DND_RELEASE: if (dnd_save_focus == this) { // if the dragged text comes from the same widget - if (!readonly()) { - // remove the selected text - int old_position = position(); - if (dnd_save_mark > dnd_save_position) { - int tmp = dnd_save_mark; - dnd_save_mark = dnd_save_position; - dnd_save_position = tmp; - } - replace(dnd_save_mark, dnd_save_position, NULL, 0); - if (old_position > dnd_save_position) - position(old_position - (dnd_save_position - dnd_save_mark)); - else - position(old_position); - } // !readonly() + if (!readonly()) { + // remove the selected text + int old_position = position(); + if (dnd_save_mark > dnd_save_position) { + int tmp = dnd_save_mark; + dnd_save_mark = dnd_save_position; + dnd_save_position = tmp; + } + replace(dnd_save_mark, dnd_save_position, NULL, 0); + if (old_position > dnd_save_position) + position(old_position - (dnd_save_position - dnd_save_mark)); + else + position(old_position); + } // !readonly() } // from the same widget else if (dnd_save_focus) { - dnd_save_focus->handle(FL_UNFOCUS); + dnd_save_focus->handle(FL_UNFOCUS); } dnd_save_focus = NULL; take_focus(); return 1; /* TODO: this will scroll the area, but stop if the cursor would become invisible. - That clipping happens in drawtext(). Do we change the clipping or should + That clipping happens in drawtext(). Do we change the clipping or should we move the cursor (ouch)? case FL_MOUSEWHEEL: if (Fl::e_dy > 0) { @@ -666,7 +664,7 @@ Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l) Fl_Float_Input::Fl_Float_Input(int X,int Y,int W,int H,const char *l) -: Fl_Input(X,Y,W,H,l) +: Fl_Input(X,Y,W,H,l) { type(FL_FLOAT_INPUT); clear_flag(MAC_USE_ACCENTS_MENU); @@ -713,7 +711,3 @@ int Fl_Secret_Input::handle(int event) { } return retval; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 7ca8ff0f9..b3dde0f25 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Common input widget routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -61,8 +59,8 @@ const char* Fl_Input_::expand(const char* p, char* buf) const { if (input_type()==FL_SECRET_INPUT) { while (o<e && p < value_+size_) { if (fl_utf8len((char)p[0]) >= 1) { - l_secret = fl_utf8encode(Fl_Screen_Driver::secret_input_character, o); - o += l_secret; + l_secret = fl_utf8encode(Fl_Screen_Driver::secret_input_character, o); + o += l_secret; } p++; } @@ -72,10 +70,10 @@ const char* Fl_Input_::expand(const char* p, char* buf) const { word_wrap = w() - Fl::box_dw(box()) - 2; width_to_lastspace += (int)fl_width(lastspace_out, (int) (o-lastspace_out)); if (p > lastspace+1) { - if (word_count && width_to_lastspace > word_wrap) { - p = lastspace; o = lastspace_out; break; - } - word_count++; + if (word_count && width_to_lastspace > word_wrap) { + p = lastspace; o = lastspace_out; break; + } + word_count++; } lastspace = p; lastspace_out = o; @@ -90,8 +88,8 @@ const char* Fl_Input_::expand(const char* p, char* buf) const { *o++ = ' '; } } else { - *o++ = '^'; - *o++ = c ^ 0x40; + *o++ = '^'; + *o++ = c ^ 0x40; } } else { *o++ = c; @@ -113,10 +111,10 @@ const char* Fl_Input_::expand(const char* p, char* buf) const { \return width of string in pixels */ double Fl_Input_::expandpos( - const char* p, // real string - const char* e, // pointer into real string - const char* buf, // conversion of real string by expand() - int* returnn // return offset into buf here + const char* p, // real string + const char* e, // pointer into real string + const char* buf, // conversion of real string by expand() + int* returnn // return offset into buf here ) const { int n = 0; int chr = 0; @@ -149,7 +147,7 @@ double Fl_Input_::expandpos( /** \internal Marks a range of characters for update. - This call marks all characters from \p to the end of the + This call marks all characters from \p to the end of the text buffer for update. At least these characters will be redrawn in the next update cycle. @@ -202,9 +200,9 @@ void Fl_Input_::setfont() const { } /** - Draws the text in the passed bounding box. + Draws the text in the passed bounding box. - If <tt>damage() & FL_DAMAGE_ALL</tt> is true, this assumes the + If <tt>damage() & FL_DAMAGE_ALL</tt> is true, this assumes the area has already been erased to color(). Otherwise it does minimal update and erases the area itself. @@ -248,19 +246,19 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { cury = lines*height; int newscroll = xscroll_; if (curx > newscroll+W-threshold) { - // figure out scrolling so there is space after the cursor: - newscroll = curx+threshold-W; - // figure out the furthest left we ever want to scroll: - int ex = int(expandpos(p, e, buf, 0))+4-W; - // use minimum of both amounts: - if (ex < newscroll) newscroll = ex; + // figure out scrolling so there is space after the cursor: + newscroll = curx+threshold-W; + // figure out the furthest left we ever want to scroll: + int ex = int(expandpos(p, e, buf, 0))+4-W; + // use minimum of both amounts: + if (ex < newscroll) newscroll = ex; } else if (curx < newscroll+threshold) { - newscroll = curx-threshold; + newscroll = curx-threshold; } if (newscroll < 0) newscroll = 0; if (newscroll != xscroll_) { - xscroll_ = newscroll; - mu_p = 0; erase_cursor_only = 0; + xscroll_ = newscroll; + mu_p = 0; erase_cursor_only = 0; } } lines++; @@ -294,7 +292,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { if (ypos <= -height) goto CONTINUE; // clipped off top - if (do_mu) { // for minimal update: + if (do_mu) { // for minimal update: const char* pp = value()+mu_p; // pointer to where minimal update starts if (e < pp) goto CONTINUE2; // this line is before the changes if (readonly()) erase_cursor_only = 0; // this isn't the most efficient way @@ -303,13 +301,13 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { float r = (float)(X+W); float xx; if (p >= pp) { - xx = (float)X; - if (erase_cursor_only) r = xpos+2; - else if (readonly()) xx -= 3; + xx = (float)X; + if (erase_cursor_only) r = xpos+2; + else if (readonly()) xx -= 3; } else { - xx = xpos + (float)expandpos(p, pp, buf, 0); - if (erase_cursor_only) r = xx+2; - else if (readonly()) xx -= 3; + xx = xpos + (float)expandpos(p, pp, buf, 0); + if (erase_cursor_only) r = xx+2; + else if (readonly()) xx -= 3; } // clip to and erase it: fl_push_clip((int)xx-1-height/8, Y+ypos, (int)(r-xx+2+height/4), height); @@ -326,9 +324,9 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { float x1 = xpos; int offset1 = 0; if (pp > p) { - fl_color(tc); - x1 += (float)expandpos(p, pp, buf, &offset1); - fl_draw(buf, offset1, xpos, (float)(Y+ypos+desc)); + fl_color(tc); + x1 += (float)expandpos(p, pp, buf, &offset1); + fl_draw(buf, offset1, xpos, (float)(Y+ypos+desc)); } pp = value()+selend; float x2 = (float)(X+W); @@ -351,8 +349,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { fl_line((int)x1, Y+ypos+height-1, (int)(x1+width), Y+ypos+height-1); } if (pp < e) { - fl_color(tc); - fl_draw(buf+offset2, (int) strlen(buf+offset2), x2, (float)(Y+ypos+desc)); + fl_color(tc); + fl_draw(buf+offset2, (int) strlen(buf+offset2), x2, (float)(Y+ypos+desc)); } } else { // draw unselected text @@ -365,16 +363,16 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { CONTINUE2: // draw the cursor: if (Fl::focus() == this && ( - (Fl::screen_driver()->has_marked_text() && Fl::compose_state) || - selstart == selend) && - position() >= p-value() && position() <= e-value()) { + (Fl::screen_driver()->has_marked_text() && Fl::compose_state) || + selstart == selend) && + position() >= p-value() && position() <= e-value()) { fl_color(cursor_color()); // cursor position may need to be recomputed (see STR #2486) curx = int(expandpos(p, value()+position(), buf, 0)+.5); if (readonly()) { fl_line((int)(xpos+curx-2.5f), Y+ypos+height-1, - (int)(xpos+curx+0.5f), Y+ypos+height-4, - (int)(xpos+curx+3.5f), Y+ypos+height-1); + (int)(xpos+curx+0.5f), Y+ypos+height-4, + (int)(xpos+curx+3.5f), Y+ypos+height-1); } else { fl_rectf((int)(xpos+curx+0.5), Y+ypos, 2, height); } @@ -456,9 +454,9 @@ int Fl_Input_::word_start(int i) const { /** Finds the end of a line. - This call calculates the end of a line based on the given - index \p i. - + This call calculates the end of a line based on the given + index \p i. + \param [in] i starting index for the search \return end of the line */ @@ -487,9 +485,9 @@ int Fl_Input_::line_end(int i) const { /** Finds the start of a line. - This call calculates the start of a line based on the given - index \p i. - + This call calculates the start of a line based on the given + index \p i. + \param [in] i starting index for the search \return start of the line */ @@ -523,7 +521,7 @@ static int strict_word_end(const char *s, int len, int i, int itype) { return i; } -/** +/** Handles mouse clicks and mouse moves. \todo Add comment and parameters */ @@ -569,23 +567,23 @@ void Fl_Input_::handle_mouse(int X, int Y, int /*W*/, int /*H*/, int drag) { if (Fl::event_clicks()) { if (newpos >= newmark) { if (newpos == newmark) { - if (newpos < size()) newpos++; - else newmark--; + if (newpos < size()) newpos++; + else newmark--; } if (Fl::event_clicks() > 1) { - newpos = line_end(newpos); - newmark = line_start(newmark); + newpos = line_end(newpos); + newmark = line_start(newmark); } else { - newpos = strict_word_end(value(), size(), newpos, input_type()); - newmark = strict_word_start(value(), newmark, input_type()); + newpos = strict_word_end(value(), size(), newpos, input_type()); + newmark = strict_word_start(value(), newmark, input_type()); } } else { if (Fl::event_clicks() > 1) { - newpos = line_start(newpos); - newmark = line_end(newmark); + newpos = line_start(newpos); + newmark = line_end(newmark); } else { - newpos = strict_word_start(value(), newpos, input_type()); - newmark = strict_word_end(value(), size(), newmark, input_type()); + newpos = strict_word_start(value(), newpos, input_type()); + newmark = strict_word_end(value(), size(), newmark, input_type()); } } // if the multiple click does not increase the selection, revert @@ -608,9 +606,9 @@ void Fl_Input_::handle_mouse(int X, int Y, int /*W*/, int /*H*/, int drag) { \e mark (\c m) is the other end of the selected text. If they are equal then there is no selection. Changing this does not affect the clipboard (use copy() to do that). - + Changing these values causes a redraw(). The new - values are bounds checked. + values are bounds checked. \param p index for the cursor position \param m index for the mark @@ -654,7 +652,7 @@ int Fl_Input_::position(int p, int m) { if (position_ == mark_) { // old position was just a cursor if (Fl::focus() == this && !(damage()&FL_DAMAGE_EXPOSE)) { - minimal_update(position_); erase_cursor_only = 1; + minimal_update(position_); erase_cursor_only = 1; } } else { // old position was a selection minimal_update(position_, mark_); @@ -668,7 +666,7 @@ int Fl_Input_::position(int p, int m) { /** Moves the cursor to the column given by \p up_down_pos. - This function is helpful when implementing up and down + This function is helpful when implementing up and down cursor movement. It moves the cursor from the beginning of a line to the column indicated by the global variable \p up_down_pos in pixel units. @@ -726,10 +724,10 @@ int Fl_Input_::copy(int clipboard) { static char* undobuffer; static int undobufferlength; static Fl_Input_* undowidget; -static int undoat; // points after insertion -static int undocut; // number of characters deleted there -static int undoinsert; // number of characters inserted -static int yankcut; // length of valid contents of buffer, even if undocut=0 +static int undoat; // points after insertion +static int undocut; // number of characters deleted there +static int undoinsert; // number of characters inserted +static int yankcut; // length of valid contents of buffer, even if undocut=0 static void undobuffersize(int n) { if (n > undobufferlength) { @@ -773,7 +771,7 @@ int Fl_Input_::append(const char* t, int l, char keep_selection) All changes to the text buffer go through this function. It deletes the region between \p b and \p e (either one may be less or equal to the other), and then inserts the string \p text - at that point and moves the mark() and + at that point and moves the mark() and position() to the end of the insertion. Does the callback if <tt>when() & FL_WHEN_CHANGED</tt> and there is a change. @@ -807,7 +805,7 @@ int Fl_Input_::append(const char* t, int l, char keep_selection) \param [in] text string that will be inserted \param [in] ilen length of \p text or 0 for \c nul terminated strings \return 0 if nothing changed - + \note If \p text does not point to a valid UTF-8 character or includes invalid UTF-8 sequences, the text is inserted nevertheless (counting invalid UTF-8 bytes as one character each). @@ -834,7 +832,7 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) { // we must count UTF-8 *characters* to determine whether we can insert // the full text or only a part of it (and how much this would be) - int nchars = 0; // characters in value() - deleted + inserted + int nchars = 0; // characters in value() - deleted + inserted const char *p = value_; while (p < (char *)(value_+size_)) { if (p == (char *)(value_+b)) { // skip removed part @@ -846,7 +844,7 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) { nchars++; p += ulen; } - int nlen = 0; // length (in bytes) to be inserted + int nlen = 0; // length (in bytes) to be inserted p = text; while (p < (char *)(text+ilen) && nchars < maximum_size()) { int ulen = fl_utf8len(*p); @@ -980,7 +978,7 @@ int Fl_Input_::undo() { Copies the \e yank buffer to the clipboard. This method copies all the previous contiguous cuts from the undo - information to the clipboard. This function implements + information to the clipboard. This function implements the \c ^K shortcut key. \return 0 if the operation did not change the clipboard @@ -1002,7 +1000,7 @@ void Fl_Input_::maybe_do_callback() { } } -/** +/** Handles all kinds of text field related events. This is called by derived classes. @@ -1097,11 +1095,11 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) { if (*p == '.') { p ++; while (isdigit(*p & 255) && p < e) p ++; - if (*p == 'e' || *p == 'E') { - p ++; - if (*p == '+' || *p == '-') p ++; - while (isdigit(*p & 255) && p < e) p ++; - } + if (*p == 'e' || *p == 'E') { + p ++; + if (*p == '+' || *p == '-') p ++; + while (isdigit(*p & 255) && p < e) p ++; + } } if (p < e) { fl_beep(FL_BEEP_ERROR); @@ -1111,7 +1109,7 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) { return replace(position(), mark(), t, (int) (e-t));} case FL_SHORTCUT: - if (!(shortcut() ? Fl::test_shortcut(shortcut()) : test_shortcut())) + if (!(shortcut() ? Fl::test_shortcut(shortcut()) : test_shortcut())) return 0; if (Fl::visible_focus() && handle(FL_FOCUS)) { Fl::focus(this); @@ -1169,7 +1167,7 @@ void Fl_Input_::put_in_buffer(int len) { } if (!bufsize) { if (len > size_) len += 9; // let a few characters insert before realloc - bufsize = len+1; + bufsize = len+1; buffer = (char*)malloc(bufsize); } else if (bufsize <= len) { // we may need to move old value in case it points into buffer: @@ -1200,7 +1198,7 @@ void Fl_Input_::put_in_buffer(int len) { /** Changes the widget text. - This function changes the text and sets the mark and the point to + This function changes the text and sets the mark and the point to the end of it. The string is \e not copied. If the user edits the string it is copied to the internal buffer then. This can save a great deal of time and memory if your program is rapidly @@ -1211,7 +1209,7 @@ void Fl_Input_::put_in_buffer(int len) { You can use the \p len parameter to directly set the length if you know it already or want to put \c nul characters in the text. - \param [in] str the new text + \param [in] str the new text \param [in] len the length of the new text \return non-zero if the new value is different than the current one */ @@ -1227,8 +1225,8 @@ int Fl_Input_::static_value(const char* str, int len) { int i = 0; // find first different character: if (value_) { - for (; i<size_ && i<len && str[i]==value_[i]; i++) {/*empty*/} - if (i==size_ && i==len) return 0; + for (; i<size_ && i<len && str[i]==value_[i]; i++) {/*empty*/} + if (i==size_ && i==len) return 0; } minimal_update(i); } @@ -1248,7 +1246,7 @@ int Fl_Input_::static_value(const char* str, int len) { /** Changes the widget text. - This function changes the text and sets the mark and the point to + This function changes the text and sets the mark and the point to the end of it. The string is \e not copied. If the user edits the string it is copied to the internal buffer then. This can save a great deal of time and memory if your program is rapidly @@ -1256,7 +1254,7 @@ int Fl_Input_::static_value(const char* str, int len) { the passed string remains unchanged until either the Fl_Input is destroyed or value() is called again. - \param [in] str the new text + \param [in] str the new text \return non-zero if the new value is different than the current one */ int Fl_Input_::static_value(const char* str) { @@ -1268,12 +1266,12 @@ int Fl_Input_::static_value(const char* str) { This function changes the text and sets the mark and the point to the end of it. The string is copied to the internal - buffer. Passing \c NULL is the same as "". + buffer. Passing \c NULL is the same as "". You can use the \p length parameter to directly set the length if you know it already or want to put \c nul characters in the text. - \param [in] str the new text + \param [in] str the new text \param [in] len the length of the new text \return non-zero if the new value is different than the current one \see Fl_Input_::value(const char* str), Fl_Input_::value() @@ -1284,14 +1282,14 @@ int Fl_Input_::value(const char* str, int len) { return r; } -/** +/** Changes the widget text. This function changes the text and sets the mark and the point to the end of it. The string is copied to the internal - buffer. Passing \c NULL is the same as \c "". + buffer. Passing \c NULL is the same as \c "". - \param [in] str the new text + \param [in] str the new text \return non-zero if the new value is different than the current one \see Fl_Input_::value(const char* str, int len), Fl_Input_::value() */ @@ -1339,18 +1337,14 @@ int Fl_Input_::linesPerPage() { /** Returns the character at index \p i. - This function returns the UTF-8 character at \p i + This function returns the UTF-8 character at \p i as a ucs4 character code. \param [in] i index into the value field \return the character at index \p i */ -unsigned int Fl_Input_::index(int i) const +unsigned int Fl_Input_::index(int i) const { int len = 0; return fl_utf8decode(value_+i, value_+size_, &len); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Input_Choice.cxx b/src/Fl_Input_Choice.cxx index dd3c9b1cc..765b9656b 100644 --- a/src/Fl_Input_Choice.cxx +++ b/src/Fl_Input_Choice.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // An input/chooser widget. // ______________ ____ // | || __ | @@ -14,11 +12,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -119,7 +117,7 @@ void Fl_Input_Choice::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 (item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER)) return; // ignore submenus if (!strcmp(o->inp_->value(), o->menu_->text())) { o->Fl_Widget::clear_changed(); @@ -174,16 +172,16 @@ void Fl_Input_Choice::inp_cb(Fl_Widget*, void *data) { Fl_Input_Choice::Fl_Input_Choice (int X, int Y, int W, int H, const char *L) : Fl_Group(X,Y,W,H,L) { Fl_Group::box(FL_DOWN_BOX); - align(FL_ALIGN_LEFT); // default like Fl_Input + align(FL_ALIGN_LEFT); // default like Fl_Input inp_ = new Fl_Input(inp_x(), inp_y(), inp_w(), inp_h()); inp_->callback(inp_cb, (void*)this); - inp_->box(FL_FLAT_BOX); // cosmetic + inp_->box(FL_FLAT_BOX); // cosmetic inp_->when(FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED); menu_ = new InputMenuButton(menu_x(), menu_y(), menu_w(), menu_h()); menu_->callback(menu_cb, (void*)this); - menu_->box(FL_FLAT_BOX); // cosmetic + menu_->box(FL_FLAT_BOX); // cosmetic end(); } @@ -239,7 +237,7 @@ void Fl_Input_Choice::clear_changed() { choice->update_menubutton(); // cause menubutton to reflect this value too // (returns 1 if match was found, 0 if not) // Verify menubutton()'s value. - printf("menu button choice index=%d, value=%s\n", + printf("menu button choice index=%d, value=%s\n", choice->menubutton()->value(), // would be -1 if update not done choice->menubutton()->text()); // would be NULL if update not done \endcode @@ -258,9 +256,5 @@ int Fl_Input_Choice::update_menubutton() { return 1; } } - return 0; // not found + return 0; // not found } - -// -// End of "$Id$". -// diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx index 42e76d694..b794d382a 100644 --- a/src/Fl_JPEG_Image.cxx +++ b/src/Fl_JPEG_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_JPEG_Image routines. // // Copyright 1997-2011 by Easy Software Products. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -58,8 +56,8 @@ extern "C" #ifdef HAVE_LIBJPEG struct fl_jpeg_error_mgr { - jpeg_error_mgr pub_; // Destination manager... - jmp_buf errhand_; // Error handler + jpeg_error_mgr pub_; // Destination manager... + jmp_buf errhand_; // Error handler }; #endif // HAVE_LIBJPEG @@ -71,12 +69,12 @@ struct fl_jpeg_error_mgr { #ifdef HAVE_LIBJPEG extern "C" { static void - fl_jpeg_error_handler(j_common_ptr dinfo) { // I - Decompressor info + fl_jpeg_error_handler(j_common_ptr dinfo) { // I - Decompressor info longjmp(((fl_jpeg_error_mgr *)(dinfo->err))->errhand_, 1); } static void - fl_jpeg_output_handler(j_common_ptr) { // I - Decompressor info (not used) + fl_jpeg_output_handler(j_common_ptr) { // I - Decompressor info (not used) } } #endif // HAVE_LIBJPEG @@ -84,16 +82,16 @@ extern "C" { /** \brief The constructor loads the JPEG image from the given jpeg filename. - - The inherited destructor frees all memory and server resources that are used + + The inherited destructor frees all memory and server resources that are used by the image. - + Use Fl_Image::fail() to check if Fl_JPEG_Image failed to load. fail() returns ERR_FILE_ACCESS if the file could not be opened or read, ERR_FORMAT if the JPEG format could not be decoded, and ERR_NO_IMAGE if the image could not be loaded for another reason. If the image has loaded correctly, w(), h(), and d() should return values greater than zero. - + \param[in] filename a full path and name pointing to a valid jpeg file. \see Fl_JPEG_Image::Fl_JPEG_Image(const char *imagename, const unsigned char *data) @@ -333,8 +331,3 @@ void Fl_JPEG_Image::load_jpg_(const char *filename, const char *sharename, const } #endif // HAVE_LIBJPEG } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index 33ecbc116..4de85bc5f 100644 --- a/src/Fl_Light_Button.cxx +++ b/src/Fl_Light_Button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Lighted button widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Subclass of Fl_Button where the "box" indicates whether it is @@ -35,10 +33,10 @@ void Fl_Light_Button::draw() { fl_inactive(selection_color())) : color(); int W = labelsize(); - int bx = Fl::box_dx(box()); // box frame width - int dx = bx + 2; // relative position of check mark etc. - int dy = (h() - W) / 2; // neg. offset o.k. for vertical centering - int lx = 0; // relative label position (STR #3237) + int bx = Fl::box_dx(box()); // box frame width + int dx = bx + 2; // relative position of check mark etc. + int dy = (h() - W) / 2; // neg. offset o.k. for vertical centering + int lx = 0; // relative label position (STR #3237) if (down_box()) { // draw other down_box() styles: @@ -49,71 +47,71 @@ void Fl_Light_Button::draw() { case _FL_PLASTIC_UP_BOX : // Check box... draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); - if (value()) { - if (Fl::is_scheme("gtk+")) { - fl_color(FL_SELECTION_COLOR); - } else { - fl_color(col); - } - int tx = x() + dx + 3; - int tw = W - 6; - int d1 = tw/3; - int d2 = tw-d1; - int ty = y() + dy + (W+d2)/2-d1-2; - for (int n = 0; n < 3; n++, ty++) { - fl_line(tx, ty, tx+d1, ty+d1); - fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); - } - } + if (value()) { + if (Fl::is_scheme("gtk+")) { + fl_color(FL_SELECTION_COLOR); + } else { + fl_color(col); + } + int tx = x() + dx + 3; + int tw = W - 6; + int d1 = tw/3; + int d2 = tw-d1; + int ty = y() + dy + (W+d2)/2-d1-2; + for (int n = 0; n < 3; n++, ty++) { + fl_line(tx, ty, tx+d1, ty+d1); + fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); + } + } break; case _FL_ROUND_DOWN_BOX : case _FL_ROUND_UP_BOX : // Radio button... draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); - if (value()) { - int tW = (W - Fl::box_dw(down_box())) / 2 + 1; - if ((W - tW) & 1) tW++; // Make sure difference is even to center - int tdx = dx + (W - tW) / 2; - int tdy = dy + (W - tW) / 2; - - if (Fl::is_scheme("gtk+")) { - fl_color(FL_SELECTION_COLOR); - tW --; - fl_pie(x() + tdx - 1, y() + tdy - 1, tW + 3, tW + 3, 0.0, 360.0); - fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f)); - } else fl_color(col); - - switch (tW) { - // Larger circles draw fine... - default : + if (value()) { + int tW = (W - Fl::box_dw(down_box())) / 2 + 1; + if ((W - tW) & 1) tW++; // Make sure difference is even to center + int tdx = dx + (W - tW) / 2; + int tdy = dy + (W - tW) / 2; + + if (Fl::is_scheme("gtk+")) { + fl_color(FL_SELECTION_COLOR); + tW --; + fl_pie(x() + tdx - 1, y() + tdy - 1, tW + 3, tW + 3, 0.0, 360.0); + fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f)); + } else fl_color(col); + + switch (tW) { + // Larger circles draw fine... + default : fl_pie(x() + tdx, y() + tdy, tW, tW, 0.0, 360.0); - break; + break; // Small circles don't draw well on many systems... - case 6 : - fl_rectf(x() + tdx + 2, y() + tdy, tW - 4, tW); - fl_rectf(x() + tdx + 1, y() + tdy + 1, tW - 2, tW - 2); - fl_rectf(x() + tdx, y() + tdy + 2, tW, tW - 4); - break; - - case 5 : - case 4 : - case 3 : - fl_rectf(x() + tdx + 1, y() + tdy, tW - 2, tW); - fl_rectf(x() + tdx, y() + tdy + 1, tW, tW - 2); - break; - - case 2 : - case 1 : - fl_rectf(x() + tdx, y() + tdy, tW, tW); - break; - } - - if (Fl::is_scheme("gtk+")) { - fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5)); - fl_arc(x() + tdx, y() + tdy, tW + 1, tW + 1, 60.0, 180.0); - } - } + case 6 : + fl_rectf(x() + tdx + 2, y() + tdy, tW - 4, tW); + fl_rectf(x() + tdx + 1, y() + tdy + 1, tW - 2, tW - 2); + fl_rectf(x() + tdx, y() + tdy + 2, tW, tW - 4); + break; + + case 5 : + case 4 : + case 3 : + fl_rectf(x() + tdx + 1, y() + tdy, tW - 2, tW); + fl_rectf(x() + tdx, y() + tdy + 1, tW, tW - 2); + break; + + case 2 : + case 1 : + fl_rectf(x() + tdx, y() + tdy, tW, tW); + break; + } + + if (Fl::is_scheme("gtk+")) { + fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5)); + fl_arc(x() + tdx, y() + tdy, tW + 1, tW + 1, 60.0, 180.0); + } + } break; default : draw_box(down_box(), x()+dx, y()+dy, W, W, col); @@ -162,12 +160,7 @@ Fl_Light_Button::Fl_Light_Button(int X, int Y, int W, int H, const char* l) Fl_Radio_Light_Button::Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l) -: Fl_Light_Button(X,Y,W,H,l) +: Fl_Light_Button(X,Y,W,H,l) { type(FL_RADIO_BUTTON); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_MacOS_Sys_Menu_Bar.mm b/src/Fl_MacOS_Sys_Menu_Bar.mm index f75db1d81..7f7abba2e 100644 --- a/src/Fl_MacOS_Sys_Menu_Bar.mm +++ b/src/Fl_MacOS_Sys_Menu_Bar.mm @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS system menu bar widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #if defined(__APPLE__) @@ -115,10 +113,10 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; const Fl_Menu_Item *item = [self getFlItem]; menu->picked(item); Fl::flush(); - if ( item->flags & FL_MENU_TOGGLE ) { // update the menu toggle symbol + if ( item->flags & FL_MENU_TOGGLE ) { // update the menu toggle symbol [self setState:(item->value() ? NSOnState : NSOffState)]; } - else if ( item->flags & FL_MENU_RADIO ) { // update the menu radio symbols + else if ( item->flags & FL_MENU_RADIO ) { // update the menu radio symbols NSMenu* this_menu = [self menu]; NSInteger flRank = [this_menu indexOfItem:self]; NSInteger last = [this_menu numberOfItems] - 1; @@ -174,11 +172,11 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; { // Separate key and modifier int mod = key; - mod &= ~FL_KEY_MASK; // modifier(s) - key &= FL_KEY_MASK; // key + mod &= ~FL_KEY_MASK; // modifier(s) + key &= FL_KEY_MASK; // key unichar mac_key = (unichar)key; if ( (key >= (FL_F+1)) && (key <= FL_F_Last) ) { // Handle function keys - int fkey_num = (key - FL_F); // 1,2.. + int fkey_num = (key - FL_F); // 1,2.. mac_key = NSF1FunctionKey + fkey_num - 1; } [self setKeyEquivalent:[NSString stringWithCharacters:&mac_key length:1]]; @@ -190,8 +188,8 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; NSString *title = NSLocalizedString([NSString stringWithUTF8String:name], nil); free(name); FLMenuItem *item = [[FLMenuItem alloc] initWithTitle:title - action:selector - keyEquivalent:@""]; + action:selector + keyEquivalent:@""]; // >= 0 if mitem is in the menu items of fl_sys_menu_bar, -1 if not NSInteger index = (fl_sys_menu_bar ? fl_sys_menu_bar->find_index(mitem) : -1); [item setTag:index]; @@ -239,7 +237,7 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; #endif @end - + void Fl_MacOS_Sys_Menu_Bar_Driver::about( Fl_Callback *cb, void *user_data) { Fl_Menu_Item aboutItem; @@ -249,9 +247,9 @@ void Fl_MacOS_Sys_Menu_Bar_Driver::about( Fl_Callback *cb, void *user_data) NSMenu *appleMenu = [[[NSApp mainMenu] itemAtIndex:0] submenu]; CFStringRef cfname = CFStringCreateCopy(NULL, (CFStringRef)[[appleMenu itemAtIndex:0] title]); [appleMenu removeItemAtIndex:0]; - FLMenuItem *item = [[[FLMenuItem alloc] initWithTitle:(NSString*)cfname - action:@selector(directCallback) - keyEquivalent:@""] autorelease]; + FLMenuItem *item = [[[FLMenuItem alloc] initWithTitle:(NSString*)cfname + action:@selector(directCallback) + keyEquivalent:@""] autorelease]; NSData *pointer = [NSData dataWithBytes:&aboutItem length:sizeof(Fl_Menu_Item)]; [item setRepresentedObject:pointer]; [appleMenu insertItem:item atIndex:0]; @@ -264,7 +262,7 @@ void Fl_MacOS_Sys_Menu_Bar_Driver::about( Fl_Callback *cb, void *user_data) */ static void setMenuShortcut( NSMenu* mh, int miCnt, const Fl_Menu_Item *m ) { - if ( !m->shortcut_ ) + if ( !m->shortcut_ ) return; if ( m->flags & FL_SUBMENU ) return; @@ -319,7 +317,7 @@ static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *m { NSMenu *submenu; int miCnt, flags; - + if (mitem) { NSMenuItem *menuItem; char *ts = remove_ampersand(mitem->text); @@ -327,7 +325,7 @@ static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *m free(ts); submenu = [[NSMenu alloc] initWithTitle:(NSString*)title]; [submenu setAutoenablesItems:NO]; - + int cnt; cnt = [mh numberOfItems]; cnt--; @@ -335,7 +333,7 @@ static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *m [menuItem setSubmenu:submenu]; [submenu release]; } else submenu = mh; - + while ( mm->text ) { if (!mm->visible() ) { // skip invisible items and submenus mm = mm->next(0); @@ -365,7 +363,7 @@ static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *m mm++; } } - + /* * convert a complete Fl_Menu_Item array into a series of menus in the top menu bar @@ -490,7 +488,7 @@ int Fl_MacOS_Sys_Menu_Bar_Driver::insert(int index, const char* label, int short /** \class Fl_Mac_App_Menu Mac OS-specific class allowing to customize and localize the application menu. - + The public class attributes are used to build the application menu. They can be localized at run time to any UTF-8 text by placing instructions such as this before fl_open_display() gets called: @@ -666,7 +664,3 @@ void fl_mac_set_about(Fl_Callback *cb, void *user_data, int shortcut) { } #endif /* __APPLE__ */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index fa671188d..0274501b8 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Warning: this menu code is quite a mess! @@ -70,7 +68,7 @@ int Fl_Menu_Item::size() const { } } -// Advance a pointer to next visible or invisible item of a menu array, +// Advance a pointer to next visible or invisible item of a menu array, // skipping the contents of submenus. static const Fl_Menu_Item* next_visible_or_not(const Fl_Menu_Item* m) { int nest = 0; @@ -125,15 +123,15 @@ class menuwindow : public Fl_Menu_Window { public: menutitle* title; int handle(int); - int itemheight; // zero == menubar + int itemheight; // zero == menubar int numitems; int selected; - int drawn_selected; // last redraw has this selected + int drawn_selected; // last redraw has this selected int shortcutWidth; const Fl_Menu_Item* menu; menuwindow(const Fl_Menu_Item* m, int X, int Y, int W, int H, - const Fl_Menu_Item* picked, const Fl_Menu_Item* title, - int menubar = 0, int menubar_title = 0, int right_edge = 0); + const Fl_Menu_Item* picked, const Fl_Menu_Item* title, + int menubar = 0, int menubar_title = 0, int right_edge = 0); ~menuwindow(); void set_selected(int); int find_selected(int mx, int my); @@ -145,9 +143,9 @@ public: extern char fl_draw_shortcut; -/** - Measures width of label, including effect of & characters. - Optionally, can get height if hp is not NULL. +/** + Measures width of label, including effect of & characters. + Optionally, can get height if hp is not NULL. */ int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const { Fl_Label l; @@ -168,7 +166,7 @@ int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const { /** Draws the menu item in bounding box x,y,w,h, optionally selects the item. */ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, - int selected) const { + int selected) const { Fl_Label l; l.value = text; l.image = 0; @@ -184,11 +182,11 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, Fl_Boxtype b = m && m->down_box() ? m->down_box() : FL_FLAT_BOX; if (fl_contrast(r,color)!=r) { // back compatibility boxtypes if (selected == 2) { // menu title - r = color; - b = m ? m->box() : FL_UP_BOX; + r = color; + b = m ? m->box() : FL_UP_BOX; } else { - r = (Fl_Color)(FL_COLOR_CUBE-1); // white - l.color = fl_contrast((Fl_Color)labelcolor_, r); + r = (Fl_Color)(FL_COLOR_CUBE-1); // white + l.color = fl_contrast((Fl_Color)labelcolor_, r); } } else { l.color = fl_contrast((Fl_Color)labelcolor_, r); @@ -209,64 +207,64 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, if (flags & FL_MENU_RADIO) { fl_draw_box(FL_ROUND_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR); if (value()) { - int tW = (W - Fl::box_dw(FL_ROUND_DOWN_BOX)) / 2 + 1; - if ((W - tW) & 1) tW++; // Make sure difference is even to center - int td = (W - tW) / 2; + int tW = (W - Fl::box_dw(FL_ROUND_DOWN_BOX)) / 2 + 1; + if ((W - tW) & 1) tW++; // Make sure difference is even to center + int td = (W - tW) / 2; if (Fl::is_scheme("gtk+")) { - fl_color(FL_SELECTION_COLOR); - tW --; - fl_pie(x + td + 1, y + d + td - 1, tW + 3, tW + 3, 0.0, 360.0); - fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f)); - } else fl_color(labelcolor_); - - switch (tW) { - // Larger circles draw fine... - default : + fl_color(FL_SELECTION_COLOR); + tW --; + fl_pie(x + td + 1, y + d + td - 1, tW + 3, tW + 3, 0.0, 360.0); + fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f)); + } else fl_color(labelcolor_); + + switch (tW) { + // Larger circles draw fine... + default : fl_pie(x + td + 2, y + d + td, tW, tW, 0.0, 360.0); - break; + break; // Small circles don't draw well on many systems... - case 6 : - fl_rectf(x + td + 4, y + d + td, tW - 4, tW); - fl_rectf(x + td + 3, y + d + td + 1, tW - 2, tW - 2); - fl_rectf(x + td + 2, y + d + td + 2, tW, tW - 4); - break; - - case 5 : - case 4 : - case 3 : - fl_rectf(x + td + 3, y + d + td, tW - 2, tW); - fl_rectf(x + td + 2, y + d + td + 1, tW, tW - 2); - break; - - case 2 : - case 1 : - fl_rectf(x + td + 2, y + d + td, tW, tW); - break; - } - - if (Fl::is_scheme("gtk+")) { - fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5)); - fl_arc(x + td + 2, y + d + td, tW + 1, tW + 1, 60.0, 180.0); - } + case 6 : + fl_rectf(x + td + 4, y + d + td, tW - 4, tW); + fl_rectf(x + td + 3, y + d + td + 1, tW - 2, tW - 2); + fl_rectf(x + td + 2, y + d + td + 2, tW, tW - 4); + break; + + case 5 : + case 4 : + case 3 : + fl_rectf(x + td + 3, y + d + td, tW - 2, tW); + fl_rectf(x + td + 2, y + d + td + 1, tW, tW - 2); + break; + + case 2 : + case 1 : + fl_rectf(x + td + 2, y + d + td, tW, tW); + break; + } + + if (Fl::is_scheme("gtk+")) { + fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5)); + fl_arc(x + td + 2, y + d + td, tW + 1, tW + 1, 60.0, 180.0); + } } } else { fl_draw_box(FL_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR); if (value()) { - if (Fl::is_scheme("gtk+")) { - fl_color(FL_SELECTION_COLOR); - } else { - fl_color(labelcolor_); - } - int tx = x + 5; - int tw = W - 6; - int d1 = tw/3; - int d2 = tw-d1; - int ty = y + d + (W+d2)/2-d1-2; - for (int n = 0; n < 3; n++, ty++) { - fl_line(tx, ty, tx+d1, ty+d1); - fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); - } + if (Fl::is_scheme("gtk+")) { + fl_color(FL_SELECTION_COLOR); + } else { + fl_color(labelcolor_); + } + int tx = x + 5; + int tw = W - 6; + int d1 = tw/3; + int d2 = tw-d1; + int ty = y + d + (W+d2)/2-d1-2; + for (int n = 0; n < 3; n++, ty++) { + fl_line(tx, ty, tx+d1, ty+d1); + fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); + } } } x += W + 3; @@ -289,8 +287,8 @@ menutitle::menutitle(int X, int Y, int W, int H, const Fl_Menu_Item* L) : } menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp, - const Fl_Menu_Item* picked, const Fl_Menu_Item* t, - int menubar, int menubar_title, int right_edge) + const Fl_Menu_Item* picked, const Fl_Menu_Item* t, + int menubar, int menubar_title, int right_edge) : Fl_Menu_Window(X, Y, Wp, Hp, 0) { int scr_x, scr_y, scr_w, scr_h; @@ -340,10 +338,10 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp, if (t) Wtitle = t->measure(&Htitle, button) + 12; int W = 0; if (m) for (; m->text; m = m->next()) { - int hh; + int hh; int w1 = m->measure(&hh, button); if (hh+Fl::menu_linespacing()>itemheight) itemheight = hh+Fl::menu_linespacing(); - if (m->flags&(FL_SUBMENU|FL_SUBMENU_POINTER)) + if (m->flags&(FL_SUBMENU|FL_SUBMENU_POINTER)) w1 += FL_NORMAL_SIZE; if (w1 > W) W = w1; // calculate the maximum width of all shortcuts @@ -374,8 +372,8 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp, if (Wp > W) W = Wp; if (Wtitle > W) W = Wtitle; - if (X < scr_x) X = scr_x; - // this change improves popup submenu positioning at right screen edge, + if (X < scr_x) X = scr_x; + // this change improves popup submenu positioning at right screen edge, // but it makes right_edge argument useless //if (X > scr_x+scr_w-W) X = right_edge-W; if (X > scr_x+scr_w-W) X = scr_x+scr_w-W; @@ -512,7 +510,7 @@ void menutitle::draw() { } void menuwindow::draw() { - if (damage() != FL_DAMAGE_CHILD) { // complete redraw + if (damage() != FL_DAMAGE_CHILD) { // complete redraw fl_draw_box(box(), 0, 0, w(), h(), button ? button->color() : color()); if (menu) { const Fl_Menu_Item* m; int j; @@ -523,7 +521,7 @@ void menuwindow::draw() { drawentry(menu->next(drawn_selected), drawn_selected, 1); drawentry(menu->next(selected), selected, 1); } - } + } drawn_selected = selected; } @@ -592,9 +590,9 @@ int menuwindow::is_inside(int mx, int my) { // of windows is slow, and we don't want to fall behind the events. // values for menustate.state: -#define INITIAL_STATE 0 // no mouse up or down since popup() called -#define PUSH_STATE 1 // mouse has been pushed on a normal item -#define DONE_STATE 2 // exit the popup, the current item was picked +#define INITIAL_STATE 0 // no mouse up or down since popup() called +#define PUSH_STATE 1 // mouse has been pushed on a normal item +#define DONE_STATE 2 // exit the popup, the current item was picked #define MENU_PUSH_STATE 3 // mouse has been pushed on a menu title struct menustate { @@ -636,7 +634,7 @@ static void setitem(int m, int n) { static int forward(int menu) { // go to next item in menu menu if possible menustate &pp = *p; // Fl_Menu_Button can generate menu=-1. This line fixes it and selectes the first item. - if (menu==-1) + if (menu==-1) menu = 0; menuwindow &m = *(pp.p[menu]); int item = (menu == pp.menu_number) ? pp.item_number : m.selected; @@ -664,19 +662,19 @@ int menuwindow::handle(int e) { and "svn blame" shows it is here to fix STR #449. But this STR is Mac OS-specific. So, it is unclear why handle_part2() is called also for X11. - + Furthermore, calling handle_part2() for X11 renders the fix for STR #2619 below necessary. If handle_part2() is not called under X11, then STR #2619 does not occur. need_menu_handle_part1_extra() activates this fix. - + FLTK 1.3.4 behavior: Fl::system_driver()->need_menu_handle_part2() returns true on Mac + X11 Fl::system_driver()->need_menu_handle_part1_extra() returns true on X11 - + Alternative behavior that seems equally correct: Fl::system_driver()->need_menu_handle_part2() returns true on Mac need_menu_handle_part1_extra() does not exist - + Other alternative: Neither need_menu_handle_part2() nor need_menu_handle_part1_extra() exist --> the menuwindow code is entirely cross-platform and simpler. @@ -708,7 +706,7 @@ int menuwindow::handle_part2(int e, int ret) { menuwindow *mw = pp.p[--i]; if (mw) { mw->hide(); - if (mw->title) + if (mw->title) mw->title->hide(); } } @@ -748,13 +746,13 @@ int menuwindow::handle_part1(int e) { return 1; case FL_Right: if (pp.menubar && (pp.menu_number<=0 || (pp.menu_number==1 && pp.nummenus==2))) - forward(0); + forward(0); else if (pp.menu_number < pp.nummenus-1) forward(pp.menu_number+1); return 1; case FL_Left: if (pp.menubar && pp.menu_number<=1) backward(0); else if (pp.menu_number>0) - setitem(pp.menu_number-1, pp.p[pp.menu_number-1]->selected); + setitem(pp.menu_number-1, pp.p[pp.menu_number-1]->selected); return 1; case FL_Enter: case FL_KP_Enter: @@ -767,16 +765,16 @@ int menuwindow::handle_part1(int e) { return 1; } break; - case FL_SHORTCUT: + case FL_SHORTCUT: { for (int mymenu = pp.nummenus; mymenu--;) { - menuwindow &mw = *(pp.p[mymenu]); - int item; const Fl_Menu_Item* m = mw.menu->find_shortcut(&item); - if (m) { - setitem(m, mymenu, item); - if (!m->submenu()) pp.state = DONE_STATE; - return 1; - } + menuwindow &mw = *(pp.p[mymenu]); + int item; const Fl_Menu_Item* m = mw.menu->find_shortcut(&item); + if (m) { + setitem(m, mymenu, item); + if (!m->submenu()) pp.state = DONE_STATE; + return 1; + } } } break; @@ -796,60 +794,60 @@ int menuwindow::handle_part1(int e) { int item=0; int mymenu = pp.nummenus-1; // Clicking or dragging outside menu cancels it... if ((!pp.menubar || mymenu) && !pp.is_inside(mx, my)) { - setitem(0, -1, 0); - if (e==FL_PUSH) - pp.state = DONE_STATE; - return 1; + setitem(0, -1, 0); + if (e==FL_PUSH) + pp.state = DONE_STATE; + return 1; } for (mymenu = pp.nummenus-1; ; mymenu--) { - item = pp.p[mymenu]->find_selected(mx, my); - if (item >= 0) - break; - if (mymenu <= 0) { - // buttons in menubars must be deselected if we move outside of them! - if (pp.menu_number==-1 && e==FL_PUSH) { - pp.state = DONE_STATE; - return 1; - } - if (pp.current_item && pp.menu_number==0 && !pp.current_item->submenu()) { - if (e==FL_PUSH) - pp.state = DONE_STATE; - setitem(0, -1, 0); - return 1; - } - // all others can stay selected - return 0; - } + item = pp.p[mymenu]->find_selected(mx, my); + if (item >= 0) + break; + if (mymenu <= 0) { + // buttons in menubars must be deselected if we move outside of them! + if (pp.menu_number==-1 && e==FL_PUSH) { + pp.state = DONE_STATE; + return 1; + } + if (pp.current_item && pp.menu_number==0 && !pp.current_item->submenu()) { + if (e==FL_PUSH) + pp.state = DONE_STATE; + setitem(0, -1, 0); + return 1; + } + // all others can stay selected + return 0; + } } if (my == 0 && item > 0) setitem(mymenu, item - 1); else setitem(mymenu, item); if (e == FL_PUSH) { - if (pp.current_item && pp.current_item->submenu() // this is a menu title - && item != pp.p[mymenu]->selected // and it is not already on - && !pp.current_item->callback_) // and it does not have a callback - pp.state = MENU_PUSH_STATE; - else - pp.state = PUSH_STATE; + if (pp.current_item && pp.current_item->submenu() // this is a menu title + && item != pp.p[mymenu]->selected // and it is not already on + && !pp.current_item->callback_) // and it does not have a callback + pp.state = MENU_PUSH_STATE; + else + pp.state = PUSH_STATE; } } return 1; case FL_RELEASE: // Mouse must either be held down/dragged some, or this must be // the second click (not the one that popped up the menu): - if ( !Fl::event_is_click() - || pp.state == PUSH_STATE + if ( !Fl::event_is_click() + || pp.state == PUSH_STATE || (pp.menubar && pp.current_item && !pp.current_item->submenu()) // button - ) { + ) { #if 0 // makes the check/radio items leave the menu up const Fl_Menu_Item* m = pp.current_item; if (m && button && (m->flags & (FL_MENU_TOGGLE|FL_MENU_RADIO))) { - ((Fl_Menu_*)button)->picked(m); - pp.p[pp.menu_number]->redraw(); + ((Fl_Menu_*)button)->picked(m); + pp.p[pp.menu_number]->redraw(); } else #endif // do nothing if they try to pick inactive items if (!pp.current_item || pp.current_item->activevisible()) - pp.state = DONE_STATE; + pp.state = DONE_STATE; } return 1; } @@ -925,8 +923,8 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( { for (int k = menubar; k < pp.nummenus; k++) { if (!pp.p[k]->shown()) { - if (pp.p[k]->title) pp.p[k]->title->show(); - pp.p[k]->show(); + if (pp.p[k]->title) pp.p[k]->title->show(); + pp.p[k]->show(); } } } @@ -936,7 +934,7 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( const Fl_Menu_Item* oldi = pp.current_item; Fl::wait(); if (pbutton && wp.deleted()) // menu widget has been deleted (STR #3503) - break; + break; if (pp.state == DONE_STATE) break; // done. if (pp.current_item == oldi) continue; } @@ -972,54 +970,54 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( else menutable = (Fl_Menu_Item*)(m)->user_data_; // figure out where new menu goes: int nX, nY; - if (!pp.menu_number && pp.menubar) { // menu off a menubar: - nX = cw.x() + cw.titlex(pp.item_number); - nY = cw.y() + cw.h(); - initial_item = 0; + if (!pp.menu_number && pp.menubar) { // menu off a menubar: + nX = cw.x() + cw.titlex(pp.item_number); + nY = cw.y() + cw.h(); + initial_item = 0; } else { - nX = cw.x() + cw.w(); - nY = cw.y() + pp.item_number * cw.itemheight; - title = 0; + nX = cw.x() + cw.w(); + nY = cw.y() + pp.item_number * cw.itemheight; + title = 0; } if (initial_item) { // bring up submenu containing initial item: - menuwindow* n = new menuwindow(menutable,X,Y,W,H,initial_item,title,0,0,cw.x()); - pp.p[pp.nummenus++] = n; - // move all earlier menus to line up with this new one: - if (n->selected>=0) { - int dy = n->y()-nY; - int dx = n->x()-nX; - int waX, waY, waW, waH; - Fl::screen_work_area(waX, waY, waW, waH, X, Y); - for (int menu = 0; menu <= pp.menu_number; menu++) { - menuwindow* tt = pp.p[menu]; - int nx = tt->x()+dx; if (nx < waX) {nx = waX; dx = -tt->x() + waX;} - int ny = tt->y()+dy; if (ny < waY) {ny = waY; dy = -tt->y() + waY;} - tt->position(nx, ny); - } - setitem(pp.nummenus-1, n->selected); - goto STARTUP; - } + menuwindow* n = new menuwindow(menutable,X,Y,W,H,initial_item,title,0,0,cw.x()); + pp.p[pp.nummenus++] = n; + // move all earlier menus to line up with this new one: + if (n->selected>=0) { + int dy = n->y()-nY; + int dx = n->x()-nX; + int waX, waY, waW, waH; + Fl::screen_work_area(waX, waY, waW, waH, X, Y); + for (int menu = 0; menu <= pp.menu_number; menu++) { + menuwindow* tt = pp.p[menu]; + int nx = tt->x()+dx; if (nx < waX) {nx = waX; dx = -tt->x() + waX;} + int ny = tt->y()+dy; if (ny < waY) {ny = waY; dy = -tt->y() + waY;} + tt->position(nx, ny); + } + setitem(pp.nummenus-1, n->selected); + goto STARTUP; + } } else if (pp.nummenus > pp.menu_number+1 && - pp.p[pp.menu_number+1]->menu == menutable) { - // the menu is already up: - while (pp.nummenus > pp.menu_number+2) delete pp.p[--pp.nummenus]; - pp.p[pp.nummenus-1]->set_selected(-1); + pp.p[pp.menu_number+1]->menu == menutable) { + // the menu is already up: + while (pp.nummenus > pp.menu_number+2) delete pp.p[--pp.nummenus]; + pp.p[pp.nummenus-1]->set_selected(-1); } else { - // delete all the old menus and create new one: - while (pp.nummenus > pp.menu_number+1) delete pp.p[--pp.nummenus]; - pp.p[pp.nummenus++]= new menuwindow(menutable, nX, nY, - title?1:0, 0, 0, title, 0, menubar, - (title ? 0 : cw.x()) ); + // delete all the old menus and create new one: + while (pp.nummenus > pp.menu_number+1) delete pp.p[--pp.nummenus]; + pp.p[pp.nummenus++]= new menuwindow(menutable, nX, nY, + title?1:0, 0, 0, title, 0, menubar, + (title ? 0 : cw.x()) ); } } else { // !m->submenu(): while (pp.nummenus > pp.menu_number+1) delete pp.p[--pp.nummenus]; if (!pp.menu_number && pp.menubar) { - // kludge so "menubar buttons" turn "on" by using menu title: - pp.fakemenu = new menuwindow(0, - cw.x()+cw.titlex(pp.item_number), - cw.y()+cw.h(), 0, 0, - 0, m, 0, 1); - pp.fakemenu->title->show(); + // kludge so "menubar buttons" turn "on" by using menu title: + pp.fakemenu = new menuwindow(0, + cw.x()+cw.titlex(pp.item_number), + cw.y()+cw.h(), 0, 0, + 0, m, 0, 1); + pp.fakemenu->title->show(); } } } @@ -1044,7 +1042,7 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( positioned with the cursor in the top-left corner. \param[in] X,Y the position of the mouse cursor, relative to the - window that got the most recent event (usually you can pass + window that got the most recent event (usually you can pass Fl::event_x() and Fl::event_y() unchanged here). \param[in] title a character string title for the menu. If @@ -1070,10 +1068,10 @@ const Fl_Menu_Item* Fl_Menu_Item::popup( } /** - Search only the top level menu for a shortcut. + Search only the top level menu for a shortcut. Either &x in the label or the shortcut fields are used. - This tests the current event, which must be an FL_KEYBOARD or + This tests the current event, which must be an FL_KEYBOARD or FL_SHORTCUT, against a shortcut value. \param ip returns the index of the item, if \p ip is not NULL. @@ -1086,9 +1084,9 @@ const Fl_Menu_Item* Fl_Menu_Item::find_shortcut(int* ip, const bool require_alt) if (m) for (int ii = 0; m->text; m = next_visible_or_not(m), ii++) { if (m->active()) { if (Fl::test_shortcut(m->shortcut_) - || Fl_Widget::test_shortcut(m->text, require_alt)) { - if (ip) *ip=ii; - return m; + || Fl_Widget::test_shortcut(m->text, require_alt)) { + if (ip) *ip=ii; + return m; } } } @@ -1115,15 +1113,11 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const { // if (Fl_Widget::test_shortcut(m->text)) return m; // only return matches from lower menu if nothing found in top menu: if (!ret && m->submenu()) { - const Fl_Menu_Item* s = - (m->flags&FL_SUBMENU) ? m+1:(const Fl_Menu_Item*)m->user_data_; - ret = s->test_shortcut(); + const Fl_Menu_Item* s = + (m->flags&FL_SUBMENU) ? m+1:(const Fl_Menu_Item*)m->user_data_; + ret = s->test_shortcut(); } } } return ret; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Menu_.cxx b/src/Fl_Menu_.cxx index 171ccb200..f0af2f065 100644 --- a/src/Fl_Menu_.cxx +++ b/src/Fl_Menu_.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Common menu code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,15 +7,15 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // This is a base class for all items that have a menu: -// Fl_Menu_Bar, Fl_Menu_Button, Fl_Choice +// Fl_Menu_Bar, Fl_Menu_Button, Fl_Choice // This provides storage for a menu item, functions to add/modify/delete // items, and a call for when the user picks a menu item. @@ -57,9 +55,9 @@ \endcode \returns - - 0 : OK (name has menuitem's pathname) - - -1 : item not found (name="") - - -2 : 'name' not large enough (name="") + - 0 : OK (name has menuitem's pathname) + - -1 : item not found (name="") + - -2 : 'name' not large enough (name="") \see find_item() */ int Fl_Menu_::item_pathname(char *name, int namelen, const Fl_Menu_Item *finditem) const { @@ -68,61 +66,61 @@ int Fl_Menu_::item_pathname(char *name, int namelen, const Fl_Menu_Item *findite } // INTERNAL: Descend into a specific menu hierarchy -int Fl_Menu_::item_pathname_(char *name, - int namelen, - const Fl_Menu_Item *finditem, - const Fl_Menu_Item *menu) const { +int Fl_Menu_::item_pathname_(char *name, + int namelen, + const Fl_Menu_Item *finditem, + const Fl_Menu_Item *menu) const { int len = 0; int level = 0; - finditem = finditem ? finditem : mvalue(); + finditem = finditem ? finditem : mvalue(); menu = menu ? menu : this->menu(); for ( int t=0; t<size(); t++ ) { const Fl_Menu_Item *m = menu + t; - if (m->submenu()) { // submenu? descend + if (m->submenu()) { // submenu? descend if (m->flags & FL_SUBMENU_POINTER) { // SUBMENU POINTER? Recurse to descend int slen = strlen(name); - const Fl_Menu_Item *submenu = (const Fl_Menu_Item*)m->user_data(); + const Fl_Menu_Item *submenu = (const Fl_Menu_Item*)m->user_data(); if (m->label()) { if (*name) SAFE_STRCAT("/"); - SAFE_STRCAT(m->label()); + SAFE_STRCAT(m->label()); } if (item_pathname_(name, len, finditem, submenu) == 0) - return 0; - name[slen] = 0; // continue from where we were + return 0; + name[slen] = 0; // continue from where we were } else { // REGULAR SUBMENU? DESCEND - ++level; + ++level; if (*name) SAFE_STRCAT("/"); if (m->label()) SAFE_STRCAT(m->label()); - if (m == finditem) return(0); // found? done. + if (m == finditem) return(0); // found? done. } } else { - if (m->label()) { // menu item? - if ( m == finditem ) { // found? tack on itemname, done. - SAFE_STRCAT("/"); - SAFE_STRCAT(m->label()); - return(0); - } - } else { // end of submenu? pop + if (m->label()) { // menu item? + if ( m == finditem ) { // found? tack on itemname, done. + SAFE_STRCAT("/"); + SAFE_STRCAT(m->label()); + return(0); + } + } else { // end of submenu? pop if ( --level < 0 ) { - *name = '\0'; - return -1; - } - char *ss = strrchr(name, '/'); - if ( ss ) { *ss = 0; len = (int) strlen(name); } // "File/Edit" -> "File" - else { name[0] = '\0'; len = 0; } // "File" -> "" - continue; + *name = '\0'; + return -1; + } + char *ss = strrchr(name, '/'); + if ( ss ) { *ss = 0; len = (int) strlen(name); } // "File/Edit" -> "File" + else { name[0] = '\0'; len = 0; } // "File" -> "" + continue; } } } *name = '\0'; - return(-1); // item not found + return(-1); // item not found } /** Find the menu item for a given menu \p pathname, such as "Edit/Copy". - + This method finds a menu item in the menu array, also traversing submenus, but not submenu pointers (FL_SUBMENU_POINTER). @@ -137,16 +135,16 @@ int Fl_Menu_::item_pathname_(char *name, // [..] Fl_Menu_Item *item; if ( ( item = (Fl_Menu_Item*)menubar->find_item("File/&Open") ) != NULL ) { - item->labelcolor(FL_RED); + item->labelcolor(FL_RED); } if ( ( item = (Fl_Menu_Item*)menubar->find_item("Edit/&Copy") ) != NULL ) { - item->labelcolor(FL_GREEN); + item->labelcolor(FL_GREEN); } \endcode \param pathname The path and name of the menu item \returns The item found, or NULL if not found - \see find_index(const char*), find_item(Fl_Callback*), item_pathname() + \see find_index(const char*), find_item(Fl_Callback*), item_pathname() */ const Fl_Menu_Item * Fl_Menu_::find_item(const char *pathname) { int i = find_index(pathname); @@ -187,7 +185,7 @@ int Fl_Menu_::find_index(const Fl_Menu_Item *item) const { /** Find the index into the menu array for a given callback \p cb. - + This method finds a menu item's index position, also traversing submenus, but \b not submenu pointers (FL_SUBMENU_POINTER). This is useful if an application uses internationalisation and a menu item can not be found @@ -206,7 +204,7 @@ int Fl_Menu_::find_index(Fl_Callback *cb) const { /** Find the menu item index for a given menu \p pathname, such as "Edit/Copy". - + This method finds a menu item's index position for the given menu pathname, also traversing submenus, but \b not submenu pointers (FL_SUBMENU_POINTER). @@ -218,7 +216,7 @@ int Fl_Menu_::find_index(Fl_Callback *cb) const { */ int Fl_Menu_::find_index(const char *pathname) const { - char menupath[1024] = ""; // File/Export + char menupath[1024] = ""; // File/Export for ( int t=0; t < size(); t++ ) { Fl_Menu_Item *m = menu_ + t; if (m->flags&FL_SUBMENU) { @@ -229,14 +227,14 @@ int Fl_Menu_::find_index(const char *pathname) const { if (!strcmp(menupath, pathname)) return(t); } else { if (!m->label()) { - // END OF SUBMENU? Pop back one level. - char *ss = strrchr(menupath, '/'); - if ( ss ) *ss = 0; - else menupath[0] = '\0'; - continue; + // END OF SUBMENU? Pop back one level. + char *ss = strrchr(menupath, '/'); + if ( ss ) *ss = 0; + else menupath[0] = '\0'; + continue; } // IT'S A MENU ITEM - char itempath[1024]; // eg. Edit/Copy + char itempath[1024]; // eg. Edit/Copy strcpy(itempath, menupath); if (itempath[0]) strlcat(itempath, "/", sizeof(itempath)); strlcat(itempath, m->label(), sizeof(itempath)); @@ -248,12 +246,12 @@ int Fl_Menu_::find_index(const char *pathname) const { /** Find the menu item for the given callback \p cb. - + This method finds a menu item in a menu array, also traversing submenus, but - not submenu pointers. This is useful if an application uses + not submenu pointers. This is useful if an application uses internationalisation and a menu item can not be found using its label. This search is also much faster. - + \param[in] cb find the first item with this callback \returns The item found, or NULL if not found \see find_item(const char*) @@ -280,7 +278,7 @@ int Fl_Menu_::value(const Fl_Menu_Item* m) { return 0; } -/** +/** When user picks a menu item, call this. It will do the callback. Unfortunately this also casts away const for the checkboxes, but this was necessary so non-checkbox menus can really be declared const... @@ -303,8 +301,8 @@ const Fl_Menu_Item* Fl_Menu_::picked(const Fl_Menu_Item* v) { value_ = v; if (when()&(FL_WHEN_CHANGED|FL_WHEN_RELEASE)) { if (changed() || when()&FL_WHEN_NOT_CHANGED) { - if (value_ && value_->callback_) value_->do_callback((Fl_Widget*)this); - else do_callback(); + if (value_ && value_->callback_) value_->do_callback((Fl_Widget*)this); + else do_callback(); } } } @@ -347,7 +345,7 @@ void Fl_Menu_::setonly(Fl_Menu_Item* item) { if (!first) return; // item does not belong to our menu item->flags |= FL_MENU_RADIO | FL_MENU_VALUE; Fl_Menu_Item* j; - for (j = item; ; ) { // go down + for (j = item; ; ) { // go down if (j->flags & FL_MENU_DIVIDER) break; // stop on divider lines j++; if (!j->text || !j->radio()) break; // stop after group @@ -367,7 +365,7 @@ void Fl_Menu_::setonly(Fl_Menu_Item* item) { void Fl_Menu_Item::setonly() { flags |= FL_MENU_RADIO | FL_MENU_VALUE; Fl_Menu_Item* j; - for (j = this; ; ) { // go down + for (j = this; ; ) { // go down if (j->flags & FL_MENU_DIVIDER) break; // stop on divider lines j++; if (!j->text || !j->radio()) break; // stop after group @@ -422,10 +420,10 @@ void Fl_Menu_::menu(const Fl_Menu_Item* m) { // this version is ok with new Fl_Menu_add code with fl_menu_array_owner: -/** - Sets the menu array pointer with a copy of m that will be automatically deleted. +/** + Sets the menu array pointer with a copy of m that will be automatically deleted. If userdata \p ud is not NULL, then all user data pointers are changed in the menus as well. - See void Fl_Menu_::menu(const Fl_Menu_Item* m). + See void Fl_Menu_::menu(const Fl_Menu_Item* m). */ void Fl_Menu_::copy(const Fl_Menu_Item* m, void* ud) { int n = m->size(); @@ -451,7 +449,7 @@ Fl_Menu_* fl_menu_array_owner = 0; /** Same as menu(NULL), set the array pointer to null, indicating a zero-length menu. - + Menus must not be cleared during a callback to the same menu. */ void Fl_Menu_::clear() { @@ -476,9 +474,9 @@ void Fl_Menu_::clear() { that shows the last few files that have been opened. The specified \p index must point to a submenu. - + The submenu is cleared with remove(). - If the menu array was directly set with menu(x), then copy() + If the menu array was directly set with menu(x), then copy() is done to make a private array. \warning Since this method can change the internal menu array, any menu @@ -501,14 +499,10 @@ void Fl_Menu_::clear() { int Fl_Menu_::clear_submenu(int index) { if ( index < 0 || index >= size() ) return(-1); if ( ! (menu_[index].flags & FL_SUBMENU) ) return(-1); - ++index; // advance to first item in submenu + ++index; // advance to first item in submenu while ( index < size() ) { // keep remove()ing top item until end is reached - if ( menu_[index].text == 0 ) break; // end of this submenu? done - remove(index); // remove items/submenus + if ( menu_[index].text == 0 ) break; // end of this submenu? done + remove(index); // remove items/submenus } return(0); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Menu_Bar.cxx b/src/Fl_Menu_Bar.cxx index 3bf1a8f8d..ebb97b7ca 100644 --- a/src/Fl_Menu_Bar.cxx +++ b/src/Fl_Menu_Bar.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu bar widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -66,10 +64,6 @@ int Fl_Menu_Bar::handle(int event) { Fl_Menu_Bar::Fl_Menu_Bar(int X, int Y, int W, int H,const char *l) -: Fl_Menu_(X,Y,W,H,l) +: Fl_Menu_(X,Y,W,H,l) { } - -// -// End of "$Id$". -// diff --git a/src/Fl_Menu_Button.cxx b/src/Fl_Menu_Button.cxx index 0a5099b2c..5b69ea703 100644 --- a/src/Fl_Menu_Button.cxx +++ b/src/Fl_Menu_Button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu button widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -21,7 +19,7 @@ #include <FL/fl_draw.H> -static Fl_Menu_Button *pressed_menu_button_ = 0; +static Fl_Menu_Button *pressed_menu_button_ = 0; void Fl_Menu_Button::draw() { @@ -108,14 +106,10 @@ int Fl_Menu_Button::handle(int e) { /** Creates a new Fl_Menu_Button widget using the given position, size, and label string. The default boxtype is FL_UP_BOX. - <P>The constructor sets menu() to NULL. See + <P>The constructor sets menu() to NULL. See Fl_Menu_ for the methods to set or change the menu. */ Fl_Menu_Button::Fl_Menu_Button(int X,int Y,int W,int H,const char *l) : Fl_Menu_(X,Y,W,H,l) { down_box(FL_NO_BOX); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Menu_Window.cxx b/src/Fl_Menu_Window.cxx index c6a04ad16..559dbe533 100644 --- a/src/Fl_Menu_Window.cxx +++ b/src/Fl_Menu_Window.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu window code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // This is the window type used by Fl_Menu to make the pop-ups. @@ -54,18 +52,13 @@ Fl_Menu_Window::~Fl_Menu_Window() { Fl_Menu_Window::Fl_Menu_Window(int W, int H, const char *l) -: Fl_Single_Window(W,H,l) -{ - image(0); +: Fl_Single_Window(W,H,l) +{ + image(0); } Fl_Menu_Window::Fl_Menu_Window(int X, int Y, int W, int H, const char *l) -: Fl_Single_Window(X,Y,W,H,l) { - image(0); +: Fl_Single_Window(X,Y,W,H,l) { + image(0); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Menu_add.cxx b/src/Fl_Menu_add.cxx index b8954c9f0..9e0ba77e5 100644 --- a/src/Fl_Menu_add.cxx +++ b/src/Fl_Menu_add.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menu utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Methods to alter the menu in an Fl_Menu_ widget. @@ -70,7 +68,7 @@ static Fl_Menu_Item* array_insert( m->user_data_ = 0; m->flags = flags; m->labeltype_ = m->labelsize_ = m->labelcolor_ = 0; - m->labelfont_ = FL_HELVETICA; + m->labelfont_ = FL_HELVETICA; return array; } @@ -105,31 +103,31 @@ static int compare(const char* a, const char* b) { int Fl_Menu_Item::add( const char *mytext, int sc, - Fl_Callback *cb, + Fl_Callback *cb, void *data, int myflags ) { - return(insert(-1,mytext,sc,cb,data,myflags)); // -1: append + return(insert(-1,mytext,sc,cb,data,myflags)); // -1: append } -/** +/** Inserts an item at position \p index. - + If \p index is -1, the item is added the same way as Fl_Menu_Item::add(). - If 'mytext' contains any un-escaped front slashes (/), it's assumed - a menu pathname is being specified, and the value of \p index + If 'mytext' contains any un-escaped front slashes (/), it's assumed + a menu pathname is being specified, and the value of \p index will be ignored. In all other aspects, the behavior of insert() is the same as add(). - - \param[in] index insert new items here - \param[in] mytext new label string, details see above - \param[in] sc keyboard shortcut for new item - \param[in] cb callback function for new item - \param[in] data user data for new item - \param[in] myflags menu flags as described in FL_Menu_Item + + \param[in] index insert new items here + \param[in] mytext new label string, details see above + \param[in] sc keyboard shortcut for new item + \param[in] cb callback function for new item + \param[in] data user data for new item + \param[in] myflags menu flags as described in FL_Menu_Item \returns the index into the menu() array, where the entry was added */ @@ -137,7 +135,7 @@ int Fl_Menu_Item::insert( int index, const char *mytext, int sc, - Fl_Callback *cb, + Fl_Callback *cb, void *data, int myflags ) { @@ -182,7 +180,7 @@ int Fl_Menu_Item::insert( msize++; m = array+n; } - m++; /* go into the submenu */ + m++; /* go into the submenu */ flags1 = 0; } @@ -190,7 +188,7 @@ int Fl_Menu_Item::insert( for (; m->text; m = m->next()) if (!(m->flags&FL_SUBMENU) && !compare(m->text,item)) break; - if (!m->text) { /* add a new menu item */ + if (!m->text) { /* add a new menu item */ int n = (index==-1) ? (int) (m-array) : index; array = array_insert(array, msize, n, item, myflags|flags1); msize++; @@ -215,21 +213,21 @@ int Fl_Menu_Item::insert( /** Adds a new menu item. - \param[in] label The text label for the menu item. - \param[in] shortcut Optional keyboard shortcut that can be an int or string: - (FL_CTRL+'a') or "^a". Default 0 if none. - \param[in] callback Optional callback invoked when user clicks the item. - Default 0 if none. - \param[in] userdata Optional user data passed as an argument to the callback. - Default 0 if none. - \param[in] flags Optional flags that control the type of menu item; - see below. Default is 0 for none. - \returns The index into the menu() array, where the entry was added. + \param[in] label The text label for the menu item. + \param[in] shortcut Optional keyboard shortcut that can be an int or string: + (FL_CTRL+'a') or "^a". Default 0 if none. + \param[in] callback Optional callback invoked when user clicks the item. + Default 0 if none. + \param[in] userdata Optional user data passed as an argument to the callback. + Default 0 if none. + \param[in] flags Optional flags that control the type of menu item; + see below. Default is 0 for none. + \returns The index into the menu() array, where the entry was added. \par Description - If the menu array was directly set with menu(x), then copy() is done + If the menu array was directly set with menu(x), then copy() is done to make a private array. - \par + \par Since this method can change the internal menu array, any menu item pointers or indices the application may have cached can become stale, and should be recalculated/refreshed. @@ -240,27 +238,27 @@ int Fl_Menu_Item::insert( \par label The menu item's label. This argument is required and must not be NULL. \par - The characters "&", "/", "\", and "_" are treated as special characters in the label string. + The characters "&", "/", "\", and "_" are treated as special characters in the label string. The "&" character specifies that the following character is an accelerator and will be underlined. - The "\" character is used to escape the next character in the string. + The "\" character is used to escape the next character in the string. Labels starting with the "_" character cause a divider to be placed after that menu item. - \par + \par A label of the form "File/Quit" will create the submenu "File" with a menu item called "Quit". The "/" character is ignored if it appears as the first character of the label string, e.g. "/File/Quit". - \par + \par The label string is copied to new memory and can be freed. The other arguments (including the shortcut) are copied into the menu item unchanged. - \par + \par If an item exists already with that name then it is replaced with this new one. Otherwise this new one is added to the end of the correct menu or submenu. The return value is the offset into the array that the new entry was placed at. - + \par shortcut - The keyboard shortcut for this menu item. - \par + The keyboard shortcut for this menu item. + \par This parameter is optional, and defaults to 0 to indicate no shortcut. \par The shortcut can either be a raw integer value (eg. FL_CTRL+'A') @@ -293,20 +291,20 @@ int Fl_Menu_Item::insert( fl_old_shortcut(const char*). \par callback - The callback to invoke when this menu item is selected. - \par + The callback to invoke when this menu item is selected. + \par This parameter is optional, and defaults to 0 for no callback. \par userdata - The callback's 'user data' that is passed to the callback. - \par + The callback's 'user data' that is passed to the callback. + \par This parameter is optional, and defaults to 0. \par flags - These are bit flags to define what kind of menu item this is. + These are bit flags to define what kind of menu item this is. \par This parameter is optional, and defaults to 0 to define a 'regular' menu item. - \par + \par These flags can be 'OR'ed together: \code FL_MENU_INACTIVE // Deactivate menu item (gray out) @@ -325,11 +323,11 @@ int Fl_Menu_Item::insert( set to 0. If you add submenus with the 'path' technique, then the corresponding submenu terminators (maybe more than one) are added as well. - \todo Raw integer shortcut needs examples. + \todo Raw integer shortcut needs examples. Dependent on responses to http://fltk.org/newsgroups.php?gfltk.development+v:10086 and results of STR#2344 */ int Fl_Menu_::add(const char *label,int shortcut,Fl_Callback *callback,void *userdata,int flags) { - return(insert(-1,label,shortcut,callback,userdata,flags)); // -1: append + return(insert(-1,label,shortcut,callback,userdata,flags)); // -1: append } @@ -339,25 +337,25 @@ int Fl_Menu_::add(const char *label,int shortcut,Fl_Callback *callback,void *use If \p index is -1, the menu item is appended; same behavior as add(). To properly insert a menu item, \p label must be the name of the item (eg. "Quit"), - and not a 'menu pathname' (eg. "File/Quit"). If a menu pathname is specified, + and not a 'menu pathname' (eg. "File/Quit"). If a menu pathname is specified, the value of \p index is \em ignored, the new item's position defined by the pathname. - + For more details, see add(). Except for the \p index parameter, add() has more detailed information on parameters and behavior, and is functionally equivalent. \param[in] index The menu array's index position where the new item is inserted. If -1, behavior is the same as add(). - \param[in] label The text label for the menu item. If the label + \param[in] label The text label for the menu item. If the label is a menu pathname, \p index is ignored, and the pathname - indicates the position of the new item. + indicates the position of the new item. \param[in] shortcut Optional keyboard shortcut. Can be an int (FL_CTRL+'a') or a string ("^a"). Default is 0. \param[in] callback Optional callback invoked when user clicks the item. Default 0 if none. \param[in] userdata Optional user data passed as an argument to the callback. Default 0 if none. - \param[in] flags Optional flags that control the type of menu item; + \param[in] flags Optional flags that control the type of menu item; see add() for more info. Default is 0 for none. \returns The index into the menu() array, where the entry was added. @@ -388,10 +386,10 @@ int Fl_Menu_::insert( // start with a blank array: alloc = 2; // indicates that the strings can be freed if (local_array) { - menu_ = local_array; + menu_ = local_array; } else { - local_array_alloc = 15; - local_array = menu_ = new Fl_Menu_Item[local_array_alloc]; + local_array_alloc = 15; + local_array = menu_ = new Fl_Menu_Item[local_array_alloc]; memset(local_array, 0, sizeof(Fl_Menu_Item) * local_array_alloc); } memset(menu_, 0, sizeof(Fl_Menu_Item)); @@ -421,7 +419,7 @@ int Fl_Menu_::insert( same special characters as described for the long version of add(). No items must be added to a menu during a callback to the same menu. - + \param str string containing multiple menu labels as described above \returns the index into the menu() array, where the entry was added */ @@ -448,7 +446,7 @@ int Fl_Menu_::add(const char *str) { Changes the text of item \p i. This is the only way to get slash into an add()'ed menu item. If the menu array was directly set with menu(x) then copy() is done to make a private array. - + \param i index into menu array \param str new label for menu item at index i */ @@ -467,9 +465,9 @@ void Fl_Menu_::replace(int i, const char *str) { /** Deletes item \p i from the menu. If the menu array was directly set with menu(x) then copy() is done to make a private array. - + No items must be removed from a menu during a callback to the same menu. - + \param i index into menu array */ void Fl_Menu_::remove(int i) { @@ -526,7 +524,3 @@ const Fl_Menu_Item *Fl_Menu_::menu_end() { } return menu_; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Menu_global.cxx b/src/Fl_Menu_global.cxx index d73a83515..4a15f6e37 100644 --- a/src/Fl_Menu_global.cxx +++ b/src/Fl_Menu_global.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Global menu shortcut code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Make all the shortcuts in this menu global. @@ -33,19 +31,15 @@ static int handler(int e) { /** Make the shortcuts for this menu work no matter what window has the - focus when you type it. This is done by using + focus when you type it. This is done by using Fl::add_handler(). This Fl_Menu_ widget does not have to be visible (ie the window it is in can be hidden, or it does not have to be put in a window at all). <P>Currently there can be only one global()menu. Setting a new - one will replace the old one. There is no way to remove the + one will replace the old one. There is no way to remove the global() setting (so don't destroy the widget!) */ void Fl_Menu_::global() { if (!the_widget) Fl::add_handler(handler); the_widget = this; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Multi_Label.cxx b/src/Fl_Multi_Label.cxx index 1a9050494..72074bc12 100644 --- a/src/Fl_Multi_Label.cxx +++ b/src/Fl_Multi_Label.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Multi-label widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Allows two or more labels to be used on a widget (by having one of them @@ -69,7 +67,3 @@ void Fl_Multi_Label::label(Fl_Widget* o) { void Fl_Multi_Label::label(Fl_Menu_Item* o) { o->label(FL_MULTI_LABEL, (const char*)this); // calls fl_define_FL_MULTI_LABEL() } - -// -// End of "$Id$". -// diff --git a/src/Fl_Native_File_Chooser.cxx b/src/Fl_Native_File_Chooser.cxx index b3f824ffb..b2b499c36 100644 --- a/src/Fl_Native_File_Chooser.cxx +++ b/src/Fl_Native_File_Chooser.cxx @@ -1,4 +1,3 @@ -// "$Id$" // // FLTK native OS file chooser widget // @@ -9,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -186,7 +185,7 @@ int Fl_Native_File_Chooser::filters() const { /** Sets which filter will be initially selected. - + The first filter is indexed as 0. If filter_value()==filters(), then "All Files" was chosen. If filter_value() > filters(), then a custom filter was set. @@ -271,21 +270,21 @@ char *Fl_Native_File_Chooser_Driver::strfree(char *val) { // 'val' can be NULL; s is returned unmodified. // // Usage: -// char *s = strnew("foo"); // s = "foo" -// s = strapp(s, "bar"); // s = "foobar" +// char *s = strnew("foo"); // s = "foo" +// s = strapp(s, "bar"); // s = "foobar" // char *Fl_Native_File_Chooser_Driver::strapp(char *s, const char *val) { if ( ! val ) { - return(s); // Nothing to append? return s + return(s); // Nothing to append? return s } if ( ! s ) { - return(strnew(val)); // New string? return copy of val + return(strnew(val)); // New string? return copy of val } char *news = new char[strlen(s)+strlen(val)+1]; strcpy(news, s); strcat(news, val); - delete [] s; // delete old string - return(news); // return new copy + delete [] s; // delete old string + return(news); // return new copy } // APPEND A CHARACTER TO A STRING @@ -300,7 +299,3 @@ void Fl_Native_File_Chooser_Driver::chrcat(char *s, char c) { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Native_File_Chooser_FLTK.cxx b/src/Fl_Native_File_Chooser_FLTK.cxx index ef5ce5d95..144ca950d 100644 --- a/src/Fl_Native_File_Chooser_FLTK.cxx +++ b/src/Fl_Native_File_Chooser_FLTK.cxx @@ -1,6 +1,5 @@ -// "$Id$" // -// FLTK native file chooser widget wrapper for GTK's GtkFileChooserDialog +// FLTK native file chooser widget wrapper for GTK's GtkFileChooserDialog // // Copyright 1998-2014 by Bill Spitzak and others. // Copyright 2012 IMM @@ -9,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -44,10 +43,10 @@ Fl_Native_File_Chooser_FLTK_Driver::Fl_Native_File_Chooser_FLTK_Driver(int val) _file_chooser= NULL; if (val >= 0) { _file_chooser = new Fl_File_Chooser(NULL, NULL, 0, NULL); - type(val); // do this after _file_chooser created + type(val); // do this after _file_chooser created } _nfilters = 0; -} +} Fl_Native_File_Chooser_FLTK_Driver::~Fl_Native_File_Chooser_FLTK_Driver() { delete _file_chooser; @@ -133,8 +132,8 @@ int Fl_Native_File_Chooser_FLTK_Driver::show() { // OPTIONS: NEW FOLDER if ( options() & Fl_Native_File_Chooser::NEW_FOLDER ) - _file_chooser->type(_file_chooser->type() | Fl_File_Chooser::CREATE); // on - + _file_chooser->type(_file_chooser->type() | Fl_File_Chooser::CREATE); // on + // SHOW _file_chooser->show(); @@ -236,22 +235,22 @@ const char *Fl_Native_File_Chooser_FLTK_Driver::directory() const { // for freeing with strfree(). // void Fl_Native_File_Chooser_FLTK_Driver::parse_filter() { - _parsedfilt = strfree(_parsedfilt); // clear previous parsed filter (if any) + _parsedfilt = strfree(_parsedfilt); // clear previous parsed filter (if any) _nfilters = 0; char *in = _filter; if ( !in ) return; int has_name = strchr(in, '\t') ? 1 : 0; - char mode = has_name ? 'n' : 'w'; // parse mode: n=title, w=wildcard - char wildcard[1024] = ""; // parsed wildcard + char mode = has_name ? 'n' : 'w'; // parse mode: n=title, w=wildcard + char wildcard[1024] = ""; // parsed wildcard char name[1024] = ""; // Parse filter user specified for ( ; 1; in++ ) { /*** DEBUG printf("WORKING ON '%c': mode=<%c> name=<%s> wildcard=<%s>\n", - *in, mode, name, wildcard); + *in, mode, name, wildcard); ***/ switch (*in) { @@ -259,40 +258,40 @@ void Fl_Native_File_Chooser_FLTK_Driver::parse_filter() { case '\t': if ( mode != 'n' ) goto regchar; mode = 'w'; - break; + break; // ESCAPE NEXT CHAR case '\\': - ++in; - goto regchar; + ++in; + goto regchar; // FINISHED PARSING ONE OF POSSIBLY SEVERAL FILTERS? case '\r': case '\n': case '\0': - // APPEND NEW FILTER TO LIST - if ( wildcard[0] ) { - // OUT: "name(wild)\tname(wild)" - char comp[2048]; - sprintf(comp, "%s%.511s(%.511s)", ((_parsedfilt)?"\t":""), - name, wildcard); - _parsedfilt = strapp(_parsedfilt, comp); - _nfilters++; - //DEBUG printf("DEBUG: PARSED FILT NOW <%s>\n", _parsedfilt); - } - // RESET - wildcard[0] = name[0] = '\0'; - mode = strchr(in, '\t') ? 'n' : 'w'; - // DONE? - if ( *in == '\0' ) return; // done - else continue; // not done yet, more filters + // APPEND NEW FILTER TO LIST + if ( wildcard[0] ) { + // OUT: "name(wild)\tname(wild)" + char comp[2048]; + sprintf(comp, "%s%.511s(%.511s)", ((_parsedfilt)?"\t":""), + name, wildcard); + _parsedfilt = strapp(_parsedfilt, comp); + _nfilters++; + //DEBUG printf("DEBUG: PARSED FILT NOW <%s>\n", _parsedfilt); + } + // RESET + wildcard[0] = name[0] = '\0'; + mode = strchr(in, '\t') ? 'n' : 'w'; + // DONE? + if ( *in == '\0' ) return; // done + else continue; // not done yet, more filters // Parse all other chars - default: // handle all non-special chars - regchar: // handle regular char - switch ( mode ) { - case 'n': chrcat(name, *in); continue; - case 'w': chrcat(wildcard, *in); continue; - } - break; + default: // handle all non-special chars + regchar: // handle regular char + switch ( mode ) { + case 'n': chrcat(name, *in); continue; + case 'w': chrcat(wildcard, *in); continue; + } + break; } } //NOTREACHED @@ -315,7 +314,3 @@ int Fl_Native_File_Chooser_FLTK_Driver::exist_dialog() { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx index 4195ef9bf..4de7343b6 100644 --- a/src/Fl_Native_File_Chooser_GTK.cxx +++ b/src/Fl_Native_File_Chooser_GTK.cxx @@ -1,6 +1,5 @@ -// "$Id$" // -// FLTK native file chooser widget wrapper for GTK's GtkFileChooserDialog +// FLTK native file chooser widget wrapper for GTK's GtkFileChooserDialog // // Copyright 1998-2018 by Bill Spitzak and others. // Copyright 2012 IMM @@ -9,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -31,11 +30,11 @@ /* --------------------- Type definitions from GLIB and GTK --------------------- */ /* all of this is from the public gnome API, so unlikely to change */ -#ifndef FALSE -#define FALSE (0) +#ifndef FALSE +#define FALSE (0) #endif -#ifndef TRUE -#define TRUE (!FALSE) +#ifndef TRUE +#define TRUE (!FALSE) #endif typedef void* gpointer; typedef int gint; @@ -49,7 +48,7 @@ struct _GSList gpointer data; GSList *next; }; -#define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL) +#define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL) typedef struct _GtkWidget GtkWidget; typedef struct _GtkFileChooser GtkFileChooser; typedef struct _GtkDialog GtkDialog; @@ -69,7 +68,7 @@ typedef enum { struct _GtkFileFilterInfo { GtkFileFilterFlags contains; - + const gchar *filename; const gchar *uri; const gchar *display_name; @@ -93,10 +92,10 @@ const int GTK_RESPONSE_ACCEPT = -3; const int GTK_RESPONSE_DELETE_EVENT = -4; const int GTK_RESPONSE_CANCEL = -6; typedef void (*GCallback)(void); -#define G_CALLBACK(f) ((GCallback) (f)) +#define G_CALLBACK(f) ((GCallback) (f)) typedef int GConnectFlags; -typedef struct _GClosure GClosure; -typedef void (*GClosureNotify)(gpointer data, GClosure *closure); +typedef struct _GClosure GClosure; +typedef void (*GClosureNotify)(gpointer data, GClosure *closure); /* --------------------- End of Type definitions from GLIB and GTK --------------------- */ @@ -123,7 +122,7 @@ private: 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_Native_File_Chooser_Driver(int val); virtual ~Fl_GTK_Native_File_Chooser_Driver(); @@ -137,7 +136,7 @@ private: 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_Native_File_Chooser_Driver::pair*); static void free_pair(pair *p); Fl_Preferences gtk_chooser_prefs; @@ -242,8 +241,8 @@ static XX_gtk_file_filter_add_pattern fl_gtk_file_filter_add_pattern = NULL; // void gtk_file_filter_add_custom(GtkFileFilter *filter, GtkFileFilterFlags needed, // GtkFileFilterFunc func, gpointer data, GDestroyNotify notify); typedef void (*XX_gtk_file_filter_add_custom)(GtkFileFilter *filter, GtkFileFilterFlags needed, - GtkFileFilterFunc func, gpointer data, - GDestroyNotify notify); + GtkFileFilterFunc func, gpointer data, + GDestroyNotify notify); static XX_gtk_file_filter_add_custom fl_gtk_file_filter_add_custom = NULL; // void gtk_file_filter_set_name(GtkFileFilter*, const gchar*); @@ -355,7 +354,7 @@ int Fl_GTK_Native_File_Chooser_Driver::have_looked_for_GTK_libs = 0; Fl_GTK_Native_File_Chooser_Driver::Fl_GTK_Native_File_Chooser_Driver(int val) : Fl_Native_File_Chooser_FLTK_Driver(-1), gtk_chooser_prefs(Fl_Preferences::USER, "fltk.org", "fltk/GTK-file-chooser") { - gtkw_ptr = NULL; // used to hold a GtkWidget* + gtkw_ptr = NULL; // used to hold a GtkWidget* gtkw_slist = NULL; // will hold the returned file names in a multi-selection... gtkw_count = 0; // How many items were selected? gtkw_filename = NULL; // holds the last name we read back in a single file selection... @@ -368,7 +367,7 @@ gtk_chooser_prefs(Fl_Preferences::USER, "fltk.org", "fltk/GTK-file-chooser") Fl_GTK_Native_File_Chooser_Driver::~Fl_GTK_Native_File_Chooser_Driver() { // Should free up resources taken for... - if(gtkw_ptr) { + if(gtkw_ptr) { fl_gtk_widget_destroy (gtkw_ptr); gtkw_ptr = NULL; } @@ -456,7 +455,7 @@ void Fl_GTK_Native_File_Chooser_Driver::changed_output_type(const char *filter) delete[] r; } -/* Filters files before display in chooser. +/* Filters files before display in chooser. Also used to detect when the filter just changed */ gboolean Fl_GTK_Native_File_Chooser_Driver::custom_gtk_filter_function(const GtkFileFilterInfo *info, Fl_GTK_Native_File_Chooser_Driver::pair* p) { @@ -557,10 +556,10 @@ static void update_preview_cb(GtkFileChooser *file_chooser, GtkImage* gtkimg) Fl_Shared_Image *img = NULL; char *preview_text = NULL; char *filename = NULL; - + fl_gtk_widget_set_sensitive(plus_button, false); fl_gtk_widget_set_sensitive(minus_button, false); - + if (Fl_GTK_Native_File_Chooser_Driver::want_preview) filename = fl_gtk_file_chooser_get_preview_filename(file_chooser); // 2.4 if (filename) { if (!fl_filename_isdir(filename)) { @@ -640,7 +639,7 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() fl_gtk_widget_destroy (gtkw_ptr); gtkw_ptr = NULL; } - + // set the dialog action type GtkFileChooserAction gtw_action_type; switch (_btype) { @@ -648,15 +647,15 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() case Fl_Native_File_Chooser::BROWSE_MULTI_DIRECTORY: gtw_action_type = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER; break; - + case Fl_Native_File_Chooser::BROWSE_SAVE_FILE: gtw_action_type = GTK_FILE_CHOOSER_ACTION_SAVE; break; - + case Fl_Native_File_Chooser::BROWSE_SAVE_DIRECTORY: gtw_action_type = GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER; break; - + case Fl_Native_File_Chooser::BROWSE_MULTI_FILE: case Fl_Native_File_Chooser::BROWSE_FILE: default: @@ -665,26 +664,26 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() } // create a new dialog gtkw_ptr = fl_gtk_file_chooser_dialog_new (gtkw_title, - NULL, /* parent_window */ - gtw_action_type, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - gtw_action_type == GTK_FILE_CHOOSER_ACTION_SAVE || gtw_action_type == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ? - GTK_STOCK_SAVE : GTK_STOCK_OPEN, - GTK_RESPONSE_ACCEPT, - NULL); + NULL, /* parent_window */ + gtw_action_type, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + gtw_action_type == GTK_FILE_CHOOSER_ACTION_SAVE || gtw_action_type == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ? + GTK_STOCK_SAVE : GTK_STOCK_OPEN, + GTK_RESPONSE_ACCEPT, + NULL); // did we create a valid dialog widget? if(!gtkw_ptr) { // fail return -1; } - + // set the dialog properties switch (_btype) { case Fl_Native_File_Chooser::BROWSE_MULTI_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_MULTI_FILE: fl_gtk_file_chooser_set_select_multiple((GtkFileChooser *)gtkw_ptr, TRUE); break; - + case Fl_Native_File_Chooser::BROWSE_SAVE_FILE: if (_preset_file)fl_gtk_file_chooser_set_current_name ((GtkFileChooser *)gtkw_ptr, fl_filename_name(_preset_file)); /* FALLTHROUGH */ @@ -692,13 +691,13 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() fl_gtk_file_chooser_set_create_folders((GtkFileChooser *)gtkw_ptr, TRUE); fl_gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser *)gtkw_ptr, (_options & Fl_Native_File_Chooser::SAVEAS_CONFIRM)?TRUE:FALSE); break; - + case Fl_Native_File_Chooser::BROWSE_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_FILE: default: break; } - + if (_directory && _directory[0]) { p = extract_dir_from_path(_directory); if (p) fl_gtk_file_chooser_set_current_folder((GtkFileChooser *)gtkw_ptr, p); @@ -707,7 +706,7 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() p = extract_dir_from_path(_preset_file); if (p) fl_gtk_file_chooser_set_current_folder((GtkFileChooser *)gtkw_ptr, p); } - + GtkFileFilter **filter_tab = NULL; if (_parsedfilt) { filter_tab = new GtkFileFilter*[_nfilters]; @@ -719,11 +718,11 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() fl_gtk_file_filter_set_name(filter_tab[count], p); p = strchr(p, '(') + 1; char *q = strchr(p, ')'); *q = 0; - fl_gtk_file_filter_add_custom(filter_tab[count], - GTK_FILE_FILTER_FILENAME, - (GtkFileFilterFunc)Fl_GTK_Native_File_Chooser_Driver::custom_gtk_filter_function, - new Fl_GTK_Native_File_Chooser_Driver::pair(this, p), - (GDestroyNotify)Fl_GTK_Native_File_Chooser_Driver::free_pair); + fl_gtk_file_filter_add_custom(filter_tab[count], + GTK_FILE_FILTER_FILENAME, + (GtkFileFilterFunc)Fl_GTK_Native_File_Chooser_Driver::custom_gtk_filter_function, + new Fl_GTK_Native_File_Chooser_Driver::pair(this, p), + (GDestroyNotify)Fl_GTK_Native_File_Chooser_Driver::free_pair); fl_gtk_file_chooser_add_filter((GtkFileChooser *)gtkw_ptr, filter_tab[count]); p = strtok(NULL, "\t"); count++; @@ -738,7 +737,7 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() fl_gtk_file_chooser_add_filter((GtkFileChooser *)gtkw_ptr, gfilter); } } - + // extra buttons "Show hidden" [+ "Preview" before it if fl_register_images() was called] GtkWidget *show_hidden_button = fl_gtk_check_button_new_with_label(Fl_File_Chooser::hidden_label); fl_g_signal_connect_data(show_hidden_button, "toggled", G_CALLBACK(hidden_files_cb), gtkw_ptr, NULL, (GConnectFlags) 0); @@ -760,7 +759,7 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() minus_button = fl_gtk_button_new_with_label(">---<"); fl_g_signal_connect_data(minus_button, "clicked", G_CALLBACK(minus_cb), preview, NULL, (GConnectFlags) 0); fl_gtk_table_attach_defaults(table, minus_button, 2,3, 0, 1); - + fl_gtk_table_attach_defaults(table, show_hidden_button, 3, 4, 0, 1); extra = (GtkWidget*)table; } @@ -775,7 +774,7 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() } gboolean state = fl_gtk_file_chooser_get_show_hidden((GtkFileChooser *)gtkw_ptr); fl_gtk_toggle_button_set_active((GtkToggleButton *)show_hidden_button, state); - + gint response_id = GTK_RESPONSE_NONE; fl_g_signal_connect_data(gtkw_ptr, "response", G_CALLBACK(run_response_handler), &response_id, NULL, (GConnectFlags) 0); while (response_id == GTK_RESPONSE_NONE) { // loop that shows the GTK dialog window @@ -790,16 +789,16 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() if ( xevent.type == Expose || xevent.type == ConfigureNotify ) fl_handle(xevent); } Fl::flush(); // do the drawings needed after Expose events - } - + } + if (response_id == GTK_RESPONSE_ACCEPT) { if (_parsedfilt) { GtkFileFilter *gfilter = fl_gtk_file_chooser_get_filter((GtkFileChooser *)gtkw_ptr); for (_filtvalue = 0; _filtvalue < _nfilters; _filtvalue++) { - if (filter_tab[_filtvalue] == gfilter) break; + if (filter_tab[_filtvalue] == gfilter) break; } } - + // discard any filenames or lists from previous calls if(gtkw_filename) { fl_g_free(gtkw_filename); @@ -815,7 +814,7 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() gtkw_slist = NULL; } gtkw_count = 0; // assume we have no files selected now - + if(fl_gtk_file_chooser_get_select_multiple((GtkFileChooser *)gtkw_ptr) == FALSE) { gtkw_filename = fl_gtk_file_chooser_get_filename ((GtkFileChooser *)gtkw_ptr); if (gtkw_filename) { @@ -828,7 +827,7 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() gtkw_slist = fl_gtk_file_chooser_get_filenames((GtkFileChooser *)gtkw_ptr); gtkw_count = fl_g_slist_length((GSList *)gtkw_slist); if(gtkw_count) result = 0; - + // puts("multiple"); // GSList *iter = (GSList *)gtkw_slist; // printf ("Selected %d files\n", gtkw_count); @@ -842,11 +841,11 @@ int Fl_GTK_Native_File_Chooser_Driver::fl_gtk_chooser_wrapper() delete[] filter_tab; if ( response_id == GTK_RESPONSE_DELETE_EVENT) gtkw_ptr = NULL; else fl_gtk_widget_hide (gtkw_ptr); - + // I think this is analogus to doing an Fl::check() - we need this here to make sure // the GtkFileChooserDialog is removed from the display correctly - while (fl_gtk_events_pending ()) fl_gtk_main_iteration (); - + while (fl_gtk_events_pending ()) fl_gtk_main_iteration (); + return result; } // fl_gtk_chooser_wrapper @@ -926,7 +925,7 @@ void Fl_GTK_Native_File_Chooser_Driver::probe_for_GTK_libs(void) { GET_SYM(gtk_file_chooser_set_show_hidden, ptr_gtk); GET_SYM(gtk_file_chooser_get_show_hidden, ptr_gtk); GET_SYM(gtk_toggle_button_set_active, ptr_gtk); - + did_find_GTK_libs = 1; } // probe_for_GTK_libs @@ -949,7 +948,3 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { } #endif // FL_CFG_WIN_X11 - -// -// End of "$Id$". -// diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm index 96e291c08..14dff14ae 100644 --- a/src/Fl_Native_File_Chooser_MAC.mm +++ b/src/Fl_Native_File_Chooser_MAC.mm @@ -1,4 +1,3 @@ -// "$Id$" // // FLTK native OS file chooser widget // @@ -9,15 +8,15 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // TODO: -// o When doing 'open file', only dir is preset, not filename. +// o When doing 'open file', only dir is preset, not filename. // Possibly 'preset_file' could be used to select the filename. // @@ -28,35 +27,35 @@ #include <FL/Fl_Native_File_Chooser.H> #include <FL/Fl_File_Chooser.H> #include <FL/filename.H> -#define MAXFILTERS 80 +#define MAXFILTERS 80 #import <Cocoa/Cocoa.h> class Fl_Quartz_Native_File_Chooser_Driver : public Fl_Native_File_Chooser_Driver { private: - int _btype; // kind-of browser to show() - int _options; // general options - NSSavePanel *_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: + int _btype; // kind-of browser to show() + int _options; // general options + NSSavePanel *_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) + + 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 - + + 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(); @@ -136,20 +135,20 @@ Fl_Quartz_Native_File_Chooser_Driver::Fl_Quartz_Native_File_Chooser_Driver(int v // DESTRUCTOR Fl_Quartz_Native_File_Chooser_Driver::~Fl_Quartz_Native_File_Chooser_Driver() { - // _opts // nothing to manage - // _options // nothing to manage - // _keepstate // nothing to manage - // _tempitem // nothing to manage + // _opts // nothing to manage + // _options // nothing to manage + // _keepstate // nothing to manage + // _tempitem // nothing to manage clear_pathnames(); _directory = strfree(_directory); _title = strfree(_title); _preset_file = strfree(_preset_file); _filter = strfree(_filter); - //_filt_names // managed by clear_filters() - //_filt_patt[i] // managed by clear_filters() - //_filt_total // managed by clear_filters() + //_filt_names // managed by clear_filters() + //_filt_patt[i] // managed by clear_filters() + //_filt_total // managed by clear_filters() clear_filters(); - //_filt_value // nothing to manage + //_filt_value // nothing to manage _errmsg = strfree(_errmsg); } @@ -178,7 +177,7 @@ int Fl_Quartz_Native_File_Chooser_Driver::show() { // Make sure fltk interface updates before posting our dialog Fl::flush(); - + // POST BROWSER int err = post(); @@ -305,8 +304,8 @@ void Fl_Quartz_Native_File_Chooser_Driver::parse_filter(const char *in) { if ( ! in ) return; int has_name = strchr(in, '\t') ? 1 : 0; - char mode = has_name ? 'n' : 'w'; // parse mode: n=title, w=wildcard - char wildcard[1024] = ""; // parsed wildcard + char mode = has_name ? 'n' : 'w'; // parse mode: n=title, w=wildcard + char wildcard[1024] = ""; // parsed wildcard char name[1024] = ""; // Parse filter user specified @@ -315,59 +314,59 @@ void Fl_Quartz_Native_File_Chooser_Driver::parse_filter(const char *in) { //// DEBUG //// printf("WORKING ON '%c': mode=<%c> name=<%s> wildcard=<%s>\n", //// *in, mode, name, wildcard); - + switch (*in) { // FINISHED PARSING NAME? case '\t': - if ( mode != 'n' ) goto regchar; - mode = 'w'; - break; + if ( mode != 'n' ) goto regchar; + mode = 'w'; + break; // ESCAPE NEXT CHAR case '\\': - ++in; - goto regchar; + ++in; + goto regchar; // FINISHED PARSING ONE OF POSSIBLY SEVERAL FILTERS? case '\r': case '\n': case '\0': - // TITLE - // If user didn't specify a name, make one - // - if ( name[0] == '\0' ) { - sprintf(name, "%.*s Files", (int)sizeof(name)-10, wildcard); - } - // APPEND NEW FILTER TO LIST - if ( wildcard[0] ) { - // Add to filtername list - // Tab delimit if more than one. We later break - // tab delimited string into CFArray with - // CFStringCreateArrayBySeparatingStrings() - // - if ( _filt_total ) { + // TITLE + // If user didn't specify a name, make one + // + if ( name[0] == '\0' ) { + sprintf(name, "%.*s Files", (int)sizeof(name)-10, wildcard); + } + // APPEND NEW FILTER TO LIST + if ( wildcard[0] ) { + // Add to filtername list + // Tab delimit if more than one. We later break + // tab delimited string into CFArray with + // CFStringCreateArrayBySeparatingStrings() + // + if ( _filt_total ) { _filt_names = strapp(_filt_names, "\t"); - } - _filt_names = strapp(_filt_names, name); - - // Add filter to the pattern array - _filt_patt[_filt_total++] = strnew(wildcard); - } - // RESET - wildcard[0] = name[0] = '\0'; - mode = strchr(in, '\t') ? 'n' : 'w'; - // DONE? - if ( *in == '\0' ) return; // done - else continue; // not done yet, more filters + } + _filt_names = strapp(_filt_names, name); + + // Add filter to the pattern array + _filt_patt[_filt_total++] = strnew(wildcard); + } + // RESET + wildcard[0] = name[0] = '\0'; + mode = strchr(in, '\t') ? 'n' : 'w'; + // DONE? + if ( *in == '\0' ) return; // done + else continue; // not done yet, more filters // Parse all other chars - default: // handle all non-special chars - regchar: // handle regular char - switch ( mode ) { + default: // handle all non-special chars + regchar: // handle regular char + switch ( mode ) { case 'n': chrcat(name, *in); continue; case 'w': chrcat(wildcard, *in); continue; - } - break; + } + break; } } //NOTREACHED @@ -440,28 +439,28 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { const char *r, *s; char *t; t = q; - do { // copy to t what is in filter removing what is between \t and \n, if any + do { // copy to t what is in filter removing what is between \t and \n, if any r = strchr(p, '\n'); if (!r) r = p + strlen(p); s = strchr(p, '\t'); - if (s && s < r) { - memcpy(q, p, s - p); - q += s - p; + if (s && s < r) { + memcpy(q, p, s - p); + q += s - p; if (rank < count) { sprintf(q, " (%s)", patterns[rank]); q += strlen(q); } } - else { - memcpy(q, p, r - p); - q += r - p; + else { + memcpy(q, p, r - p); + q += r - p; } rank++; - *(q++) = '\n'; + *(q++) = '\n'; if (*r) p = r + 1; else p = r; } while(*p); *q = 0; return t; } - -@interface FLopenDelegate : NSObject + +@interface FLopenDelegate : NSObject #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 <NSOpenSavePanelDelegate> #endif @@ -495,7 +494,7 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { } @end -@interface FLsaveDelegate : NSObject +@interface FLsaveDelegate : NSObject #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 <NSOpenSavePanelDelegate> #endif @@ -533,9 +532,9 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { char *q = p+1; while (*q != ' ' && *q != ')' && *q != 0) q++; *q = 0; - NSString *ns = [NSString stringWithFormat:@"%@.%@", - [[dialog performSelector:@selector(nameFieldStringValue)] stringByDeletingPathExtension], - [NSString stringWithUTF8String:p]]; + NSString *ns = [NSString stringWithFormat:@"%@.%@", + [[dialog performSelector:@selector(nameFieldStringValue)] stringByDeletingPathExtension], + [NSString stringWithUTF8String:p]]; if (fl_mac_os_version >= 100900) [dialog setAllowedFileTypes:[NSArray arrayWithObject:[NSString stringWithUTF8String:p]]]; free(s); [dialog performSelector:@selector(setNameFieldStringValue:) withObject:ns]; @@ -549,7 +548,7 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { saveas_confirm = o; } @end - + static NSPopUpButton *createPopupAccessory(NSSavePanel *panel, const char *filter, const char *title, int rank) { NSPopUpButton *popup; @@ -648,11 +647,11 @@ int Fl_Quartz_Native_File_Chooser_Driver::runmodal() // 0 - user picked a file // 1 - user cancelled // -1 - failed; errmsg() has reason -// +// int Fl_Quartz_Native_File_Chooser_Driver::post() { // INITIALIZE BROWSER - if ( _filt_total == 0 ) { // Make sure they match - _filt_value = 0; // TBD: move to someplace more logical? + if ( _filt_total == 0 ) { // Make sure they match + _filt_value = 0; // TBD: move to someplace more logical? } fl_open_display(); NSAutoreleasePool *localPool; @@ -663,7 +662,7 @@ int Fl_Quartz_Native_File_Chooser_Driver::post() { case Fl_Native_File_Chooser::BROWSE_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_MULTI_DIRECTORY: _panel = [NSOpenPanel openPanel]; - break; + break; case Fl_Native_File_Chooser::BROWSE_SAVE_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_SAVE_FILE: _panel = [NSSavePanel savePanel]; @@ -689,7 +688,7 @@ int Fl_Quartz_Native_File_Chooser_Driver::post() { [_panel setCanCreateDirectories:YES]; break; } - + // SHOW THE DIALOG NSWindow *key = [NSApp keyWindow]; NSPopUpButton *popup = nil; @@ -708,7 +707,7 @@ int Fl_Quartz_Native_File_Chooser_Driver::post() { } } else { - FLsaveDelegate *saveDelegate = [[[FLsaveDelegate alloc] init] autorelease]; + FLsaveDelegate *saveDelegate = [[[FLsaveDelegate alloc] init] autorelease]; [_panel setAllowsOtherFileTypes:YES]; [_panel setDelegate:saveDelegate]; [saveDelegate option:(_options & Fl_Native_File_Chooser::SAVEAS_CONFIRM)]; @@ -718,9 +717,9 @@ int Fl_Quartz_Native_File_Chooser_Driver::post() { popup = createPopupAccessory(_panel, t, [[_panel nameFieldLabel] UTF8String], _filt_value); delete[] t; if (_options & Fl_Native_File_Chooser::USE_FILTER_EXT) { - [popup setAction:@selector(changedPopup:)]; - [popup setTarget:saveDelegate]; - [saveDelegate panel:(NSSavePanel*)_panel]; + [popup setAction:@selector(changedPopup:)]; + [popup setTarget:saveDelegate]; + [saveDelegate panel:(NSSavePanel*)_panel]; if (fl_mac_os_version >= 100900) { char *p = _filt_patt[_filt_value]; char *q = strchr(p, '.'); if(!q) q = p-1; @@ -746,7 +745,7 @@ int Fl_Quartz_Native_File_Chooser_Driver::post() { _tpathnames = (int)[array count]; _pathnames = new char*[_tpathnames]; for(int i = 0; i < _tpathnames; i++) { - _pathnames[i] = strnew([[(NSURL*)[array objectAtIndex:i] path] UTF8String]); + _pathnames[i] = strnew([[(NSURL*)[array objectAtIndex:i] path] UTF8String]); } } else get_saveas_basename(); @@ -757,7 +756,3 @@ int Fl_Quartz_Native_File_Chooser_Driver::post() { } #endif // __APPLE__ - -// -// End of "$Id$". -// diff --git a/src/Fl_Native_File_Chooser_WIN32.cxx b/src/Fl_Native_File_Chooser_WIN32.cxx index 3f6b6d9e7..594afd53e 100644 --- a/src/Fl_Native_File_Chooser_WIN32.cxx +++ b/src/Fl_Native_File_Chooser_WIN32.cxx @@ -1,4 +1,3 @@ -// "$Id$" // // FLTK native OS file chooser widget // @@ -10,65 +9,65 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Any application to multi-folder implementation: // http://www.codeproject.com/dialog/selectfolder.asp // -#ifndef FL_DOXYGEN // PREVENT DOXYGEN'S USE OF THIS FILE +#ifndef FL_DOXYGEN // PREVENT DOXYGEN'S USE OF THIS FILE #include <FL/Enumerations.H> -#include <stdlib.h> // malloc -#include <stdio.h> // sprintf +#include <stdlib.h> // malloc +#include <stdio.h> // sprintf #include <wchar.h> -#define FNFC_MAX_PATH 32768 // XXX: MAX_PATH under win32 is 260, too small for modern use +#define FNFC_MAX_PATH 32768 // XXX: MAX_PATH under win32 is 260, too small for modern use #include <FL/Fl_Native_File_Chooser.H> # include <windows.h> -# include <commdlg.h> // OPENFILENAMEW, GetOpenFileName() -# include <shlobj.h> // BROWSEINFOW, SHBrowseForFolder() -# include <FL/filename.H> // FL_EXPORT -#include <FL/platform.H> // fl_open_display +# include <commdlg.h> // OPENFILENAMEW, GetOpenFileName() +# include <shlobj.h> // BROWSEINFOW, SHBrowseForFolder() +# include <FL/filename.H> // FL_EXPORT +#include <FL/platform.H> // fl_open_display class Fl_WinAPI_Native_File_Chooser_Driver : public Fl_Native_File_Chooser_Driver { private: - int _btype; // kind-of browser to show() - int _options; // general options - OPENFILENAMEW *_ofn_ptr; // GetOpenFileName() & GetSaveFileName() struct - BROWSEINFOW *_binf_ptr; // SHBrowseForFolder() struct - WCHAR *_wpattern; // pattern buffer for filter - 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 - + int _btype; // kind-of browser to show() + int _options; // general options + OPENFILENAMEW *_ofn_ptr; // GetOpenFileName() & GetSaveFileName() struct + BROWSEINFOW *_binf_ptr; // SHBrowseForFolder() struct + WCHAR *_wpattern; // pattern buffer for filter + 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 ClearOFN(); void ClearBINF(); void Win2Unix(char *s); void Unix2Win(char *s); int showfile(); int showdir(); - + void parse_filter(const char *); void clear_filters(); void add_filter(const char *, const char *); @@ -107,10 +106,10 @@ static LPCWSTR utf8towchar(const char *in); static char *wchartoutf8(LPCWSTR in); -#define LCURLY_CHR '{' -#define RCURLY_CHR '}' -#define LBRACKET_CHR '[' -#define RBRACKET_CHR ']' +#define LCURLY_CHR '{' +#define RCURLY_CHR '}' +#define LBRACKET_CHR '[' +#define RBRACKET_CHR ']' // STATIC: PRINT WINDOWS 'DOUBLE NULL' STRING (DEBUG) #ifdef DEBUG @@ -165,9 +164,9 @@ static void dnullcat(char*&wp, const char *string, int n = -1 ) { int wplen = dnulllen(wp); // Make copy of wp into larger buffer char *tmp = new char[wplen + inlen + 4]; - memcpy(tmp, wp, wplen+2); // copy of wp plus doublenull - delete[] wp; // delete old wp - wp = tmp; // use new copy + memcpy(tmp, wp, wplen+2); // copy of wp plus doublenull + delete[] wp; // delete old wp + wp = tmp; // use new copy //DEBUG printf("DEBUG: dnullcat COPY: <"); dnullprint(wp); printf("> (wplen=%d)\n", wplen); } @@ -290,11 +289,11 @@ void Fl_WinAPI_Native_File_Chooser_Driver::add_pathname(const char *s) { _pathnames = new char*[_tpathnames]; } else { // Grow array by 1 - char **tmp = new char*[_tpathnames+1]; // create new buffer + char **tmp = new char*[_tpathnames+1]; // create new buffer memcpy((void*)tmp, (void*)_pathnames, - sizeof(char*)*_tpathnames); // copy old - delete[] _pathnames; // delete old - _pathnames = tmp; // use new + sizeof(char*)*_tpathnames); // copy old + delete[] _pathnames; // delete old + _pathnames = tmp; // use new ++_tpathnames; } _pathnames[_tpathnames-1] = strnew(s); @@ -321,8 +320,8 @@ void Fl_WinAPI_Native_File_Chooser_Driver::ClearOFN() { delete[] (TCHAR*) _ofn_ptr->lpstrInitialDir; //msvc6 compilation fix _ofn_ptr->lpstrInitialDir = NULL; } - _ofn_ptr->lpstrFilter = NULL; // (deleted elsewhere) - int temp = _ofn_ptr->nFilterIndex; // keep the filter_value + _ofn_ptr->lpstrFilter = NULL; // (deleted elsewhere) + int temp = _ofn_ptr->nFilterIndex; // keep the filter_value memset((void*)_ofn_ptr, 0, sizeof(OPENFILENAMEW)); _ofn_ptr->lStructSize = sizeof(OPENFILENAMEW); _ofn_ptr->nFilterIndex = temp; @@ -379,18 +378,18 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { ClearOFN(); clear_pathnames(); size_t fsize = FNFC_MAX_PATH; - _ofn_ptr->Flags |= OFN_NOVALIDATE; // prevent disabling of front slashes - _ofn_ptr->Flags |= OFN_HIDEREADONLY; // hide goofy readonly flag + _ofn_ptr->Flags |= OFN_NOVALIDATE; // prevent disabling of front slashes + _ofn_ptr->Flags |= OFN_HIDEREADONLY; // hide goofy readonly flag // USE NEW BROWSER - _ofn_ptr->Flags |= OFN_EXPLORER; // use newer explorer windows - _ofn_ptr->Flags |= OFN_ENABLESIZING; // allow window to be resized (hey, why not?) - _ofn_ptr->Flags |= OFN_NOCHANGEDIR; // XXX: docs say ineffective on XP/2K/NT, but set it anyway.. + _ofn_ptr->Flags |= OFN_EXPLORER; // use newer explorer windows + _ofn_ptr->Flags |= OFN_ENABLESIZING; // allow window to be resized (hey, why not?) + _ofn_ptr->Flags |= OFN_NOCHANGEDIR; // XXX: docs say ineffective on XP/2K/NT, but set it anyway.. switch ( _btype ) { case Fl_Native_File_Chooser::BROWSE_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_MULTI_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_SAVE_DIRECTORY: - abort(); // never happens: handled by showdir() + abort(); // never happens: handled by showdir() case Fl_Native_File_Chooser::BROWSE_FILE: break; case Fl_Native_File_Chooser::BROWSE_MULTI_FILE: @@ -398,7 +397,7 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { break; case Fl_Native_File_Chooser::BROWSE_SAVE_FILE: if ( options() & Fl_Native_File_Chooser::SAVEAS_CONFIRM && type() == Fl_Native_File_Chooser::BROWSE_SAVE_FILE ) { - _ofn_ptr->Flags |= OFN_OVERWRITEPROMPT; + _ofn_ptr->Flags |= OFN_OVERWRITEPROMPT; } break; } @@ -406,7 +405,7 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { _ofn_ptr->lpstrFile = new WCHAR[fsize]; _ofn_ptr->nMaxFile = (DWORD) fsize-1; _ofn_ptr->lpstrFile[0] = 0; - _ofn_ptr->lpstrFile[1] = 0; // dnull + _ofn_ptr->lpstrFile[1] = 0; // dnull // PARENT WINDOW _ofn_ptr->hwndOwner = GetForegroundWindow(); // DIALOG TITLE @@ -419,7 +418,7 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { _ofn_ptr->lpstrTitle = NULL; } // FILTER - if (_parsedfilt != NULL) { // to convert a null-containing char string into a widechar string + if (_parsedfilt != NULL) { // to convert a null-containing char string into a widechar string // NEW if ( !_wpattern ) _wpattern = new WCHAR[FNFC_MAX_PATH]; const char *p = _parsedfilt; @@ -444,7 +443,7 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { wcscpy(_ofn_ptr->lpstrFile, utf8towchar(_preset_file)); // Unix2Win(_ofn_ptr->lpstrFile); len = wcslen(_ofn_ptr->lpstrFile); - _ofn_ptr->lpstrFile[len+0] = 0; // multiselect needs dnull + _ofn_ptr->lpstrFile[len+0] = 0; // multiselect needs dnull _ofn_ptr->lpstrFile[len+1] = 0; } if ( _directory ) { @@ -459,7 +458,7 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { // SAVE THE CURRENT DIRECTORY // See above warning (XXX) for OFN_NOCHANGEDIR // - char *save_cwd = SaveCWD(); // must be freed with RestoreCWD() + char *save_cwd = SaveCWD(); // must be freed with RestoreCWD() // OPEN THE DIALOG WINDOW int err; if ( _btype == Fl_Native_File_Chooser::BROWSE_SAVE_FILE ) { @@ -470,10 +469,10 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { // GET EXTENDED ERROR int exterr = CommDlgExtendedError(); // RESTORE CURRENT DIRECTORY - RestoreCWD(save_cwd); save_cwd = 0; // also frees save_cwd + RestoreCWD(save_cwd); save_cwd = 0; // also frees save_cwd // ERROR OR CANCEL? if ( err == 0 ) { - if ( exterr == 0 ) return(1); // user hit cancel + if ( exterr == 0 ) return(1); // user hit cancel // Otherwise, an error occurred.. char msg[80]; sprintf(msg, "CommDlgExtendedError() code=%d", err); @@ -492,17 +491,17 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { const WCHAR *dirname = _ofn_ptr->lpstrFile; size_t dirlen = wcslen(dirname); if ( dirlen > 0 ) { - // WALK STRING SEARCHING FOR 'DOUBLE-NULL' - // eg. "/dir/name\0foo1\0foo2\0foo3\0\0" - // - char pathname[FNFC_MAX_PATH]; - for ( const WCHAR *s = dirname + dirlen + 1; - *s; s+= (wcslen(s)+1)) { - strcpy(pathname, wchartoutf8(dirname)); - strcat(pathname, "\\"); - strcat(pathname, wchartoutf8(s)); - add_pathname(pathname); - } + // WALK STRING SEARCHING FOR 'DOUBLE-NULL' + // eg. "/dir/name\0foo1\0foo2\0foo3\0\0" + // + char pathname[FNFC_MAX_PATH]; + for ( const WCHAR *s = dirname + dirlen + 1; + *s; s+= (wcslen(s)+1)) { + strcpy(pathname, wchartoutf8(dirname)); + strcat(pathname, "\\"); + strcat(pathname, wchartoutf8(s)); + add_pathname(pathname); + } } // XXX // Work around problem where pasted forward-slash pathname @@ -510,15 +509,15 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showfile() { // not to grok forward slashes, passing back as a 'filename'..! // if ( _tpathnames == 0 ) { - add_pathname(wchartoutf8(dirname)); - // Win2Unix(_pathnames[_tpathnames-1]); + add_pathname(wchartoutf8(dirname)); + // Win2Unix(_pathnames[_tpathnames-1]); } break; } case Fl_Native_File_Chooser::BROWSE_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_MULTI_DIRECTORY: case Fl_Native_File_Chooser::BROWSE_SAVE_DIRECTORY: - abort(); // never happens: handled by showdir() + abort(); // never happens: handled by showdir() } return(0); } @@ -535,10 +534,10 @@ static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data) { case BFFM_SELCHANGED: TCHAR path[FNFC_MAX_PATH]; if ( SHGetPathFromIDList((ITEMIDLIST*)param, path) ) { - ::SendMessage(win, BFFM_ENABLEOK, 0, 1); + ::SendMessage(win, BFFM_ENABLEOK, 0, 1); } else { - // disable ok button if not a path - ::SendMessage(win, BFFM_ENABLEOK, 0, 0); + // disable ok button if not a path + ::SendMessage(win, BFFM_ENABLEOK, 0, 0); } break; case BFFM_VALIDATEFAILED: @@ -554,7 +553,7 @@ static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data) { // SHOW DIRECTORY BROWSER int Fl_WinAPI_Native_File_Chooser_Driver::showdir() { // initialize OLE only once - fl_open_display(); // init needed by BIF_USENEWUI + fl_open_display(); // init needed by BIF_USENEWUI ClearBINF(); clear_pathnames(); // PARENT WINDOW @@ -571,7 +570,7 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showdir() { } // FLAGS - _binf_ptr->ulFlags = 0; // initialize + _binf_ptr->ulFlags = 0; // initialize // TBD: make sure matches to runtime system, if need be. //(what if _WIN32_IE doesn't match system? does the program not run?) @@ -588,16 +587,16 @@ int Fl_WinAPI_Native_File_Chooser_Driver::showdir() { // drives, and with BIF_SHAREABLE set I do not. // --- -#if defined(BIF_NONEWFOLDERBUTTON) // Version 6.0 +#if defined(BIF_NONEWFOLDERBUTTON) // Version 6.0 if ( _btype == Fl_Native_File_Chooser::BROWSE_DIRECTORY ) _binf_ptr->ulFlags |= BIF_NONEWFOLDERBUTTON; _binf_ptr->ulFlags |= BIF_USENEWUI | BIF_RETURNONLYFSDIRS; -#elif defined(BIF_USENEWUI) // Version 5.0 +#elif defined(BIF_USENEWUI) // Version 5.0 if ( _btype == Fl_Native_File_Chooser::BROWSE_DIRECTORY ) _binf_ptr->ulFlags |= BIF_EDITBOX; else if ( _btype == Fl_Native_File_Chooser::BROWSE_SAVE_DIRECTORY ) _binf_ptr->ulFlags |= BIF_USENEWUI; _binf_ptr->ulFlags |= BIF_RETURNONLYFSDIRS; -#elif defined(BIF_EDITBOX) // Version 4.71 +#elif defined(BIF_EDITBOX) // Version 4.71 _binf_ptr->ulFlags |= BIF_RETURNONLYFSDIRS | BIF_EDITBOX; -#else // Version Old +#else // Version Old _binf_ptr->ulFlags |= BIF_RETURNONLYFSDIRS; #endif @@ -721,7 +720,7 @@ void Fl_WinAPI_Native_File_Chooser_Driver::filter(const char *val) { _filter = strnew(val); parse_filter(_filter); } - add_filter("All Files", "*.*"); // always include 'all files' option + add_filter("All Files", "*.*"); // always include 'all files' option #ifdef DEBUG dnullprint(_parsedfilt); @@ -742,8 +741,8 @@ void Fl_WinAPI_Native_File_Chooser_Driver::clear_filters() { } // ADD A FILTER -void Fl_WinAPI_Native_File_Chooser_Driver::add_filter(const char *name_in, // name of filter (optional: can be null) - const char *winfilter) { // windows style filter (eg. "*.cxx;*.h") +void Fl_WinAPI_Native_File_Chooser_Driver::add_filter(const char *name_in, // name of filter (optional: can be null) + const char *winfilter) { // windows style filter (eg. "*.cxx;*.h") // No name? Make one.. char name[1024]; if ( !name_in || name_in[0] == '\0' ) { @@ -771,40 +770,40 @@ static int count_filters(const char *filter) { const char *in = filter; while (*in) { switch(*in) { - case '\\': // escape next character - ++in; if ( *in == 0 ) continue; // skip escape. EOL? done - ++in; // skip escaped char - continue; - case LCURLY_CHR: // start "{aaa,bbb}" - mode = *in; // set mode, parse over curly - ++count; // at least +1 wildcard - break; - case RCURLY_CHR: // end "{aaa,bbb}" - if ( mode == LCURLY_CHR ) // disable curly mode (if on) - mode = 0; - break; - case LBRACKET_CHR: // start "[xyz]" - mode = *in; // set mode, parse over bracket - break; - case RBRACKET_CHR: // end "[xyz]" - if ( mode == LBRACKET_CHR ) // disable bracket mode (if on) - mode = 0; - break; - default: // any other char - switch (mode) { // handle {} or [] modes - case LCURLY_CHR: // handle "{aaa,bbb}" - if (*in==',' || *in=='|') // ',' and '|' adds filters - ++count; - break; - case LBRACKET_CHR: // handle "[xyz]" - ++count; // all chars in []'s add new filter - break; - } - break; + case '\\': // escape next character + ++in; if ( *in == 0 ) continue; // skip escape. EOL? done + ++in; // skip escaped char + continue; + case LCURLY_CHR: // start "{aaa,bbb}" + mode = *in; // set mode, parse over curly + ++count; // at least +1 wildcard + break; + case RCURLY_CHR: // end "{aaa,bbb}" + if ( mode == LCURLY_CHR ) // disable curly mode (if on) + mode = 0; + break; + case LBRACKET_CHR: // start "[xyz]" + mode = *in; // set mode, parse over bracket + break; + case RBRACKET_CHR: // end "[xyz]" + if ( mode == LBRACKET_CHR ) // disable bracket mode (if on) + mode = 0; + break; + default: // any other char + switch (mode) { // handle {} or [] modes + case LCURLY_CHR: // handle "{aaa,bbb}" + if (*in==',' || *in=='|') // ',' and '|' adds filters + ++count; + break; + case LBRACKET_CHR: // handle "[xyz]" + ++count; // all chars in []'s add new filter + break; + } + break; } - ++in; // parse past char + ++in; // parse past char } - return count > 0 ? count : 1; // return at least 1 + return count > 0 ? count : 1; // return at least 1 } // CONVERT FLTK STYLE PATTERN MATCHES TO WINDOWS 'DOUBLENULL' PATTERN @@ -837,7 +836,7 @@ void Fl_WinAPI_Native_File_Chooser_Driver::parse_filter(const char *in) { if ( ! in || in[0] == '\0' ) return; int has_name = strchr(in, '\t') ? 1 : 0; - char mode = has_name ? 'n' : 'w'; // parse mode: n=name, w=wildcard + char mode = has_name ? 'n' : 'w'; // parse mode: n=name, w=wildcard // whatever input string is, our output won't be much longer in length.. // use double length just for safety. @@ -848,8 +847,8 @@ void Fl_WinAPI_Native_File_Chooser_Driver::parse_filter(const char *in) { // Init int nwildcards = 0; - int maxfilters = count_filters(in) + 1; // count wildcard seps - char **wildcards = new char*[maxfilters]; // parsed wildcards (can be several) + int maxfilters = count_filters(in) + 1; // count wildcard seps + char **wildcards = new char*[maxfilters]; // parsed wildcards (can be several) int t; for ( t=0; t<maxfilters; t++ ) { wildcards[t] = new char[slen+1]; @@ -866,114 +865,114 @@ void Fl_WinAPI_Native_File_Chooser_Driver::parse_filter(const char *in) { switch (*in) { case ',': case '|': - if ( mode == LCURLY_CHR ) { - // create new wildcard, copy in prefix - strcat(wildcards[nwildcards++], wildprefix); - continue; - } else { - goto regchar; - } - continue; + if ( mode == LCURLY_CHR ) { + // create new wildcard, copy in prefix + strcat(wildcards[nwildcards++], wildprefix); + continue; + } else { + goto regchar; + } + continue; // FINISHED PARSING A NAME? case '\t': - if ( mode != 'n' ) goto regchar; - // finish parsing name? switch to wildcard mode - mode = 'w'; - break; + if ( mode != 'n' ) goto regchar; + // finish parsing name? switch to wildcard mode + mode = 'w'; + break; // ESCAPE NEXT CHAR case '\\': - ++in; - goto regchar; + ++in; + goto regchar; // FINISHED PARSING ONE OF POSSIBLY SEVERAL FILTERS? case '\r': case '\n': case '\0': { - if ( mode == 'w' ) { // finished parsing wildcard? - if ( nwildcards == 0 ) { - strcpy(wildcards[nwildcards++], wildprefix); - } - // Append wildcards in Microsoft's "*.one;*.two" format - comp[0] = 0; - for ( t=0; t<nwildcards; t++ ) { - if ( t != 0 ) strcat(comp, ";"); - strcat(comp, wildcards[t]); - } - // Add if not empty - if ( comp[0] ) { - add_filter(name, comp); - } - } - // RESET - for ( t=0; t<maxfilters; t++ ) { - wildcards[t][0] = '\0'; - } - nwildcards = 0; - wildprefix[0] = name[0] = '\0'; - mode = strchr(in,'\t') ? 'n' : 'w'; - // DONE? - if ( *in == '\0' ) { // done - // Free everything - delete[] wildprefix; - delete[] comp; - delete[] name; - for ( t=0; t<maxfilters; t++ ) delete[] wildcards[t]; - delete[] wildcards; - return; - } - continue; // not done yet, more filters + if ( mode == 'w' ) { // finished parsing wildcard? + if ( nwildcards == 0 ) { + strcpy(wildcards[nwildcards++], wildprefix); + } + // Append wildcards in Microsoft's "*.one;*.two" format + comp[0] = 0; + for ( t=0; t<nwildcards; t++ ) { + if ( t != 0 ) strcat(comp, ";"); + strcat(comp, wildcards[t]); + } + // Add if not empty + if ( comp[0] ) { + add_filter(name, comp); + } + } + // RESET + for ( t=0; t<maxfilters; t++ ) { + wildcards[t][0] = '\0'; + } + nwildcards = 0; + wildprefix[0] = name[0] = '\0'; + mode = strchr(in,'\t') ? 'n' : 'w'; + // DONE? + if ( *in == '\0' ) { // done + // Free everything + delete[] wildprefix; + delete[] comp; + delete[] name; + for ( t=0; t<maxfilters; t++ ) delete[] wildcards[t]; + delete[] wildcards; + return; + } + continue; // not done yet, more filters } // STARTING A WILDCARD? case LBRACKET_CHR: case LCURLY_CHR: - mode = *in; - if ( *in == LCURLY_CHR ) { - // create new wildcard - strcat(wildcards[nwildcards++], wildprefix); - } - continue; + mode = *in; + if ( *in == LCURLY_CHR ) { + // create new wildcard + strcat(wildcards[nwildcards++], wildprefix); + } + continue; // ENDING A WILDCARD? case RBRACKET_CHR: case RCURLY_CHR: - mode = 'w'; // back to wildcard mode - continue; + mode = 'w'; // back to wildcard mode + continue; // ALL OTHER NON-SPECIAL CHARACTERS default: - regchar: // handle regular char - switch ( mode ) { - case LBRACKET_CHR: - // create new wildcard - ++nwildcards; - // copy in prefix - strcpy(wildcards[nwildcards-1], wildprefix); - // append search char - chrcat(wildcards[nwildcards-1], *in); - continue; - - case LCURLY_CHR: - if ( nwildcards > 0 ) { - chrcat(wildcards[nwildcards-1], *in); - } - continue; - - case 'n': - chrcat(name, *in); - continue; - - case 'w': - chrcat(wildprefix, *in); - for ( t=0; t<nwildcards; t++ ) { - chrcat(wildcards[t], *in); - } - continue; - } - break; + regchar: // handle regular char + switch ( mode ) { + case LBRACKET_CHR: + // create new wildcard + ++nwildcards; + // copy in prefix + strcpy(wildcards[nwildcards-1], wildprefix); + // append search char + chrcat(wildcards[nwildcards-1], *in); + continue; + + case LCURLY_CHR: + if ( nwildcards > 0 ) { + chrcat(wildcards[nwildcards-1], *in); + } + continue; + + case 'n': + chrcat(name, *in); + continue; + + case 'w': + chrcat(wildprefix, *in); + for ( t=0; t<nwildcards; t++ ) { + chrcat(wildcards[t], *in); + } + continue; + } + break; } } } @@ -1030,7 +1029,3 @@ static LPCWSTR utf8towchar(const char *in) { } #endif /* !FL_DOXYGEN */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Overlay_Window.cxx b/src/Fl_Overlay_Window.cxx index 5b7c90313..401acd9f6 100644 --- a/src/Fl_Overlay_Window.cxx +++ b/src/Fl_Overlay_Window.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Overlay window code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -80,7 +78,3 @@ int Fl_Overlay_Window::can_do_overlay() { void Fl_Overlay_Window::redraw_overlay() { Fl_Window_Driver::driver(this)->redraw_overlay(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx index bd2d4540f..4c9579bb8 100644 --- a/src/Fl_PNG_Image.cxx +++ b/src/Fl_PNG_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_PNG_Image routines. // // Copyright 1997-2012 by Easy Software Products. @@ -12,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: @@ -57,8 +55,8 @@ typedef struct { extern "C" { static void png_read_data_from_mem( png_structp png_ptr, //pointer to our data - png_bytep data, // where to copy the image data for libpng computing - png_size_t length) // length of data to copy + png_bytep data, // where to copy the image data for libpng computing + png_size_t length) // length of data to copy { fl_png_memory *png_mem_data = (fl_png_memory*)png_get_io_ptr(png_ptr); // get the pointer to our struct if (png_mem_data->current + length > png_mem_data->last) { @@ -85,7 +83,7 @@ extern "C" { PNG format could not be decoded, and ERR_NO_IMAGE if the image could not be loaded for another reason. - \param[in] filename Name of PNG file to read + \param[in] filename Name of PNG file to read */ Fl_PNG_Image::Fl_PNG_Image (const char *filename): Fl_RGB_Image(0,0,0) { @@ -102,7 +100,7 @@ Fl_PNG_Image::Fl_PNG_Image (const char *filename): Fl_RGB_Image(0,0,0) shared images (see: Fl_Shared_Image) and will be available by that name. \param name_png A name given to this image or NULL - \param buffer Pointer to the start of the PNG image in memory + \param buffer Pointer to the start of the PNG image in memory \param maxsize Size in bytes of the memory buffer containing the PNG image */ Fl_PNG_Image::Fl_PNG_Image ( @@ -115,18 +113,18 @@ Fl_PNG_Image::Fl_PNG_Image ( void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_png, int maxsize) { #if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ) - int i; // Looping var - int channels; // Number of color channels - png_structp pp; // PNG read pointer - png_infop info = 0; // PNG info pointers - png_bytep *rows; // PNG row pointers + int i; // Looping var + int channels; // Number of color channels + png_structp pp; // PNG read pointer + png_infop info = 0; // PNG info pointers + png_bytep *rows; // PNG row pointers fl_png_memory png_mem_data; int from_memory = (buffer_png != NULL); // true if reading image from memory // Note: The file pointer fp must not be an automatic (stack) variable // to avoid potential clobbering by setjmp/longjmp (gcc: [-Wclobbered]). - static FILE *fp; // intentionally initialized separately below - fp = NULL; // always initialize file pointer + static FILE *fp; // intentionally initialized separately below + fp = NULL; // always initialize file pointer if (!from_memory) { if ((fp = fl_fopen(name_png, "rb")) == NULL) { @@ -231,8 +229,3 @@ void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_p } #endif // HAVE_LIBPNG && HAVE_LIBZ } - - -// -// End of "$Id$". -// diff --git a/src/Fl_PNM_Image.cxx b/src/Fl_PNM_Image.cxx index 94a7ea8fd..9d2945bc7 100644 --- a/src/Fl_PNM_Image.cxx +++ b/src/Fl_PNM_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_PNM_Image routines. // // Copyright 1997-2010 by Easy Software Products. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: @@ -51,18 +49,18 @@ \param[in] filename a full path and name pointing to a valid jpeg file. */ -Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read +Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read : Fl_RGB_Image(0,0,0) { - FILE *fp; // File pointer - int x, y; // Looping vars - char line[1024], // Input line - *lineptr; // Pointer in line - uchar *ptr, // Pointer to pixel values - byte, // Byte from file - bit; // Bit in pixel - int format, // Format of PNM file - val, // Pixel value - maxval; // Maximum pixel value + FILE *fp; // File pointer + int x, y; // Looping vars + char line[1024], // Input line + *lineptr; // Pointer in line + uchar *ptr, // Pointer to pixel values + byte, // Byte from file + bit; // Bit in pixel + int format, // Format of PNM file + val, // Pixel value + maxval; // Maximum pixel value if ((fp = fl_fopen(filename, "rb")) == NULL) { @@ -119,9 +117,9 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read while (lineptr != NULL && maxval == 0) { if (*lineptr == '\0' || *lineptr == '#') { - lineptr = fgets(line, sizeof(line), fp); + lineptr = fgets(line, sizeof(line), fp); } else if (isdigit(*lineptr)) { - maxval = strtol(lineptr, &lineptr, 10); + maxval = strtol(lineptr, &lineptr, 10); } else lineptr ++; } } else maxval = 1; @@ -150,7 +148,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read for (x = w(); x > 0; x --) if (fscanf(fp, "%d", &val) == 1) *ptr++ = (uchar)(255 * (1-val)); break; - + case 2 : for (x = w(); x > 0; x --) if (fscanf(fp, "%d", &val) == 1) *ptr++ = (uchar)(255 * val / maxval); @@ -168,7 +166,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read for (x = w(), byte = (uchar)getc(fp), bit = 128; x > 0; x --) { if ((byte & bit) == 0) *ptr++ = 255; // 0 bit for white pixel else *ptr++ = 0; // 1 bit for black pixel - + if (bit > 1) bit >>= 1; else { bit = 128; @@ -176,7 +174,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read } } break; - + case 5 : case 6 : if (maxval < 256) { @@ -189,11 +187,11 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read } } break; - + case 7 : /* XV 3:3:2 thumbnail format */ for (x = w(); x > 0; x --) { byte = (uchar)getc(fp); - + *ptr++ = (uchar)(255 * ((byte >> 5) & 7) / 7); *ptr++ = (uchar)(255 * ((byte >> 2) & 7) / 7); *ptr++ = (uchar)(255 * (byte & 3) / 3); @@ -204,8 +202,3 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read fclose(fp); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Pack.cxx b/src/Fl_Pack.cxx index 351722a89..7b42076f9 100644 --- a/src/Fl_Pack.cxx +++ b/src/Fl_Pack.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Packing widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Based on code by Curtis Edwards @@ -40,9 +38,9 @@ variables, but you must declare the Fl_Pack <I>first</I>, so that it is destroyed last. - \param[in] X,Y X and Y coordinates (position) - \param[in] W,H width and height, respectively - \param[in] L label (optional) + \param[in] X,Y X and Y coordinates (position) + \param[in] W,H width and height, respectively + \param[in] L label (optional) */ Fl_Pack::Fl_Pack(int X, int Y, int W, int H, const char *L) @@ -154,7 +152,3 @@ void Fl_Pack::draw() { draw_label(); } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Paged_Device.cxx b/src/Fl_Paged_Device.cxx index 3d6f0b09c..368e09856 100644 --- a/src/Fl_Paged_Device.cxx +++ b/src/Fl_Paged_Device.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // implementation of Fl_Paged_Device class for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file Fl_Paged_Device.cxx \brief implementation of class Fl_Paged_Device. @@ -40,7 +38,7 @@ int Fl_Paged_Device::begin_job(int pagecount, int *frompage, int *topage, char * /** \brief Begins a new printed page - The page coordinates are initially in points, i.e., 1/72 inch, + The page coordinates are initially in points, i.e., 1/72 inch, and with origin at the top left of the printable page area. \return 0 if OK, non-zero if any error */ @@ -67,7 +65,7 @@ void Fl_Paged_Device::margins(int *left, int *top, int *right, int *bottom) {} After a scale() call, do a printable_rect() call to get the new dimensions of the printable page area. Successive scale() calls don't combine their effects. \param scale_x Horizontal dimensions of plot are multiplied by this quantity. - \param scale_y Same as above, vertically. + \param scale_y Same as above, vertically. The value 0. is equivalent to setting \p scale_y = \p scale_x. Thus, scale(factor); is equivalent to scale(factor, factor); */ @@ -76,7 +74,7 @@ void Fl_Paged_Device::scale (float scale_x, float scale_y) {} /** \brief Rotates the graphics operations relatively to paper. - The rotation is centered on the current graphics origin. + The rotation is centered on the current graphics origin. Successive rotate() calls don't combine their effects. \param angle Rotation angle in counter-clockwise degrees. */ @@ -95,10 +93,10 @@ int Fl_Paged_Device::end_page (void) {return 1;} void Fl_Paged_Device::end_job (void) {} -const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS] = { +const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS] = { // order of enum Page_Format // comes from appendix B of 5003.PPD_Spec_v4.3.pdf - + // A* // index(Ai) = i {2384, 3370, "A0"}, {1684, 2384, "A1"}, @@ -110,7 +108,7 @@ const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS { 210, 297, "A7"}, { 148, 210, "A8"}, { 105, 148, "A9"}, - + // B* // index(Bi) = i+10 {2920, 4127, "B0"}, {2064, 2920, "B1"}, @@ -123,7 +121,7 @@ const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS { 181, 258, "B8"}, { 127, 181, "B9"}, { 91, 127, "B10"}, - + // others { 459, 649, "EnvC5"}, // envelope { 312, 624, "EnvDL"}, // envelope @@ -135,7 +133,3 @@ const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS { 792, 1224, "Tabloid"}, { 297, 684, "Env10"} // envelope }; - -// -// End of "$Id$". -// diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx index cd8479157..61bfcb962 100644 --- a/src/Fl_Pixmap.cxx +++ b/src/Fl_Pixmap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pixmap drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Draws X pixmap data, keeping it stashed in a server pixmap so it @@ -81,12 +79,12 @@ void Fl_Pixmap::label(Fl_Menu_Item* m) { void Fl_Pixmap::copy_data() { if (alloc_data) return; - char **new_data, // New data array - **new_row; // Current row in image - int i, // Looping var - ncolors, // Number of colors in image - chars_per_pixel,// Characters per color - chars_per_line; // Characters per line + char **new_data, // New data array + **new_row; // Current row in image + int i, // Looping var + ncolors, // Number of colors in image + chars_per_pixel,// Characters per color + chars_per_line; // Characters per line // Figure out how many colors there are, and how big they are... sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel); @@ -128,7 +126,7 @@ void Fl_Pixmap::copy_data() { } Fl_Image *Fl_Pixmap::copy(int W, int H) { - Fl_Pixmap *new_image; // New pixmap + Fl_Pixmap *new_image; // New pixmap if (!data()) { // happens with bad pixmap data return new Fl_Pixmap((char *const*)0); } @@ -142,21 +140,21 @@ Fl_Image *Fl_Pixmap::copy(int W, int H) { if (W <= 0 || H <= 0) return 0; // OK, need to resize the image data; allocate memory and - char **new_data, // New array for image data - **new_row, // Pointer to row in image data - *new_ptr, // Pointer into new array - new_info[255]; // New information line - const char *old_ptr; // Pointer into old array - int i, // Looping var - c, // Channel number - sy, // Source coordinate - dx, dy, // Destination coordinates - xerr, yerr, // X & Y errors - xmod, ymod, // X & Y moduli - xstep, ystep; // X & Y step increments - int ncolors, // Number of colors in image - chars_per_pixel,// Characters per color - chars_per_line; // Characters per line + char **new_data, // New array for image data + **new_row, // Pointer to row in image data + *new_ptr, // Pointer into new array + new_info[255]; // New information line + const char *old_ptr; // Pointer into old array + int i, // Looping var + c, // Channel number + sy, // Source coordinate + dx, dy, // Destination coordinates + xerr, yerr, // X & Y errors + xmod, ymod, // X & Y moduli + xstep, ystep; // X & Y step increments + int ncolors, // Number of colors in image + chars_per_pixel,// Characters per color + chars_per_line; // Characters per line // Figure out how many colors there are, and how big they are... sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel); @@ -199,16 +197,16 @@ Fl_Image *Fl_Pixmap::copy(int W, int H) { new_ptr = *new_row; for (dx = W, xerr = W, old_ptr = data()[sy + ncolors + 1]; - dx > 0; - dx --) { + dx > 0; + dx --) { for (c = 0; c < chars_per_pixel; c ++) *new_ptr++ = old_ptr[c]; old_ptr += xstep; xerr -= xmod; if (xerr <= 0) { - xerr += W; - old_ptr += chars_per_pixel; + xerr += W; + old_ptr += chars_per_pixel; } } @@ -235,8 +233,8 @@ void Fl_Pixmap::color_average(Fl_Color c, float i) { copy_data(); // Get the color to blend with... - uchar r, g, b; - unsigned ia, ir, ig, ib; + uchar r, g, b; + unsigned ia, ir, ig, ib; Fl::get_color(c, r, g, b); if (i < 0.0f) i = 0.0f; @@ -248,10 +246,10 @@ void Fl_Pixmap::color_average(Fl_Color c, float i) { ib = b * (256 - ia); // Update the colormap to do the blend... - char line[255]; // New colormap line - int color, // Looping var - ncolors, // Number of colors in image - chars_per_pixel;// Characters per color + char line[255]; // New colormap line + int color, // Looping var + ncolors, // Number of colors in image + chars_per_pixel;// Characters per color sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel); @@ -272,14 +270,14 @@ void Fl_Pixmap::color_average(Fl_Color c, float i) { const char *p = data()[color + 1] + chars_per_pixel + 1; const char *previous_word = p; for (;;) { - while (*p && isspace(*p)) p++; - char what = *p++; - while (*p && !isspace(*p)) p++; - while (*p && isspace(*p)) p++; - if (!*p) {p = previous_word; break;} - if (what == 'c') break; - previous_word = p; - while (*p && !isspace(*p)) p++; + while (*p && isspace(*p)) p++; + char what = *p++; + while (*p && !isspace(*p)) p++; + while (*p && isspace(*p)) p++; + if (!*p) {p = previous_word; break;} + if (what == 'c') break; + previous_word = p; + while (*p && !isspace(*p)) p++; } if (fl_parse_color(p, r, g, b)) { @@ -288,13 +286,13 @@ void Fl_Pixmap::color_average(Fl_Color c, float i) { b = (ia * b + ib) >> 8; if (chars_per_pixel > 1) sprintf(line, "%c%c c #%02X%02X%02X", - data()[color + 1][0], - data()[color + 1][1], r, g, b); + data()[color + 1][0], + data()[color + 1][1], r, g, b); else sprintf(line, "%c c #%02X%02X%02X", data()[color + 1][0], r, g, b); delete[] (char *)data()[color + 1]; - ((char **)data())[color + 1] = new char[strlen(line) + 1]; - strcpy((char *)data()[color + 1], line); + ((char **)data())[color + 1] = new char[strlen(line) + 1]; + strcpy((char *)data()[color + 1], line); } } } @@ -308,8 +306,8 @@ void Fl_Pixmap::delete_data() { } void Fl_Pixmap::set_data(const char * const * p) { - int height, // Number of lines in image - ncolors; // Number of colors in image + int height, // Number of lines in image + ncolors; // Number of colors in image if (p) { sscanf(p[0],"%*d%d%d", &height, &ncolors); @@ -327,11 +325,11 @@ void Fl_Pixmap::desaturate() { copy_data(); // Update the colormap to grayscale... - char line[255]; // New colormap line - int i, // Looping var - ncolors, // Number of colors in image - chars_per_pixel;// Characters per color - uchar r, g, b; + char line[255]; // New colormap line + int i, // Looping var + ncolors, // Number of colors in image + chars_per_pixel;// Characters per color + uchar r, g, b; sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel); @@ -350,31 +348,27 @@ void Fl_Pixmap::desaturate() { const char *p = data()[i + 1] + chars_per_pixel + 1; const char *previous_word = p; for (;;) { - while (*p && isspace(*p)) p++; - char what = *p++; - while (*p && !isspace(*p)) p++; - while (*p && isspace(*p)) p++; - if (!*p) {p = previous_word; break;} - if (what == 'c') break; - previous_word = p; - while (*p && !isspace(*p)) p++; + while (*p && isspace(*p)) p++; + char what = *p++; + while (*p && !isspace(*p)) p++; + while (*p && isspace(*p)) p++; + if (!*p) {p = previous_word; break;} + if (what == 'c') break; + previous_word = p; + while (*p && !isspace(*p)) p++; } if (fl_parse_color(p, r, g, b)) { g = (uchar)((r * 31 + g * 61 + b * 8) / 100); if (chars_per_pixel > 1) sprintf(line, "%c%c c #%02X%02X%02X", data()[i + 1][0], - data()[i + 1][1], g, g, g); + data()[i + 1][1], g, g, g); else sprintf(line, "%c c #%02X%02X%02X", data()[i + 1][0], g, g, g); delete[] (char *)data()[i + 1]; - ((char **)data())[i + 1] = new char[strlen(line) + 1]; - strcpy((char *)data()[i + 1], line); + ((char **)data())[i + 1] = new char[strlen(line) + 1]; + strcpy((char *)data()[i + 1], line); } } } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Positioner.cxx b/src/Fl_Positioner.cxx index 85522cfae..af86685c1 100644 --- a/src/Fl_Positioner.cxx +++ b/src/Fl_Positioner.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Positioner widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // The positioner widget from Forms, gives 2D input @@ -99,7 +97,7 @@ int Fl_Positioner::handle(int event, int X, int Y, int W, int H) { redraw(); } } if (!(when() & FL_WHEN_CHANGED || - (when() & FL_WHEN_RELEASE && event == FL_RELEASE))) return 1; + (when() & FL_WHEN_RELEASE && event == FL_RELEASE))) return 1; if (changed() || when()&FL_WHEN_NOT_CHANGED) { if (event == FL_RELEASE) clear_changed(); do_callback(); @@ -145,7 +143,3 @@ void Fl_Positioner::ybounds(double a, double b) { redraw(); } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index d02016a92..e7327012a 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Preferences methods for the Fast Light Tool Kit (FLTK). // // Copyright 2011-2020 by Bill Spitzak and others. @@ -12,9 +10,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -666,7 +664,7 @@ char Fl_Preferences::set( const char *key, const char *text ) { else if ( c=='\n' ) { *d++ = '\\'; *d++ = 'n'; s++; } else if ( c=='\r' ) { *d++ = '\\'; *d++ = 'r'; s++; } else if ( c<32 || c==0x7f ) - { *d++ = '\\'; *d++ = '0'+((c>>6)&3); *d++ = '0'+((c>>3)&7); *d++ = '0'+(c&7); s++; } + { *d++ = '\\'; *d++ = '0'+((c>>6)&3); *d++ = '0'+((c>>3)&7); *d++ = '0'+(c&7); s++; } else *d++ = *s++; } *d = 0; @@ -1000,20 +998,20 @@ int Fl_Preferences::RootNode::read() { if (fgets( buf, 1024, f )==0) { /* ignore */ } Node *nd = prefs_->node; for (;;) { - if ( !fgets( buf, 1024, f ) ) break; // EOF or Error - if ( buf[0]=='[' ) { // read a new group + if ( !fgets( buf, 1024, f ) ) break; // EOF or Error + if ( buf[0]=='[' ) { // read a new group size_t end = strcspn( buf+1, "]\n\r" ); buf[ end+1 ] = 0; nd = prefs_->node->find( buf+1 ); - } else if ( buf[0]=='+' ) { // value of previous name/value pair spans multiple lines + } else if ( buf[0]=='+' ) { // value of previous name/value pair spans multiple lines size_t end = strcspn( buf+1, "\n\r" ); - if ( end != 0 ) { // if entry is not empty + if ( end != 0 ) { // if entry is not empty buf[ end+1 ] = 0; nd->add( buf+1 ); } - } else { // read a name/value pair + } else { // read a name/value pair size_t end = strcspn( buf, "\n\r" ); - if ( end != 0 ) { // if entry is not empty + if ( end != 0 ) { // if entry is not empty buf[ end ] = 0; nd->set( buf ); } @@ -1048,7 +1046,7 @@ int Fl_Preferences::RootNode::write() { if (strncmp(filename_, "/etc/fltk/", 10) == 0) { char *p; p = filename_ + 9; - do { // for each directory to the pref file + do { // for each directory to the pref file *p = 0; fl_chmod(filename_, 0755); // rwxr-xr-x *p = '/'; @@ -1140,12 +1138,12 @@ void Fl_Preferences::Node::deleteAllEntries() { if ( entry_ ) { for ( int i = 0; i < nEntry_; i++ ) { if ( entry_[i].name ) { - free( entry_[i].name ); - entry_[i].name = 0L; + free( entry_[i].name ); + entry_[i].name = 0L; } if ( entry_[i].value ) { - free( entry_[i].value ); - entry_[i].value = 0L; + free( entry_[i].value ); + entry_[i].value = 0L; } } free( entry_ ); @@ -1195,21 +1193,21 @@ int Fl_Preferences::Node::write( FILE *f ) { fprintf( f, "\n[%s]\n\n", path_ ); for ( int i = 0; i < nEntry_; i++ ) { char *src = entry_[i].value; - if ( src ) { // hack it into smaller pieces if needed + if ( src ) { // hack it into smaller pieces if needed fprintf( f, "%s:", entry_[i].name ); size_t cnt, written = 0; for ( cnt = 0; cnt < 60; cnt++ ) - if ( src[cnt]==0 ) break; + if ( src[cnt]==0 ) break; written += fwrite( src, cnt, 1, f ); fprintf( f, "\n" ); src += cnt; for (;*src;) { - for ( cnt = 0; cnt < 80; cnt++ ) - if ( src[cnt]==0 ) break; + for ( cnt = 0; cnt < 80; cnt++ ) + if ( src[cnt]==0 ) break; fputc( '+', f ); - written += fwrite( src, cnt, 1, f ); + written += fwrite( src, cnt, 1, f ); fputc( '\n', f ); - src += cnt; + src += cnt; } } else @@ -1258,10 +1256,10 @@ void Fl_Preferences::Node::set( const char *name, const char *value ) if ( strcmp( name, entry_[i].name ) == 0 ) { if ( !value ) return; // annotation if ( strcmp( value, entry_[i].value ) != 0 ) { - if ( entry_[i].value ) - free( entry_[i].value ); - entry_[i].value = strdup( value ); - dirty_ = 1; + if ( entry_[i].value ) + free( entry_[i].value ); + entry_[i].value = strdup( value ); + dirty_ = 1; } lastEntrySet = i; return; @@ -1374,14 +1372,14 @@ Fl_Preferences::Node *Fl_Preferences::Node::search( const char *path, int offset if ( offset == 0 ) { if ( path[0] == '.' ) { if ( path[1] == 0 ) { - return this; // user was searching for current node + return this; // user was searching for current node } else if ( path[1] == '/' ) { - Node *nn = this; - while ( nn->parent() ) nn = nn->parent(); - if ( path[2]==0 ) { // user is searching for root ( "./" ) - return nn; - } - return nn->search( path+2, 2 ); // do a relative search on the root node + Node *nn = this; + while ( nn->parent() ) nn = nn->parent(); + if ( path[2]==0 ) { // user is searching for root ( "./" ) + return nn; + } + return nn->search( path+2, 2 ); // do a relative search on the root node } } offset = (int) strlen( path_ ) + 1; @@ -1394,8 +1392,8 @@ Fl_Preferences::Node *Fl_Preferences::Node::search( const char *path, int offset return this; if ( len <= 0 || path[ len ] == '/' ) { for ( Node *nd = child_; nd; nd = nd->next_ ) { - Node *nn = nd->search( path, offset ); - if ( nn ) return nn; + Node *nn = nd->search( path, offset ); + if ( nn ) return nn; } return 0; } @@ -1460,11 +1458,11 @@ char Fl_Preferences::Node::remove() { nd = parent()->child_; np = 0L; for ( ; nd; np = nd, nd = nd->next_ ) { if ( nd == this ) { - if ( np ) - np->next_ = nd->next_; - else - parent()->child_ = nd->next_; - break; + if ( np ) + np->next_ = nd->next_; + else + parent()->child_ = nd->next_; + break; } } parent()->dirty_ = 1; @@ -1674,7 +1672,3 @@ int Fl_Plugin_Manager::loadAll(const char *filepath, const char *pattern) { free(dir); return 0; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Printer.cxx b/src/Fl_Printer.cxx index 3f8e50355..22b2a891e 100644 --- a/src/Fl_Printer.cxx +++ b/src/Fl_Printer.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Encompasses platform-specific printing-support code and +// Encompasses platform-specific printing-support code and // PostScript output code for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Printer.H> @@ -212,7 +210,3 @@ Fl_Printer::~Fl_Printer(void) } #endif // defined(FL_NO_PRINT_SUPPORT) - -// -// End of "$Id$". -// diff --git a/src/Fl_Progress.cxx b/src/Fl_Progress.cxx index dc0ab5fa9..614cbc9f0 100644 --- a/src/Fl_Progress.cxx +++ b/src/Fl_Progress.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Progress bar widget routines. // // Copyright 2000-2010 by Michael Sweet. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: @@ -44,9 +42,9 @@ /** Draws the progress bar. */ void Fl_Progress::draw() { - int progress; // Size of progress bar... - int bx, by, bw, bh; // Box areas... - int tx, tw; // Temporary X + width + int progress; // Size of progress bar... + int bx, by, bw, bh; // Box areas... + int tx, tw; // Temporary X + width // Get the box borders... @@ -89,13 +87,13 @@ void Fl_Progress::draw() } -/** +/** The constructor creates the progress bar using the position, size, and label. - + You can set the background color with color() and the progress bar color with selection_color(), or you can set both colors together with color(unsigned bg, unsigned sel). - + The default colors are FL_BACKGROUND2_COLOR and FL_YELLOW, resp. */ Fl_Progress::Fl_Progress(int X, int Y, int W, int H, const char* L) @@ -107,8 +105,3 @@ Fl_Progress::Fl_Progress(int X, int Y, int W, int H, const char* L) maximum(100.0f); value(0.0f); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Repeat_Button.cxx b/src/Fl_Repeat_Button.cxx index 874a126e4..03dc2a997 100644 --- a/src/Fl_Repeat_Button.cxx +++ b/src/Fl_Repeat_Button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Repeat button widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -40,14 +38,14 @@ int Fl_Repeat_Button::handle(int event) { if (Fl::visible_focus()) Fl::focus(this); newval = Fl::event_inside(this); J1: - if (!active()) + if (!active()) newval = 0; if (value(newval)) { if (newval) { - Fl::add_timeout(INITIALREPEAT,repeat_callback,this); - do_callback(); + Fl::add_timeout(INITIALREPEAT,repeat_callback,this); + do_callback(); } else { - Fl::remove_timeout(repeat_callback,this); + Fl::remove_timeout(repeat_callback,this); } } return 1; @@ -58,11 +56,6 @@ int Fl_Repeat_Button::handle(int event) { Fl_Repeat_Button::Fl_Repeat_Button(int X,int Y,int W,int H,const char *l) -: Fl_Button(X,Y,W,H,l) +: Fl_Button(X,Y,W,H,l) { } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Return_Button.cxx b/src/Fl_Return_Button.cxx index c816db0f7..1c0f5f264 100644 --- a/src/Fl_Return_Button.cxx +++ b/src/Fl_Return_Button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Return button widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -62,11 +60,6 @@ int Fl_Return_Button::handle(int event) { Fl_Return_Button::Fl_Return_Button(int X, int Y, int W, int H,const char *l) -: Fl_Button(X,Y,W,H,l) +: Fl_Button(X,Y,W,H,l) { } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Roller.cxx b/src/Fl_Roller.cxx index d6c878252..03e665314 100644 --- a/src/Fl_Roller.cxx +++ b/src/Fl_Roller.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Roller widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Rapid-App style knob @@ -117,12 +115,12 @@ void Fl_Roller::draw() { // draw ridges: double junk; for (double yy = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;; - yy += delta) { - int yy1 = int((sin(yy)/sin(ARC)+1)*W/2); - if (yy1 <= 0) continue; else if (yy1 >= W-1) break; - fl_color(FL_DARK3); fl_yxline(X+yy1,Y+1,Y+H-1); - if (yy < 0) yy1--; else yy1++; - fl_color(FL_LIGHT1);fl_yxline(X+yy1,Y+1,Y+H-1); + yy += delta) { + int yy1 = int((sin(yy)/sin(ARC)+1)*W/2); + if (yy1 <= 0) continue; else if (yy1 >= W-1) break; + fl_color(FL_DARK3); fl_yxline(X+yy1,Y+1,Y+H-1); + if (yy < 0) yy1--; else yy1++; + fl_color(FL_LIGHT1);fl_yxline(X+yy1,Y+1,Y+H-1); } // draw edges: h1 = W/8+1; // distance from end the color inverts @@ -151,12 +149,12 @@ void Fl_Roller::draw() { // draw ridges: double junk; for (double yy = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta; - ; yy += delta) { - int yy1 = int((sin(yy)/sin(ARC)+1)*H/2); - if (yy1 <= 0) continue; else if (yy1 >= H-1) break; - fl_color(FL_DARK3); fl_xyline(X+1,Y+yy1,X+W-1); - if (yy < 0) yy1--; else yy1++; - fl_color(FL_LIGHT1);fl_xyline(X+1,Y+yy1,X+W-1); + ; yy += delta) { + int yy1 = int((sin(yy)/sin(ARC)+1)*H/2); + if (yy1 <= 0) continue; else if (yy1 >= H-1) break; + fl_color(FL_DARK3); fl_xyline(X+1,Y+yy1,X+W-1); + if (yy < 0) yy1--; else yy1++; + fl_color(FL_LIGHT1);fl_xyline(X+1,Y+yy1,X+W-1); } // draw edges: h1 = H/8+1; // distance from end the color inverts @@ -185,7 +183,3 @@ Fl_Roller::Fl_Roller(int X,int Y,int W,int H,const char* L) box(FL_UP_BOX); step(1,1000); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Round_Button.cxx b/src/Fl_Round_Button.cxx index 0f66396cd..78c990788 100644 --- a/src/Fl_Round_Button.cxx +++ b/src/Fl_Round_Button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Round button for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2014 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // A subclass of Fl_Button that always draws as a round circle. This @@ -66,8 +64,3 @@ Fl_Radio_Round_Button::Fl_Radio_Round_Button(int X,int Y,int W,int H,const char { type(FL_RADIO_BUTTON); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_SVG_Image.cxx b/src/Fl_SVG_Image.cxx index c010aa2cf..06c3beb61 100644 --- a/src/Fl_SVG_Image.cxx +++ b/src/Fl_SVG_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // SVG image code for the Fast Light Tool Kit (FLTK). // // Copyright 2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -33,11 +31,11 @@ static double strtoll(const char *str, char **endptr, int base) { } #endif -#define NANOSVG_ALL_COLOR_KEYWORDS // Include full list of color keywords. -#define NANOSVG_IMPLEMENTATION // Expands implementation +#define NANOSVG_ALL_COLOR_KEYWORDS // Include full list of color keywords. +#define NANOSVG_IMPLEMENTATION // Expands implementation #include "../nanosvg/nanosvg.h" -#define NANOSVGRAST_IMPLEMENTATION // Expands implementation +#define NANOSVGRAST_IMPLEMENTATION // Expands implementation #include "../nanosvg/nanosvgrast.h" #if defined(HAVE_LIBZ) @@ -158,7 +156,7 @@ void Fl_SVG_Image::init_(const char *filename, const char *in_filedata, Fl_SVG_I } if (filedata) { counted_svg_image_->svg_image = nsvgParse(filedata, "px", 96); - free(filedata); // made with svg_inflate|malloc|strdup + free(filedata); // made with svg_inflate|malloc|strdup if (counted_svg_image_->svg_image->width == 0 || counted_svg_image_->svg_image->height == 0) { d(-1); ld(ERR_FORMAT); @@ -273,7 +271,3 @@ void Fl_SVG_Image::normalize() { } #endif // FLTK_USE_SVG - -// -// End of "$Id$". -// diff --git a/src/Fl_Screen_Driver.H b/src/Fl_Screen_Driver.H index b7bb6df83..5ab942f21 100644 --- a/src/Fl_Screen_Driver.H +++ b/src/Fl_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // All screen related calls in a driver style class. // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -50,7 +48,7 @@ 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 { @@ -63,7 +61,7 @@ protected: int num_screens; static float fl_intersection(int x1, int y1, int w1, int h1, - int x2, int y2, int w2, int h2); + int x2, int y2, int w2, int h2); public: static int keyboard_screen_scaling; // true means ctrl/+/-/0/ resize windows @@ -139,7 +137,7 @@ public: /* Member function read_win_rectangle() supports public functions fl_read_image() and fl_capture_window_part() which capture pixel data from a window (or also from an offscreen buffer with fl_read_image). - + If 'may_capture_subwins' is true, an implementation may or may not capture also the content of subwindows embedded in 'win'. If subwindows were captured, *'did_capture_subwins' is returned set to true. If read_win_rectangle() @@ -147,11 +145,11 @@ public: be set before the call to the address of a boolean set to false. The implementation of this virtual function for the macOS platform has the capability of capturing subwindows when asked for. - + 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(). - + win is the window to capture from, or NULL to capture from the current offscreen */ virtual Fl_RGB_Image *read_win_rectangle(int X, int Y, int w, int h, Fl_Window *win, @@ -175,7 +173,7 @@ public: 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); @@ -203,7 +201,3 @@ public: \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index a4a4cfcc5..a2a5321c5 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // All screen related calls in a driver style class. // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -172,18 +170,18 @@ Image depths can differ between "to" and "from". /* Captures rectangle x,y,w,h from a mapped window or GL window. All sub-GL-windows that intersect x,y,w,h, and their subwindows, are also captured. - + Arguments when this function is initially called: g: a window or GL window x,y,w,h: a rectangle in window g's coordinates full_img: NULL - + Arguments when this function recursively calls itself: g: an Fl_Group x,y,w,h: a rectangle in g's coordinates if g is a window, or in g's parent window coords if g is a group full_img: NULL, or a previously captured image that encompasses the x,y,w,h rectangle and that will be partially overwritten with the new capture - + Return value: An Fl_RGB_Image*, the depth of which is platform-dependent, containing the captured pixels, or NULL if capture failed. @@ -235,62 +233,62 @@ int Fl_Screen_Driver::input_widget_handle_key(int key, unsigned mods, unsigned s case FL_Delete: { int selected = (input->position() != input->mark()) ? 1 : 0; if (mods==0 && shift && selected) - return input->kf_copy_cut(); // Shift-Delete with selection (WP,NP,WOW,GE,KE,OF) + return input->kf_copy_cut(); // Shift-Delete with selection (WP,NP,WOW,GE,KE,OF) if (mods==0 && shift && !selected) - return input->kf_delete_char_right(); // Shift-Delete no selection (WP,NP,WOW,GE,KE,!OF) - if (mods==0) return input->kf_delete_char_right(); // Delete (Standard) - if (mods==FL_CTRL) return input->kf_delete_word_right(); // Ctrl-Delete (WP,!NP,WOW,GE,KE,!OF) - return 0; // ignore other combos, pass to parent + return input->kf_delete_char_right(); // Shift-Delete no selection (WP,NP,WOW,GE,KE,!OF) + if (mods==0) return input->kf_delete_char_right(); // Delete (Standard) + if (mods==FL_CTRL) return input->kf_delete_word_right(); // Ctrl-Delete (WP,!NP,WOW,GE,KE,!OF) + return 0; // ignore other combos, pass to parent } - + case FL_Left: - if (mods==0) return input->kf_move_char_left(); // Left (WP,NP,WOW,GE,KE,OF) - if (mods==FL_CTRL) return input->kf_move_word_left(); // Ctrl-Left (WP,NP,WOW,GE,KE,!OF) - if (mods==FL_META) return input->kf_move_char_left(); // Meta-Left (WP,NP,?WOW,GE,KE) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_char_left(); // Left (WP,NP,WOW,GE,KE,OF) + if (mods==FL_CTRL) return input->kf_move_word_left(); // Ctrl-Left (WP,NP,WOW,GE,KE,!OF) + if (mods==FL_META) return input->kf_move_char_left(); // Meta-Left (WP,NP,?WOW,GE,KE) + return 0; // ignore other combos, pass to parent + case FL_Right: - if (mods==0) return input->kf_move_char_right(); // Right (WP,NP,WOW,GE,KE,OF) - if (mods==FL_CTRL) return input->kf_move_word_right(); // Ctrl-Right (WP,NP,WOW,GE,KE,!OF) - if (mods==FL_META) return input->kf_move_char_right(); // Meta-Right (WP,NP,?WOW,GE,KE,!OF) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_char_right(); // Right (WP,NP,WOW,GE,KE,OF) + if (mods==FL_CTRL) return input->kf_move_word_right(); // Ctrl-Right (WP,NP,WOW,GE,KE,!OF) + if (mods==FL_META) return input->kf_move_char_right(); // Meta-Right (WP,NP,?WOW,GE,KE,!OF) + return 0; // ignore other combos, pass to parent + case FL_Up: - if (mods==0) return input->kf_lines_up(1); // Up (WP,NP,WOW,GE,KE,OF) - if (mods==FL_CTRL) return input->kf_move_up_and_sol(); // Ctrl-Up (WP,!NP,WOW,GE,!KE,OF) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_lines_up(1); // Up (WP,NP,WOW,GE,KE,OF) + if (mods==FL_CTRL) return input->kf_move_up_and_sol(); // Ctrl-Up (WP,!NP,WOW,GE,!KE,OF) + return 0; // ignore other combos, pass to parent + case FL_Down: - if (mods==0) return input->kf_lines_down(1); // Dn (WP,NP,WOW,GE,KE,OF) - if (mods==FL_CTRL) return input->kf_move_down_and_eol(); // Ctrl-Down (WP,!NP,WOW,GE,!KE,OF) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_lines_down(1); // Dn (WP,NP,WOW,GE,KE,OF) + if (mods==FL_CTRL) return input->kf_move_down_and_eol(); // Ctrl-Down (WP,!NP,WOW,GE,!KE,OF) + return 0; // ignore other combos, pass to parent + case FL_Page_Up: // Fl_Input has no scroll control, so instead we move the cursor by one page - if (mods==0) return input->kf_page_up(); // PageUp (WP,NP,WOW,GE,KE) - if (mods==FL_CTRL) return input->kf_page_up(); // Ctrl-PageUp (!WP,!NP,!WOW,!GE,KE,OF) - if (mods==FL_ALT) return input->kf_page_up(); // Alt-PageUp (!WP,!NP,!WOW,!GE,KE,OF) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_page_up(); // PageUp (WP,NP,WOW,GE,KE) + if (mods==FL_CTRL) return input->kf_page_up(); // Ctrl-PageUp (!WP,!NP,!WOW,!GE,KE,OF) + if (mods==FL_ALT) return input->kf_page_up(); // Alt-PageUp (!WP,!NP,!WOW,!GE,KE,OF) + return 0; // ignore other combos, pass to parent + case FL_Page_Down: - if (mods==0) return input->kf_page_down(); // PageDn (WP,NP,WOW,GE,KE) - if (mods==FL_CTRL) return input->kf_page_down(); // Ctrl-PageDn (!WP,!NP,!WOW,!GE,KE,OF) - if (mods==FL_ALT) return input->kf_page_down(); // Alt-PageDn (!WP,!NP,!WOW,!GE,KE,OF) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_page_down(); // PageDn (WP,NP,WOW,GE,KE) + if (mods==FL_CTRL) return input->kf_page_down(); // Ctrl-PageDn (!WP,!NP,!WOW,!GE,KE,OF) + if (mods==FL_ALT) return input->kf_page_down(); // Alt-PageDn (!WP,!NP,!WOW,!GE,KE,OF) + return 0; // ignore other combos, pass to parent + case FL_Home: - if (mods==0) return input->kf_move_sol(); // Home (WP,NP,WOW,GE,KE,OF) - if (mods==FL_CTRL) return input->kf_top(); // Ctrl-Home (WP,NP,WOW,GE,KE,OF) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_sol(); // Home (WP,NP,WOW,GE,KE,OF) + if (mods==FL_CTRL) return input->kf_top(); // Ctrl-Home (WP,NP,WOW,GE,KE,OF) + return 0; // ignore other combos, pass to parent + case FL_End: - if (mods==0) return input->kf_move_eol(); // End (WP,NP,WOW,GE,KE,OF) - if (mods==FL_CTRL) return input->kf_bottom(); // Ctrl-End (WP,NP,WOW,GE,KE,OF) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_eol(); // End (WP,NP,WOW,GE,KE,OF) + if (mods==FL_CTRL) return input->kf_bottom(); // Ctrl-End (WP,NP,WOW,GE,KE,OF) + return 0; // ignore other combos, pass to parent + case FL_BackSpace: - if (mods==0) return input->kf_delete_char_left(); // Backspace (WP,NP,WOW,GE,KE,OF) - if (mods==FL_CTRL) return input->kf_delete_word_left(); // Ctrl-Backspace (WP,!NP,WOW,GE,KE,!OF) + if (mods==0) return input->kf_delete_char_left(); // Backspace (WP,NP,WOW,GE,KE,OF) + if (mods==FL_CTRL) return input->kf_delete_word_left(); // Ctrl-Backspace (WP,!NP,WOW,GE,KE,!OF) return 0; // ignore other combos, pass to parent } @@ -309,7 +307,7 @@ void Fl_Screen_Driver::rescale_all_windows_from_screen(int screen, float f) Fl_Window *win = Fl::first_window(); while (win) { if (!win->parent() && - (Fl_Window_Driver::driver(win)->screen_num() == screen || rescalable() == SYSTEMWIDE_APP_SCALING) && + (Fl_Window_Driver::driver(win)->screen_num() == screen || rescalable() == SYSTEMWIDE_APP_SCALING) && win->user_data() != &Fl_Screen_Driver::transient_scale_display) { count++; } @@ -321,8 +319,8 @@ void Fl_Screen_Driver::rescale_all_windows_from_screen(int screen, float f) win = Fl::first_window(); // memorize all top-level windows while (win) { if (!win->parent() && - (Fl_Window_Driver::driver(win)->screen_num() == screen || rescalable() == SYSTEMWIDE_APP_SCALING) && - win->user_data() != &Fl_Screen_Driver::transient_scale_display) { + (Fl_Window_Driver::driver(win)->screen_num() == screen || rescalable() == SYSTEMWIDE_APP_SCALING) && + win->user_data() != &Fl_Screen_Driver::transient_scale_display) { win_array[i++] = win; } win = Fl::next_window(win); @@ -480,7 +478,7 @@ void Fl_Screen_Driver::open_display() if (rescalable()) { use_startup_scale_factor(); if (keyboard_screen_scaling) - Fl::add_handler(Fl_Screen_Driver::scale_handler); + Fl::add_handler(Fl_Screen_Driver::scale_handler); int mx, my; int ns = Fl::screen_driver()->get_mouse(mx, my); Fl_Graphics_Driver::default_driver().scale(scale(ns)); @@ -519,7 +517,3 @@ void Fl_Screen_Driver::default_icons(const Fl_RGB_Image *icons[], int count) {} \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index 910cf3aad..6d754d134 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Scroll widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -68,17 +66,17 @@ void Fl_Scroll::draw_clip(void* v,int X, int Y, int W, int H) { case _FL_PLASTIC_UP_FRAME : case _FL_PLASTIC_DOWN_FRAME : if (s->parent() == (Fl_Group *)s->window() && Fl::scheme_bg_) { - Fl::scheme_bg_->draw(X-(X%((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->w()), - Y-(Y%((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->h()), - W+((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->w(), - H+((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->h()); - break; + Fl::scheme_bg_->draw(X-(X%((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->w()), + Y-(Y%((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->h()), + W+((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->w(), + H+((Fl_Tiled_Image *)Fl::scheme_bg_)->image()->h()); + break; } default : - fl_color(s->color()); - fl_rectf(X,Y,W,H); - break; + fl_color(s->color()); + fl_rectf(X,Y,W,H); + break; } Fl_Widget*const* a = s->array(); for (int i=s->children()-2; i--;) { @@ -119,15 +117,15 @@ void Fl_Scroll::recalc_scrollbars(ScrollInfo &si) { if ( o==&scrollbar || o==&hscrollbar ) continue; if ( first ) { first = 0; - si.child.l = o->x(); - si.child.r = o->x()+o->w(); - si.child.b = o->y()+o->h(); - si.child.t = o->y(); + si.child.l = o->x(); + si.child.r = o->x()+o->w(); + si.child.b = o->y()+o->h(); + si.child.t = o->y(); } else { - if (o->x() < si.child.l) si.child.l = o->x(); - if (o->y() < si.child.t) si.child.t = o->y(); - if (o->x()+o->w() > si.child.r) si.child.r = o->x()+o->w(); - if (o->y()+o->h() > si.child.b) si.child.b = o->y()+o->h(); + if (o->x() < si.child.l) si.child.l = o->x(); + if (o->y() < si.child.t) si.child.t = o->y(); + if (o->x()+o->w() > si.child.r) si.child.r = o->x()+o->w(); + if (o->y()+o->h() > si.child.b) si.child.b = o->y()+o->h(); } } @@ -144,24 +142,24 @@ void Fl_Scroll::recalc_scrollbars(ScrollInfo &si) { si.hneeded = 0; if (type() & VERTICAL) { if ((type() & ALWAYS_ON) || si.child.t < Y || si.child.b > Y+H) { - si.vneeded = 1; - W -= si.scrollsize; - if (scrollbar.align() & FL_ALIGN_LEFT) X += si.scrollsize; + si.vneeded = 1; + W -= si.scrollsize; + if (scrollbar.align() & FL_ALIGN_LEFT) X += si.scrollsize; } } if (type() & HORIZONTAL) { if ((type() & ALWAYS_ON) || si.child.l < X || si.child.r > X+W) { - si.hneeded = 1; - H -= si.scrollsize; - if (scrollbar.align() & FL_ALIGN_TOP) Y += si.scrollsize; - // recheck vertical since we added a horizontal scrollbar - if (!si.vneeded && (type() & VERTICAL)) { - if ((type() & ALWAYS_ON) || si.child.t < Y || si.child.b > Y+H) { - si.vneeded = 1; - W -= si.scrollsize; - if (scrollbar.align() & FL_ALIGN_LEFT) X += si.scrollsize; - } - } + si.hneeded = 1; + H -= si.scrollsize; + if (scrollbar.align() & FL_ALIGN_TOP) Y += si.scrollsize; + // recheck vertical since we added a horizontal scrollbar + if (!si.vneeded && (type() & VERTICAL)) { + if ((type() & ALWAYS_ON) || si.child.t < Y || si.child.b > Y+H) { + si.vneeded = 1; + W -= si.scrollsize; + if (scrollbar.align() & FL_ALIGN_LEFT) X += si.scrollsize; + } + } } } si.innerchild.x = X; @@ -173,15 +171,15 @@ void Fl_Scroll::recalc_scrollbars(ScrollInfo &si) { // calculate hor scrollbar position si.hscroll.x = si.innerchild.x; si.hscroll.y = (scrollbar.align() & FL_ALIGN_TOP) - ? si.innerbox.y - : si.innerbox.y + si.innerbox.h - si.scrollsize; + ? si.innerbox.y + : si.innerbox.y + si.innerbox.h - si.scrollsize; si.hscroll.w = si.innerchild.w; si.hscroll.h = si.scrollsize; // calculate ver scrollbar position si.vscroll.x = (scrollbar.align() & FL_ALIGN_LEFT) ? si.innerbox.x - : si.innerbox.x + si.innerbox.w - si.scrollsize; + : si.innerbox.x + si.innerbox.w - si.scrollsize; si.vscroll.y = si.innerchild.y; si.vscroll.w = si.scrollsize; si.vscroll.h = si.innerchild.h; @@ -261,9 +259,9 @@ void Fl_Scroll::draw() { B = 0; for (int i=children()-2; i--; a++) { if ((*a)->x() < L) L = (*a)->x(); - if (((*a)->x() + (*a)->w()) > R) R = (*a)->x() + (*a)->w(); + if (((*a)->x() + (*a)->w()) > R) R = (*a)->x() + (*a)->w(); if ((*a)->y() < T) T = (*a)->y(); - if (((*a)->y() + (*a)->h()) > B) B = (*a)->y() + (*a)->h(); + if (((*a)->y() + (*a)->h()) > B) B = (*a)->y() + (*a)->h(); } if (L > X) draw_clip(this, X, Y, L - X, H); if (R < (X + W)) draw_clip(this, R, Y, X + W - R, H); @@ -285,22 +283,22 @@ void Fl_Scroll::draw() { // Now that we know what's needed, make it so. if (si.vneeded && !scrollbar.visible()) { - scrollbar.set_visible(); - d = FL_DAMAGE_ALL; + scrollbar.set_visible(); + d = FL_DAMAGE_ALL; } else if (!si.vneeded && scrollbar.visible()) { - scrollbar.clear_visible(); - draw_clip(this, si.vscroll.x, si.vscroll.y, si.vscroll.w, si.vscroll.h); - d = FL_DAMAGE_ALL; + scrollbar.clear_visible(); + draw_clip(this, si.vscroll.x, si.vscroll.y, si.vscroll.w, si.vscroll.h); + d = FL_DAMAGE_ALL; } if (si.hneeded && !hscrollbar.visible()) { - hscrollbar.set_visible(); - d = FL_DAMAGE_ALL; + hscrollbar.set_visible(); + d = FL_DAMAGE_ALL; } else if (!si.hneeded && hscrollbar.visible()) { - hscrollbar.clear_visible(); - draw_clip(this, si.hscroll.x, si.hscroll.y, si.hscroll.w, si.hscroll.h); - d = FL_DAMAGE_ALL; + hscrollbar.clear_visible(); + draw_clip(this, si.hscroll.x, si.hscroll.y, si.hscroll.w, si.hscroll.h); + d = FL_DAMAGE_ALL; } else if ( hscrollbar.h() != si.scrollsize || scrollbar.w() != si.scrollsize ) { // scrollsize changed @@ -308,11 +306,11 @@ void Fl_Scroll::draw() { } scrollbar.resize(si.vscroll.x, si.vscroll.y, si.vscroll.w, si.vscroll.h); - oldy = yposition_ = si.vscroll.pos; // si.innerchild.y - si.child.t; + oldy = yposition_ = si.vscroll.pos; // si.innerchild.y - si.child.t; scrollbar.value(si.vscroll.pos, si.vscroll.size, si.vscroll.first, si.vscroll.total); hscrollbar.resize(si.hscroll.x, si.hscroll.y, si.hscroll.w, si.hscroll.h); - oldx = xposition_ = si.hscroll.pos; // si.innerchild.x - si.child.l; + oldx = xposition_ = si.hscroll.pos; // si.innerchild.x - si.child.l; hscrollbar.value(si.hscroll.pos, si.hscroll.size, si.hscroll.first, si.hscroll.total); } @@ -449,7 +447,3 @@ int Fl_Scroll::handle(int event) { fix_scrollbar_order(); return Fl_Group::handle(event); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Scrollbar.cxx b/src/Fl_Scrollbar.cxx index a659e8e14..64071dbe2 100644 --- a/src/Fl_Scrollbar.cxx +++ b/src/Fl_Scrollbar.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Scroll bar widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -149,40 +147,40 @@ int Fl_Scrollbar::handle(int event) { if (horizontal()) { switch (Fl::event_key()) { case FL_Left: - v -= ls; - break; + v -= ls; + break; case FL_Right: - v += ls; - break; + v += ls; + break; default: - return 0; + return 0; } } else { // vertical switch (Fl::event_key()) { case FL_Up: - v -= ls; - break; + v -= ls; + break; case FL_Down: - v += ls; - break; + v += ls; + break; case FL_Page_Up: - if (slider_size() >= 1.0) return 0; - v -= int((maximum()-minimum())*slider_size()/(1.0-slider_size())); - v += ls; - break; + if (slider_size() >= 1.0) return 0; + v -= int((maximum()-minimum())*slider_size()/(1.0-slider_size())); + v += ls; + break; case FL_Page_Down: - if (slider_size() >= 1.0) return 0; - v += int((maximum()-minimum())*slider_size()/(1.0-slider_size())); - v -= ls; - break; + if (slider_size() >= 1.0) return 0; + v += int((maximum()-minimum())*slider_size()/(1.0-slider_size())); + v -= ls; + break; case FL_Home: - v = int(minimum()); - break; + v = int(minimum()); + break; case FL_End: - v = int(maximum()); - break; + v = int(maximum()); + break; default: - return 0; + return 0; } } v = int(clamp(v)); @@ -208,9 +206,9 @@ void Fl_Scrollbar::draw() { Fl_Slider::draw(X+H,Y,W-2*H,H); if (damage()&FL_DAMAGE_ALL) { draw_box((pushed_==1) ? fl_down(slider()) : slider(), - X, Y, H, H, selection_color()); + X, Y, H, H, selection_color()); draw_box((pushed_==2) ? fl_down(slider()) : slider(), - X+W-H, Y, H, H, selection_color()); + X+W-H, Y, H, H, selection_color()); if (active_r()) fl_color(labelcolor()); else @@ -219,13 +217,13 @@ void Fl_Scrollbar::draw() { int x1 = X+(H-w1-1)/2; int yy1 = Y+(H-2*w1-1)/2; if (Fl::is_scheme("gtk+")) { - fl_polygon(x1, yy1+w1, x1+w1, yy1+2*w1, x1+w1-1, yy1+w1, x1+w1, yy1); - x1 += (W-H); - fl_polygon(x1, yy1, x1+1, yy1+w1, x1, yy1+2*w1, x1+w1, yy1+w1); + fl_polygon(x1, yy1+w1, x1+w1, yy1+2*w1, x1+w1-1, yy1+w1, x1+w1, yy1); + x1 += (W-H); + fl_polygon(x1, yy1, x1+1, yy1+w1, x1, yy1+2*w1, x1+w1, yy1+w1); } else { - fl_polygon(x1, yy1+w1, x1+w1, yy1+2*w1, x1+w1, yy1); - x1 += (W-H); - fl_polygon(x1, yy1, x1, yy1+2*w1, x1+w1, yy1+w1); + fl_polygon(x1, yy1+w1, x1+w1, yy1+2*w1, x1+w1, yy1); + x1 += (W-H); + fl_polygon(x1, yy1, x1, yy1+2*w1, x1+w1, yy1+w1); } } } else { // vertical @@ -233,9 +231,9 @@ void Fl_Scrollbar::draw() { Fl_Slider::draw(X,Y+W,W,H-2*W); if (damage()&FL_DAMAGE_ALL) { draw_box((pushed_==1) ? fl_down(slider()) : slider(), - X, Y, W, W, selection_color()); + X, Y, W, W, selection_color()); draw_box((pushed_==2) ? fl_down(slider()) : slider(), - X, Y+H-W, W, W, selection_color()); + X, Y+H-W, W, W, selection_color()); if (active_r()) fl_color(labelcolor()); else @@ -244,14 +242,14 @@ void Fl_Scrollbar::draw() { int x1 = X+(W-2*w1-1)/2; int yy1 = Y+(W-w1-1)/2; if (Fl::is_scheme("gtk+")) { - fl_polygon(x1, yy1+w1, x1+w1, yy1+w1-1, x1+2*w1, yy1+w1, x1+w1, yy1); - yy1 += H-W; - fl_polygon(x1, yy1, x1+w1, yy1+1, x1+w1, yy1+w1); - fl_polygon(x1+w1, yy1+1, x1+2*w1, yy1, x1+w1, yy1+w1); + fl_polygon(x1, yy1+w1, x1+w1, yy1+w1-1, x1+2*w1, yy1+w1, x1+w1, yy1); + yy1 += H-W; + fl_polygon(x1, yy1, x1+w1, yy1+1, x1+w1, yy1+w1); + fl_polygon(x1+w1, yy1+1, x1+2*w1, yy1, x1+w1, yy1+w1); } else { - fl_polygon(x1, yy1+w1, x1+2*w1, yy1+w1, x1+w1, yy1); - yy1 += H-W; - fl_polygon(x1, yy1, x1+w1, yy1+w1, x1+2*w1, yy1); + fl_polygon(x1, yy1+w1, x1+2*w1, yy1+w1, x1+w1, yy1); + yy1 += H-W; + fl_polygon(x1, yy1, x1+w1, yy1+w1, x1+2*w1, yy1); } } } @@ -276,8 +274,3 @@ Fl_Scrollbar::~Fl_Scrollbar() { if (pushed_) Fl::remove_timeout(timeout_cb, this); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx index e8cfb3fb9..4ea778d6a 100644 --- a/src/Fl_Shared_Image.cxx +++ b/src/Fl_Shared_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Shared image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -32,13 +30,13 @@ // Global class vars... // -Fl_Shared_Image **Fl_Shared_Image::images_ = 0; // Shared images -int Fl_Shared_Image::num_images_ = 0; // Number of shared images -int Fl_Shared_Image::alloc_images_ = 0; // Allocated shared images +Fl_Shared_Image **Fl_Shared_Image::images_ = 0; // Shared images +int Fl_Shared_Image::num_images_ = 0; // Number of shared images +int Fl_Shared_Image::alloc_images_ = 0; // Allocated shared images Fl_Shared_Handler *Fl_Shared_Image::handlers_ = 0;// Additional format handlers -int Fl_Shared_Image::num_handlers_ = 0; // Number of format handlers -int Fl_Shared_Image::alloc_handlers_ = 0; // Allocated format handlers +int Fl_Shared_Image::num_handlers_ = 0; // Number of format handlers +int Fl_Shared_Image::alloc_handlers_ = 0; // Allocated format handlers // @@ -91,15 +89,15 @@ int Fl_Shared_Image::num_images() { same width and height. The second step will match if there is an image marked \p original with the same name, regardless of width and height. - \returns Whether the images match or their relative sort order (see text). + \returns Whether the images match or their relative sort order (see text). - \retval 0 the images match - \retval <0 Image \p i0 is \e less than image \p i1 - \retval >0 Image \p i0 is \e greater than image \p i1 + \retval 0 the images match + \retval <0 Image \p i0 is \e less than image \p i1 + \retval >0 Image \p i0 is \e greater than image \p i1 */ int -Fl_Shared_Image::compare(Fl_Shared_Image **i0, // I - First image - Fl_Shared_Image **i1) { // I - Second image +Fl_Shared_Image::compare(Fl_Shared_Image **i0, // I - First image + Fl_Shared_Image **i1) { // I - Second image int i = strcmp((*i0)->name(), (*i1)->name()); if (i) return i; @@ -133,8 +131,8 @@ Fl_Shared_Image::Fl_Shared_Image() : Fl_Image(0,0,0) { The constructors are protected and cannot be used directly from a program. Use the get() method instead. */ -Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename - Fl_Image *img) // I - Image +Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename + Fl_Image *img) // I - Image : Fl_Image(0,0,0) { name_ = new char[strlen(n) + 1]; strcpy((char *)name_, n); @@ -159,7 +157,7 @@ Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename */ void Fl_Shared_Image::add() { - Fl_Shared_Image **temp; // New image pointer array... + Fl_Shared_Image **temp; // New image pointer array... if (num_images_ >= alloc_images_) { // Allocate more memory... @@ -219,7 +217,7 @@ Fl_Shared_Image::~Fl_Shared_Image() { so that no hole will occur. */ void Fl_Shared_Image::release() { - int i; // Looping var... + int i; // Looping var... refcount_ --; if (refcount_ > 0) return; @@ -250,10 +248,10 @@ void Fl_Shared_Image::release() { /** Reloads the shared image from disk. */ void Fl_Shared_Image::reload() { // Load image from disk... - int i; // Looping var - FILE *fp; // File pointer - uchar header[64]; // Buffer for auto-detecting files - Fl_Image *img; // New image + int i; // Looping var + FILE *fp; // File pointer + uchar header[64]; // Buffer for auto-detecting files + Fl_Image *img; // New image if (!name_) return; @@ -305,8 +303,8 @@ void Fl_Shared_Image::reload() { Fl_Image * Fl_Shared_Image::copy(int W, int H) { - Fl_Image *temp_image; // New image file - Fl_Shared_Image *temp_shared; // New shared image + Fl_Image *temp_image; // New image file + Fl_Shared_Image *temp_shared; // New shared image // Make a copy of the image we're sharing... if (!image_) temp_image = 0; @@ -333,8 +331,8 @@ Fl_Shared_Image::copy(int W, int H) { // void -Fl_Shared_Image::color_average(Fl_Color c, // I - Color to blend with - float i) { // I - Blend fraction +Fl_Shared_Image::color_average(Fl_Color c, // I - Color to blend with + float i) { // I - Blend fraction if (!image_) return; image_->color_average(c, i); @@ -398,8 +396,8 @@ void Fl_Shared_Image::uncache() when no longer needed. */ Fl_Shared_Image* Fl_Shared_Image::find(const char *name, int W, int H) { - Fl_Shared_Image *key, // Image key - **match; // Matching image + Fl_Shared_Image *key, // Image key + **match; // Matching image if (num_images_) { key = new Fl_Shared_Image(); @@ -441,10 +439,10 @@ Fl_Shared_Image* Fl_Shared_Image::find(const char *name, int W, int H) { copy with width \p W and height \p H is also added to the list of shared images. - \note If the sizes differ, then \e two images are created as mentioned above. - This is intentional so the original image is cached and preserved. - If you request the same image with another size later, then the - \b original image will be found, copied, resized, and returned. + \note If the sizes differ, then \e two images are created as mentioned above. + This is intentional so the original image is cached and preserved. + If you request the same image with another size later, then the + \b original image will be found, copied, resized, and returned. Shared JPEG and PNG images can also be created from memory by using their named memory access constructor. @@ -460,7 +458,7 @@ Fl_Shared_Image* Fl_Shared_Image::find(const char *name, int W, int H) { \see Fl_PNG_Image::Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int maxsize) */ Fl_Shared_Image* Fl_Shared_Image::get(const char *name, int W, int H) { - Fl_Shared_Image *temp; // Image + Fl_Shared_Image *temp; // Image if ((temp = find(name, W, H)) != NULL) return temp; @@ -485,9 +483,9 @@ Fl_Shared_Image* Fl_Shared_Image::get(const char *name, int W, int H) { /** Builds a shared image from a pre-existing Fl_RGB_Image. - \param[in] rgb an Fl_RGB_Image used to build a new shared image. - \param[in] own_it 1 if the shared image should delete \p rgb when - it is itself deleted, 0 otherwise + \param[in] rgb an Fl_RGB_Image used to build a new shared image. + \param[in] own_it 1 if the shared image should delete \p rgb when + it is itself deleted, 0 otherwise \version 1.3.4 */ @@ -504,8 +502,8 @@ Fl_Shared_Image *Fl_Shared_Image::get(Fl_RGB_Image *rgb, int own_it) for adding new formats. */ void Fl_Shared_Image::add_handler(Fl_Shared_Handler f) { - int i; // Looping var... - Fl_Shared_Handler *temp; // New image handler array... + int i; // Looping var... + Fl_Shared_Handler *temp; // New image handler array... // First see if we have already added the handler... for (i = 0; i < num_handlers_; i ++) { @@ -533,7 +531,7 @@ void Fl_Shared_Image::add_handler(Fl_Shared_Handler f) { /** Removes a shared image handler. */ void Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) { - int i; // Looping var... + int i; // Looping var... // First see if the handler has been added... for (i = 0; i < num_handlers_; i ++) { @@ -551,8 +549,3 @@ void Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) { (num_handlers_ - i) * sizeof(Fl_Shared_Handler )); } } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Simple_Terminal.cxx b/src/Fl_Simple_Terminal.cxx index ae91a6f06..cc9d77082 100644 --- a/src/Fl_Simple_Terminal.cxx +++ b/src/Fl_Simple_Terminal.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // A simple terminal widget for Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <ctype.h> /* isdigit */ @@ -432,19 +430,19 @@ int Fl_Simple_Terminal::current_style_index() const { \param stable - the style table, an array of structs of the type Fl_Text_Display::Style_Table_Entry. Can be NULL - to use the default style table (see ansi(bool)). + to use the default style table (see ansi(bool)). \param stable_size - the sizeof() the style table (in bytes). Set this to 0 if 'stable' is NULL. \param normal_style_index - the style table index# used when the special ANSI sequence "\033[0m" is encountered. - Normally use 0 so that sequence selects the - first item in the table. Only use different - values if a different entry in the table - should be the default. This value should - not be larger than the number of items in - the table, or it will be clamped with a - modulus operation. This value is ignored - if stable is NULL. + Normally use 0 so that sequence selects the + first item in the table. Only use different + values if a different entry in the table + should be the default. This value should + not be larger than the number of items in + the table, or it will be clamped with a + modulus operation. This value is ignored + if stable is NULL. */ void Fl_Simple_Terminal::style_table(Fl_Text_Display::Style_Table_Entry *stable, int stable_size, int normal_style_index) { diff --git a/src/Fl_Single_Window.cxx b/src/Fl_Single_Window.cxx index c5e37fabc..e753a6860 100644 --- a/src/Fl_Single_Window.cxx +++ b/src/Fl_Single_Window.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Single-buffered window for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,40 +7,35 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -// A window with a single-buffered context +// A window with a single-buffered context // -// This is provided for systems where the base class is double -// buffered. You can turn it off using this subclass in case -// your display looks better without it. +// This is provided for systems where the base class is double +// buffered. You can turn it off using this subclass in case +// your display looks better without it. #include <FL/Fl_Single_Window.H> -void Fl_Single_Window::show() +void Fl_Single_Window::show() { Fl_Window::show(); } Fl_Single_Window::Fl_Single_Window(int W, int H, const char *l) -: Fl_Window(W,H,l) +: Fl_Window(W,H,l) { } Fl_Single_Window::Fl_Single_Window(int X, int Y, int W, int H, const char *l) -: Fl_Window(X,Y,W,H,l) +: Fl_Window(X,Y,W,H,l) { } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx index e5f32ef01..077dbcd21 100644 --- a/src/Fl_Slider.cxx +++ b/src/Fl_Slider.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Slider widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -59,18 +57,18 @@ void Fl_Slider::slider_size(double v) { if (v < 0) v = 0; if (v > 1) v = 1; if (slider_size_ != float(v)) { - slider_size_ = float(v); + slider_size_ = float(v); damage(FL_DAMAGE_EXPOSE); } } -/** - Sets the minimum (a) and maximum (b) values for the valuator widget. +/** + Sets the minimum (a) and maximum (b) values for the valuator widget. if at least one of the values is changed, a partial redraw is asked. */ void Fl_Slider::bounds(double a, double b) { if (minimum() != a || maximum() != b) { - Fl_Valuator::bounds(a, b); + Fl_Valuator::bounds(a, b); damage(FL_DAMAGE_EXPOSE); } } @@ -167,38 +165,38 @@ void Fl_Slider::draw(int X, int Y, int W, int H) { Fl::is_scheme("gtk+")) { if (W>H && wsl>(hsl+8)) { // Draw horizontal grippers - int yy, hh; - hh = hsl-8; - xx = xsl+(wsl-hsl-4)/2; - yy = ysl+3; + int yy, hh; + hh = hsl-8; + xx = xsl+(wsl-hsl-4)/2; + yy = ysl+3; - fl_color(fl_darker(selection_color())); - fl_line(xx, yy+hh, xx+hh, yy); - fl_line(xx+6, yy+hh, xx+hh+6, yy); - fl_line(xx+12, yy+hh, xx+hh+12, yy); + fl_color(fl_darker(selection_color())); + fl_line(xx, yy+hh, xx+hh, yy); + fl_line(xx+6, yy+hh, xx+hh+6, yy); + fl_line(xx+12, yy+hh, xx+hh+12, yy); xx++; - fl_color(fl_lighter(selection_color())); - fl_line(xx, yy+hh, xx+hh, yy); - fl_line(xx+6, yy+hh, xx+hh+6, yy); - fl_line(xx+12, yy+hh, xx+hh+12, yy); + fl_color(fl_lighter(selection_color())); + fl_line(xx, yy+hh, xx+hh, yy); + fl_line(xx+6, yy+hh, xx+hh+6, yy); + fl_line(xx+12, yy+hh, xx+hh+12, yy); } else if (H>W && hsl>(wsl+8)) { // Draw vertical grippers - int yy; - xx = xsl+4; - ww = wsl-8; - yy = ysl+(hsl-wsl-4)/2; + int yy; + xx = xsl+4; + ww = wsl-8; + yy = ysl+(hsl-wsl-4)/2; - fl_color(fl_darker(selection_color())); - fl_line(xx, yy+ww, xx+ww, yy); - fl_line(xx, yy+ww+6, xx+ww, yy+6); - fl_line(xx, yy+ww+12, xx+ww, yy+12); + fl_color(fl_darker(selection_color())); + fl_line(xx, yy+ww, xx+ww, yy); + fl_line(xx, yy+ww+6, xx+ww, yy+6); + fl_line(xx, yy+ww+12, xx+ww, yy+12); yy++; - fl_color(fl_lighter(selection_color())); - fl_line(xx, yy+ww, xx+ww, yy); - fl_line(xx, yy+ww+6, xx+ww, yy+6); - fl_line(xx, yy+ww+12, xx+ww, yy+12); + fl_color(fl_lighter(selection_color())); + fl_line(xx, yy+ww, xx+ww, yy); + fl_line(xx, yy+ww+6, xx+ww, yy+6); + fl_line(xx, yy+ww+12, xx+ww, yy+12); } } } @@ -247,10 +245,10 @@ int Fl_Slider::handle(int event, int X, int Y, int W, int H) { S = 0; if (event == FL_PUSH) { - int xx = int(val*ww+.5); - offcenter = mx-xx; - if (offcenter < -10 || offcenter > 10) offcenter = 0; - else return 1; + int xx = int(val*ww+.5); + offcenter = mx-xx; + if (offcenter < -10 || offcenter > 10) offcenter = 0; + else return 1; } } else { @@ -260,11 +258,11 @@ int Fl_Slider::handle(int event, int X, int Y, int W, int H) { if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4; if (S < T) S = T; if (event == FL_PUSH) { - int xx = int(val*(ww-S)+.5); - offcenter = mx-xx; - if (offcenter < 0) offcenter = 0; - else if (offcenter > S) offcenter = S; - else return 1; + int xx = int(val*(ww-S)+.5); + offcenter = mx-xx; + if (offcenter < 0) offcenter = 0; + else if (offcenter > S) offcenter = S; + else return 1; } } @@ -297,40 +295,40 @@ int Fl_Slider::handle(int event, int X, int Y, int W, int H) { case FL_KEYBOARD: { Fl_Widget_Tracker wp(this); switch (Fl::event_key()) { - case FL_Up: - if (horizontal()) return 0; - handle_push(); - if (wp.deleted()) return 1; - handle_drag(clamp(increment(value(),-1))); - if (wp.deleted()) return 1; - handle_release(); - return 1; - case FL_Down: - if (horizontal()) return 0; - handle_push(); - if (wp.deleted()) return 1; - handle_drag(clamp(increment(value(),1))); - if (wp.deleted()) return 1; - handle_release(); - return 1; - case FL_Left: - if (!horizontal()) return 0; - handle_push(); - if (wp.deleted()) return 1; - handle_drag(clamp(increment(value(),-1))); - if (wp.deleted()) return 1; - handle_release(); - return 1; - case FL_Right: - if (!horizontal()) return 0; - handle_push(); - if (wp.deleted()) return 1; - handle_drag(clamp(increment(value(),1))); - if (wp.deleted()) return 1; - handle_release(); - return 1; - default: - return 0; + case FL_Up: + if (horizontal()) return 0; + handle_push(); + if (wp.deleted()) return 1; + handle_drag(clamp(increment(value(),-1))); + if (wp.deleted()) return 1; + handle_release(); + return 1; + case FL_Down: + if (horizontal()) return 0; + handle_push(); + if (wp.deleted()) return 1; + handle_drag(clamp(increment(value(),1))); + if (wp.deleted()) return 1; + handle_release(); + return 1; + case FL_Left: + if (!horizontal()) return 0; + handle_push(); + if (wp.deleted()) return 1; + handle_drag(clamp(increment(value(),-1))); + if (wp.deleted()) return 1; + handle_release(); + return 1; + case FL_Right: + if (!horizontal()) return 0; + handle_push(); + if (wp.deleted()) return 1; + handle_drag(clamp(increment(value(),1))); + if (wp.deleted()) return 1; + handle_release(); + return 1; + default: + return 0; } } // break not required because of switch... @@ -355,15 +353,15 @@ int Fl_Slider::handle(int event) { } return handle(event, - x()+Fl::box_dx(box()), - y()+Fl::box_dy(box()), - w()-Fl::box_dw(box()), - h()-Fl::box_dh(box())); + x()+Fl::box_dx(box()), + y()+Fl::box_dy(box()), + w()-Fl::box_dw(box()), + h()-Fl::box_dh(box())); } Fl_Fill_Slider::Fl_Fill_Slider(int X,int Y,int W,int H,const char *L) -: Fl_Slider(X,Y,W,H,L) +: Fl_Slider(X,Y,W,H,L) { type(FL_VERT_FILL_SLIDER); } @@ -376,27 +374,22 @@ Fl_Hor_Slider::Fl_Hor_Slider(int X,int Y,int W,int H,const char *l) Fl_Hor_Fill_Slider::Fl_Hor_Fill_Slider(int X,int Y,int W,int H,const char *L) -: Fl_Slider(X,Y,W,H,L) +: Fl_Slider(X,Y,W,H,L) { type(FL_HOR_FILL_SLIDER); } Fl_Hor_Nice_Slider::Fl_Hor_Nice_Slider(int X,int Y,int W,int H,const char *L) -: Fl_Slider(X,Y,W,H,L) +: Fl_Slider(X,Y,W,H,L) { - type(FL_HOR_NICE_SLIDER); + type(FL_HOR_NICE_SLIDER); box(FL_FLAT_BOX); } Fl_Nice_Slider::Fl_Nice_Slider(int X,int Y,int W,int H,const char *L) : Fl_Slider(X,Y,W,H,L) { - type(FL_VERT_NICE_SLIDER); + type(FL_VERT_NICE_SLIDER); box(FL_FLAT_BOX); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Spinner.cxx b/src/Fl_Spinner.cxx index 3ef102a55..65e5fcf74 100644 --- a/src/Fl_Spinner.cxx +++ b/src/Fl_Spinner.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Spinner widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -32,7 +30,7 @@ */ void Fl_Spinner::sb_cb(Fl_Widget *w, Fl_Spinner *sb) { - double v; // New value + double v; // New value if (w == &(sb->input_)) { // Something changed in the input field... @@ -50,9 +48,9 @@ void Fl_Spinner::sb_cb(Fl_Widget *w, Fl_Spinner *sb) { v = sb->value_ + sb->step_; if (v > sb->maximum_) { if (sb->wrap_) - v = sb->minimum_; + v = sb->minimum_; else - v = sb->maximum_; + v = sb->maximum_; } sb->value_ = v; sb->update(); @@ -61,9 +59,9 @@ void Fl_Spinner::sb_cb(Fl_Widget *w, Fl_Spinner *sb) { v = sb->value_ - sb->step_; if (v < sb->minimum_) { if (sb->wrap_) - v = sb->maximum_; + v = sb->maximum_; else - v = sb->minimum_; + v = sb->minimum_; } sb->value_ = v; sb->update(); @@ -138,11 +136,11 @@ int Fl_Spinner::handle(int event) { case FL_KEYDOWN: case FL_SHORTCUT: if (Fl::event_key() == FL_Up) { - up_button_.do_callback(); - return 1; + up_button_.do_callback(); + return 1; } else if (Fl::event_key() == FL_Down) { - down_button_.do_callback(); - return 1; + down_button_.do_callback(); + return 1; } return 0; @@ -212,8 +210,3 @@ int Fl_Spinner::Fl_Spinner_Input::handle(int event) { } return Fl_Input::handle(event); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Sys_Menu_Bar.cxx b/src/Fl_Sys_Menu_Bar.cxx index 50487efac..662cb0f19 100644 --- a/src/Fl_Sys_Menu_Bar.cxx +++ b/src/Fl_Sys_Menu_Bar.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // system menu bar widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -163,7 +161,7 @@ void Fl_Sys_Menu_Bar::remove(int index) /** \brief rename an item from the system menu bar - + \param index the index of the item to rename \param name the new item name as a UTF8 string */ @@ -210,7 +208,7 @@ Fl_Sys_Menu_Bar::window_menu_style_enum Fl_Sys_Menu_Bar::window_menu_style() { all windows in a single tabbed display mode. This is the \b default Window menu style for FLTK apps. \li \c tabbing_mode_preferred : new windows are displayed in tabbed mode when first created - + The Window menu, if present, is entirely created and controlled by the FLTK library. Mac OS version 10.12 or later must be running for windows to be displayed in tabbed form. Under non MacOS platforms, this function does nothing. @@ -228,7 +226,7 @@ void Fl_Sys_Menu_Bar::window_menu_style(Fl_Sys_Menu_Bar::window_menu_style_enum Fl_Sys_Menu_Bar::window_menu_style(window_menu_style_enum) before the first Fl_Window::show(). Alternatively, an app can call create_window_menu() after having populated the system menu bar, for example with menu(const Fl_Menu_Item *), and before the first Fl_Window::show(). - + This function does nothing on non MacOS platforms. \version 1.4 */ @@ -254,7 +252,3 @@ Fl_Sys_Menu_Bar_Driver::~Fl_Sys_Menu_Bar_Driver() {} Fl_Sys_Menu_Bar::window_menu_style_enum Fl_Sys_Menu_Bar_Driver::window_menu_style_ = Fl_Sys_Menu_Bar::tabbing_mode_automatic; #endif // !defined(FL_DOXYGEN) - -// -// End of "$Id$". -// diff --git a/src/Fl_Sys_Menu_Bar_Driver.H b/src/Fl_Sys_Menu_Bar_Driver.H index 7d869ae64..be0fbbc9d 100644 --- a/src/Fl_Sys_Menu_Bar_Driver.H +++ b/src/Fl_Sys_Menu_Bar_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // system menu bar widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_Sys_Menu_Bar_Driver_H @@ -57,7 +55,3 @@ public: #endif // !defined(FL_DOXYGEN) #endif // Fl_Sys_Menu_Bar_Driver_H - -// -// End of "$Id$". -// diff --git a/src/Fl_System_Driver.H b/src/Fl_System_Driver.H index 67f608177..0474154d4 100644 --- a/src/Fl_System_Driver.H +++ b/src/Fl_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // A base class for platform specific system calls // for the Fast Light Tool Kit (FLTK). // @@ -12,9 +10,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -242,7 +240,3 @@ public: \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_System_Driver.cxx b/src/Fl_System_Driver.cxx index f4550566a..f2b3c9584 100644 --- a/src/Fl_System_Driver.cxx +++ b/src/Fl_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // A base class for platform specific system calls. // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -137,7 +135,7 @@ void Fl_System_Driver::fatal(const char *format, va_list args) { /* the following function was stolen from the X sources as indicated. */ -/* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */ +/* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */ /* $XConsortium: XParseGeom.c,v 11.18 91/02/21 17:23:05 rws Exp $ */ /* @@ -168,7 +166,7 @@ static int ReadInteger(char* string, char** NextString) { int Result = 0; int Sign = 1; - + if (*string == '+') string++; else if (*string == '-') { @@ -193,11 +191,11 @@ int Fl_System_Driver::XParseGeometry(const char* string, int* x, int* y, unsigned int tempWidth = 0, tempHeight = 0; int tempX = 0, tempY = 0; char *nextCharacter; - + if ( (string == NULL) || (*string == '\0')) return(mask); if (*string == '=') string++; /* ignore possible '=' at beg of geometry spec */ - + strind = (char *)string; if (*strind != '+' && *strind != '-' && *strind != 'x') { tempWidth = ReadInteger(strind, &nextCharacter); @@ -206,7 +204,7 @@ int Fl_System_Driver::XParseGeometry(const char* string, int* x, int* y, strind = nextCharacter; mask |= fl_WidthValue; } - + if (*strind == 'x' || *strind == 'X') { strind++; tempHeight = ReadInteger(strind, &nextCharacter); @@ -215,7 +213,7 @@ int Fl_System_Driver::XParseGeometry(const char* string, int* x, int* y, strind = nextCharacter; mask |= fl_HeightValue; } - + if ((*strind == '+') || (*strind == '-')) { if (*strind == '-') { strind++; @@ -224,7 +222,7 @@ int Fl_System_Driver::XParseGeometry(const char* string, int* x, int* y, return (0); strind = nextCharacter; mask |= fl_XNegative; - + } else { strind++; tempX = ReadInteger(strind, &nextCharacter); @@ -241,7 +239,7 @@ int Fl_System_Driver::XParseGeometry(const char* string, int* x, int* y, return(0); strind = nextCharacter; mask |= fl_YNegative; - + } else { strind++; tempY = ReadInteger(strind, &nextCharacter); @@ -252,12 +250,12 @@ int Fl_System_Driver::XParseGeometry(const char* string, int* x, int* y, mask |= fl_YValue; } } - + /* If strind isn't at the end of the string the it's an invalid geometry specification. */ - + if (*strind != '\0') return (0); - + if (mask & fl_XValue) *x = tempX; if (mask & fl_YValue) @@ -411,23 +409,23 @@ int Fl_System_Driver::filename_expand(char *to,int tolen, const char *from) { strlcpy(temp,from, tolen); char *start = temp; char *end = temp+strlen(temp); - + int ret = 0; - - for (char *a=temp; a<end; ) { // for each slash component + + for (char *a=temp; a<end; ) { // for each slash component char *e; for (e=a; e<end && *e != '/'; e++) {/*empty*/} // find next slash const char *value = 0; // this will point at substitute value switch (*a) { - case '~': // a home directory name - if (e <= a+1) { // current user's directory + case '~': // a home directory name + if (e <= a+1) { // current user's directory value = getenv("HOME"); - } else { // another user's directory + } else { // another user's directory char t = *e; *(char *)e = 0; value = getpwnam(a+1); *(char *)e = t; } break; - case '$': /* an environment variable */ + case '$': /* an environment variable */ {char t = *e; *(char *)e = 0; value = getenv(a+1); *(char *)e = t;} break; } @@ -498,7 +496,3 @@ void Fl_System_Driver::gettime(time_t *sec, int *usec) { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Table.cxx b/src/Fl_Table.cxx index cdbc9d171..431847b61 100644 --- a/src/Fl_Table.cxx +++ b/src/Fl_Table.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Table -- A table widget // // Copyright 2002 by Greg Ercolano. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Table.H> @@ -23,9 +21,9 @@ #include <FL/fl_draw.H> #include <sys/types.h> -#include <string.h> // memcpy -#include <stdio.h> // fprintf -#include <stdlib.h> // realloc/free +#include <string.h> // memcpy +#include <stdio.h> // fprintf +#include <stdlib.h> // realloc/free // An STL-ish vector without templates (private to Fl_Table) @@ -53,10 +51,10 @@ void Fl_Table::IntVector::size(unsigned int count) { and causes the screen to redraw. */ void Fl_Table::row_position(int row) { - if ( _row_position == row ) return; // OPTIMIZATION: no change? avoid redraw + if ( _row_position == row ) return; // OPTIMIZATION: no change? avoid redraw if ( row < 0 ) row = 0; else if ( row >= rows() ) row = rows() - 1; - if ( table_h <= tih ) return; // don't scroll if table smaller than window + if ( table_h <= tih ) return; // don't scroll if table smaller than window double newtop = row_scroll_position(row); if ( newtop > vscrollbar->maximum() ) { newtop = vscrollbar->maximum(); @@ -64,7 +62,7 @@ void Fl_Table::row_position(int row) { vscrollbar->Fl_Slider::value(newtop); table_scrolled(); redraw(); - _row_position = row; // HACK: override what table_scrolled() came up with + _row_position = row; // HACK: override what table_scrolled() came up with } /** @@ -72,10 +70,10 @@ void Fl_Table::row_position(int row) { and causes the screen to redraw. */ void Fl_Table::col_position(int col) { - if ( _col_position == col ) return; // OPTIMIZATION: no change? avoid redraw + if ( _col_position == col ) return; // OPTIMIZATION: no change? avoid redraw if ( col < 0 ) col = 0; else if ( col >= cols() ) col = cols() - 1; - if ( table_w <= tiw ) return; // don't scroll if table smaller than window + if ( table_w <= tiw ) return; // don't scroll if table smaller than window double newleft = col_scroll_position(col); if ( newleft > hscrollbar->maximum() ) { newleft = hscrollbar->maximum(); @@ -83,7 +81,7 @@ void Fl_Table::col_position(int col) { hscrollbar->Fl_Slider::value(newleft); table_scrolled(); redraw(); - _col_position = col; // HACK: override what table_scrolled() came up with + _col_position = col; // HACK: override what table_scrolled() came up with } /** @@ -91,8 +89,8 @@ void Fl_Table::col_position(int col) { */ long Fl_Table::row_scroll_position(int row) { int startrow = 0; - long scroll = 0; - // OPTIMIZATION: + long scroll = 0; + // OPTIMIZATION: // Attempt to use precomputed row scroll position // if ( toprow_scrollpos != -1 && row >= toprow ) { @@ -111,7 +109,7 @@ long Fl_Table::row_scroll_position(int row) { long Fl_Table::col_scroll_position(int col) { int startcol = 0; long scroll = 0; - // OPTIMIZATION: + // OPTIMIZATION: // Attempt to use precomputed row scroll position // if ( leftcol_scrollpos != -1 && col >= leftcol ) { @@ -161,39 +159,39 @@ Fl_Table::Fl_Table(int X, int Y, int W, int H, const char *l) : Fl_Group(X,Y,W,H _dragging_y = -1; _last_row = -1; _auto_drag = 0; - current_col = -1; + current_col = -1; current_row = -1; select_row = -1; select_col = -1; _scrollbar_size = 0; - flags_ = 0; // TABCELLNAV off + flags_ = 0; // TABCELLNAV off box(FL_THIN_DOWN_FRAME); - + vscrollbar = new Fl_Scrollbar(x()+w()-Fl::scrollbar_size(), y(), Fl::scrollbar_size(), h()-Fl::scrollbar_size()); vscrollbar->type(FL_VERTICAL); vscrollbar->callback(scroll_cb, (void*)this); - + hscrollbar = new Fl_Scrollbar(x(), y()+h()-Fl::scrollbar_size(), w(), Fl::scrollbar_size()); hscrollbar->type(FL_HORIZONTAL); hscrollbar->callback(scroll_cb, (void*)this); - + table = new Fl_Scroll(x(), y(), w(), h()); table->box(FL_NO_BOX); - table->type(0); // don't show Fl_Scroll's scrollbars -- use our own - table->hide(); // hide unless children are present + table->type(0); // don't show Fl_Scroll's scrollbars -- use our own + table->hide(); // hide unless children are present table->end(); - + table_resized(); redraw(); - - Fl_Group::end(); // end the group's begin() - - table->begin(); // leave with fltk children getting added to the scroll + + Fl_Group::end(); // end the group's begin() + + table->begin(); // leave with fltk children getting added to the scroll } - + /** The destructor for Fl_Table. Destroys the table and its associated widgets. @@ -211,7 +209,7 @@ Fl_Table::~Fl_Table() { void Fl_Table::row_height(int row, int height) { if ( row < 0 ) return; if ( row < (int)_rowheights.size() && _rowheights[row] == height ) { - return; // OPTIMIZATION: no change? avoid redraw + return; // OPTIMIZATION: no change? avoid redraw } // Add row heights, even if none yet int now_size = (int)_rowheights.size(); @@ -222,7 +220,7 @@ void Fl_Table::row_height(int row, int height) { } _rowheights[row] = height; table_resized(); - if ( row <= botrow ) { // OPTIMIZATION: only redraw if onscreen or above screen + if ( row <= botrow ) { // OPTIMIZATION: only redraw if onscreen or above screen redraw(); } // ROW RESIZE CALLBACK @@ -235,12 +233,12 @@ void Fl_Table::row_height(int row, int height) { Sets the width of the specified column in pixels, and the table is redrawn. callback() will be invoked with CONTEXT_RC_RESIZE if the column's width was actually changed, and when() is FL_WHEN_CHANGED. -*/ +*/ void Fl_Table::col_width(int col, int width) { if ( col < 0 ) return; if ( col < (int)_colwidths.size() && _colwidths[col] == width ) { - return; // OPTIMIZATION: no change? avoid redraw + return; // OPTIMIZATION: no change? avoid redraw } // Add column widths, even if none yet int now_size = (int)_colwidths.size(); @@ -252,7 +250,7 @@ void Fl_Table::col_width(int col, int width) } _colwidths[col] = width; table_resized(); - if ( col <= rightcol ) { // OPTIMIZATION: only redraw if onscreen or to the left + if ( col <= rightcol ) { // OPTIMIZATION: only redraw if onscreen or to the left redraw(); } // COLUMN RESIZE CALLBACK @@ -275,12 +273,12 @@ int Fl_Table::row_col_clamp(TableContext context, int &R, int &C) { // Allow col headers to draw even if no rows if ( R >= _rows && R != 0 ) { R = _rows - 1; clamped = 1; } break; - + case CONTEXT_ROW_HEADER: // Allow row headers to draw even if no columns if ( C >= _cols && C != 0 ) { C = _cols - 1; clamped = 1; } break; - + case CONTEXT_CELL: default: // CLAMP R/C TO _rows/_cols @@ -303,7 +301,7 @@ void Fl_Table::get_bounds(TableContext context, int &X, int &Y, int &W, int &H) W = tow; H = col_header_height(); return; - + case CONTEXT_ROW_HEADER: // Row header clipping. X = wix; @@ -311,12 +309,12 @@ void Fl_Table::get_bounds(TableContext context, int &X, int &Y, int &W, int &H) W = row_header_width(); H = toh; return; - + case CONTEXT_TABLE: // Table inner dimensions X = tix; Y = tiy; W = tiw; H = tih; return; - + // TODO: Add other contexts.. default: fprintf(stderr, "Fl_Table::get_bounds(): context %d unimplemented\n", (int)context); @@ -389,12 +387,12 @@ Fl_Table::TableContext Fl_Table::cursor2rowcol(int &R, int &C, ResizeFlag &resiz if ( Fl::event_inside(tox, toy, tow, toh) ) { for ( R = toprow; R <= botrow; R++ ) { find_cell(CONTEXT_CELL, R, C, X, Y, W, H); - if ( Fl::event_y() < Y ) break; // OPT: thanks lars - if ( Fl::event_y() >= (Y+H) ) continue; // OPT: " " + if ( Fl::event_y() < Y ) break; // OPT: thanks lars + if ( Fl::event_y() >= (Y+H) ) continue; // OPT: " " for ( C = leftcol; C <= rightcol; C++ ) { find_cell(CONTEXT_CELL, R, C, X, Y, W, H); if ( Fl::event_inside(X, Y, W, H) ) { - return(CONTEXT_CELL); // found it + return(CONTEXT_CELL); // found it } } } @@ -413,7 +411,7 @@ Fl_Table::TableContext Fl_Table::cursor2rowcol(int &R, int &C, ResizeFlag &resiz - -1 -- if R or C are out of range, and X/Y/W/H will be set to zero. */ int Fl_Table::find_cell(TableContext context, int R, int C, int &X, int &Y, int &W, int &H) { - if ( row_col_clamp(context, R, C) ) { // row or col out of range? error + if ( row_col_clamp(context, R, C) ) { // row or col out of range? error X=Y=W=H=0; return(-1); } @@ -421,24 +419,24 @@ int Fl_Table::find_cell(TableContext context, int R, int C, int &X, int &Y, int Y = row_scroll_position(R) - vscrollbar->value() + tiy; W = col_width(C); H = row_height(R); - + switch ( context ) { case CONTEXT_COL_HEADER: Y = wiy; H = col_header_height(); return(0); - + case CONTEXT_ROW_HEADER: X = wix; W = row_header_width(); return(0); - + case CONTEXT_CELL: return(0); - + case CONTEXT_TABLE: return(0); - + // TODO -- HANDLE OTHER CONTEXTS default: fprintf(stderr, "Fl_Table::find_cell: unknown context %d\n", (int)context); @@ -534,22 +532,22 @@ void Fl_Table::recalc_dimensions() { if ( row_header() ) { tix += row_header_width(); tox += row_header_width(); tiw -= row_header_width(); tow -= row_header_width(); - } + } // Make scroll bars disappear if window large enough { // First pass: can hide via window size? int hidev = (table_h <= tih); - int hideh = (table_w <= tiw); + int hideh = (table_w <= tiw); int scrollsize = _scrollbar_size ? _scrollbar_size : Fl::scrollbar_size(); // Second pass: Check for interference if ( !hideh && hidev ) { hidev = (( table_h - tih + scrollsize ) <= 0 ); } if ( !hidev && hideh ) { hideh = (( table_w - tiw + scrollsize ) <= 0 ); } // Determine scrollbar visibility, trim ti[xywh]/to[xywh] - if ( hidev ) { vscrollbar->hide(); } + if ( hidev ) { vscrollbar->hide(); } else { vscrollbar->show(); tiw -= scrollsize; tow -= scrollsize; } - if ( hideh ) { hscrollbar->hide(); } + if ( hideh ) { hscrollbar->hide(); } else { hscrollbar->show(); tih -= scrollsize; toh -= scrollsize; } - } + } // Resize the child table table->resize(tox, toy, tow, toh); table->init_sizes(); @@ -569,14 +567,14 @@ void Fl_Table::table_scrolled() { if ( y > voff ) { y -= row_height(row); break; } } _row_position = toprow = ( row >= _rows ) ? (row - 1) : row; - toprow_scrollpos = y; // OPTIMIZATION: save for later use + toprow_scrollpos = y; // OPTIMIZATION: save for later use // Find bottom row voff = vscrollbar->value() + tih; for ( ; row < _rows; row++ ) { y += row_height(row); if ( y >= voff ) { break; } } - botrow = ( row >= _rows ) ? (row - 1) : row; + botrow = ( row >= _rows ) ? (row - 1) : row; // Left column int x, col, hoff = hscrollbar->value(); for ( col=x=0; col < _cols; col++ ) { @@ -584,7 +582,7 @@ void Fl_Table::table_scrolled() { if ( x > hoff ) { x -= col_width(col); break; } } _col_position = leftcol = ( col >= _cols ) ? (col - 1) : col; - leftcol_scrollpos = x; // OPTIMIZATION: save for later use + leftcol_scrollpos = x; // OPTIMIZATION: save for later use // Right column // Work with data left over from leftcol calculation // @@ -593,7 +591,7 @@ void Fl_Table::table_scrolled() { x += col_width(col); if ( x >= hoff ) { break; } } - rightcol = ( col >= _cols ) ? (col - 1) : col; + rightcol = ( col >= _cols ) ? (col - 1) : col; // First tell children to scroll draw_cell(CONTEXT_RC_RESIZE, 0,0,0,0,0,0); } @@ -604,8 +602,8 @@ void Fl_Table::table_scrolled() { */ void Fl_Table::table_resized() { table_h = row_scroll_position(rows()); - table_w = col_scroll_position(cols()); - recalc_dimensions(); + table_w = col_scroll_position(cols()); + recalc_dimensions(); // Recalc scrollbar sizes // Clamp scrollbar value() after a resize. // Resize scrollbars to enforce a constant trough width after a window resize. @@ -619,25 +617,25 @@ void Fl_Table::table_resized() { vscrollbar->precision(10); vscrollbar->slider_size(vscrolltab); vscrollbar->resize(wix+wiw-scrollsize, wiy, - scrollsize, + scrollsize, wih - ((hscrollbar->visible())?scrollsize:0)); - vscrollbar->Fl_Valuator::value(vscrollbar->clamp(vscrollbar->value())); + vscrollbar->Fl_Valuator::value(vscrollbar->clamp(vscrollbar->value())); // Horizontal scrollbar hscrollbar->bounds(0, table_w-tiw); hscrollbar->precision(10); hscrollbar->slider_size(hscrolltab); hscrollbar->resize(wix, wiy+wih-scrollsize, - wiw - ((vscrollbar->visible())?scrollsize:0), + wiw - ((vscrollbar->visible())?scrollsize:0), scrollsize); hscrollbar->Fl_Valuator::value(hscrollbar->clamp(hscrollbar->value())); } - + // Tell FLTK child widgets were resized Fl_Group::init_sizes(); - + // Recalc top/bot/left/right table_scrolled(); - + // DO *NOT* REDRAW -- LEAVE THIS UP TO THE CALLER // redraw(); } @@ -647,7 +645,7 @@ void Fl_Table::table_resized() { */ void Fl_Table::scroll_cb(Fl_Widget*w, void *data) { Fl_Table *o = (Fl_Table*)data; - o->recalc_dimensions(); // recalc tix, tiy, etc. + o->recalc_dimensions(); // recalc tix, tiy, etc. o->table_scrolled(); o->redraw(); } @@ -661,13 +659,13 @@ void Fl_Table::rows(int val) { { int default_h = ( _rowheights.size() > 0 ) ? _rowheights.back() : 25; int now_size = _rowheights.size(); - _rowheights.size(val); // enlarge or shrink as needed + _rowheights.size(val); // enlarge or shrink as needed while ( now_size < val ) { - _rowheights[now_size++] = default_h; // fill new + _rowheights[now_size++] = default_h; // fill new } } table_resized(); - + // OPTIMIZATION: redraw only if change is visible. if ( val >= oldrows && oldrows > botrow ) { // NO REDRAW @@ -684,9 +682,9 @@ void Fl_Table::cols(int val) { { int default_w = ( _colwidths.size() > 0 ) ? _colwidths[_colwidths.size()-1] : 80; int now_size = _colwidths.size(); - _colwidths.size(val); // enlarge or shrink as needed + _colwidths.size(val); // enlarge or shrink as needed while ( now_size < val ) { - _colwidths[now_size++] = default_w; // fill new + _colwidths[now_size++] = default_w; // fill new } } table_resized(); @@ -802,17 +800,17 @@ int Fl_Table::move_cursor(int R, int C) { */ int Fl_Table::handle(int event) { PRINTEVENT; - int ret = Fl_Group::handle(event); // let FLTK group handle events first + int ret = Fl_Group::handle(event); // let FLTK group handle events first // Which row/column are we over? - int R, C; // row/column being worked on - ResizeFlag resizeflag; // which resizing area are we over? (0=none) + int R, C; // row/column being worked on + ResizeFlag resizeflag; // which resizing area are we over? (0=none) TableContext context = cursor2rowcol(R, C, resizeflag); if (ret) { if (Fl::event_inside(hscrollbar) || Fl::event_inside(vscrollbar)) return 1; - if ( context != CONTEXT_ROW_HEADER && // mouse not in row header (STR#2742) - context != CONTEXT_COL_HEADER && // mouse not in col header (STR#2742) - Fl::focus() != this && // we don't have focus? - contains(Fl::focus())) { // focus is a child? + if ( context != CONTEXT_ROW_HEADER && // mouse not in row header (STR#2742) + context != CONTEXT_COL_HEADER && // mouse not in col header (STR#2742) + Fl::focus() != this && // we don't have focus? + contains(Fl::focus())) { // focus is a child? return 1; } } @@ -840,19 +838,19 @@ int Fl_Table::handle(int event) { current_col = select_col = C; _selecting = CONTEXT_CELL; } else { - // Clear selection if not resizing row/col - if ( !resizeflag ) { + // Clear selection if not resizing row/col + if ( !resizeflag ) { current_row = select_row = -1; current_col = select_col = -1; - } + } } } // A click on table with user's callback defined? // Need this for eg. right click to pop up a menu // - if ( Fl_Widget::callback() && // callback defined? - resizeflag == RESIZE_NONE ) { // not resizing? - do_callback(context, R, C); // do callback with context (cell, header, etc) + if ( Fl_Widget::callback() && // callback defined? + resizeflag == RESIZE_NONE ) { // not resizing? + do_callback(context, R, C); // do callback with context (cell, header, etc) } // Handle selection if handling a left-click // Use snapshot of _event_button we made before servicing user's cb's @@ -862,21 +860,21 @@ int Fl_Table::handle(int event) { switch ( context ) { case CONTEXT_CELL: // FL_PUSH on a cell? - ret = 1; // express interest in FL_RELEASE + ret = 1; // express interest in FL_RELEASE break; - + case CONTEXT_NONE: // FL_PUSH on table corner? if ( _event_button == 1 && _event_x < x() + row_header_width()) { current_col = 0; select_col = cols() - 1; current_row = 0; - select_row = rows() - 1; + select_row = rows() - 1; damage_zone(current_row, current_col, select_row, select_col); ret = 1; } break; - + case CONTEXT_COL_HEADER: // FL_PUSH on a column header? if ( _event_button == 1) { @@ -884,16 +882,16 @@ int Fl_Table::handle(int event) { if ( resizeflag ) { // Start resize if left click on column border. // "ret=1" ensures we get drag events from now on. - // (C-1) is used if mouse is over the left hand side + // (C-1) is used if mouse is over the left hand side // of cell, so we resize the next column on the left. // - _resizing_col = ( resizeflag & RESIZE_COL_LEFT ) ? C-1 : C; + _resizing_col = ( resizeflag & RESIZE_COL_LEFT ) ? C-1 : C; _resizing_row = -1; _dragging_x = _event_x; ret = 1; } else { // Not resizing? Select the column - if ( Fl::focus() != this && contains(Fl::focus()) ) return 0; // STR #3018 - item 1 + if ( Fl::focus() != this && contains(Fl::focus()) ) return 0; // STR #3018 - item 1 current_col = select_col = C; current_row = 0; select_row = rows() - 1; @@ -903,7 +901,7 @@ int Fl_Table::handle(int event) { } } break; - + case CONTEXT_ROW_HEADER: // FL_PUSH on a row header? if ( _event_button == 1 ) { @@ -914,13 +912,13 @@ int Fl_Table::handle(int event) { // (R-1) is used if mouse is over the top of the cell, // so that we resize the row above. // - _resizing_row = ( resizeflag & RESIZE_ROW_ABOVE ) ? R-1 : R; + _resizing_row = ( resizeflag & RESIZE_ROW_ABOVE ) ? R-1 : R; _resizing_col = -1; - _dragging_y = _event_y; + _dragging_y = _event_y; ret = 1; } else { // Not resizing? Select the row - if ( Fl::focus() != this && contains(Fl::focus()) ) return 0; // STR #3018 - item 1 + if ( Fl::focus() != this && contains(Fl::focus()) ) return 0; // STR #3018 - item 1 current_row = select_row = R; current_col = 0; select_col = cols() - 1; @@ -930,19 +928,19 @@ int Fl_Table::handle(int event) { } } break; - + default: - ret = 0; // express disinterest + ret = 0; // express disinterest break; } _last_row = R; break; - + case FL_DRAG: if (_auto_drag == 1) { ret = 1; break; - } + } if ( _resizing_col > -1 ) { // Dragging column? // @@ -983,11 +981,11 @@ int Fl_Table::handle(int event) { do_callback(CONTEXT_RC_RESIZE, R, C); } } else { - if (_event_button == 1 && + if (_event_button == 1 && _selecting == CONTEXT_CELL && context == CONTEXT_CELL) { // Dragging a cell selection? - if ( _event_clicks ) break; // STR #3018 - item 2 + if ( _event_clicks ) break; // STR #3018 - item 2 if (select_row != R || select_col != C) { damage_zone(current_row, current_col, select_row, select_col, R, C); } @@ -995,8 +993,8 @@ int Fl_Table::handle(int event) { select_col = C; ret = 1; } - else if (_event_button == 1 && - _selecting == CONTEXT_ROW_HEADER && + else if (_event_button == 1 && + _selecting == CONTEXT_ROW_HEADER && context & (CONTEXT_ROW_HEADER|CONTEXT_COL_HEADER|CONTEXT_CELL)) { if (select_row != R) { damage_zone(current_row, current_col, select_row, select_col, R, C); @@ -1004,8 +1002,8 @@ int Fl_Table::handle(int event) { select_row = R; ret = 1; } - else if (_event_button == 1 && - _selecting == CONTEXT_COL_HEADER + else if (_event_button == 1 && + _selecting == CONTEXT_COL_HEADER && context & (CONTEXT_ROW_HEADER|CONTEXT_COL_HEADER|CONTEXT_CELL)) { if (select_col != C) { damage_zone(current_row, current_col, select_row, select_col, R, C); @@ -1015,33 +1013,33 @@ int Fl_Table::handle(int event) { } } // Enable autodrag if not resizing, and mouse has moved off table edge - if ( _resizing_row < 0 && _resizing_col < 0 && _auto_drag == 0 && + if ( _resizing_row < 0 && _resizing_col < 0 && _auto_drag == 0 && ( _event_x > x() + w() - 20 || - _event_x < x() + row_header_width() || + _event_x < x() + row_header_width() || _event_y > y() + h() - 20 || _event_y < y() + col_header_height() ) ) { _start_auto_drag(); } break; - + case FL_RELEASE: _stop_auto_drag(); switch ( context ) { - case CONTEXT_ROW_HEADER: // release on row header - case CONTEXT_COL_HEADER: // release on col header - case CONTEXT_CELL: // release on a cell - case CONTEXT_TABLE: // release on dead zone - if ( _resizing_col == -1 && // not resizing a column - _resizing_row == -1 && // not resizing a row - Fl_Widget::callback() && // callback defined - when() & FL_WHEN_RELEASE && // on button release - _last_row == R ) { // release on same row PUSHed? + case CONTEXT_ROW_HEADER: // release on row header + case CONTEXT_COL_HEADER: // release on col header + case CONTEXT_CELL: // release on a cell + case CONTEXT_TABLE: // release on dead zone + if ( _resizing_col == -1 && // not resizing a column + _resizing_row == -1 && // not resizing a row + Fl_Widget::callback() && // callback defined + when() & FL_WHEN_RELEASE && // on button release + _last_row == R ) { // release on same row PUSHed? // Need this for eg. left clicking on a cell to select it do_callback(context, R, C); } break; - + default: break; } @@ -1052,27 +1050,27 @@ int Fl_Table::handle(int event) { ret = 1; } break; - + case FL_MOVE: - if ( context == CONTEXT_COL_HEADER && // in column header? - resizeflag ) { // resize + near boundary? - change_cursor(FL_CURSOR_WE); // show resize cursor + if ( context == CONTEXT_COL_HEADER && // in column header? + resizeflag ) { // resize + near boundary? + change_cursor(FL_CURSOR_WE); // show resize cursor } - else if ( context == CONTEXT_ROW_HEADER && // in row header? - resizeflag ) { // resize + near boundary? - change_cursor(FL_CURSOR_NS); // show resize cursor + else if ( context == CONTEXT_ROW_HEADER && // in row header? + resizeflag ) { // resize + near boundary? + change_cursor(FL_CURSOR_NS); // show resize cursor } else { - change_cursor(FL_CURSOR_DEFAULT); // normal cursor + change_cursor(FL_CURSOR_DEFAULT); // normal cursor } ret = 1; break; - - case FL_ENTER: // See FLTK event docs on the FL_ENTER widget + + case FL_ENTER: // See FLTK event docs on the FL_ENTER widget if (!ret) take_focus(); ret = 1; //FALLTHROUGH - - case FL_LEAVE: // We want to track the mouse if resizing is allowed. + + case FL_LEAVE: // We want to track the mouse if resizing is allowed. if ( resizeflag ) { ret = 1; } @@ -1081,16 +1079,16 @@ int Fl_Table::handle(int event) { change_cursor(FL_CURSOR_DEFAULT); } break; - + case FL_FOCUS: Fl::focus(this); //FALLTHROUGH - + case FL_UNFOCUS: _stop_auto_drag(); ret = 1; break; - + case FL_KEYBOARD: { ret = 0; int is_row = select_row; @@ -1120,13 +1118,13 @@ int Fl_Table::handle(int event) { case FL_Down: ret = move_cursor(1, 0); break; - case FL_Tab: - if ( !tab_cell_nav() ) break; // not navigating cells? let fltk handle it (STR#2862) - if ( _event_state & FL_SHIFT ) { - ret = move_cursor(0, -1, 0); // shift-tab -> left - } else { - ret = move_cursor(0, 1, 0); // tab -> right - } + case FL_Tab: + if ( !tab_cell_nav() ) break; // not navigating cells? let fltk handle it (STR#2862) + if ( _event_state & FL_SHIFT ) { + ret = move_cursor(0, -1, 0); // shift-tab -> left + } else { + ret = move_cursor(0, 1, 0); // tab -> right + } break; } if (ret && Fl::focus() != this) { @@ -1134,19 +1132,19 @@ int Fl_Table::handle(int event) { take_focus(); } //if (!ret && Fl_Widget::callback() && when() & FL_WHEN_NOT_CHANGED ) - if ( Fl_Widget::callback() && + if ( Fl_Widget::callback() && ( - ( !ret && when() & FL_WHEN_NOT_CHANGED ) || - ( is_row!= select_row || is_col!= select_col ) + ( !ret && when() & FL_WHEN_NOT_CHANGED ) || + ( is_row!= select_row || is_col!= select_col ) ) ) { - do_callback(CONTEXT_CELL, select_row, select_col); + do_callback(CONTEXT_CELL, select_row, select_col); //damage_zone(current_row, current_col, select_row, select_col); ret = 1; } break; } - + default: change_cursor(FL_CURSOR_DEFAULT); break; @@ -1169,8 +1167,8 @@ void Fl_Table::resize(int X, int Y, int W, int H) { void Fl_Table::_redraw_cell(TableContext context, int r, int c) { if ( r < 0 || c < 0 ) return; int X,Y,W,H; - find_cell(context, r, c, X, Y, W, H); // find positions of cell - draw_cell(context, r, c, X, Y, W, H); // call users' function to draw it + find_cell(context, r, c, X, Y, W, H); // find positions of cell + draw_cell(context, r, c, X, Y, W, H); // call users' function to draw it } /** @@ -1179,7 +1177,7 @@ void Fl_Table::_redraw_cell(TableContext context, int r, int c) { */ int Fl_Table::is_selected(int r, int c) { int s_left, s_right, s_top, s_bottom; - + if (select_col > current_col) { s_left = current_col; s_right = select_col; @@ -1252,18 +1250,18 @@ void Fl_Table::set_selection(int row_top, int col_left, int row_bot, int col_rig Lets fltk widgets draw themselves first, followed by the cells via calls to draw_cell(). */ -void Fl_Table::draw() { +void Fl_Table::draw() { int scrollsize = _scrollbar_size ? _scrollbar_size : Fl::scrollbar_size(); // Check if scrollbar size changed - if ( ( vscrollbar && (scrollsize != vscrollbar->w()) ) || + if ( ( vscrollbar && (scrollsize != vscrollbar->w()) ) || ( hscrollbar && (scrollsize != hscrollbar->h()) ) ) { // handle size change, min/max, table dim's, etc table_resized(); } - draw_cell(CONTEXT_STARTPAGE, 0, 0, // let user's drawing routine - tix, tiy, tiw, tih); // prep new page - + draw_cell(CONTEXT_STARTPAGE, 0, 0, // let user's drawing routine + tix, tiy, tiw, tih); // prep new page + // Let fltk widgets draw themselves first. Do this after // draw_cell(CONTEXT_STARTPAGE) in case user moves widgets around. // Use window 'inner' clip to prevent drawing into table border. @@ -1274,10 +1272,10 @@ void Fl_Table::draw() { Fl_Group::draw(); } fl_pop_clip(); - + // Explicitly draw border around widget, if any draw_box(box(), x(), y(), w(), h(), color()); - + // If Fl_Scroll 'table' is hidden, draw its box // Do this after Fl_Group::draw() so we draw over scrollbars // that leak around the border. @@ -1286,7 +1284,7 @@ void Fl_Table::draw() { if ( damage() & FL_DAMAGE_ALL || damage() & FL_DAMAGE_CHILD ) { draw_box(table->box(), tox, toy, tow, toh, table->color()); } - } + } // Clip all further drawing to the inner widget dimensions fl_push_clip(wix, wiy, wiw, wih); { @@ -1294,7 +1292,7 @@ void Fl_Table::draw() { if ( ! ( damage() & FL_DAMAGE_ALL ) && _redraw_leftcol != -1 ) { fl_push_clip(tix, tiy, tiw, tih); for ( int c = _redraw_leftcol; c <= _redraw_rightcol; c++ ) { - for ( int r = _redraw_toprow; r <= _redraw_botrow; r++ ) { + for ( int r = _redraw_toprow; r <= _redraw_botrow; r++ ) { _redraw_cell(CONTEXT_CELL, r, c); } } @@ -1319,7 +1317,7 @@ void Fl_Table::draw() { _redraw_cell(CONTEXT_COL_HEADER, 0, c); } fl_pop_clip(); - } + } // Draw all cells. // This includes cells partially obscured off edges of table. // No longer do this last; you might think it would be nice @@ -1329,16 +1327,16 @@ void Fl_Table::draw() { fl_push_clip(tix, tiy, tiw, tih); { for ( int r = toprow; r <= botrow; r++ ) { for ( int c = leftcol; c <= rightcol; c++ ) { - _redraw_cell(CONTEXT_CELL, r, c); + _redraw_cell(CONTEXT_CELL, r, c); } } } - fl_pop_clip(); + fl_pop_clip(); // Draw little rectangle in corner of headers if ( row_header() && col_header() ) { fl_rectf(wix, wiy, row_header_width(), col_header_height(), color()); } - + // Table has a boxtype? Close those few dead pixels if ( table->box() ) { if ( col_header() ) { @@ -1348,50 +1346,46 @@ void Fl_Table::draw() { fl_rectf(wix, toy, row_header_width(), Fl::box_dx(table->box()), color()); } } - + // Table width smaller than window? Fill remainder with rectangle if ( table_w < tiw ) { - fl_rectf(tix + table_w, tiy, tiw - table_w, tih, color()); + fl_rectf(tix + table_w, tiy, tiw - table_w, tih, color()); // Col header? fill that too if ( col_header() ) { - fl_rectf(tix + table_w, - wiy, + fl_rectf(tix + table_w, + wiy, // get that corner just right.. - (tiw - table_w + Fl::box_dw(table->box()) - + (tiw - table_w + Fl::box_dw(table->box()) - Fl::box_dx(table->box())), col_header_height(), color()); } - } + } // Table height smaller than window? Fill remainder with rectangle if ( table_h < tih ) { - fl_rectf(tix, tiy + table_h, tiw, tih - table_h, color()); + fl_rectf(tix, tiy + table_h, tiw, tih - table_h, color()); if ( row_header() ) { // NOTE: // Careful with that lower corner; don't use tih; when eg. // table->box(FL_THIN_UP_FRAME) and hscrollbar hidden, // leaves a row of dead pixels. // - fl_rectf(wix, tiy + table_h, row_header_width(), - (wiy+wih) - (tiy+table_h) - + fl_rectf(wix, tiy + table_h, row_header_width(), + (wiy+wih) - (tiy+table_h) - ( hscrollbar->visible() ? scrollsize : 0), color()); } } - } + } // Both scrollbars? Draw little box in lower right if ( vscrollbar->visible() && hscrollbar->visible() ) { - fl_rectf(vscrollbar->x(), hscrollbar->y(), + fl_rectf(vscrollbar->x(), hscrollbar->y(), vscrollbar->w(), hscrollbar->h(), color()); - } - draw_cell(CONTEXT_ENDPAGE, 0, 0, // let user's drawing - tix, tiy, tiw, tih); // routines cleanup - + } + draw_cell(CONTEXT_ENDPAGE, 0, 0, // let user's drawing + tix, tiy, tiw, tih); // routines cleanup + _redraw_leftcol = _redraw_rightcol = _redraw_toprow = _redraw_botrow = -1; } fl_pop_clip(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Table_Row.cxx b/src/Fl_Table_Row.cxx index 29a0a1557..33a1e4dd4 100644 --- a/src/Fl_Table_Row.cxx +++ b/src/Fl_Table_Row.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Table_Row -- A row oriented table widget // // A class specializing in a table of rows. @@ -12,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -32,7 +30,7 @@ // #define DEBUG 1 #ifdef DEBUG #include <FL/names.h> -#include <stdio.h> // fprintf() +#include <stdio.h> // fprintf() #define PRINTEVENT \ fprintf(stderr,"TableRow %s: ** Event: %s --\n", (label()?label():"none"), fl_eventnames[event]); #else @@ -46,7 +44,7 @@ void Fl_Table_Row::CharVector::copy(char *newarr, int newsize) { memcpy(arr, newarr, newsize * sizeof(char)); } -Fl_Table_Row::CharVector::~CharVector() { // DTOR +Fl_Table_Row::CharVector::~CharVector() { // DTOR if (arr) free(arr); arr = 0; } @@ -80,7 +78,7 @@ void Fl_Table_Row::type(TableRowSelectMode val) { int count = 0; for ( int row=0; row<rows(); row++ ) { if ( _rowselect[row] ) { - if ( ++count > 1 ) { // only one allowed + if ( ++count > 1 ) { // only one allowed _rowselect[row] = 0; } } @@ -111,7 +109,7 @@ int Fl_Table_Row::select_row(int row, int flag) { switch ( _selectmode ) { case SELECT_NONE: return(-1); - + case SELECT_SINGLE: { int oldval; for ( int t=0; t<rows(); t++ ) { @@ -131,13 +129,13 @@ int Fl_Table_Row::select_row(int row, int flag) { } break; } - + case SELECT_MULTI: { int oldval = _rowselect[row]; if ( flag == 2 ) { _rowselect[row] ^= 1; } else { _rowselect[row] = flag; } - if ( _rowselect[row] != oldval ) { // select state changed? - if ( row >= toprow && row <= botrow ) { // row visible? + if ( _rowselect[row] != oldval ) { // select state changed? + if ( row >= toprow && row <= botrow ) { // row visible? // Extend partial redraw range redraw_range(row, row, leftcol, rightcol); } @@ -153,11 +151,11 @@ void Fl_Table_Row::select_all_rows(int flag) { switch ( _selectmode ) { case SELECT_NONE: return; - + case SELECT_SINGLE: if ( flag != 0 ) return; //FALLTHROUGH - + case SELECT_MULTI: { char changed = 0; if ( flag == 2 ) { @@ -168,7 +166,7 @@ void Fl_Table_Row::select_all_rows(int flag) { } else { for ( int row=0; row<(int)_rowselect.size(); row++ ) { changed |= (_rowselect[row] != flag)?1:0; - _rowselect[row] = flag; + _rowselect[row] = flag; } } if ( changed ) { @@ -181,46 +179,46 @@ void Fl_Table_Row::select_all_rows(int flag) { // Set number of rows void Fl_Table_Row::rows(int val) { Fl_Table::rows(val); - while ( val > (int)_rowselect.size() ) { _rowselect.push_back(0); } // enlarge - while ( val < (int)_rowselect.size() ) { _rowselect.pop_back(); } // shrink + while ( val > (int)_rowselect.size() ) { _rowselect.push_back(0); } // enlarge + while ( val < (int)_rowselect.size() ) { _rowselect.pop_back(); } // shrink } // Handle events int Fl_Table_Row::handle(int event) { - PRINTEVENT; + PRINTEVENT; // Make snapshots of realtime event states *before* we service user's cb, // which may do things like post popup menus that return with unexpected button states. int _event_button = Fl::event_button(); - //int _event_clicks = Fl::event_clicks(); // uncomment if needed + //int _event_clicks = Fl::event_clicks(); // uncomment if needed int _event_x = Fl::event_x(); int _event_y = Fl::event_y(); - //int _event_key = Fl::event_key(); // uncomment if needed + //int _event_key = Fl::event_key(); // uncomment if needed int _event_state = Fl::event_state(); - //Fl_Widget *_focus = Fl::focus(); // uncomment if needed - + //Fl_Widget *_focus = Fl::focus(); // uncomment if needed + // Let base class handle event // Note: base class may invoke user callbacks that post menus, // so from here on use event state snapshots (above). // int ret = Fl_Table::handle(event); - + // The following code disables cell selection.. why was it added? -erco 05/18/03 - // if ( ret ) { _last_y = Fl::event_y(); return(1); } // base class 'handled' it (eg. column resize) - + // if ( ret ) { _last_y = Fl::event_y(); return(1); } // base class 'handled' it (eg. column resize) + int shiftstate = (_event_state & FL_CTRL) ? FL_CTRL : (_event_state & FL_SHIFT) ? FL_SHIFT : 0; - + // Which row/column are we over? - int R, C; // row/column being worked on - ResizeFlag resizeflag; // which resizing area are we over? (0=none) + int R, C; // row/column being worked on + ResizeFlag resizeflag; // which resizing area are we over? (0=none) TableContext context = cursor2rowcol(R, C, resizeflag); switch ( event ) { case FL_PUSH: if ( _event_button == 1 ) { - _last_push_x = _event_x; // save regardless of context - _last_push_y = _event_y; // " " - + _last_push_x = _event_x; // save regardless of context + _last_push_y = _event_y; // " " + // Handle selection in table. // Select cell under cursor, and enable drag selection mode. // @@ -228,9 +226,9 @@ int Fl_Table_Row::handle(int event) { // Ctrl key? Toggle selection state switch ( shiftstate ) { case FL_CTRL: - select_row(R, 2); // toggle + select_row(R, 2); // toggle break; - + case FL_SHIFT: { select_row(R, 1); if ( _last_row > -1 ) { @@ -245,27 +243,27 @@ int Fl_Table_Row::handle(int event) { } break; } - + default: - select_all_rows(0); // clear all previous selections + select_all_rows(0); // clear all previous selections select_row(R, 1); break; } - + _last_row = R; _dragging_select = 1; ret = 1; // FL_PUSH handled (ensures FL_DRAG will be sent) // redraw(); // redraw() handled by select_row() } - } + } break; - + case FL_DRAG: { if ( _dragging_select ) { // Dragged off table edges? Handle scrolling - int offtop = toy - _last_y; // >0 if off top of table - int offbot = _last_y - (toy + toh); // >0 if off bottom of table - + int offtop = toy - _last_y; // >0 if off top of table + int offbot = _last_y - (toy + toh); // >0 if off bottom of table + if ( offtop > 0 && row_position() > 0 ) { // Only scroll in upward direction int diff = _last_y - _event_y; @@ -285,17 +283,17 @@ int Fl_Table_Row::handle(int event) { break; } row_position(row_position() + diff); - context = CONTEXT_CELL; C = 0; R = botrow; // HACK: fake it - if ( R < 0 || R > rows() ) { ret = 1; break; } // HACK: ugly + context = CONTEXT_CELL; C = 0; R = botrow; // HACK: fake it + if ( R < 0 || R > rows() ) { ret = 1; break; } // HACK: ugly } if ( context == CONTEXT_CELL ) { switch ( shiftstate ) { case FL_CTRL: - if ( R != _last_row ) { // toggle if dragged to new row - select_row(R, 2); // 2=toggle + if ( R != _last_row ) { // toggle if dragged to new row + select_row(R, 2); // 2=toggle } break; - + case FL_SHIFT: default: select_row(R, 1); @@ -311,38 +309,34 @@ int Fl_Table_Row::handle(int event) { } break; } - ret = 1; // drag handled + ret = 1; // drag handled _last_row = R; } } break; } - + case FL_RELEASE: if ( _event_button == 1 ) { _dragging_select = 0; - ret = 1; // release handled - // Clicked off edges of data table? + ret = 1; // release handled + // Clicked off edges of data table? // A way for user to clear the current selection. // int databot = tiy + table_h, dataright = tix + table_w; - if ( + if ( ( _last_push_x > dataright && _event_x > dataright ) || ( _last_push_y > databot && _event_y > databot ) ) { - select_all_rows(0); // clear previous selections + select_all_rows(0); // clear previous selections } } break; - + default: break; } _last_y = _event_y; return(ret); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index be5ed24f9..17b73fdc9 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tab widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // This is the "file card tabs" interface to allow you to put lots and lots @@ -189,13 +187,13 @@ int Fl_Tabs::handle(int event) { } if (o && // Released on a tab and.. (value(o) || // tab changed value or.. - (when()&(FL_WHEN_NOT_CHANGED)) // ..no change but WHEN_NOT_CHANGED set, - ) // handles FL_WHEN_RELEASE_ALWAYS too. - ) { + (when()&(FL_WHEN_NOT_CHANGED)) // ..no change but WHEN_NOT_CHANGED set, + ) // handles FL_WHEN_RELEASE_ALWAYS too. + ) { Fl_Widget_Tracker wp(o); set_changed(); - do_callback(); - if (wp.deleted()) return 1; + do_callback(); + if (wp.deleted()) return 1; } Fl_Tooltip::current(o); } else { @@ -222,10 +220,10 @@ int Fl_Tabs::handle(int event) { case FL_UNFOCUS: if (!Fl::visible_focus()) return Fl_Group::handle(event); if (Fl::event() == FL_RELEASE || - Fl::event() == FL_SHORTCUT || - Fl::event() == FL_KEYBOARD || - Fl::event() == FL_FOCUS || - Fl::event() == FL_UNFOCUS) { + Fl::event() == FL_SHORTCUT || + Fl::event() == FL_KEYBOARD || + Fl::event() == FL_FOCUS || + Fl::event() == FL_UNFOCUS) { redraw_tabs(); if (Fl::event() == FL_FOCUS) return Fl_Group::handle(event); if (Fl::event() == FL_UNFOCUS) return 0; @@ -234,22 +232,22 @@ int Fl_Tabs::handle(int event) { case FL_KEYBOARD: switch (Fl::event_key()) { case FL_Left: - if (!children()) return 0; + if (!children()) return 0; if (child(0)->visible()) return 0; - for (i = 1; i < children(); i ++) - if (child(i)->visible()) break; - value(child(i - 1)); - set_changed(); - do_callback(); + for (i = 1; i < children(); i ++) + if (child(i)->visible()) break; + value(child(i - 1)); + set_changed(); + do_callback(); return 1; case FL_Right: - if (!children()) return 0; + if (!children()) return 0; if (child(children() - 1)->visible()) return 0; - for (i = 0; i < children(); i ++) - if (child(i)->visible()) break; - value(child(i + 1)); - set_changed(); - do_callback(); + for (i = 0; i < children(); i ++) + if (child(i)->visible()) break; + value(child(i + 1)); + set_changed(); + do_callback(); return 1; case FL_Down: redraw(); @@ -500,39 +498,39 @@ Fl_Tabs::~Fl_Tabs() { \li > 0: use given \p tabh value, tabs on top (height = tabh) \li < -1: use given \p tabh value, tabs on bottom (height = -tabh) - \param[in] tabh position and optional height of tabs (see above) - \param[out] rx,ry,rw,rh (x,y,w,h) of client area for children + \param[in] tabh position and optional height of tabs (see above) + \param[out] rx,ry,rw,rh (x,y,w,h) of client area for children - \since FLTK 1.3.0 + \since FLTK 1.3.0 */ void Fl_Tabs::client_area(int &rx, int &ry, int &rw, int &rh, int tabh) { - if (children()) { // use existing values + if (children()) { // use existing values rx = child(0)->x(); ry = child(0)->y(); rw = child(0)->w(); rh = child(0)->h(); - } else { // calculate values + } else { // calculate values int y_offset; int label_height = fl_height(labelfont(), labelsize()) + BORDER*2; - if (tabh == 0) // use default (at top) + if (tabh == 0) // use default (at top) y_offset = label_height; - else if (tabh == -1) // use default (at bottom) + else if (tabh == -1) // use default (at bottom) y_offset = -label_height; else - y_offset = tabh; // user given value + y_offset = tabh; // user given value rx = x(); rw = w(); - if (y_offset >= 0) { // labels at top + if (y_offset >= 0) { // labels at top ry = y() + y_offset; rh = h() - y_offset; - } else { // labels at bottom + } else { // labels at bottom ry = y(); rh = h() + y_offset; } @@ -549,7 +547,3 @@ void Fl_Tabs::clear_tab_positions() { tab_width = 0; } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index 4cfa5e470..9691d7a4a 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copyright 2001-2017 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under // the LGPL for the FLTK library granted by Mark Edel. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -30,7 +28,7 @@ This file is based on a port of NEdit to FLTK many years ago. NEdit at that point was already stretched beyond the task it was designed for which explains why the source code is sometimes pretty convoluted. It still is a very useful - widget for FLTK, and we are thankful that the nedit team allowed us to + widget for FLTK, and we are thankful that the nedit team allowed us to integrate their code. With the introduction of Unicode and UTF-8, Fl_Text_... has to go into a whole @@ -38,7 +36,7 @@ features make less sense in the multibyte and multiwidth world of UTF-8. Columns are a good example. There is simply no such thing. The new Fl_Text_... - widget converts columns to pixels by multiplying them with the average + widget converts columns to pixels by multiplying them with the average character width for a given font. Rectangular selections were rarely used (if at all) and make little sense when @@ -48,8 +46,8 @@ routines. They are slower, but give the expected result for proportional fonts. And constantly recalculating character widths is just much too expensive. Lines - of text are now subdivided into blocks of text which are measured at once - instead of individual characters. + of text are now subdivided into blocks of text which are measured at once + instead of individual characters. */ @@ -71,10 +69,10 @@ static int min(int i1, int i2) static char *undobuffer; static int undobufferlength; static Fl_Text_Buffer *undowidget; -static int undoat; // points after insertion -static int undocut; // number of characters deleted there -static int undoinsert; // number of characters inserted -static int undoyankcut; // length of valid contents of buffer, even if undocut=0 +static int undoat; // points after insertion +static int undocut; // number of characters deleted there +static int undoinsert; // number of characters inserted +static int undoyankcut; // length of valid contents of buffer, even if undocut=0 /* Resize the undo buffer to match at least the requested size. @@ -84,7 +82,7 @@ static void undobuffersize(int n) if (n > undobufferlength) { if (undobuffer) { do { - undobufferlength *= 2; + undobufferlength *= 2; } while (undobufferlength < n); undobuffer = (char *) realloc(undobuffer, undobufferlength); } else { @@ -156,7 +154,7 @@ char *Fl_Text_Buffer::text() const { memcpy(t+mGapStart, mBuf+mGapEnd, mLength - mGapStart); t[mLength] = '\0'; return t; -} +} /* @@ -171,12 +169,12 @@ void Fl_Text_Buffer::text(const char *t) if (!t) t=""; call_predelete_callbacks(0, length()); - + /* Save information for redisplay, and get rid of the old buffer */ const char *deletedText = text(); int deletedLength = mLength; free((void *) mBuf); - + /* Start a new buffer with a gap of mPreferredGapSize at the end */ int insertedLength = (int) strlen(t); mBuf = (char *) malloc(insertedLength + mPreferredGapSize); @@ -184,10 +182,10 @@ void Fl_Text_Buffer::text(const char *t) mGapStart = insertedLength; mGapEnd = mGapStart + mPreferredGapSize; memcpy(mBuf, t, insertedLength); - + /* Zero all of the existing selections */ update_selections(0, deletedLength, 0); - + /* Call the saved display routine(s) to update the screen */ call_modify_callbacks(0, deletedLength, insertedLength, 0, deletedText); free((void *) deletedText); @@ -200,9 +198,9 @@ void Fl_Text_Buffer::text(const char *t) char *Fl_Text_Buffer::text_range(int start, int end) const { IS_UTF8_ALIGNED2(this, (start)) IS_UTF8_ALIGNED2(this, (end)) - + char *s = NULL; - + /* Make sure start and end are ok, and allocate memory for returned string. If start is bad, return "", if end is bad, adjust it. */ if (start < 0 || start > mLength) @@ -220,7 +218,7 @@ char *Fl_Text_Buffer::text_range(int start, int end) const { end = mLength; int copiedLength = end - start; s = (char *) malloc(copiedLength + 1); - + /* Copy the text from the buffer to the returned string */ if (end <= mGapStart) { memcpy(s, mBuf + start, copiedLength); @@ -239,15 +237,15 @@ char *Fl_Text_Buffer::text_range(int start, int end) const { Return a UCS-4 character at the given index. Pos must be at a character boundary. */ -unsigned int Fl_Text_Buffer::char_at(int pos) const { +unsigned int Fl_Text_Buffer::char_at(int pos) const { if (pos < 0 || pos >= mLength) return '\0'; - + IS_UTF8_ALIGNED2(this, (pos)) - + const char *src = address(pos); return fl_utf8decode(src, 0, 0); -} +} /* @@ -259,7 +257,7 @@ char Fl_Text_Buffer::byte_at(int pos) const { return '\0'; const char *src = address(pos); return *src; -} +} /* @@ -270,20 +268,20 @@ void Fl_Text_Buffer::insert(int pos, const char *text) { IS_UTF8_ALIGNED2(this, (pos)) IS_UTF8_ALIGNED(text) - + /* check if there is actually any text */ if (!text || !*text) return; - + /* if pos is not contiguous to existing text, make it */ if (pos > mLength) pos = mLength; if (pos < 0) pos = 0; - + /* Even if nothing is deleted, we must call these callbacks */ call_predelete_callbacks(pos, 0); - + /* insert and redisplay */ int nInserted = insert_(pos, text); mCursorPosHint = pos + nInserted; @@ -295,7 +293,7 @@ void Fl_Text_Buffer::insert(int pos, const char *text) /** Can be used by subclasses that need their own printf() style functionality. e.g. Fl_Simple_Terminal::printf() would wrap around this method. - \note The expanded string is currently limited to 1024 characters. + \note The expanded string is currently limited to 1024 characters. \param[in] fmt is a printf format string for the message text. \param[in] ap is a va_list created by va_start() and closed with va_end(), which the caller is responsible for handling. @@ -303,7 +301,7 @@ void Fl_Text_Buffer::insert(int pos, const char *text) void Fl_Text_Buffer::vprintf(const char *fmt, va_list ap) { char buffer[1024]; // XXX: 1024 should be user configurable ::vsnprintf(buffer, 1024, fmt, ap); - buffer[1024-1] = 0; // XXX: MICROSOFT + buffer[1024-1] = 0; // XXX: MICROSOFT append(buffer); } @@ -325,7 +323,7 @@ void Fl_Text_Buffer::vprintf(const char *fmt, va_list ap) { tbuf->printf("The current PID is %ld.\n", (long)getpid()); : \endcode - \note The expanded string is currently limited to 1024 characters. + \note The expanded string is currently limited to 1024 characters. \param[in] fmt is a printf format string for the message text. */ void Fl_Text_Buffer::printf(const char *fmt, ...) { @@ -353,7 +351,7 @@ void Fl_Text_Buffer::replace(int start, int end, const char *text) IS_UTF8_ALIGNED2(this, (start)) IS_UTF8_ALIGNED2(this, (end)) IS_UTF8_ALIGNED(text) - + call_predelete_callbacks(start, end - start); const char *deletedText = text_range(start, end); remove_(start, end); @@ -386,11 +384,11 @@ void Fl_Text_Buffer::remove(int start, int end) end = 0; IS_UTF8_ALIGNED2(this, (start)) - IS_UTF8_ALIGNED2(this, (end)) - + IS_UTF8_ALIGNED2(this, (end)) + if (start == end) return; - + call_predelete_callbacks(start, end - start); /* Remove and redisplay */ const char *deletedText = text_range(start, end); @@ -406,14 +404,14 @@ void Fl_Text_Buffer::remove(int start, int end) fromStart, fromEnd, and toPos must be at a character boundary. */ void Fl_Text_Buffer::copy(Fl_Text_Buffer * fromBuf, int fromStart, - int fromEnd, int toPos) + int fromEnd, int toPos) { IS_UTF8_ALIGNED2(fromBuf, fromStart) IS_UTF8_ALIGNED2(fromBuf, fromEnd) IS_UTF8_ALIGNED2(this, (toPos)) - + int copiedLength = fromEnd - fromStart; - + /* Prepare the buffer to receive the new text. If the new text fits in the current buffer, just move the gap (if necessary) to where the text should be inserted. If the new text is too large, reallocate @@ -423,19 +421,19 @@ void Fl_Text_Buffer::copy(Fl_Text_Buffer * fromBuf, int fromStart, reallocate_with_gap(toPos, copiedLength + mPreferredGapSize); else if (toPos != mGapStart) move_gap(toPos); - + /* Insert the new text (toPos now corresponds to the start of the gap) */ if (fromEnd <= fromBuf->mGapStart) { memcpy(&mBuf[toPos], &fromBuf->mBuf[fromStart], copiedLength); } else if (fromStart >= fromBuf->mGapStart) { memcpy(&mBuf[toPos], - &fromBuf->mBuf[fromStart + (fromBuf->mGapEnd - fromBuf->mGapStart)], - copiedLength); + &fromBuf->mBuf[fromStart + (fromBuf->mGapEnd - fromBuf->mGapStart)], + copiedLength); } else { int part1Length = fromBuf->mGapStart - fromStart; memcpy(&mBuf[toPos], &fromBuf->mBuf[fromStart], part1Length); memcpy(&mBuf[toPos + part1Length], - &fromBuf->mBuf[fromBuf->mGapEnd], copiedLength - part1Length); + &fromBuf->mBuf[fromBuf->mGapEnd], copiedLength - part1Length); } mGapStart += copiedLength; mLength += copiedLength; @@ -447,20 +445,20 @@ void Fl_Text_Buffer::copy(Fl_Text_Buffer * fromBuf, int fromStart, Take the previous changes and undo them. Return the previous cursor position in cursorPos. Returns 1 if the undo was applied. CursorPos will be at a character boundary. - */ + */ int Fl_Text_Buffer::undo(int *cursorPos) { if (undowidget != this || (!undocut && !undoinsert && !mCanUndo)) return 0; - + int ilen = undocut; int xlen = undoinsert; int b = undoat - xlen; - + if (xlen && undoyankcut && !ilen) { ilen = undoyankcut; } - + if (xlen && ilen) { undobuffersize(ilen + 1); undobuffer[ilen] = 0; @@ -481,7 +479,7 @@ int Fl_Text_Buffer::undo(int *cursorPos) *cursorPos = mCursorPosHint; undoyankcut = 0; } - + return 1; } @@ -493,27 +491,27 @@ void Fl_Text_Buffer::canUndo(char flag) { mCanUndo = flag; // disabling undo also clears the last undo operation! - if (!mCanUndo && undowidget==this) + if (!mCanUndo && undowidget==this) undowidget = 0; } /* - Change the tab width. This will cause a couple of callbacks and a complete - redisplay. + Change the tab width. This will cause a couple of callbacks and a complete + redisplay. Matt: I am not entirely sure why we need to trigger callbacks because tabs are only a graphical hint, not changing any text at all, but I leave - this in here for back compatibility. + this in here for back compatibility. */ void Fl_Text_Buffer::tab_distance(int tabDist) { - /* First call the pre-delete callbacks with the previous tab setting + /* First call the pre-delete callbacks with the previous tab setting still active. */ call_predelete_callbacks(0, mLength); - + /* Change the tab setting */ mTabDist = tabDist; - + /* Force any display routines to redisplay everything (unfortunately, this means copying the whole buffer contents to provide "deletedText" */ const char *deletedText = text(); @@ -529,10 +527,10 @@ void Fl_Text_Buffer::tab_distance(int tabDist) void Fl_Text_Buffer::select(int start, int end) { IS_UTF8_ALIGNED2(this, (start)) - IS_UTF8_ALIGNED2(this, (end)) - + IS_UTF8_ALIGNED2(this, (end)) + Fl_Text_Selection oldSelection = mPrimary; - + mPrimary.set(start, end); redisplay_selection(&oldSelection, &mPrimary); } @@ -544,12 +542,12 @@ void Fl_Text_Buffer::select(int start, int end) void Fl_Text_Buffer::unselect() { Fl_Text_Selection oldSelection = mPrimary; - + mPrimary.mSelected = 0; redisplay_selection(&oldSelection, &mPrimary); } - + /* Return the primary selection range. */ @@ -593,7 +591,7 @@ void Fl_Text_Buffer::replace_selection(const char *text) void Fl_Text_Buffer::secondary_select(int start, int end) { Fl_Text_Selection oldSelection = mSecondary; - + mSecondary.set(start, end); redisplay_selection(&oldSelection, &mSecondary); } @@ -605,12 +603,12 @@ void Fl_Text_Buffer::secondary_select(int start, int end) void Fl_Text_Buffer::secondary_unselect() { Fl_Text_Selection oldSelection = mSecondary; - + mSecondary.mSelected = 0; redisplay_selection(&oldSelection, &mSecondary); } - + /* Return the selected range. */ @@ -654,7 +652,7 @@ void Fl_Text_Buffer::replace_secondary_selection(const char *text) void Fl_Text_Buffer::highlight(int start, int end) { Fl_Text_Selection oldSelection = mHighlight; - + mHighlight.set(start, end); redisplay_selection(&oldSelection, &mHighlight); } @@ -666,12 +664,12 @@ void Fl_Text_Buffer::highlight(int start, int end) void Fl_Text_Buffer::unhighlight() { Fl_Text_Selection oldSelection = mHighlight; - + mHighlight.mSelected = 0; redisplay_selection(&oldSelection, &mHighlight); } - + /* Return position of highlight. */ @@ -694,7 +692,7 @@ char *Fl_Text_Buffer::highlight_text() Add a callback that is called whenever text is modified. */ void Fl_Text_Buffer::add_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, - void *cbArg) + void *cbArg) { Fl_Text_Modify_Cb *newModifyProcs = new Fl_Text_Modify_Cb[mNModifyProcs + 1]; @@ -718,11 +716,11 @@ void Fl_Text_Buffer::add_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, /* Remove a callback. */ -void Fl_Text_Buffer::remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, +void Fl_Text_Buffer::remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void *cbArg) { int i, toRemove = -1; - + /* find the matching callback to remove */ for (i = 0; i < mNModifyProcs; i++) { if (mModifyProcs[i] == bufModifiedCB && mCbArgs[i] == cbArg) { @@ -735,7 +733,7 @@ void Fl_Text_Buffer::remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, ("Fl_Text_Buffer::remove_modify_callback(): Can't find modify CB to remove"); return; } - + /* Allocate new lists for remaining callback procs and args (if any are left) */ mNModifyProcs--; @@ -749,7 +747,7 @@ void Fl_Text_Buffer::remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, } Fl_Text_Modify_Cb *newModifyProcs = new Fl_Text_Modify_Cb[mNModifyProcs]; void **newCBArgs = new void *[mNModifyProcs]; - + /* copy out the remaining members and free the old lists */ for (i = 0; i < toRemove; i++) { newModifyProcs[i] = mModifyProcs[i]; @@ -769,7 +767,7 @@ void Fl_Text_Buffer::remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, /* Add a callback that is called before deleting text. */ -void Fl_Text_Buffer::add_predelete_callback(Fl_Text_Predelete_Cb bufPreDeleteCB, +void Fl_Text_Buffer::add_predelete_callback(Fl_Text_Predelete_Cb bufPreDeleteCB, void *cbArg) { Fl_Text_Predelete_Cb *newPreDeleteProcs = @@ -800,7 +798,7 @@ void Fl_Text_Buffer::remove_predelete_callback(Fl_Text_Predelete_Cb bufPreDelete /* find the matching callback to remove */ for (i = 0; i < mNPredeleteProcs; i++) { if (mPredeleteProcs[i] == bufPreDeleteCB && - mPredeleteCbArgs[i] == cbArg) { + mPredeleteCbArgs[i] == cbArg) { toRemove = i; break; } @@ -810,7 +808,7 @@ void Fl_Text_Buffer::remove_predelete_callback(Fl_Text_Predelete_Cb bufPreDelete ("Fl_Text_Buffer::remove_predelete_callback(): Can't find pre-delete CB to remove"); return; } - + /* Allocate new lists for remaining callback procs and args (if any are left) */ mNPredeleteProcs--; if (mNPredeleteProcs == 0) { @@ -822,7 +820,7 @@ void Fl_Text_Buffer::remove_predelete_callback(Fl_Text_Predelete_Cb bufPreDelete } Fl_Text_Predelete_Cb *newPreDeleteProcs = new Fl_Text_Predelete_Cb[mNPredeleteProcs]; void **newCBArgs = new void *[mNPredeleteProcs]; - + /* copy out the remaining members and free the old lists */ for (i = 0; i < toRemove; i++) { newPreDeleteProcs[i] = mPredeleteProcs[i]; @@ -845,18 +843,18 @@ void Fl_Text_Buffer::remove_predelete_callback(Fl_Text_Predelete_Cb bufPreDelete */ char *Fl_Text_Buffer::line_text(int pos) const { return text_range(line_start(pos), line_end(pos)); -} +} /* Find the beginning of the line. */ -int Fl_Text_Buffer::line_start(int pos) const +int Fl_Text_Buffer::line_start(int pos) const { if (!findchar_backward(pos, '\n', &pos)) return 0; return pos + 1; -} +} /* @@ -866,7 +864,7 @@ int Fl_Text_Buffer::line_end(int pos) const { if (!findchar_forward(pos, '\n', &pos)) pos = mLength; return pos; -} +} /** Returns whether character at position \p pos is a word separator. @@ -913,20 +911,20 @@ int Fl_Text_Buffer::word_end(int pos) const { Count the number of characters between two positions. */ int Fl_Text_Buffer::count_displayed_characters(int lineStartPos, - int targetPos) const + int targetPos) const { IS_UTF8_ALIGNED2(this, (lineStartPos)) IS_UTF8_ALIGNED2(this, (targetPos)) - + int charCount = 0; - + int pos = lineStartPos; while (pos < targetPos) { pos = next_char(pos); charCount++; } return charCount; -} +} /* @@ -938,7 +936,7 @@ int Fl_Text_Buffer::skip_displayed_characters(int lineStartPos, int nChars) IS_UTF8_ALIGNED2(this, (lineStartPos)) int pos = lineStartPos; - + for (int charCount = 0; charCount < nChars && pos < mLength; charCount++) { unsigned int c = char_at(pos); if (c == '\n') @@ -957,10 +955,10 @@ int Fl_Text_Buffer::skip_displayed_characters(int lineStartPos, int nChars) int Fl_Text_Buffer::count_lines(int startPos, int endPos) const { IS_UTF8_ALIGNED2(this, (startPos)) IS_UTF8_ALIGNED2(this, (endPos)) - + int gapLen = mGapEnd - mGapStart; int lineCount = 0; - + int pos = startPos; while (pos < mGapStart) { @@ -968,7 +966,7 @@ int Fl_Text_Buffer::count_lines(int startPos, int endPos) const { return lineCount; if (mBuf[pos++] == '\n') lineCount++; - } + } while (pos < mLength) { if (pos == endPos) return lineCount; @@ -987,10 +985,10 @@ int Fl_Text_Buffer::count_lines(int startPos, int endPos) const { int Fl_Text_Buffer::skip_lines(int startPos, int nLines) { IS_UTF8_ALIGNED2(this, (startPos)) - + if (nLines == 0) return startPos; - + int gapLen = mGapEnd - mGapStart; int pos = startPos; int lineCount = 0; @@ -999,7 +997,7 @@ int Fl_Text_Buffer::skip_lines(int startPos, int nLines) lineCount++; if (lineCount == nLines) { IS_UTF8_ALIGNED2(this, (pos)) - return pos; + return pos; } } } @@ -1008,7 +1006,7 @@ int Fl_Text_Buffer::skip_lines(int startPos, int nLines) lineCount++; if (lineCount >= nLines) { IS_UTF8_ALIGNED2(this, (pos)) - return pos; + return pos; } } } @@ -1025,18 +1023,18 @@ int Fl_Text_Buffer::skip_lines(int startPos, int nLines) int Fl_Text_Buffer::rewind_lines(int startPos, int nLines) { IS_UTF8_ALIGNED2(this, (startPos)) - + int pos = startPos - 1; if (pos <= 0) return 0; - + int gapLen = mGapEnd - mGapStart; int lineCount = -1; while (pos >= mGapStart) { if (mBuf[pos + gapLen] == '\n') { if (++lineCount >= nLines) { IS_UTF8_ALIGNED2(this, (pos+1)) - return pos + 1; + return pos + 1; } } pos--; @@ -1045,7 +1043,7 @@ int Fl_Text_Buffer::rewind_lines(int startPos, int nLines) if (mBuf[pos] == '\n') { if (++lineCount >= nLines) { IS_UTF8_ALIGNED2(this, (pos+1)) - return pos + 1; + return pos + 1; } } pos--; @@ -1058,11 +1056,11 @@ int Fl_Text_Buffer::rewind_lines(int startPos, int nLines) Find a matching string in the buffer. */ int Fl_Text_Buffer::search_forward(int startPos, const char *searchString, - int *foundPos, int matchCase) const + int *foundPos, int matchCase) const { IS_UTF8_ALIGNED2(this, (startPos)) IS_UTF8_ALIGNED(searchString) - + if (!searchString) return 0; int bp; @@ -1100,21 +1098,21 @@ int Fl_Text_Buffer::search_forward(int startPos, const char *searchString, unsigned int s = fl_utf8decode(sp, 0, &l); if (fl_tolower(b)!=fl_tolower(s)) break; - sp += l; + sp += l; bp = next_char(bp); } startPos = next_char(startPos); } - } + } return 0; } int Fl_Text_Buffer::search_backward(int startPos, const char *searchString, - int *foundPos, int matchCase) const + int *foundPos, int matchCase) const { IS_UTF8_ALIGNED2(this, (startPos)) IS_UTF8_ALIGNED(searchString) - + if (!searchString) return 0; int bp; @@ -1152,12 +1150,12 @@ int Fl_Text_Buffer::search_backward(int startPos, const char *searchString, unsigned int s = fl_utf8decode(sp, 0, &l); if (fl_tolower(b)!=fl_tolower(s)) break; - sp += l; + sp += l; bp = next_char(bp); } startPos = prev_char(startPos); } - } + } return 0; } @@ -1171,9 +1169,9 @@ int Fl_Text_Buffer::insert_(int pos, const char *text) { if (!text || !*text) return 0; - + int insertedLength = (int) strlen(text); - + /* Prepare the buffer to receive the new text. If the new text fits in the current buffer, just move the gap (if necessary) to where the text should be inserted. If the new text is too large, reallocate @@ -1183,13 +1181,13 @@ int Fl_Text_Buffer::insert_(int pos, const char *text) reallocate_with_gap(pos, insertedLength + mPreferredGapSize); else if (pos != mGapStart) move_gap(pos); - + /* Insert the new text (pos now corresponds to the start of the gap) */ memcpy(&mBuf[pos], text, insertedLength); mGapStart += insertedLength; mLength += insertedLength; update_selections(pos, 0, insertedLength); - + if (mCanUndo) { if (undowidget == this && undoat == pos && undoinsert) { undoinsert += insertedLength; @@ -1201,7 +1199,7 @@ int Fl_Text_Buffer::insert_(int pos, const char *text) undocut = 0; undowidget = this; } - + return insertedLength; } @@ -1213,7 +1211,7 @@ int Fl_Text_Buffer::insert_(int pos, const char *text) void Fl_Text_Buffer::remove_(int start, int end) { /* if the gap is not contiguous to the area to remove, move it there */ - + if (mCanUndo) { if (undowidget == this && undoat == end && undocut) { undobuffersize(undocut + end - start + 1); @@ -1228,11 +1226,11 @@ void Fl_Text_Buffer::remove_(int start, int end) undoyankcut = 0; undowidget = this; } - + if (start > mGapStart) { if (mCanUndo) memcpy(undobuffer, mBuf + (mGapEnd - mGapStart) + start, - end - start); + end - start); move_gap(start); } else if (end < mGapStart) { if (mCanUndo) @@ -1245,19 +1243,19 @@ void Fl_Text_Buffer::remove_(int start, int end) memcpy(undobuffer + prelen, mBuf + mGapEnd, end - start - prelen); } } - + /* expand the gap to encompass the deleted characters */ mGapEnd += end - mGapStart; mGapStart = start; - + /* update the length */ mLength -= end - start; - + /* fix up any selections which might be affected by the change */ update_selections(start, end - start, 0); } - + /** \brief Sets the selection range. @@ -1310,7 +1308,7 @@ int Fl_Text_Selection::position(int *startpos, int *endpos) const { *startpos = mStart; *endpos = mEnd; return 1; -} +} /** @@ -1329,7 +1327,7 @@ int Fl_Text_Selection::includes(int pos) const { */ char *Fl_Text_Buffer::selection_text_(Fl_Text_Selection * sel) const { int start, end; - + /* If there's no selection, return an allocated empty string */ if (!sel->position(&start, &end)) { @@ -1337,7 +1335,7 @@ char *Fl_Text_Buffer::selection_text_(Fl_Text_Selection * sel) const { *s = '\0'; return s; } - + /* Return the selected range */ return text_range(start, end); } @@ -1350,7 +1348,7 @@ char *Fl_Text_Buffer::selection_text_(Fl_Text_Selection * sel) const { void Fl_Text_Buffer::remove_selection_(Fl_Text_Selection * sel) { int start, end; - + if (!sel->position(&start, &end)) return; remove(start, end); @@ -1363,37 +1361,37 @@ void Fl_Text_Buffer::remove_selection_(Fl_Text_Selection * sel) Unicode safe. */ void Fl_Text_Buffer::replace_selection_(Fl_Text_Selection * sel, - const char *text) + const char *text) { Fl_Text_Selection oldSelection = *sel; - + /* If there's no selection, return */ int start, end; if (!sel->position(&start, &end)) return; - + /* Do the appropriate type of replace */ replace(start, end, text); - + /* Unselect (happens automatically in BufReplace, but BufReplaceRect can't detect when the contents of a selection goes away) */ sel->mSelected = 0; redisplay_selection(&oldSelection, sel); } - + /* Call all callbacks. Unicode safe. */ void Fl_Text_Buffer::call_modify_callbacks(int pos, int nDeleted, - int nInserted, int nRestyled, - const char *deletedText) const { + int nInserted, int nRestyled, + const char *deletedText) const { IS_UTF8_ALIGNED2(this, pos) for (int i = 0; i < mNModifyProcs; i++) (*mModifyProcs[i]) (pos, nInserted, nDeleted, nRestyled, - deletedText, mCbArgs[i]); -} + deletedText, mCbArgs[i]); +} /* @@ -1403,7 +1401,7 @@ void Fl_Text_Buffer::call_modify_callbacks(int pos, int nDeleted, void Fl_Text_Buffer::call_predelete_callbacks(int pos, int nDeleted) const { for (int i = 0; i < mNPredeleteProcs; i++) (*mPredeleteProcs[i]) (pos, nDeleted, mPredeleteCbArgs[i]); -} +} /* @@ -1411,13 +1409,13 @@ void Fl_Text_Buffer::call_predelete_callbacks(int pos, int nDeleted) const { Unicode safe. */ void Fl_Text_Buffer::redisplay_selection(Fl_Text_Selection * - oldSelection, - Fl_Text_Selection * - newSelection) const + oldSelection, + Fl_Text_Selection * + newSelection) const { int oldStart, oldEnd, newStart, newEnd, ch1Start, ch1End, ch2Start, ch2End; - + /* If either selection is rectangular, add an additional character to the end of the selection to request the redraw routines to wipe out the parts of the selection beyond the end of the line */ @@ -1425,7 +1423,7 @@ void Fl_Text_Buffer::redisplay_selection(Fl_Text_Selection * newStart = newSelection->mStart; oldEnd = oldSelection->mEnd; newEnd = newSelection->mEnd; - + /* If the old or new selection is unselected, just redisplay the single area that is (was) selected and return */ if (!oldSelection->mSelected && !newSelection->mSelected) @@ -1439,7 +1437,7 @@ void Fl_Text_Buffer::redisplay_selection(Fl_Text_Selection * call_modify_callbacks(oldStart, 0, 0, oldEnd - oldStart, NULL); return; } - + /* If the selections are non-contiguous, do two separate updates and return */ if (oldEnd < newStart || newEnd < oldStart) { @@ -1447,7 +1445,7 @@ void Fl_Text_Buffer::redisplay_selection(Fl_Text_Selection * call_modify_callbacks(newStart, 0, 0, newEnd - newStart, NULL); return; } - + /* Otherwise, separate into 3 separate regions: ch1, and ch2 (the two changed areas), and the unchanged area of their intersection, and update only the changed area(s) */ @@ -1469,7 +1467,7 @@ void Fl_Text_Buffer::redisplay_selection(Fl_Text_Selection * void Fl_Text_Buffer::move_gap(int pos) { int gapLen = mGapEnd - mGapStart; - + if (pos > mGapStart) memmove(&mBuf[mGapStart], &mBuf[mGapEnd], pos - mGapStart); else @@ -1487,19 +1485,19 @@ void Fl_Text_Buffer::reallocate_with_gap(int newGapStart, int newGapLen) { char *newBuf = (char *) malloc(mLength + newGapLen); int newGapEnd = newGapStart + newGapLen; - + if (newGapStart <= mGapStart) { memcpy(newBuf, mBuf, newGapStart); memcpy(&newBuf[newGapEnd], &mBuf[newGapStart], - mGapStart - newGapStart); + mGapStart - newGapStart); memcpy(&newBuf[newGapEnd + mGapStart - newGapStart], - &mBuf[mGapEnd], mLength - mGapStart); - } else { /* newGapStart > mGapStart */ + &mBuf[mGapEnd], mLength - mGapStart); + } else { /* newGapStart > mGapStart */ memcpy(newBuf, mBuf, mGapStart); memcpy(&newBuf[mGapStart], &mBuf[mGapEnd], newGapStart - mGapStart); memcpy(&newBuf[newGapEnd], - &mBuf[mGapEnd + newGapStart - mGapStart], - mLength - newGapStart); + &mBuf[mGapEnd + newGapStart - mGapStart], + mLength - newGapStart); } free((void *) mBuf); mBuf = newBuf; @@ -1513,7 +1511,7 @@ void Fl_Text_Buffer::reallocate_with_gap(int newGapStart, int newGapLen) Unicode safe. Pos must be at a character boundary. */ void Fl_Text_Buffer::update_selections(int pos, int nDeleted, - int nInserted) + int nInserted) { mPrimary.update(pos, nDeleted, nInserted); mSecondary.update(pos, nDeleted, nInserted); @@ -1559,55 +1557,55 @@ void Fl_Text_Selection::update(int pos, int nDeleted, int nInserted) StartPos must be at a character boundary, searchChar is UCS-4 encoded. */ int Fl_Text_Buffer::findchar_forward(int startPos, unsigned searchChar, - int *foundPos) const + int *foundPos) const { if (startPos >= mLength) { *foundPos = mLength; return 0; } - + if (startPos<0) startPos = 0; - + for ( ; startPos<mLength; startPos = next_char(startPos)) { if (searchChar == char_at(startPos)) { *foundPos = startPos; return 1; } } - + *foundPos = mLength; return 0; } - + /* Find a UCS-4 character. StartPos must be at a character boundary, searchChar is UCS-4 encoded. */ int Fl_Text_Buffer::findchar_backward(int startPos, unsigned int searchChar, - int *foundPos) const { + int *foundPos) const { if (startPos <= 0) { *foundPos = 0; return 0; } - + if (startPos > mLength) startPos = mLength; - + for (startPos = prev_char(startPos); startPos>=0; startPos = prev_char(startPos)) { if (searchChar == char_at(startPos)) { *foundPos = startPos; return 1; } } - + *foundPos = 0; return 0; } //#define EXAMPLE_ENCODING // shows how to process any encoding for which a decoding function exists -#ifdef EXAMPLE_ENCODING +#ifdef EXAMPLE_ENCODING // returns the UCS equivalent of *p in CP1252 and advances p by 1 unsigned cp1252toucs(char* &p) @@ -1647,10 +1645,10 @@ unsigned utf16toucs(char* &p) // Output is true UTF-8. // p_trf points to a function that transforms encoded byte(s) into one UCS // and that increases the pointer by the adequate quantity -static int general_input_filter(char *buffer, int buflen, - char *line, int sline, char* &endline, - unsigned (*p_trf)(char* &), - FILE *fp) +static int general_input_filter(char *buffer, int buflen, + char *line, int sline, char* &endline, + unsigned (*p_trf)(char* &), + FILE *fp) { char *p, *q, multibyte[5]; int lq, r, offset; @@ -1659,7 +1657,7 @@ static int general_input_filter(char *buffer, int buflen, while (q < buffer + buflen) { if (p >= endline) { r = fread(line, 1, sline, fp); - endline = line + r; + endline = line + r; if (r == 0) return q - buffer; p = line; } @@ -1670,7 +1668,7 @@ static int general_input_filter(char *buffer, int buflen, } lq = fl_utf8encode( p_trf(p), multibyte ); memcpy(q, multibyte, lq); - q += lq; + q += lq; } memmove(line, p, endline - p); endline -= (p - line); @@ -1689,13 +1687,13 @@ static int general_input_filter(char *buffer, int buflen, *input_was_changed returns true if input was not strict UTF-8, so output differs from input. */ -static int utf8_input_filter(char *buffer, // result buffer we fill with utf8 encoded text - int buflen, // max size of buffer from caller - char *line, // file line buffer caller wants us to use - int sline, // max size of line buffer - char* &endline, // keeps track of leftovers in line[] buffer between calls - FILE *fp, // open file we're reading data from - int *input_was_changed) // returned flag: 'true' if buffer[] different from file due to utf8 encoding +static int utf8_input_filter(char *buffer, // result buffer we fill with utf8 encoded text + int buflen, // max size of buffer from caller + char *line, // file line buffer caller wants us to use + int sline, // max size of line buffer + char* &endline, // keeps track of leftovers in line[] buffer between calls + FILE *fp, // open file we're reading data from + int *input_was_changed) // returned flag: 'true' if buffer[] different from file due to utf8 encoding { // p - work pointer to line[] // q - work pointer to buffer[] @@ -1710,37 +1708,37 @@ static int utf8_input_filter(char *buffer, // result buffer we fill with utf8 p = line; q = buffer; while (q < buffer + buflen) { - if (p >= endline) { // walked off end of input file's line buffer? - r = (int) fread(line, 1, sline, fp); // read another block of sline bytes from file - endline = line + r; - if (r == 0) return (int) (q - buffer); // EOF? return bytes read into buffer[] + if (p >= endline) { // walked off end of input file's line buffer? + r = (int) fread(line, 1, sline, fp); // read another block of sline bytes from file + endline = line + r; + if (r == 0) return (int) (q - buffer); // EOF? return bytes read into buffer[] p = line; } // Predict length of utf8 sequence // See if utf8 seq we're working on would extend off end of line buffer, // and if so, adjust + load more data so that it doesn't. // - l = fl_utf8len1(*p); // anticipate length of utf8 sequence - if (p + l > endline) { // would walk off end of line buffer? - memmove(line, p, endline - p); // re-jigger line buffer to get some room + l = fl_utf8len1(*p); // anticipate length of utf8 sequence + if (p + l > endline) { // would walk off end of line buffer? + memmove(line, p, endline - p); // re-jigger line buffer to get some room endline -= (p - line); - r = (int) fread(endline, 1, sline - (endline - line), fp); // re-fill line buffer + r = (int) fread(endline, 1, sline - (endline - line), fp); // re-fill line buffer endline += r; p = line; - if (endline - line < l) break; // sequence *still* extends past end? stop loop + if (endline - line < l) break; // sequence *still* extends past end? stop loop } while ( l > 0) { - u = fl_utf8decode(p, p+l, &lp); // get single utf8 encoded char as a Unicode value - lq = fl_utf8encode(u, multibyte); // re-encode Unicode value to utf8 in multibyte[] + u = fl_utf8decode(p, p+l, &lp); // get single utf8 encoded char as a Unicode value + lq = fl_utf8encode(u, multibyte); // re-encode Unicode value to utf8 in multibyte[] if (lp != l || lq != l) *input_was_changed = true; - if (q + lq > buffer + buflen) { // encoding would walk off end of buffer[]? - memmove(line, p, endline - p); // re-jigger line[] buffer for next call - endline -= (p - line); // adjust end of line[] buffer for next call - return (int) (q - buffer); // return what's decoded so far, caller will consume buffer + if (q + lq > buffer + buflen) { // encoding would walk off end of buffer[]? + memmove(line, p, endline - p); // re-jigger line[] buffer for next call + endline -= (p - line); // adjust end of line[] buffer for next call + return (int) (q - buffer); // return what's decoded so far, caller will consume buffer } memcpy(q, multibyte, lq); - q += lq; + q += lq; p += lp; l -= lp; } @@ -1750,7 +1748,7 @@ static int utf8_input_filter(char *buffer, // result buffer we fill with utf8 return (int) (q - buffer); } -const char *Fl_Text_Buffer::file_encoding_warning_message = +const char *Fl_Text_Buffer::file_encoding_warning_message = "Displayed text contains the UTF-8 transcoding\n" "of the input file which was not UTF-8 encoded.\n" "Some changes may have occurred."; @@ -1766,7 +1764,7 @@ const char *Fl_Text_Buffer::file_encoding_warning_message = FILE *fp; if (!(fp = fl_fopen(file, "r"))) return 1; - char *buffer = new char[buflen + 1]; + char *buffer = new char[buflen + 1]; char *endline, line[100]; int l; input_file_was_transcoded = false; @@ -1774,14 +1772,14 @@ const char *Fl_Text_Buffer::file_encoding_warning_message = while (true) { #ifdef EXAMPLE_ENCODING // example of 16-bit encoding: UTF-16 - l = general_input_filter(buffer, buflen, - line, sizeof(line), endline, - utf16toucs, // use cp1252toucs to read CP1252-encoded files - fp); + l = general_input_filter(buffer, buflen, + line, sizeof(line), endline, + utf16toucs, // use cp1252toucs to read CP1252-encoded files + fp); input_file_was_transcoded = true; #else - l = utf8_input_filter(buffer, buflen, line, sizeof(line), endline, - fp, &input_file_was_transcoded); + l = utf8_input_filter(buffer, buflen, line, sizeof(line), endline, + fp, &input_file_was_transcoded); #endif if (l == 0) break; buffer[l] = 0; @@ -1803,8 +1801,8 @@ const char *Fl_Text_Buffer::file_encoding_warning_message = Unicode safe. */ int Fl_Text_Buffer::outputfile(const char *file, - int start, int end, - int buflen) { + int start, int end, + int buflen) { FILE *fp; if (!(fp = fl_fopen(file, "w"))) return 1; @@ -1815,7 +1813,7 @@ int Fl_Text_Buffer::outputfile(const char *file, if (r != n) break; } - + int e = ferror(fp) ? 2 : 0; fclose(fp); return e; @@ -1831,7 +1829,7 @@ int Fl_Text_Buffer::prev_char_clipped(int pos) const if (pos<=0) return 0; - IS_UTF8_ALIGNED2(this, (pos)) + IS_UTF8_ALIGNED2(this, (pos)) char c; do { @@ -1840,8 +1838,8 @@ int Fl_Text_Buffer::prev_char_clipped(int pos) const return 0; c = byte_at(pos); } while ( (c&0xc0) == 0x80); - - IS_UTF8_ALIGNED2(this, (pos)) + + IS_UTF8_ALIGNED2(this, (pos)) return pos; } @@ -1863,12 +1861,12 @@ int Fl_Text_Buffer::prev_char(int pos) const */ int Fl_Text_Buffer::next_char(int pos) const { - IS_UTF8_ALIGNED2(this, (pos)) + IS_UTF8_ALIGNED2(this, (pos)) int n = fl_utf8len1(byte_at(pos)); pos += n; if (pos>=mLength) return mLength; - IS_UTF8_ALIGNED2(this, (pos)) + IS_UTF8_ALIGNED2(this, (pos)) return pos; } @@ -1885,7 +1883,7 @@ int Fl_Text_Buffer::next_char_clipped(int pos) const /* Align an index to the current UTF-8 boundary. */ -int Fl_Text_Buffer::utf8_align(int pos) const +int Fl_Text_Buffer::utf8_align(int pos) const { char c = byte_at(pos); while ( (c&0xc0) == 0x80) { @@ -1894,7 +1892,3 @@ int Fl_Text_Buffer::utf8_align(int pos) const } return pos; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index ad31bd0ee..8b4450cfa 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copyright 2001-2020 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under // the LGPL for the FLTK library granted by Mark Edel. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // TODO: rendering of the "optional hyphen" @@ -25,7 +23,7 @@ #include "flstring.h" #include <limits.h> #include <ctype.h> -#include <string.h> // strdup() +#include <string.h> // strdup() #include <FL/Fl.H> #include <FL/platform.H> #include <FL/Fl_Text_Buffer.H> @@ -39,7 +37,7 @@ // #define DEBUG // #define DEBUG2 -#define LINENUM_LEFT_OF_VSCROLL // uncomment this line ... +#define LINENUM_LEFT_OF_VSCROLL // uncomment this line ... // ... if you want the line numbers to be drawn left of the vertical // scrollbar (only if the vertical scrollbar is aligned left). // This is the default. @@ -137,7 +135,7 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) mMaxsize = 0; mSuppressResync = 0; mNLinesDeleted = 0; - mModifyingTabDistance = 0; // XXX: UNUSED + mModifyingTabDistance = 0; // XXX: UNUSED mColumnScale = 0; mCursor_color = FL_FOREGROUND_COLOR; @@ -148,7 +146,7 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) mVScrollBar = new Fl_Scrollbar(0,0,1,1); mVScrollBar->callback((Fl_Callback*)v_scrollbar_cb, this); - scrollbar_width_ = 0; // 0: default from Fl::scrollbar_size() + scrollbar_width_ = 0; // 0: default from Fl::scrollbar_size() scrollbar_align_ = FL_ALIGN_BOTTOM_RIGHT; dragPos = 0; @@ -162,16 +160,16 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) text_area.h = 0; shortcut_ = 0; - textfont_ = FL_HELVETICA; // textfont() - textsize_ = FL_NORMAL_SIZE; // textsize() - textcolor_ = FL_FOREGROUND_COLOR; // textcolor() + textfont_ = FL_HELVETICA; // textfont() + textsize_ = FL_NORMAL_SIZE; // textsize() + textcolor_ = FL_FOREGROUND_COLOR; // textcolor() mLineNumLeft = 0; mLineNumWidth = 0; linenumber_font_ = FL_HELVETICA; linenumber_size_ = FL_NORMAL_SIZE; linenumber_fgcolor_ = FL_INACTIVE_COLOR; - linenumber_bgcolor_ = 53; // ~90% gray + linenumber_bgcolor_ = 53; // ~90% gray linenumber_align_ = FL_ALIGN_RIGHT; linenumber_format_ = strdup("%d"); @@ -189,7 +187,7 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) Free a text display and release its associated memory. \note The text buffer that the text display displays is a separate entity - and is not freed, nor are the style buffer or style table. + and is not freed, nor are the style buffer or style table. \see Fl_Text_Display::buffer(Fl_Text_Buffer* buf) */ @@ -216,12 +214,12 @@ Fl_Text_Display::~Fl_Text_Display() { Use to also enable/disable line numbers. A value of 0 disables line numbering, values >0 enable the line number display. \param width The new width of the area for line numbers to appear, in pixels. - 0 disables line numbers (default) + 0 disables line numbers (default) */ void Fl_Text_Display::linenumber_width(int width) { if (width < 0) return; mLineNumWidth = width; - recalc_display(); // recalc line#s // resize(x(), y(), w(), h()); + recalc_display(); // recalc line#s // resize(x(), y(), w(), h()); } /** @@ -344,7 +342,7 @@ const char* Fl_Text_Display::linenumber_format() const { Multiple text widgets can be associated with the same text buffer. \note The caller is responsible for the old (replaced) buffer (if any). - This method does not delete the old buffer. + This method does not delete the old buffer. \param buf attach this text buffer */ @@ -374,7 +372,7 @@ void Fl_Text_Display::buffer( Fl_Text_Buffer *buf ) { } /* Resize the widget to update the screen... */ - recalc_display(); // resize(x(), y(), w(), h()); + recalc_display(); // resize(x(), y(), w(), h()); } @@ -406,8 +404,8 @@ void Fl_Text_Display::buffer( Fl_Text_Buffer *buf ) { \param cbArg an optional argument for the callback above, usually a pointer to the Text Display. - \todo "extendRangeForStyleMods" does not exist (might be a hangover - from the port from nedit). Find the correct function. + \todo "extendRangeForStyleMods" does not exist (might be a hangover + from the port from nedit). Find the correct function. */ void Fl_Text_Display::highlight_data(Fl_Text_Buffer *styleBuffer, const Style_Table_Entry *styleTable, @@ -454,11 +452,11 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) { printf("Fl_Text_Display::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H); printf(" current size(x=%d, y=%d, w=%d, h=%d)\n", x(), y(), w(), h()); printf(" box_d* size(x=%d, y=%d, w=%d, h=%d)\n", - Fl::box_dx(box()),Fl::box_dy(box()),Fl::box_dw(box()),Fl::box_dh(box())); + Fl::box_dx(box()),Fl::box_dy(box()),Fl::box_dw(box()),Fl::box_dh(box())); printf(" text_area size(x=%d, y=%d, w=%d, h=%d)\n", - text_area.x, text_area.y, text_area.w, text_area.h); + text_area.x, text_area.y, text_area.w, text_area.h); printf(" mContinuousWrap=%d, mWrapMarginPix=%d\n", - mContinuousWrap, mWrapMarginPix); + mContinuousWrap, mWrapMarginPix); fflush(stdout); #endif // DEBUG2 @@ -528,7 +526,7 @@ void Fl_Text_Display::recalc_display() { #ifdef DEBUG2 printf("*** again ... text_area.w = %d, oldTAWidth = %d, diff = %d\n", - text_area.w, oldTAWidth, text_area.w - oldTAWidth); + text_area.w, oldTAWidth, text_area.w - oldTAWidth); #endif // DEBUG2 if (mContinuousWrap && !mWrapMarginPix && text_area.w != oldTAWidth) { @@ -564,12 +562,12 @@ void Fl_Text_Display::recalc_display() { /* Decide if the vertical scrollbar needs to be visible */ if (!mVScrollBar->visible() && - scrollbar_align() & (FL_ALIGN_LEFT|FL_ALIGN_RIGHT) && - mNBufferLines >= mNVisibleLines-(mContinuousWrap?0:1)) + scrollbar_align() & (FL_ALIGN_LEFT|FL_ALIGN_RIGHT) && + mNBufferLines >= mNVisibleLines-(mContinuousWrap?0:1)) { - mVScrollBar->set_visible(); - text_area.w -= scrollsize; - again = 1; + mVScrollBar->set_visible(); + text_area.w -= scrollsize; + again = 1; } /* @@ -596,7 +594,7 @@ void Fl_Text_Display::recalc_display() { don't turn it off (ie mix both of your solutions). */ if (!mHScrollBar->visible() && - scrollbar_align() & (FL_ALIGN_TOP|FL_ALIGN_BOTTOM) && + scrollbar_align() & (FL_ALIGN_TOP|FL_ALIGN_BOTTOM) && (mVScrollBar->visible() || longest_vline() > text_area.w)) { char wrap_at_bounds = mContinuousWrap && (mWrapMarginPix<text_area.w); @@ -636,23 +634,23 @@ void Fl_Text_Display::recalc_display() { #endif } else { mVScrollBar->resize(X+W-scrollsize, - text_area.y - TOP_MARGIN, - scrollsize, - text_area.h + TOP_MARGIN + BOTTOM_MARGIN); + text_area.y - TOP_MARGIN, + scrollsize, + text_area.h + TOP_MARGIN + BOTTOM_MARGIN); } } if (mHScrollBar->visible()) { if (scrollbar_align() & FL_ALIGN_TOP) { mHScrollBar->resize(text_area.x - LEFT_MARGIN, - Y, - text_area.w + LEFT_MARGIN + RIGHT_MARGIN, - scrollsize); + Y, + text_area.w + LEFT_MARGIN + RIGHT_MARGIN, + scrollsize); } else { mHScrollBar->resize(text_area.x - LEFT_MARGIN, - Y + H - scrollsize, - text_area.w + LEFT_MARGIN + RIGHT_MARGIN, - scrollsize); + Y + H - scrollsize, + text_area.w + LEFT_MARGIN + RIGHT_MARGIN, + scrollsize); } } @@ -899,10 +897,10 @@ void Fl_Text_Display::cursor_style(int style) { Valid wrap modes are: - - WRAP_NONE : don't wrap text at all - - WRAP_AT_COLUMN : wrap text at the given text column - - WRAP_AT_PIXEL : wrap text at a pixel position - - WRAP_AT_BOUNDS : wrap text so that it fits into the widget width + - WRAP_NONE : don't wrap text at all + - WRAP_AT_COLUMN : wrap text at the given text column + - WRAP_AT_PIXEL : wrap text at a pixel position + - WRAP_AT_BOUNDS : wrap text so that it fits into the widget width \param wrap new wrap mode (see above) @@ -953,10 +951,10 @@ void Fl_Text_Display::wrap_mode(int wrap, int wrapMargin) { mNBufferLines = 0; mFirstChar = 0; mTopLineNum = 1; - mAbsTopLineNum = 1; // changed from 0 to 1 -- LZA / STR#2621 + mAbsTopLineNum = 1; // changed from 0 to 1 -- LZA / STR#2621 } - recalc_display(); // resize(x(), y(), w(), h()); + recalc_display(); // resize(x(), y(), w(), h()); } @@ -1065,7 +1063,7 @@ int Fl_Text_Display::position_to_xy( int pos, int* X, int* Y ) const { /* If position is not displayed, return false */ if ((pos < mFirstChar) || (pos > mLastChar && !empty_vlines()) || - (pos > buffer()->length()) ) { // STR #3231 + (pos > buffer()->length()) ) { // STR #3231 return (*X=*Y=0); // make sure X & Y are set when it is out of view } @@ -1197,9 +1195,9 @@ int Fl_Text_Display::wrapped_column(int row, int column) const { \param row \return something unknown - \todo What does this do and how is it useful? Column numbers mean little in - this context. Which functions depend on this one? - Function TextDXYToUnconstrainedPosition does not exist (nedit port?) + \todo What does this do and how is it useful? Column numbers mean little in + this context. Which functions depend on this one? + Function TextDXYToUnconstrainedPosition does not exist (nedit port?) */ int Fl_Text_Display::wrapped_row(int row) const { if (!mContinuousWrap || row < 0 || row > mNVisibleLines) @@ -1265,7 +1263,7 @@ void Fl_Text_Display::display_insert() { */ void Fl_Text_Display::show_insert_position() { display_insert_position_hint = 1; - recalc_display(); // resize(x(), y(), w(), h()); + recalc_display(); // resize(x(), y(), w(), h()); } @@ -1819,7 +1817,7 @@ void Fl_Text_Display::buffer_modified_cb( int pos, int nInserted, int nDeleted, More specifically, this allows the line number reported in the statistics line to be calibrated in absolute lines, rather than post-wrapped lines. - \todo TextDPosToLineAndCol does not exist (nedit port?) + \todo TextDPosToLineAndCol does not exist (nedit port?) */ void Fl_Text_Display::maintain_absolute_top_line_number(int state) { mNeedAbsTopLineNum = state; @@ -1899,8 +1897,8 @@ void Fl_Text_Display::reset_absolute_top_line_number() { Returns 1 if the line is displayed. In this case \p lineNum is the relative line number. - \param[in] pos byte position in buffer - \param[out] lineNum relative line number of byte \p pos in buffer + \param[in] pos byte position in buffer + \param[out] lineNum relative line number of byte \p pos in buffer \returns whether the character at byte position \p pos is currently displayed \retval 0 \p pos is not displayed; \p lineNum is invalid (zero) @@ -2286,11 +2284,11 @@ void Fl_Text_Display::draw_string(int style, if (style & PRIMARY_MASK) { if (Fl::focus() == (Fl_Widget*)this) { - if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) + if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) background = color();// Mac OS: underline marked text - else + else background = selection_color(); - } + } else background = fl_color_average(color(), selection_color(), 0.4f); } else if (style & HIGHLIGHT_MASK) { if (Fl::focus() == (Fl_Widget*)this) background = fl_color_average(color(), selection_color(), 0.5f); @@ -2893,7 +2891,7 @@ void Fl_Text_Display::calc_last_char() { void Fl_Text_Display::scroll(int topLineNum, int horizOffset) { mTopLineNumHint = topLineNum; mHorizOffsetHint = horizOffset; - recalc_display(); // resize(x(), y(), w(), h()); + recalc_display(); // resize(x(), y(), w(), h()); } @@ -2946,7 +2944,7 @@ void Fl_Text_Display::update_v_scrollbar() { #ifdef DEBUG printf("Fl_Text_Display::update_v_scrollbar():\n" " mTopLineNum=%d, mNVisibleLines=%d, mNBufferLines=%d\n", - mTopLineNum, mNVisibleLines, mNBufferLines); + mTopLineNum, mNVisibleLines, mNBufferLines); #endif // DEBUG mVScrollBar->value(mTopLineNum, mNVisibleLines, 1, mNBufferLines+1+(mContinuousWrap?0:1)); @@ -2988,8 +2986,8 @@ void Fl_Text_Display::h_scrollbar_cb(Fl_Scrollbar* b, Fl_Text_Display* textD) { \brief Refresh the line number area. \param clearAll -- (currently unused) If False, only draws the line number text, does not clear the area behind it. If True, clears the area - and redraws the text. Use False to avoid a 'flash' for - single buffered windows. + and redraws the text. Use False to avoid a 'flash' for + single buffered windows. */ // This draw_line_numbers() method based on patch from @@ -3046,16 +3044,16 @@ void Fl_Text_Display::draw_line_numbers(bool /*clearAll*/) { for (visLine=0; visLine < mNVisibleLines; visLine++) { lineStart = mLineStarts[visLine]; if (lineStart != -1 && (lineStart==0 || buffer()->char_at(lineStart-1)=='\n')) { - sprintf(lineNumString, linenumber_format(), line); - int xx = x() + xoff + 3, - yy = Y, - ww = mLineNumWidth - (3*2), - hh = lineHeight; - fl_draw(lineNumString, xx, yy, ww, hh, linenumber_align(), 0, 0); - //DEBUG fl_rect(xx, yy, ww, hh); - line++; + sprintf(lineNumString, linenumber_format(), line); + int xx = x() + xoff + 3, + yy = Y, + ww = mLineNumWidth - (3*2), + hh = lineHeight; + fl_draw(lineNumString, xx, yy, ww, hh, linenumber_align(), 0, 0); + //DEBUG fl_rect(xx, yy, ww, hh); + line++; } else { - if (visLine == 0) line++; + if (visLine == 0) line++; } Y += lineHeight; } @@ -3515,12 +3513,12 @@ void Fl_Text_Display::wrapped_line_counter(Fl_Text_Buffer *buf, int startPos, if (!foundBreak) { /* no whitespace, just break at margin */ newLineStart = max(p, buf->next_char(lineStart)); colNum++; - if (b >= buf->length()) { // STR #2730 - width = 0; - } else { - const char *s = buf->address(b); - width = measure_proportional_character(s, 0, p+styleBufOffset); - } + if (b >= buf->length()) { // STR #2730 + width = 0; + } else { + const char *s = buf->address(b); + width = measure_proportional_character(s, 0, p+styleBufOffset); + } } if (p >= maxPos) { *retPos = maxPos; @@ -3728,7 +3726,7 @@ void Fl_Text_Display::draw(void) { // don't even try if there is no associated text buffer! if (!buffer()) { draw_box(); return; } - fl_push_clip(x(),y(),w(),h()); // prevent drawing outside widget area + fl_push_clip(x(),y(),w(),h()); // prevent drawing outside widget area // background color -- change if inactive Fl_Color bgcolor = active_r() ? color() : fl_inactive(color()); @@ -3825,8 +3823,8 @@ void Fl_Text_Display::draw(void) { int has_selection = buffer()->selection_position(&start, &end); if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE) && ( - (Fl::screen_driver()->has_marked_text() && Fl::compose_state) || - (!has_selection) || mCursorPos < start || mCursorPos > end) && + (Fl::screen_driver()->has_marked_text() && Fl::compose_state) || + (!has_selection) || mCursorPos < start || mCursorPos > end) && mCursorOn && Fl::focus() == (Fl_Widget*)this ) { fl_push_clip(text_area.x-LEFT_MARGIN, text_area.y, @@ -3938,9 +3936,9 @@ int Fl_Text_Display::handle(int event) { case FL_MOVE: if (active_r()) { if (Fl::event_inside(text_area.x, text_area.y, text_area.w, - text_area.h)) window()->cursor(FL_CURSOR_INSERT); - else window()->cursor(FL_CURSOR_DEFAULT); - return 1; + text_area.h)) window()->cursor(FL_CURSOR_INSERT); + else window()->cursor(FL_CURSOR_DEFAULT); + return 1; } else { return 0; } @@ -3950,9 +3948,9 @@ int Fl_Text_Display::handle(int event) { if (active_r() && window()) { window()->cursor(FL_CURSOR_DEFAULT); - return 1; + return 1; } else { - return 0; + return 0; } case FL_PUSH: { @@ -3982,12 +3980,12 @@ int Fl_Text_Display::handle(int event) { dragType = Fl::event_clicks(); if (dragType == DRAG_CHAR) { buffer()->unselect(); -// Fl::copy("", 0, 0); /* removed for STR 2668 */ +// Fl::copy("", 0, 0); /* removed for STR 2668 */ } else if (dragType == DRAG_WORD) { buffer()->select(word_start(pos), word_end(pos)); - dragPos = word_start(pos); - } + dragPos = word_start(pos); + } if (buffer()->primary_selection()->selected()) insert_position(buffer()->primary_selection()->end()); @@ -4053,27 +4051,27 @@ int Fl_Text_Display::handle(int event) { case FL_RELEASE: { if (Fl::event_is_click() && (! Fl::event_clicks()) && - buffer()->primary_selection()->includes(dragPos) && !(Fl::event_state()&FL_SHIFT) ) { - buffer()->unselect(); // clicking in the selection: unselect and move cursor - insert_position(dragPos); - return 1; + buffer()->primary_selection()->includes(dragPos) && !(Fl::event_state()&FL_SHIFT) ) { + buffer()->unselect(); // clicking in the selection: unselect and move cursor + insert_position(dragPos); + return 1; } else if (Fl::event_clicks() == DRAG_LINE && Fl::event_button() == FL_LEFT_MOUSE) { buffer()->select(buffer()->line_start(dragPos), buffer()->next_char(buffer()->line_end(dragPos))); - dragPos = line_start(dragPos); - dragType = DRAG_CHAR; + dragPos = line_start(dragPos); + dragType = DRAG_CHAR; } else { - dragging = 0; - if (scroll_direction) { - Fl::remove_timeout(scroll_timer_cb, this); - scroll_direction = 0; - } - - // convert from WORD or LINE selection to CHAR - /*if (insert_position() >= dragPos) - dragPos = buffer()->primary_selection()->start(); - else - dragPos = buffer()->primary_selection()->end();*/ - dragType = DRAG_CHAR; + dragging = 0; + if (scroll_direction) { + Fl::remove_timeout(scroll_timer_cb, this); + scroll_direction = 0; + } + + // convert from WORD or LINE selection to CHAR + /*if (insert_position() >= dragPos) + dragPos = buffer()->primary_selection()->start(); + else + dragPos = buffer()->primary_selection()->end();*/ + dragType = DRAG_CHAR; } const char* copy = buffer()->selection_text(); @@ -4168,8 +4166,3 @@ double Fl_Text_Display::col_to_x(double col) const } return col*mColumnScale; } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index bf1728377..eaab6f39e 100644 --- a/src/Fl_Text_Editor.cxx +++ b/src/Fl_Text_Editor.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copyright 2001-2018 by Bill Spitzak and others. // // Original code Copyright Mark Edel. Permission to distribute under @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -29,10 +27,10 @@ /* Keyboard Control Matrix -key\modifier plain Ctrl Alt Meta - left 1/1 13/9 0/13 0/9 - right 2/2 14/10 0/14 0/10 - up 3/19 21/7 0/15 0/17 +key\modifier plain Ctrl Alt Meta + left 1/1 13/9 0/13 0/9 + right 2/2 14/10 0/14 0/10 + up 3/19 21/7 0/15 0/17 down 4/20 22/8 0/16 0/18 home 9/5 17/0 0/0 0/0 end 10/6 18/0 0/0 0/0 @@ -132,9 +130,9 @@ static struct { { FL_Down, FL_CTRL|FL_SHIFT, Fl_Text_Editor::kf_c_s_move }, { FL_Page_Up, FL_CTRL|FL_SHIFT, Fl_Text_Editor::kf_c_s_move }, { FL_Page_Down, FL_CTRL|FL_SHIFT, Fl_Text_Editor::kf_c_s_move }, -//{ FL_Clear, 0, Fl_Text_Editor::delete_to_eol }, - { 'z', FL_CTRL, Fl_Text_Editor::kf_undo }, - { '/', FL_CTRL, Fl_Text_Editor::kf_undo }, +//{ FL_Clear, 0, Fl_Text_Editor::delete_to_eol }, + { 'z', FL_CTRL, Fl_Text_Editor::kf_undo }, + { '/', FL_CTRL, Fl_Text_Editor::kf_undo }, { 'x', FL_CTRL, Fl_Text_Editor::kf_cut }, { FL_Delete, FL_SHIFT, Fl_Text_Editor::kf_cut }, { 'c', FL_CTRL, Fl_Text_Editor::kf_copy }, @@ -421,18 +419,18 @@ int Fl_Text_Editor::kf_meta_move(int c, Fl_Text_Editor* e) { e->show_insert_position(); } switch (c) { - case FL_Up: // top of buffer + case FL_Up: // top of buffer e->insert_position(0); e->scroll(0, 0); break; - case FL_Down: // end of buffer + case FL_Down: // end of buffer e->insert_position(e->buffer()->length()); e->scroll(e->count_lines(0, e->buffer()->length(), 1), 0); break; - case FL_Left: // beginning of line + case FL_Left: // beginning of line kf_move(FL_Home, e); break; - case FL_Right: // end of line + case FL_Right: // end of line kf_move(FL_End, e); break; } @@ -657,7 +655,7 @@ void Fl_Text_Editor::maybe_do_callback() { int Fl_Text_Editor::handle(int event) { static int dndCursorPos; - + if (!buffer()) return 0; switch (event) { @@ -670,9 +668,9 @@ int Fl_Text_Editor::handle(int event) { case FL_UNFOCUS: show_cursor(mCursorOn); // redraws the cursor if (Fl::screen_driver()->has_marked_text() && buffer()->selected() && Fl::compose_state) { - int pos = insert_position(); - buffer()->select(pos, pos); - Fl::reset_marked_text(); + int pos = insert_position(); + buffer()->select(pos, pos); + Fl::reset_marked_text(); } if (buffer()->selected()) redraw(); // Redraw selections... case FL_HIDE: @@ -680,14 +678,14 @@ int Fl_Text_Editor::handle(int event) { return 1; case FL_KEYBOARD: - if (active_r() && window() && this == Fl::belowmouse()) + if (active_r() && window() && this == Fl::belowmouse()) window()->cursor(FL_CURSOR_NONE); return handle_key(); case FL_PASTE: if (!Fl::event_text()) { fl_beep(); - return 1; + return 1; } buffer()->remove_selection(); if (insert_mode()) insert(Fl::event_text()); @@ -708,10 +706,10 @@ int Fl_Text_Editor::handle(int event) { // don't let the text_display see this event if (Fl_Group::handle(event)) return 1; dragType = DRAG_NONE; - if(buffer()->selected()) { - buffer()->unselect(); - } - int pos = xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS); + if(buffer()->selected()) { + buffer()->unselect(); + } + int pos = xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS); insert_position(pos); Fl::paste(*this, 0); Fl::focus(this); @@ -729,8 +727,8 @@ int Fl_Text_Editor::handle(int event) { return 1; } break; - - // Handle drag'n'drop attempt by the user. This is a simplified + + // Handle drag'n'drop attempt by the user. This is a simplified // implementation which allows dnd operations onto the scroll bars. case FL_DND_ENTER: // save the current cursor position if (Fl::visible_focus() && handle(FL_FOCUS)) @@ -740,10 +738,10 @@ int Fl_Text_Editor::handle(int event) { /* fall through */ case FL_DND_DRAG: // show a temporary insertion cursor insert_position(xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS)); - return 1; + return 1; case FL_DND_LEAVE: // restore original cursor insert_position(dndCursorPos); - return 1; + return 1; case FL_DND_RELEASE: // keep insertion cursor and wait for the FL_PASTE event if (!dragging) buffer()->unselect(); // FL_PASTE must not destroy current selection if drag comes from outside return 1; @@ -769,7 +767,7 @@ detail may change in the future. Know that changing the editor's key bindings for Tab and Shift-Tab may affect tab navigation. \param [in] val If \p val is 0, Tab inserts a tab character (default).<br> - If \p val is 1, Tab navigates widget focus. + If \p val is 1, Tab navigates widget focus. \see tab_nav(), Fl::OPTION_ARROW_FOCUS. \version 1.3.4 ABI feature @@ -790,9 +788,9 @@ editor buffer. If enabled, hitting Tab navigates focus to the next widget, and Shift-Tab navigates focus to the previous widget. -\returns if Tab inserts tab characters or moves the focus -\retval 0 Tab inserts tab characters (default) -\retval 1 Tab navigation is enabled. +\returns if Tab inserts tab characters or moves the focus +\retval 0 Tab inserts tab characters (default) +\retval 1 Tab navigation is enabled. \see tab_nav(int), Fl::OPTION_ARROW_FOCUS. \version 1.3.4 ABI feature @@ -800,7 +798,3 @@ and Shift-Tab navigates focus to the previous widget. int Fl_Text_Editor::tab_nav() const { return (bound_key_function(FL_Tab,0)==kf_ignore) ? 1 : 0; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Tile.cxx b/src/Fl_Tile.cxx index aa37d8c9b..997c6dd2d 100644 --- a/src/Fl_Tile.cxx +++ b/src/Fl_Tile.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tile widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -150,10 +148,10 @@ void Fl_Tile::resize(int X,int Y,int W,int H) { Fl_Widget::resize(X,Y,W,H); // find bottom-right corner of resizable: - int OR = p[1].r(); // old right border - int NR = X+W-(p[0].r()-OR); // new right border - int OB = p[1].b(); // old bottom border - int NB = Y+H-(p[0].b()-OB); // new bottom border + int OR = p[1].r(); // old right border + int NR = X+W-(p[0].r()-OR); // new right border + int OB = p[1].b(); // old bottom border + int NB = Y+H-(p[0].b()-OB); // new bottom border // move everything to be on correct side of new resizable: Fl_Widget*const* a = array(); @@ -221,20 +219,20 @@ int Fl_Tile::handle(int event) { Fl_Widget* o = *a++; if (o == resizable()) continue; if (p->r() < q->r() && o->y()<=my+GRABAREA && o->y()+o->h()>=my-GRABAREA) { - int t = mx - (o->x()+o->w()); - if (abs(t) < mindx) { - sdx = t; - mindx = abs(t); - oldx = p->r(); - } + int t = mx - (o->x()+o->w()); + if (abs(t) < mindx) { + sdx = t; + mindx = abs(t); + oldx = p->r(); + } } if (p->b() < q->b() && o->x()<=mx+GRABAREA && o->x()+o->w()>=mx-GRABAREA) { - int t = my - (o->y()+o->h()); - if (abs(t) < mindy) { - sdy = t; - mindy = abs(t); - oldy = p->b(); - } + int t = my - (o->y()+o->h()); + if (abs(t) < mindy) { + sdy = t; + mindy = abs(t); + oldy = p->b(); + } } } sdrag = 0; sx = sy = 0; @@ -297,8 +295,3 @@ Fl_Tile::Fl_Tile(int X,int Y,int W,int H,const char*L) : Fl_Group(X,Y,W,H,L) { } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Tiled_Image.cxx b/src/Fl_Tiled_Image.cxx index cd0972126..8451e062f 100644 --- a/src/Fl_Tiled_Image.cxx +++ b/src/Fl_Tiled_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tiled image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -54,9 +52,9 @@ \todo Fix Fl_Tiled_Image as background image for widgets and windows and fix the implementation of Fl::scheme(const char *). */ -Fl_Tiled_Image::Fl_Tiled_Image(Fl_Image *i, // I - Image to tile - int W, // I - Width of tiled area - int H) : // I - Height of tiled area +Fl_Tiled_Image::Fl_Tiled_Image(Fl_Image *i, // I - Image to tile + int W, // I - Width of tiled area + int H) : // I - Height of tiled area Fl_Image(W,H,0) { image_ = i; alloc_image_ = 0; @@ -79,9 +77,9 @@ Fl_Tiled_Image::Fl_Tiled_Image(Fl_Image *i, // I - Image to tile // 'Fl_Tiled_Image::copy()' - Copy and resize a tiled image... // -Fl_Image * // O - New image -Fl_Tiled_Image::copy(int W, // I - New width - int H) { // I - New height +Fl_Image * // O - New image +Fl_Tiled_Image::copy(int W, // I - New width + int H) { // I - New height if (W == w() && H == h()) return this; else return new Fl_Tiled_Image(image_, W, H); } @@ -92,8 +90,8 @@ Fl_Tiled_Image::copy(int W, // I - New width // void -Fl_Tiled_Image::color_average(Fl_Color c, // I - Color to blend with - float i) { // I - Blend fraction +Fl_Tiled_Image::color_average(Fl_Color c, // I - Color to blend with + float i) { // I - Blend fraction if (!alloc_image_) { image_ = image_->copy(); alloc_image_ = 1; @@ -150,20 +148,20 @@ Fl_Tiled_Image::desaturate() { This may be improved in a later version of the library. */ void -Fl_Tiled_Image::draw(int X, // I - Starting X position - int Y, // I - Starting Y position - int W, // I - Width of area to be filled - int H, // I - Height of area to be filled - int cx, // I - "Source" X position - int cy) { // I - "Source" Y position +Fl_Tiled_Image::draw(int X, // I - Starting X position + int Y, // I - Starting Y position + int W, // I - Width of area to be filled + int H, // I - Height of area to be filled + int cx, // I - "Source" X position + int cy) { // I - "Source" Y position - int iw = image_->w(); // effective image width - int ih = image_->h(); // effective image height + int iw = image_->w(); // effective image width + int ih = image_->h(); // effective image height if (!iw || !ih) return; if (cx >= iw || cy >= ih) return; - if (cx < 0) cx = 0; // ignore negative values + if (cx < 0) cx = 0; // ignore negative values if (cy < 0) cy = 0; // W and H null means the image is potentially as large as the current window @@ -181,22 +179,17 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position fl_push_clip(X, Y, W, H); - if (cx > 0) iw -= cx; // crop image + if (cx > 0) iw -= cx; // crop image if (cy > 0) ih -= cy; for (int yy = Y; yy < H; yy += ih) { if (fl_not_clipped(X,yy,W,ih)) { for (int xx = X; xx < W; xx += iw) { - if (fl_not_clipped(xx,yy,iw,ih)) { - image_->draw(xx,yy,iw,ih,cx,cy); - } + if (fl_not_clipped(xx,yy,iw,ih)) { + image_->draw(xx,yy,iw,ih,cx,cy); + } } } } fl_pop_clip(); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 5d572ac72..53fcdb18f 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tooltip source file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Tooltip.H> @@ -59,7 +57,7 @@ public: /** Shows the tooltip windows only if a tooltip text is available. */ void show() { if (!tip) return; - + Fl_Menu_Window::show(); } @@ -213,8 +211,8 @@ void Fl_Tooltip::enter_(Fl_Widget* w) { } enter_area(w, 0, 0, w->w(), w->h(), tw->tooltip()); } -/** - Sets the current widget target. +/** + Sets the current widget target. Acts as though enter(widget) was done but does not pop up a tooltip. This is useful to prevent a tooltip from reappearing when a modal overlapping window is deleted. FLTK does this automatically @@ -334,18 +332,18 @@ void Fl_Tooltip::set_enter_exit_once_() { } /** - Sets the current tooltip text. + Sets the current tooltip text. - Sets a string of text to display in a popup tooltip window when the user - hovers the mouse over the widget. The string is <I>not</I> copied, so - make sure any formatted string is stored in a static, global, + Sets a string of text to display in a popup tooltip window when the user + hovers the mouse over the widget. The string is <I>not</I> copied, so + make sure any formatted string is stored in a static, global, or allocated buffer. If you want a copy made and managed for you, use the copy_tooltip() method, which will manage the tooltip string automatically. - If no tooltip is set, the tooltip of the parent is inherited. Setting a - tooltip for a group and setting no tooltip for a child will show the - group's tooltip instead. To avoid this behavior, you can set the child's + If no tooltip is set, the tooltip of the parent is inherited. Setting a + tooltip for a group and setting no tooltip for a child will show the + group's tooltip instead. To avoid this behavior, you can set the child's tooltip to an empty string (""). \param[in] text New tooltip text (no copy is made) \see copy_tooltip(const char*), tooltip() @@ -362,16 +360,16 @@ void Fl_Widget::tooltip(const char *text) { } /** - Sets the current tooltip text. - Unlike tooltip(), this method allocates a copy of the tooltip + Sets the current tooltip text. + Unlike tooltip(), this method allocates a copy of the tooltip string instead of using the original string pointer. The internal copy will automatically be freed whenever you assign a new tooltip or when the widget is destroyed. - If no tooltip is set, the tooltip of the parent is inherited. Setting a - tooltip for a group and setting no tooltip for a child will show the - group's tooltip instead. To avoid this behavior, you can set the child's + If no tooltip is set, the tooltip of the parent is inherited. Setting a + tooltip for a group and setting no tooltip for a child will show the + group's tooltip instead. To avoid this behavior, you can set the child's tooltip to an empty string (""). \param[in] text New tooltip text (an internal copy is made and managed) \see tooltip(const char*), tooltip() @@ -387,7 +385,3 @@ void Fl_Widget::copy_tooltip(const char *text) { tooltip_ = (char *)0; } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx index 7f1580f04..ec1d4816e 100644 --- a/src/Fl_Tree.cxx +++ b/src/Fl_Tree.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// #include <stdio.h> #include <stdlib.h> @@ -20,11 +18,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // INTERNAL: scroller callback (hor+vert scroll) @@ -40,29 +38,29 @@ static void scroll_cb(Fl_Widget*,void *data) { static char **parse_path(const char *path) { size_t len = strlen(path); char *cp = new char[(len+1)], *word = cp, *s = cp; // freed below or in free_path() - char **ap = new char*[(len+1)], **arr = ap; // overallocates arr[] + char **ap = new char*[(len+1)], **arr = ap; // overallocates arr[] while (1) { - if (*path =='/' || *path == 0) { // handle path sep or eos + if (*path =='/' || *path == 0) { // handle path sep or eos if (word != s) { *s++ = 0; *arr++= word; word = s; } - if ( !*path++) break; else continue; // eos? done, else cont - } else if ( *path == '\\' ) { // handle escape + if ( !*path++) break; else continue; // eos? done, else cont + } else if ( *path == '\\' ) { // handle escape if ( *(++path) ) { *s++ = *path++; } else continue; - } else { *s++ = *path++; } // handle normal char + } else { *s++ = *path++; } // handle normal char } *arr = 0; - if ( arr == ap ) delete[] cp; // empty arr[]? delete since free_path() can't + if ( arr == ap ) delete[] cp; // empty arr[]? delete since free_path() can't return ap; } // INTERNAL: Free an array 'arr' returned by parse_path() static void free_path(char **arr) { if ( arr ) { - if ( arr[0] ) { delete[] arr[0]; } // deletes cp in parse_path - delete[] arr; // deletes ptr array + if ( arr[0] ) { delete[] arr[0]; } // deletes cp in parse_path + delete[] arr; // deletes ptr array } } -#if 0 /* unused code -- STR #3169 */ +#if 0 /* unused code -- STR #3169 */ // INTERNAL: Recursively descend 'item's tree hierarchy // accumulating total child 'count' // @@ -76,15 +74,15 @@ static int find_total_children(Fl_Tree_Item *item, int count=0) { #endif /// Constructor. -Fl_Tree::Fl_Tree(int X, int Y, int W, int H, const char *L) : Fl_Group(X,Y,W,H,L) { +Fl_Tree::Fl_Tree(int X, int Y, int W, int H, const char *L) : Fl_Group(X,Y,W,H,L) { _root = new Fl_Tree_Item(this); - _root->parent(0); // we are root of tree + _root->parent(0); // we are root of tree _root->label("ROOT"); _item_focus = 0; _callback_item = 0; _callback_reason = FL_TREE_REASON_NONE; - _scrollbar_size = 0; // 0: uses Fl::scrollbar_size() - + _scrollbar_size = 0; // 0: uses Fl::scrollbar_size() + _lastselect = 0; box(FL_DOWN_BOX); @@ -137,20 +135,20 @@ Fl_Tree::~Fl_Tree() { /// \version 1.3.3 /// int Fl_Tree::extend_selection_dir(Fl_Tree_Item *from, Fl_Tree_Item *to, - int dir, int val, bool visible ) { + int dir, int val, bool visible ) { int changed = 0; for (Fl_Tree_Item *item=from; item; item = next_item(item, dir, visible) ) { switch (val) { case 0: - if ( deselect(item, when()) ) ++changed; + if ( deselect(item, when()) ) ++changed; break; case 1: if ( select(item, when()) ) ++changed; - break; + break; case 2: select_toggle(item, when()); - ++changed; // toggle always involves a change - break; + ++changed; // toggle always involves a change + break; } if ( item==to ) break; } @@ -167,7 +165,7 @@ int Fl_Tree::extend_selection_dir(Fl_Tree_Item *from, Fl_Tree_Item *to, /// but necessitates a direction to be specified to find \p 'to'.<br> /// Used by SHIFT-click to extend a selection between two items inclusive.<br> /// Handles calling redraw() if anything changed. -/// +/// /// \param[in] from Starting item /// \param[in] to Ending item /// \param[in] val Select or deselect items (0=deselect, 1=select, 2=toggle) @@ -176,21 +174,21 @@ int Fl_Tree::extend_selection_dir(Fl_Tree_Item *from, Fl_Tree_Item *to, /// \returns The number of items whose selection states were changed, if any. /// \version 1.3.3 ABI feature int Fl_Tree::extend_selection(Fl_Tree_Item *from, Fl_Tree_Item *to, - int val, bool visible) { + int val, bool visible) { int changed = 0; if ( from == to ) { - if ( visible && !from->is_visible() ) return(0); // do nothing + if ( visible && !from->is_visible() ) return(0); // do nothing switch (val) { case 0: if ( deselect(from, when()) ) ++changed; - break; + break; case 1: if ( select(from, when()) ) ++changed; - break; + break; case 2: select_toggle(from, when()); - ++changed; // always changed - break; + ++changed; // always changed + break; } return(changed); } @@ -199,20 +197,20 @@ int Fl_Tree::extend_selection(Fl_Tree_Item *from, Fl_Tree_Item *to, if ( visible && !item->is_visible() ) continue; if ( on || (item == from) || (item == to) ) { switch (val) { - case 0: - if ( deselect(item, when()) ) ++changed; - break; - case 1: - if ( select(item, when()) ) ++changed; - break; - case 2: - select_toggle(item, when()); - ++changed; // toggle always involves a change - break; + case 0: + if ( deselect(item, when()) ) ++changed; + break; + case 1: + if ( select(item, when()) ) ++changed; + break; + case 2: + select_toggle(item, when()); + ++changed; // toggle always involves a change + break; } if ( (item == from) || (item == to) ) { on ^= 1; - if ( !on ) break; // done + if ( !on ) break; // done } } } @@ -223,148 +221,148 @@ enum { PUSHED_NONE=0, PUSHED_OPEN_CLOSE, PUSHED_USER_ICON, PUSHED_LABEL }; /// Standard FLTK event handler for this widget. /// \todo add Fl_Widget_Tracker (see Fl_Browser_.cxx::handle()) int Fl_Tree::handle(int e) { - if (e == FL_NO_EVENT) return(0); // XXX: optimize to prevent slow resizes on large trees! + if (e == FL_NO_EVENT) return(0); // XXX: optimize to prevent slow resizes on large trees! int ret = 0; char is_shift = Fl::event_state() & FL_SHIFT ? 1 : 0; char is_ctrl = Fl::event_state() & FL_CTRL ? 1 : 0; - char is_command = Fl::event_state() & FL_COMMAND ? 1 : 0; // ctrl on win/lin, 'Command' on mac + char is_command = Fl::event_state() & FL_COMMAND ? 1 : 0; // ctrl on win/lin, 'Command' on mac // Developer note: Fl_Browser_::handle() used for reference here.. - // #include <FL/names.h> // for event debugging + // #include <FL/names.h> // for event debugging // fprintf(stderr, "DEBUG: %s (%d)\n", fl_eventnames[e], e); if (e == FL_ENTER || e == FL_LEAVE) return(1); switch (e) { case FL_FOCUS: { - // FLTK tests if we want focus. + // FLTK tests if we want focus. // If a nav key was used to give us focus, and we've got no saved // focus widget, determine which item gets focus depending on nav key. // - if ( ! _item_focus ) { // no focus established yet? - switch (Fl::event_key()) { // determine if focus was navigated.. - case FL_Tab: { // received focus via TAB? - int updown = is_shift ? FL_Up : FL_Down; // SHIFT-TAB similar to Up, TAB similar to Down - set_item_focus(next_visible_item(0, updown)); - break; - } - case FL_Left: // received focus via LEFT or UP? - case FL_Up: { // XK_ISO_Left_Tab - set_item_focus(next_visible_item(0, FL_Up)); - break; - } - case FL_Right: // received focus via RIGHT or DOWN? - case FL_Down: - default: { - set_item_focus(next_visible_item(0, FL_Down)); - break; - } - } + if ( ! _item_focus ) { // no focus established yet? + switch (Fl::event_key()) { // determine if focus was navigated.. + case FL_Tab: { // received focus via TAB? + int updown = is_shift ? FL_Up : FL_Down; // SHIFT-TAB similar to Up, TAB similar to Down + set_item_focus(next_visible_item(0, updown)); + break; + } + case FL_Left: // received focus via LEFT or UP? + case FL_Up: { // XK_ISO_Left_Tab + set_item_focus(next_visible_item(0, FL_Up)); + break; + } + case FL_Right: // received focus via RIGHT or DOWN? + case FL_Down: + default: { + set_item_focus(next_visible_item(0, FL_Down)); + break; + } + } } - if ( visible_focus() ) redraw(); // draw focus change + if ( visible_focus() ) redraw(); // draw focus change return(1); } - case FL_UNFOCUS: { // FLTK telling us some other widget took focus. - if ( visible_focus() ) redraw(); // draw focus change + case FL_UNFOCUS: { // FLTK telling us some other widget took focus. + if ( visible_focus() ) redraw(); // draw focus change return(1); } - case FL_KEYBOARD: { // keyboard shortcut + case FL_KEYBOARD: { // keyboard shortcut // Do shortcuts first or scrollbar will get them... - if ( (Fl::focus() == this) && // tree has focus? - _prefs.selectmode() > FL_TREE_SELECT_NONE ) { // select mode that supports kb events? - if ( !_item_focus ) { // no current focus item? - set_item_focus(first_visible_item()); // use first vis item - if ( Fl::event_key() == FL_Up || // Up or down? - Fl::event_key() == FL_Down ) // ..if so, already did 'motion' - return(1); // ..so just return. - } - if ( _item_focus ) { - int ekey = Fl::event_key(); - switch (ekey) { - case FL_Enter: // ENTER: toggle open/close - case FL_KP_Enter: { - open_toggle(_item_focus, when()); // toggle item in focus - return(1); // done, we handled key - } - case ' ': // SPACE: change selection state - switch ( _prefs.selectmode() ) { - case FL_TREE_SELECT_NONE: - break; // ignore, let group have shot at event - case FL_TREE_SELECT_SINGLE: - case FL_TREE_SELECT_SINGLE_DRAGGABLE: - if ( is_ctrl ) { // CTRL-SPACE: (single mode) toggle - if ( ! _item_focus->is_selected() ) { - select_only(_item_focus, when()); - } else { - deselect_all(0, when()); - } - } else { - select_only(_item_focus, when()); // SPACE: (single mode) select only - } - _lastselect = _item_focus; - return(1); // done, we handled key - case FL_TREE_SELECT_MULTI: - if ( is_ctrl ) { - select_toggle(_item_focus, when()); // CTRL-SPACE: (multi mode) toggle selection - } else { - select(_item_focus, when()); // SPACE: (multi-mode) select - } - _lastselect = _item_focus; - return(1); // done, we handled key - } - break; - case FL_Right: // RIGHT: open children (if any) - case FL_Left: { // LEFT: close children (if any) - if ( _item_focus ) { - if ( ekey == FL_Right && _item_focus->is_close() ) { - open(_item_focus); // open closed item - ret = 1; - } else if ( ekey == FL_Left && _item_focus->is_open() ) { - close(_item_focus); // close open item - ret = 1; - } - return(1); - } - break; - } - case FL_Up: // UP: next item up, or extend selection up - case FL_Down: { // DOWN: next item down, or extend selection down - set_item_focus(next_visible_item(_item_focus, ekey)); // next item up|dn - if ( _item_focus ) { // item in focus? - // Autoscroll - int itemtop = _item_focus->y(); - int itembot = _item_focus->y()+_item_focus->h(); - if ( itemtop < y() ) { show_item_top(_item_focus); } - if ( itembot > y()+h() ) { show_item_bottom(_item_focus); } - // Extend selection - if ( _prefs.selectmode() == FL_TREE_SELECT_MULTI && // multiselect on? - is_shift && // shift key? - ! _item_focus->is_selected() ) { // not already selected? - select(_item_focus, when()); // extend selection.. - _lastselect = _item_focus; - } - return(1); - } - break; - } - case 'a': - case 'A': { - if ( is_command ) { // ^A (win/linux), Meta-A (mac) - switch ( _prefs.selectmode() ) { - case FL_TREE_SELECT_NONE: - case FL_TREE_SELECT_SINGLE: - case FL_TREE_SELECT_SINGLE_DRAGGABLE: - break; - case FL_TREE_SELECT_MULTI: - // Do a 'select all' - select_all(); - _lastselect = first_visible_item(); - take_focus(); - return(1); - } - } - break; - } - } - } + if ( (Fl::focus() == this) && // tree has focus? + _prefs.selectmode() > FL_TREE_SELECT_NONE ) { // select mode that supports kb events? + if ( !_item_focus ) { // no current focus item? + set_item_focus(first_visible_item()); // use first vis item + if ( Fl::event_key() == FL_Up || // Up or down? + Fl::event_key() == FL_Down ) // ..if so, already did 'motion' + return(1); // ..so just return. + } + if ( _item_focus ) { + int ekey = Fl::event_key(); + switch (ekey) { + case FL_Enter: // ENTER: toggle open/close + case FL_KP_Enter: { + open_toggle(_item_focus, when()); // toggle item in focus + return(1); // done, we handled key + } + case ' ': // SPACE: change selection state + switch ( _prefs.selectmode() ) { + case FL_TREE_SELECT_NONE: + break; // ignore, let group have shot at event + case FL_TREE_SELECT_SINGLE: + case FL_TREE_SELECT_SINGLE_DRAGGABLE: + if ( is_ctrl ) { // CTRL-SPACE: (single mode) toggle + if ( ! _item_focus->is_selected() ) { + select_only(_item_focus, when()); + } else { + deselect_all(0, when()); + } + } else { + select_only(_item_focus, when()); // SPACE: (single mode) select only + } + _lastselect = _item_focus; + return(1); // done, we handled key + case FL_TREE_SELECT_MULTI: + if ( is_ctrl ) { + select_toggle(_item_focus, when()); // CTRL-SPACE: (multi mode) toggle selection + } else { + select(_item_focus, when()); // SPACE: (multi-mode) select + } + _lastselect = _item_focus; + return(1); // done, we handled key + } + break; + case FL_Right: // RIGHT: open children (if any) + case FL_Left: { // LEFT: close children (if any) + if ( _item_focus ) { + if ( ekey == FL_Right && _item_focus->is_close() ) { + open(_item_focus); // open closed item + ret = 1; + } else if ( ekey == FL_Left && _item_focus->is_open() ) { + close(_item_focus); // close open item + ret = 1; + } + return(1); + } + break; + } + case FL_Up: // UP: next item up, or extend selection up + case FL_Down: { // DOWN: next item down, or extend selection down + set_item_focus(next_visible_item(_item_focus, ekey)); // next item up|dn + if ( _item_focus ) { // item in focus? + // Autoscroll + int itemtop = _item_focus->y(); + int itembot = _item_focus->y()+_item_focus->h(); + if ( itemtop < y() ) { show_item_top(_item_focus); } + if ( itembot > y()+h() ) { show_item_bottom(_item_focus); } + // Extend selection + if ( _prefs.selectmode() == FL_TREE_SELECT_MULTI && // multiselect on? + is_shift && // shift key? + ! _item_focus->is_selected() ) { // not already selected? + select(_item_focus, when()); // extend selection.. + _lastselect = _item_focus; + } + return(1); + } + break; + } + case 'a': + case 'A': { + if ( is_command ) { // ^A (win/linux), Meta-A (mac) + switch ( _prefs.selectmode() ) { + case FL_TREE_SELECT_NONE: + case FL_TREE_SELECT_SINGLE: + case FL_TREE_SELECT_SINGLE_DRAGGABLE: + break; + case FL_TREE_SELECT_MULTI: + // Do a 'select all' + select_all(); + _lastselect = first_visible_item(); + take_focus(); + return(1); + } + } + break; + } + } + } } break; } @@ -372,7 +370,7 @@ int Fl_Tree::handle(int e) { // Let Fl_Group take a shot at handling the event if (Fl_Group::handle(e)) { - return(1); // handled? don't continue below + return(1); // handled? don't continue below } // Handle events the child FLTK widgets didn't need @@ -381,8 +379,8 @@ int Fl_Tree::handle(int e) { if ( ! _root ) return(ret); static int last_my = 0; switch ( e ) { - case FL_PUSH: { // clicked on tree - last_my = Fl::event_y(); // save for dragging direction.. + case FL_PUSH: { // clicked on tree + last_my = Fl::event_y(); // save for dragging direction.. if (Fl::visible_focus() && handle(FL_FOCUS)) Fl::focus(this); Fl_Tree_Item *item = _root->find_clicked(_prefs, 0); // Tell FL_DRAG what was pushed @@ -390,52 +388,52 @@ int Fl_Tree::handle(int e) { : item->event_on_user_icon(_prefs) ? PUSHED_USER_ICON // usericon clicked : PUSHED_LABEL // label clicked : PUSHED_NONE; // none of the above - if ( !item ) { // clicked, but not on an item? + if ( !item ) { // clicked, but not on an item? _lastselect = 0; - switch ( _prefs.selectmode() ) { - case FL_TREE_SELECT_NONE: - break; - case FL_TREE_SELECT_SINGLE: - case FL_TREE_SELECT_SINGLE_DRAGGABLE: - case FL_TREE_SELECT_MULTI: - deselect_all(); - break; - } - break; + switch ( _prefs.selectmode() ) { + case FL_TREE_SELECT_NONE: + break; + case FL_TREE_SELECT_SINGLE: + case FL_TREE_SELECT_SINGLE_DRAGGABLE: + case FL_TREE_SELECT_MULTI: + deselect_all(); + break; + } + break; } - set_item_focus(item); // becomes new focus widget, calls redraw() if needed - ret |= 1; // handled + set_item_focus(item); // becomes new focus widget, calls redraw() if needed + ret |= 1; // handled if ( Fl::event_button() == FL_LEFT_MOUSE ) { - if ( item->event_on_collapse_icon(_prefs) ) { // collapse icon clicked? - open_toggle(item); // toggle open (handles redraw) - } else if ( !item->widget() || !Fl::event_inside(item->widget()) ) { // not inside widget() - switch ( _prefs.selectmode() ) { - case FL_TREE_SELECT_NONE: - break; - case FL_TREE_SELECT_SINGLE: - case FL_TREE_SELECT_SINGLE_DRAGGABLE: - select_only(item, when()); // select only this item (handles redraw) - _lastselect = item; - break; - case FL_TREE_SELECT_MULTI: { - if ( is_shift ) { // SHIFT+PUSH? - if ( _lastselect ) { - int val = is_ctrl ? 2 : 1; - bool visible = true; - extend_selection(_lastselect, item, val, visible); - } else { - select(item); // add to selection - } - } else if ( is_ctrl ) { // CTRL+PUSH? - select_toggle(item, when()); // toggle selection state - } else { - select_only(item, when()); - } - _lastselect = item; - break; - } - } - } + if ( item->event_on_collapse_icon(_prefs) ) { // collapse icon clicked? + open_toggle(item); // toggle open (handles redraw) + } else if ( !item->widget() || !Fl::event_inside(item->widget()) ) { // not inside widget() + switch ( _prefs.selectmode() ) { + case FL_TREE_SELECT_NONE: + break; + case FL_TREE_SELECT_SINGLE: + case FL_TREE_SELECT_SINGLE_DRAGGABLE: + select_only(item, when()); // select only this item (handles redraw) + _lastselect = item; + break; + case FL_TREE_SELECT_MULTI: { + if ( is_shift ) { // SHIFT+PUSH? + if ( _lastselect ) { + int val = is_ctrl ? 2 : 1; + bool visible = true; + extend_selection(_lastselect, item, val, visible); + } else { + select(item); // add to selection + } + } else if ( is_ctrl ) { // CTRL+PUSH? + select_toggle(item, when()); // toggle selection state + } else { + select_only(item, when()); + } + _lastselect = item; + break; + } + } + } } break; } @@ -454,17 +452,17 @@ int Fl_Tree::handle(int e) { last_my = my; // Handle autoscrolling - if ( my < y() ) { // Above top? - dir = FL_Up; // ..going up - int p = vposition()-(y()-my); // ..position above us - if ( p < 0 ) p = 0; // ..don't go above 0 - vposition(p); // ..scroll to new position - } else if ( my > (y()+h()) ) { // Below bottom? - dir = FL_Down; // ..going down - int p = vposition()+(my-y()-h()); // ..position below us - if ( p > (int)_vscroll->maximum() ) // ..don't go below bottom - p = (int)_vscroll->maximum(); - vposition(p); // ..scroll to new position + if ( my < y() ) { // Above top? + dir = FL_Up; // ..going up + int p = vposition()-(y()-my); // ..position above us + if ( p < 0 ) p = 0; // ..don't go above 0 + vposition(p); // ..scroll to new position + } else if ( my > (y()+h()) ) { // Below bottom? + dir = FL_Down; // ..going down + int p = vposition()+(my-y()-h()); // ..position below us + if ( p > (int)_vscroll->maximum() ) // ..don't go below bottom + p = (int)_vscroll->maximum(); + vposition(p); // ..scroll to new position } // Now handle the event.. @@ -472,76 +470,76 @@ int Fl_Tree::handle(int e) { // if ( Fl::event_button() != FL_LEFT_MOUSE ) break; Fl_Tree_Item *item = _root->find_clicked(_prefs, 1); // item we're on, vertically - if ( !item ) break; // not near item? ignore drag event - ret |= 1; // acknowledge event + if ( !item ) break; // not near item? ignore drag event + ret |= 1; // acknowledge event if (_prefs.selectmode() != FL_TREE_SELECT_SINGLE_DRAGGABLE) - set_item_focus(item); // becomes new focus item - if (item==_lastselect) break; // same item as before? avoid reselect + set_item_focus(item); // becomes new focus item + if (item==_lastselect) break; // same item as before? avoid reselect // Handle selection behavior switch ( _prefs.selectmode() ) { - case FL_TREE_SELECT_NONE: - break; // no selection changes - case FL_TREE_SELECT_SINGLE: { - select_only(item, when()); // select only this item (handles redraw) - break; - } - case FL_TREE_SELECT_SINGLE_DRAGGABLE: { - item = _lastselect; // Keep the source intact - redraw(); - break; - } - case FL_TREE_SELECT_MULTI: { - Fl_Tree_Item *from = next_visible_item(_lastselect, dir); // avoid reselecting item - Fl_Tree_Item *to = item; - int val = is_ctrl ? 2 : 1; // toggle_select() or just select()? - bool visible = true; - extend_selection_dir(from, to, dir, val, visible); - break; - } + case FL_TREE_SELECT_NONE: + break; // no selection changes + case FL_TREE_SELECT_SINGLE: { + select_only(item, when()); // select only this item (handles redraw) + break; + } + case FL_TREE_SELECT_SINGLE_DRAGGABLE: { + item = _lastselect; // Keep the source intact + redraw(); + break; + } + case FL_TREE_SELECT_MULTI: { + Fl_Tree_Item *from = next_visible_item(_lastselect, dir); // avoid reselecting item + Fl_Tree_Item *to = item; + int val = is_ctrl ? 2 : 1; // toggle_select() or just select()? + bool visible = true; + extend_selection_dir(from, to, dir, val, visible); + break; + } } - _lastselect = item; // save current item for later + _lastselect = item; // save current item for later break; } case FL_RELEASE: if (_prefs.selectmode() == FL_TREE_SELECT_SINGLE_DRAGGABLE && Fl::event_button() == FL_LEFT_MOUSE) { Fl_Tree_Item *item = _root->find_clicked(_prefs, 1); // item mouse is over (vertically) - if (item && // mouse over valid item? - _lastselect && // item being dragged is valid? - item != _lastselect) { // item we're over not same as drag item? + if (item && // mouse over valid item? + _lastselect && // item being dragged is valid? + item != _lastselect) { // item we're over not same as drag item? // Are we dropping above or below the target item? - const int h = Fl::event_y() - item->y(); // mouse relative to item's top/left - const int mid = item->h() / 2; // middle of item relative to item's top/left - const bool is_above = h < mid; // is mouse above middle of item? + const int h = Fl::event_y() - item->y(); // mouse relative to item's top/left + const int mid = item->h() / 2; // middle of item relative to item's top/left + const bool is_above = h < mid; // is mouse above middle of item? //printf("Dropping %s target item\n", is_above ? "above" : "below"); - Fl_Tree_Item *target = is_above ? prev(item) : next(item); // target item + Fl_Tree_Item *target = is_above ? prev(item) : next(item); // target item if ( target != _lastselect ) { // Don't drop on self - Fl_Tree_Item *parent = item->parent(); // find parent for item mouse is over - if ( !parent ) { // no parent (root)? - // Special case for root; Drop as first child - _lastselect->move_into(root(), 0); - } else { - // Not root.. - if (item->children() && item->is_open() && !is_above) { - // Special case: Drop onto open folder below midline? - // Drop as first child (pos=0) - // - _lastselect->move_into(item, 0); // STR #3432 - } else if (_lastselect->parent() == parent) { - // If we're moving inside same parent, use the below/above methods - if (is_above) _lastselect->move_above(item); - else _lastselect->move_below(item); - } else { - // Moving to different parent.. - int pos = parent->find_child(item); // find position of item in parent - if (!is_above) pos++; // below? next position down - _lastselect->move_into(parent, pos); // move item into parent at position - } - } - redraw(); - do_callback_for_item(_lastselect, FL_TREE_REASON_DRAGGED); + Fl_Tree_Item *parent = item->parent(); // find parent for item mouse is over + if ( !parent ) { // no parent (root)? + // Special case for root; Drop as first child + _lastselect->move_into(root(), 0); + } else { + // Not root.. + if (item->children() && item->is_open() && !is_above) { + // Special case: Drop onto open folder below midline? + // Drop as first child (pos=0) + // + _lastselect->move_into(item, 0); // STR #3432 + } else if (_lastselect->parent() == parent) { + // If we're moving inside same parent, use the below/above methods + if (is_above) _lastselect->move_above(item); + else _lastselect->move_below(item); + } else { + // Moving to different parent.. + int pos = parent->find_child(item); // find position of item in parent + if (!is_above) pos++; // below? next position down + _lastselect->move_into(parent, pos); // move item into parent at position + } + } + redraw(); + do_callback_for_item(_lastselect, FL_TREE_REASON_DRAGGED); } } redraw(); @@ -593,7 +591,7 @@ void Fl_Tree::calc_dimensions() { if ( vshow ) { _vscroll->show(); _vscroll->resize(_tox+_tow-scrollsize, _toy, - scrollsize, h()-Fl::box_dh(box()) - (hshow ? scrollsize : 0)); + scrollsize, h()-Fl::box_dh(box()) - (hshow ? scrollsize : 0)); } else { _vscroll->hide(); _vscroll->value(0); @@ -602,7 +600,7 @@ void Fl_Tree::calc_dimensions() { if ( hshow ) { _hscroll->show(); _hscroll->resize(_tox, _toy+_toh-scrollsize, - _tow - (vshow ? scrollsize : 0), scrollsize); + _tow - (vshow ? scrollsize : 0), scrollsize); } else { _hscroll->hide(); _hscroll->value(0); @@ -642,7 +640,7 @@ void Fl_Tree::calc_dimensions() { /// /// _tree_w/_tree_h include the tree's margins (e.g. marginleft()), /// whether items are open or closed, label contents and font sizes, etc. -/// +/// /// The tree hierarchy's size is managed separately from the widget's /// size as an optimization; this way resize() on the widget doesn't /// involve recalculating the tree's hierarchy needlessly, as widget @@ -682,10 +680,10 @@ void Fl_Tree::calc_tree() { } int xmax = 0, render = 0, ytop = Y; fl_font(_prefs.labelfont(), _prefs.labelsize()); - _root->draw(X, Y, W, 0, xmax, 1, render); // descend into tree without drawing (render=0) + _root->draw(X, Y, W, 0, xmax, 1, render); // descend into tree without drawing (render=0) // Save computed tree width and height - _tree_w = _prefs.marginleft() + xmax - X; // include margin in tree's width - _tree_h = _prefs.margintop() + Y - ytop; // include margin in tree's height + _tree_w = _prefs.marginleft() + xmax - X; // include margin in tree's width + _tree_h = _prefs.margintop() + Y - ytop; // include margin in tree's height // Calc tree dims again; now that tree_w/tree_h are known, scrollbars are calculated. calc_dimensions(); } @@ -707,7 +705,7 @@ void Fl_Tree::draw() { // We handle drawing children ourselves by calling each item's draw() { // Draw group's bg + label - if ( damage() & ~FL_DAMAGE_CHILD) { // redraw entire widget? + if ( damage() & ~FL_DAMAGE_CHILD) { // redraw entire widget? Fl_Group::draw_box(); Fl_Group::draw_label(); } @@ -727,12 +725,12 @@ void Fl_Tree::draw() { { int xmax = 0; fl_font(_prefs.labelfont(), _prefs.labelsize()); - _root->draw(X, Y, W, // descend into tree here to draw it - (Fl::focus()==this)?_item_focus:0, // show focus item ONLY if Fl_Tree has focus - xmax, 1, 1); + _root->draw(X, Y, W, // descend into tree here to draw it + (Fl::focus()==this)?_item_focus:0, // show focus item ONLY if Fl_Tree has focus + xmax, 1, 1); } fl_pop_clip(); - } + } // Draw scrollbars last draw_child(*_vscroll); draw_child(*_hscroll); @@ -741,21 +739,21 @@ void Fl_Tree::draw() { fl_color(_vscroll->color()); fl_rectf(_hscroll->x()+_hscroll->w(), _vscroll->y()+_vscroll->h(), - _vscroll->w(), - _hscroll->h()); + _vscroll->w(), + _hscroll->h()); } // Draw dragging line - if (_prefs.selectmode() == FL_TREE_SELECT_SINGLE_DRAGGABLE && // drag mode? - Fl::pushed() == this) { // item clicked is the one we're drawing? + if (_prefs.selectmode() == FL_TREE_SELECT_SINGLE_DRAGGABLE && // drag mode? + Fl::pushed() == this) { // item clicked is the one we're drawing? Fl_Tree_Item *item = _root->find_clicked(_prefs, 1); // item we're on, vertically - if (item && // we're over a valid item? - item != _item_focus) { // item doesn't have keyboard focus? + if (item && // we're over a valid item? + item != _item_focus) { // item doesn't have keyboard focus? // Are we dropping above or below the target item? - const int h = Fl::event_y() - item->y(); // mouse relative to item's top/left - const int mid = item->h() / 2; // middle of item relative to item's top/left - const bool is_above = h < mid; // is mouse above middle of item? + const int h = Fl::event_y() - item->y(); // mouse relative to item's top/left + const int mid = item->h() / 2; // middle of item relative to item's top/left + const bool is_above = h < mid; // is mouse above middle of item? fl_color(FL_BLACK); int tgt = item->y() + (is_above ? 0 : item->h()); fl_line(item->x(), tgt, item->x() + item->w(), tgt); @@ -773,7 +771,7 @@ void Fl_Tree::show_self() { _root->show_self(); } -/// Set the label for the root item to \p 'new_label'. +/// Set the label for the root item to \p 'new_label'. /// /// Makes an internally managed copy of 'new_label'. /// @@ -830,7 +828,7 @@ Fl_Tree_Item* Fl_Tree::add(const char *path, Fl_Tree_Item *item) { _root = new Fl_Tree_Item(this); _root->parent(0); _root->label("ROOT"); - } + } // Find parent item via path char **arr = parse_path(path); item = _root->add(_prefs, arr, item); @@ -866,7 +864,7 @@ Fl_Tree_Item* Fl_Tree::add(Fl_Tree_Item *parent_item, const char *name) { if (item) tree->insert_above(item, "New item"); // insert new item above it : \endcode - + \param[in] above -- the item above which to insert the new item. Must not be NULL. \param[in] name -- the name of the new item \returns The new item added, or 0 if 'above' could not be found. @@ -922,12 +920,12 @@ int Fl_Tree::remove(Fl_Tree_Item *item) { if ( item == _root ) { clear(); } else { - Fl_Tree_Item *parent = item->parent(); // find item's parent + Fl_Tree_Item *parent = item->parent(); // find item's parent if ( ! parent ) return(-1); - parent->remove_child(item); // remove child + children + parent->remove_child(item); // remove child + children } return(0); -} +} /// Clear the entire tree's children, including the root. /// The tree will be left completely empty. @@ -938,7 +936,7 @@ void Fl_Tree::clear() { delete _root; _root = 0; _item_focus = 0; _lastselect = 0; -} +} /// Clear all the children for \p 'item'. /// Item may not be NULL. @@ -946,14 +944,14 @@ void Fl_Tree::clear() { void Fl_Tree::clear_children(Fl_Tree_Item *item) { if ( item->has_children() ) { item->clear_children(); - redraw(); // redraw only if there were children to clear + redraw(); // redraw only if there were children to clear } -} +} /** Find the item, given a menu style path, e.g. "/Parent/Child/item". There is both a const and non-const version of this method. - Const version allows pure const methods to use this method + Const version allows pure const methods to use this method to do lookups without causing compiler errors. To specify items or submenus that contain slashes ('/' or '\') @@ -982,7 +980,7 @@ const Fl_Tree_Item *Fl_Tree::find_item(const char *path) const { Fl_Tree_Item *Fl_Tree::find_item(const char *path) { // "Effective C++, 3rd Ed", p.23. Sola fide, Amen. return(const_cast<Fl_Tree_Item*>( - static_cast<const Fl_Tree&>(*this).find_item(path))); + static_cast<const Fl_Tree&>(*this).find_item(path))); } // Handle safe 'reverse string concatenation'. @@ -1006,9 +1004,9 @@ Fl_Tree_Item *Fl_Tree::find_item(const char *path) { /// \param[in] pathnamelen The maximum length of the string (including NULL). Must not be zero. /// \param[in] item The item whose pathname is to be returned. /// \returns -/// - 0 : OK (\p pathname returns the item's pathname) -/// - -1 : item not found (pathname="") -/// - -2 : pathname not large enough (pathname="") +/// - 0 : OK (\p pathname returns the item's pathname) +/// - -1 : item not found (pathname="") +/// - -2 : pathname not large enough (pathname="") /// \see find_item() /// int Fl_Tree::item_pathname(char *pathname, int pathnamelen, const Fl_Tree_Item *item) const { @@ -1017,25 +1015,25 @@ int Fl_Tree::item_pathname(char *pathname, int pathnamelen, const Fl_Tree_Item * if ( !item ) return(-1); // Build pathname starting at end char *s = (pathname+pathnamelen-1); - int slen = 0; // length of string compiled so far (including NULL) + int slen = 0; // length of string compiled so far (including NULL) SAFE_RCAT('\0'); while ( item ) { - if ( item->is_root() && showroot() == 0 ) break; // don't include root in path if showroot() off + if ( item->is_root() && showroot() == 0 ) break; // don't include root in path if showroot() off // Find name of current item - const char *name = item->label() ? item->label() : "???"; // name for this item + const char *name = item->label() ? item->label() : "???"; // name for this item int len = (int) strlen(name); // Add name to end of pathname[] for ( --len; len>=0; len-- ) { - SAFE_RCAT(name[len]); // rcat name of item + SAFE_RCAT(name[len]); // rcat name of item if ( name[len] == '/' || name[len] == '\\' ) { - SAFE_RCAT('\\'); // escape front or back slashes within name + SAFE_RCAT('\\'); // escape front or back slashes within name } } - SAFE_RCAT('/'); // rcat leading slash - item = item->parent(); // move up tree (NULL==root) + SAFE_RCAT('/'); // rcat leading slash + item = item->parent(); // move up tree (NULL==root) } - if ( *(++s) == '/' ) { ++s; --slen; } // leave off leading slash from pathname - if ( s != pathname ) memmove(pathname, s, slen); // Shift down right-aligned string + if ( *(++s) == '/' ) { ++s; --slen; } // leave off leading slash from pathname + if ( s != pathname ) memmove(pathname, s, slen); // Shift down right-aligned string return(0); } @@ -1049,7 +1047,7 @@ int Fl_Tree::item_pathname(char *pathname, int pathnamelen, const Fl_Tree_Item * /// /// Use this method /only/ if you've subclassed Fl_Tree, and are receiving /// events before Fl_Tree has been able to process and update callback_item(). -/// +/// /// \param[in] yonly -- 0: check both event's X and Y values. /// -- 1: only check event's Y value, don't care about X. /// \returns The item clicked, or NULL if no item was under the current event. @@ -1065,7 +1063,7 @@ const Fl_Tree_Item* Fl_Tree::find_clicked(int yonly) const { Fl_Tree_Item *Fl_Tree::find_clicked(int yonly) { // "Effective C++, 3rd Ed", p.23. Sola fide, Amen. return(const_cast<Fl_Tree_Item*>( - static_cast<const Fl_Tree&>(*this).find_clicked(yonly))); + static_cast<const Fl_Tree&>(*this).find_clicked(yonly))); } /// Set the item that was last clicked. @@ -1132,7 +1130,7 @@ Fl_Tree_Item *Fl_Tree::next_visible_item(Fl_Tree_Item *item, int dir) { \see first(), next(), last(), prev() */ Fl_Tree_Item* Fl_Tree::first() { - return(_root); // first item always root + return(_root); // first item always root } /// Returns the first open(), visible item in the tree, or 0 if none. @@ -1334,16 +1332,16 @@ Fl_Tree_Item *Fl_Tree::last_selected_item() { \version 1.3.3 */ Fl_Tree_Item *Fl_Tree::next_item(Fl_Tree_Item *item, int dir, bool visible) { - if ( ! item ) { // no start item? + if ( ! item ) { // no start item? if ( visible ) { - item = ( dir == FL_Up ) ? last_visible_item() : // wrap to bottom - first_visible_item(); // wrap to top + item = ( dir == FL_Up ) ? last_visible_item() : // wrap to bottom + first_visible_item(); // wrap to top } else { - item = ( dir == FL_Up ) ? last() : // wrap to bottom - first(); // wrap to top + item = ( dir == FL_Up ) ? last() : // wrap to bottom + first(); // wrap to top } if ( ! item ) return(0); - if ( item->visible_r() ) return(item); // return first/last visible item + if ( item->visible_r() ) return(item); // return first/last visible item } switch (dir) { case FL_Up: @@ -1353,7 +1351,7 @@ Fl_Tree_Item *Fl_Tree::next_item(Fl_Tree_Item *item, int dir, bool visible) { if ( visible ) return(item->next_visible(_prefs)); else return(item->next()); } - return(0); // unknown dir + return(0); // unknown dir } /** @@ -1389,21 +1387,21 @@ Fl_Tree_Item *Fl_Tree::next_selected_item(Fl_Tree_Item *item, int dir) { switch (dir) { case FL_Down: if ( ! item ) { - if ( ! (item = first()) ) return(0); - if ( item->is_selected() ) return(item); + if ( ! (item = first()) ) return(0); + if ( item->is_selected() ) return(item); } while ( (item = item->next()) ) - if ( item->is_selected() ) - return(item); + if ( item->is_selected() ) + return(item); return(0); case FL_Up: if ( ! item ) { - if ( ! (item = last()) ) return(0); - if ( item->is_selected() ) return(item); + if ( ! (item = last()) ) return(0); + if ( item->is_selected() ) return(item); } while ( (item = item->prev()) ) - if ( item->is_selected() ) - return(item); + if ( item->is_selected() ) + return(item); return(0); } return(0); @@ -1446,7 +1444,7 @@ int Fl_Tree::get_selected_items(Fl_Tree_Item_Array &ret_items) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] item -- the item to be opened. Must not be NULL. @@ -1462,7 +1460,7 @@ int Fl_Tree::get_selected_items(Fl_Tree_Item_Array &ret_items) { /// int Fl_Tree::open(Fl_Tree_Item *item, int docallback) { if ( item->is_open() ) return(0); - item->open(); // handles recalc_tree() + item->open(); // handles recalc_tree() redraw(); if ( docallback ) { do_callback_for_item(item, FL_TREE_REASON_OPENED); @@ -1480,7 +1478,7 @@ int Fl_Tree::open(Fl_Tree_Item *item, int docallback) { /// Items or submenus that themselves contain slashes ('/' or '\') /// should be escaped, e.g. open("Holidays/12\\/25\\/2010"). /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] path -- the tree item's pathname (e.g. "Flintstones/Fred") @@ -1493,11 +1491,11 @@ int Fl_Tree::open(Fl_Tree_Item *item, int docallback) { /// - 0 -- OK: item was already open, no change /// - -1 -- ERROR: item was not found /// \see open(), close(), is_open(), is_close(), callback_item(), callback_reason() -/// +/// int Fl_Tree::open(const char *path, int docallback) { Fl_Tree_Item *item = find_item(path); if ( ! item ) return(-1); - return(open(item, docallback)); // handles recalc_tree() + return(open(item, docallback)); // handles recalc_tree() } /// Toggle the open state of \p 'item'. @@ -1506,7 +1504,7 @@ int Fl_Tree::open(const char *path, int docallback) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] item -- the item whose open state is to be toggled. Must not be NULL. @@ -1519,9 +1517,9 @@ int Fl_Tree::open(const char *path, int docallback) { /// void Fl_Tree::open_toggle(Fl_Tree_Item *item, int docallback) { if ( item->is_open() ) { - close(item, docallback); // handles recalc_tree() + close(item, docallback); // handles recalc_tree() } else { - open(item, docallback); // handles recalc_tree() + open(item, docallback); // handles recalc_tree() } } @@ -1531,7 +1529,7 @@ void Fl_Tree::open_toggle(Fl_Tree_Item *item, int docallback) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] item -- the item to be closed. Must not be NULL. @@ -1546,7 +1544,7 @@ void Fl_Tree::open_toggle(Fl_Tree_Item *item, int docallback) { /// int Fl_Tree::close(Fl_Tree_Item *item, int docallback) { if ( item->is_close() ) return(0); - item->close(); // handles recalc_tree() + item->close(); // handles recalc_tree() redraw(); if ( docallback ) { do_callback_for_item(item, FL_TREE_REASON_CLOSED); @@ -1563,7 +1561,7 @@ int Fl_Tree::close(Fl_Tree_Item *item, int docallback) { /// Items or submenus that themselves contain slashes ('/' or '\') /// should be escaped, e.g. close("Holidays/12\\/25\\/2010"). /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] path -- the tree item's pathname (e.g. "Flintstones/Fred") @@ -1576,11 +1574,11 @@ int Fl_Tree::close(Fl_Tree_Item *item, int docallback) { /// - 0 -- OK: item was already closed, no change /// - -1 -- ERROR: item was not found /// \see open(), close(), is_open(), is_close(), callback_item(), callback_reason() -/// +/// int Fl_Tree::close(const char *path, int docallback) { Fl_Tree_Item *item = find_item(path); if ( ! item ) return(-1); - return(close(item, docallback)); // handles recalc_tree() + return(close(item, docallback)); // handles recalc_tree() } /// See if \p 'item' is open. @@ -1651,7 +1649,7 @@ int Fl_Tree::is_close(const char *path) const { /// Invokes the callback depending on the value of optional parameter \p docallback.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] item -- the item to be selected. Must not be NULL. @@ -1692,7 +1690,7 @@ int Fl_Tree::select(Fl_Tree_Item *item, int docallback) { /// Items or submenus that themselves contain slashes ('/' or '\') /// should be escaped, e.g. select("Holidays/12\\/25\\/2010"). /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] path -- the tree item's pathname (e.g. "Flintstones/Fred") @@ -1717,7 +1715,7 @@ int Fl_Tree::select(const char *path, int docallback) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] item -- the item to be selected. Must not be NULL. @@ -1731,7 +1729,7 @@ void Fl_Tree::select_toggle(Fl_Tree_Item *item, int docallback) { set_changed(); if ( docallback ) { do_callback_for_item(item, item->is_selected() ? FL_TREE_REASON_SELECTED - : FL_TREE_REASON_DESELECTED); + : FL_TREE_REASON_DESELECTED); } redraw(); } @@ -1742,7 +1740,7 @@ void Fl_Tree::select_toggle(Fl_Tree_Item *item, int docallback) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] item -- the item to be deselected. Must not be NULL. @@ -1776,7 +1774,7 @@ int Fl_Tree::deselect(Fl_Tree_Item *item, int docallback) { /// Items or submenus that themselves contain slashes ('/' or '\') /// should be escaped, e.g. deselect("Holidays/12\\/25\\/2010"). /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] path -- the tree item's pathname (e.g. "Flintstones/Fred") @@ -1802,7 +1800,7 @@ int Fl_Tree::deselect(const char *path, int docallback) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] item The item that will be deselected (along with all its children). @@ -1814,7 +1812,7 @@ int Fl_Tree::deselect(const char *path, int docallback) { /// \returns Count of how many items were actually changed to the deselected state. /// int Fl_Tree::deselect_all(Fl_Tree_Item *item, int docallback) { - item = item ? item : first(); // NULL? use first() + item = item ? item : first(); // NULL? use first() if ( ! item ) return(0); int count = 0; // Deselect item @@ -1823,7 +1821,7 @@ int Fl_Tree::deselect_all(Fl_Tree_Item *item, int docallback) { ++count; // Deselect its children for ( int t=0; t<item->children(); t++ ) { - count += deselect_all(item->child(t), docallback); // recurse + count += deselect_all(item->child(t), docallback); // recurse } return(count); } @@ -1835,26 +1833,26 @@ int Fl_Tree::deselect_all(Fl_Tree_Item *item, int docallback) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// /// \param[in] selitem The item to be selected. If NULL, first() is used. /// \param[in] docallback -- A flag that determines if the callback() is invoked or not: /// - 0 - the callback() is not invoked -/// - 1 - the callback() is invoked for each item that changed state (default), -/// callback_reason() will be either FL_TREE_REASON_SELECTED or +/// - 1 - the callback() is invoked for each item that changed state (default), +/// callback_reason() will be either FL_TREE_REASON_SELECTED or /// FL_TREE_REASON_DESELECTED /// \returns The number of items whose selection states were changed, if any. /// int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) { - selitem = selitem ? selitem : first(); // NULL? use first() + selitem = selitem ? selitem : first(); // NULL? use first() if ( ! selitem ) return(0); int changed = 0; // Deselect everything first. // Prevents callbacks from seeing more than one item selected. // for ( Fl_Tree_Item *item = first(); item; item = item->next() ) { - if ( item == selitem ) continue; // don't do anything to selitem yet.. + if ( item == selitem ) continue; // don't do anything to selitem yet.. if ( item->is_selected() ) { deselect(item, docallback); ++changed; @@ -1863,7 +1861,7 @@ int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) { // Should we 'reselect' item if already selected? if ( selitem->is_selected() && (item_reselect_mode()==FL_TREE_SELECTABLE_ALWAYS) ) { // Selection unchanged, so no ++changed - select(selitem, docallback); // do callback with reason=reselect + select(selitem, docallback); // do callback with reason=reselect } else if ( !selitem->is_selected() ) { // Item was not already selected, select and indicate changed select(selitem, docallback); @@ -1879,10 +1877,10 @@ int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) { /// parameter \p 'docallback'.<br> /// Handles calling redraw() if anything changed. /// -/// The callback can use callback_item() and callback_reason() respectively to determine +/// The callback can use callback_item() and callback_reason() respectively to determine /// the item changed and the reason the callback was called. /// -/// \param[in] item The item that will be selected (along with all its children). +/// \param[in] item The item that will be selected (along with all its children). /// If NULL, first() is used. /// \param[in] docallback -- A flag that determines if the callback() is invoked or not: /// - 0 - the callback() is not invoked @@ -1891,7 +1889,7 @@ int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) { /// \returns Count of how many items were actually changed to the selected state. /// int Fl_Tree::select_all(Fl_Tree_Item *item, int docallback) { - item = item ? item : first(); // NULL? use first() + item = item ? item : first(); // NULL? use first() if ( ! item ) return(0); int count = 0; // Select item @@ -1900,7 +1898,7 @@ int Fl_Tree::select_all(Fl_Tree_Item *item, int docallback) { ++count; // Select its children for ( int t=0; t<item->children(); t++ ) { - count += select_all(item->child(t), docallback); // recurse + count += select_all(item->child(t), docallback); // recurse } return(count); } @@ -1917,9 +1915,9 @@ Fl_Tree_Item* Fl_Tree::get_item_focus() const { /// \param[in] item The item that should take focus. If NULL, none will have focus. /// void Fl_Tree::set_item_focus(Fl_Tree_Item *item) { - if ( _item_focus != item ) { // changed? - _item_focus = item; // update - if ( visible_focus() ) redraw(); // redraw to update focus box + if ( _item_focus != item ) { // changed? + _item_focus = item; // update + if ( visible_focus() ) redraw(); // redraw to update focus box } } @@ -2134,14 +2132,14 @@ void Fl_Tree::widgetmarginleft(int val) { recalc_tree(); } -/// Gets the width of the horizontal connection lines (in pixels) +/// Gets the width of the horizontal connection lines (in pixels) /// that appear to the left of each tree item's label. /// int Fl_Tree::connectorwidth() const { return(_prefs.connectorwidth()); } -/// Sets the width of the horizontal connection lines (in pixels) +/// Sets the width of the horizontal connection lines (in pixels) /// that appear to the left of each tree item's label. /// void Fl_Tree::connectorwidth(int val) { @@ -2328,7 +2326,7 @@ Fl_Tree_Item_Draw_Mode Fl_Tree::item_draw_mode() const { /// Set the 'item draw mode' used for the tree to \p 'mode'. /// /// This affects how items in the tree are drawn, -/// such as when a widget() is defined. +/// such as when a widget() is defined. /// See ::Fl_Tree_Item_Draw_Mode for possible values. /// \version 1.3.1 ABI feature /// @@ -2339,7 +2337,7 @@ void Fl_Tree::item_draw_mode(Fl_Tree_Item_Draw_Mode mode) { /// Set the 'item draw mode' used for the tree to integer \p 'mode'. /// /// This affects how items in the tree are drawn, -/// such as when a widget() is defined. +/// such as when a widget() is defined. /// See ::Fl_Tree_Item_Draw_Mode for possible values. /// \version 1.3.1 ABI feature /// @@ -2448,7 +2446,7 @@ int Fl_Tree::vposition() const { /// Sets the vertical scroll offset to position \p 'pos'. /// The position is how many pixels of the tree are scrolled off the top edge -/// of the screen. +/// of the screen. /// \param[in] pos The vertical position (in pixels) to scroll the tree to. /// \see vposition(), hposition(), hposition(int) /// @@ -2472,7 +2470,7 @@ int Fl_Tree::hposition() const { /// Sets the horizontal scroll offset to position \p 'pos'. /// The position is how many pixels of the tree are scrolled off the left edge -/// of the screen. +/// of the screen. /// \param[in] pos The vertical position (in pixels) to scroll the tree to. /// \see hposition(), vposition(), vposition(int) /// \note Must be using FLTK ABI 1.3.3 or higher for this to be effective. @@ -2511,7 +2509,7 @@ int Fl_Tree::is_scrollbar(Fl_Widget *w) { /// /// If this value is zero (default), this widget will use the global /// 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) /// @@ -2523,17 +2521,17 @@ int Fl_Tree::scrollbar_size() const { /// for this widget, in pixels. /// /// Normally you should not need this method, and should use the global -/// Fl::scrollbar_size(int) instead to manage the size of ALL -/// your widgets' scrollbars. This ensures your application +/// Fl::scrollbar_size(int) instead to manage the size of ALL +/// your widgets' scrollbars. This ensures your application /// has a consistent UI, and is the default behavior. Normally /// this is what you want. /// /// Only use this method if you really need to override just THIS /// instance of the widget's scrollbar size. (This need 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() @@ -2648,12 +2646,12 @@ void Fl_Tree::load(Fl_Preferences &prefs) { char *key = strdup(prefs.entry(i)); int kn = (int) strlen(key); for (j=0; j<kn; j++) { - if (key[j]=='/') key[j]='\\'; + if (key[j]=='/') key[j]='\\'; } char *val; prefs.get(key, val, ""); int vn = (int) strlen(val); for (j=0; j<vn; j++) { - if (val[j]=='/') val[j]='\\'; + if (val[j]=='/') val[j]='\\'; } if (vn<40) { size_t sze = pn + strlen(key) + vn; @@ -2690,7 +2688,3 @@ void Fl_Tree::fix_scrollbar_order() { void Fl_Tree::recalc_tree() { _tree_w = _tree_h = -1; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx index 779f42073..3df432ca7 100644 --- a/src/Fl_Tree_Item.cxx +++ b/src/Fl_Tree_Item.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// #include <stdio.h> #include <stdlib.h> @@ -21,11 +19,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /////////////////////////////////////////////////////////////////////////// 80 / @@ -70,7 +68,7 @@ void Fl_Tree_Item::_Init(const Fl_Tree_Prefs &prefs, Fl_Tree *tree) { _userdeicon = 0; _userdata = 0; _parent = 0; - _children.manage_item_destroy(1); // let array's dtor manage destroying Fl_Tree_Items + _children.manage_item_destroy(1); // let array's dtor manage destroying Fl_Tree_Items _prev_sibling = 0; _next_sibling = 0; } @@ -89,17 +87,17 @@ Fl_Tree_Item::Fl_Tree_Item(Fl_Tree *tree) { // DTOR Fl_Tree_Item::~Fl_Tree_Item() { - if ( _label ) { + if ( _label ) { free((void*)_label); _label = 0; } - _widget = 0; // Fl_Group will handle destruction - _usericon = 0; // user handled allocation - _userdeicon = 0; // user handled allocation + _widget = 0; // Fl_Group will handle destruction + _usericon = 0; // user handled allocation + _userdeicon = 0; // user handled allocation // focus item? set to null if ( _tree && this == _tree->_item_focus ) { _tree->_item_focus = 0; } - //_children.clear(); // array's destructor handles itself + //_children.clear(); // array's destructor handles itself } /// Copy constructor. @@ -127,8 +125,8 @@ Fl_Tree_Item::Fl_Tree_Item(const Fl_Tree_Item *o) { _usericon = o->usericon(); _userdata = o->user_data(); _parent = o->_parent; - _prev_sibling = 0; // do not copy ptrs! use update_prev_next() - _next_sibling = 0; // do not copy ptrs! use update_prev_next() + _prev_sibling = 0; // do not copy ptrs! use update_prev_next() + _next_sibling = 0; // do not copy ptrs! use update_prev_next() } /// Print the tree as 'ascii art' to stdout. @@ -137,8 +135,8 @@ Fl_Tree_Item::Fl_Tree_Item(const Fl_Tree_Item *o) { void Fl_Tree_Item::show_self(const char *indent) const { const char *thelabel = label() ? label() : "(NULL)"; printf("%s-%s (%d children, this=%p, parent=%p, prev=%p, next=%p, depth=%d)\n", - indent,thelabel,children(),(void*)this, (void*)_parent, - _prev_sibling, _next_sibling, depth()); + indent,thelabel,children(),(void*)this, (void*)_parent, + _prev_sibling, _next_sibling, depth()); if ( children() ) { char *i2 = new char [strlen(indent)+2]; strcpy(i2, indent); @@ -157,7 +155,7 @@ void Fl_Tree_Item::show_self(const char *indent) const { void Fl_Tree_Item::label(const char *name) { if ( _label ) { free((void*)_label); _label = 0; } _label = name ? strdup(name) : 0; - recalc_tree(); // may change label geometry + recalc_tree(); // may change label geometry } /// Return the label. @@ -173,7 +171,7 @@ const Fl_Tree_Item *Fl_Tree_Item::child(int index) const { /// Clear all the children for this item. void Fl_Tree_Item::clear_children() { _children.clear(); - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry } /// Return the index of the immediate child of this item @@ -211,7 +209,7 @@ const Fl_Tree_Item* Fl_Tree_Item::find_child_item(const char *name) const { Fl_Tree_Item* Fl_Tree_Item::find_child_item(const char *name) { // "Effective C++, 3rd Ed", p.23. Sola fide, Amen. return(const_cast<Fl_Tree_Item*>( - static_cast<const Fl_Tree_Item &>(*this).find_child_item(name))); + static_cast<const Fl_Tree_Item &>(*this).find_child_item(name))); } /// Find child item by descending array \p 'arr' of names. @@ -224,10 +222,10 @@ Fl_Tree_Item* Fl_Tree_Item::find_child_item(const char *name) { const Fl_Tree_Item *Fl_Tree_Item::find_child_item(char **arr) const { for ( int t=0; t<children(); t++ ) { if ( child(t)->label() ) { - if ( strcmp(child(t)->label(), *arr) == 0 ) { // match? - if ( *(arr+1) ) { // more in arr? descend + if ( strcmp(child(t)->label(), *arr) == 0 ) { // match? + if ( *(arr+1) ) { // more in arr? descend return(_children[t]->find_child_item(arr+1)); - } else { // end of arr? done + } else { // end of arr? done return(_children[t]); } } @@ -240,7 +238,7 @@ const Fl_Tree_Item *Fl_Tree_Item::find_child_item(char **arr) const { Fl_Tree_Item *Fl_Tree_Item::find_child_item(char **arr) { // "Effective C++, 3rd Ed", p.23. Sola fide, Amen. return(const_cast<Fl_Tree_Item*>( - static_cast<const Fl_Tree_Item &>(*this).find_child_item(arr))); + static_cast<const Fl_Tree_Item &>(*this).find_child_item(arr))); } /// Find item by descending array of \p 'names'. @@ -251,11 +249,11 @@ Fl_Tree_Item *Fl_Tree_Item::find_child_item(char **arr) { /// const Fl_Tree_Item *Fl_Tree_Item::find_item(char **names) const { if ( ! *names ) return(0); - if ( label() && strcmp(label(), *names) == 0 ) { // match self? - ++names; // skip self - if ( *names == 0 ) return(this); // end of names, found ourself + if ( label() && strcmp(label(), *names) == 0 ) { // match self? + ++names; // skip self + if ( *names == 0 ) return(this); // end of names, found ourself } - if ( children() ) { // check children.. + if ( children() ) { // check children.. return(find_child_item(names)); } return(0); @@ -265,7 +263,7 @@ const Fl_Tree_Item *Fl_Tree_Item::find_item(char **names) const { Fl_Tree_Item *Fl_Tree_Item::find_item(char **names) { // "Effective C++, 3rd Ed", p.23. Sola fide, Amen. return(const_cast<Fl_Tree_Item*>( - static_cast<const Fl_Tree_Item &>(*this).find_item(names))); + static_cast<const Fl_Tree_Item &>(*this).find_item(names))); } /// Find the index number for the specified \p 'item' @@ -288,7 +286,7 @@ int Fl_Tree_Item::find_child(Fl_Tree_Item *item) { /// \version 1.3.0 release /// Fl_Tree_Item *Fl_Tree_Item::add(const Fl_Tree_Prefs &prefs, - const char *new_label) { + const char *new_label) { return(add(prefs, new_label, (Fl_Tree_Item*)0)); } @@ -301,11 +299,11 @@ Fl_Tree_Item *Fl_Tree_Item::add(const Fl_Tree_Prefs &prefs, /// \version 1.3.3 /// Fl_Tree_Item *Fl_Tree_Item::add(const Fl_Tree_Prefs &prefs, - const char *new_label, - Fl_Tree_Item *item) { + const char *new_label, + Fl_Tree_Item *item) { if ( !item ) { item = new Fl_Tree_Item(_tree); item->label(new_label); } - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry item->_parent = this; switch ( prefs.sortorder() ) { case FL_TREE_SORT_NONE: { @@ -356,35 +354,35 @@ Fl_Tree_Item *Fl_Tree_Item::add(const Fl_Tree_Prefs &prefs, char **arr) { /// \version 1.3.3 ABI feature /// Fl_Tree_Item *Fl_Tree_Item::add(const Fl_Tree_Prefs &prefs, - char **arr, - Fl_Tree_Item *newitem) { + char **arr, + Fl_Tree_Item *newitem) { if ( !*arr ) return 0; // See if we can find an existing child with name requested. Fl_Tree_Item *child = find_child_item(*arr); - if ( child ) { // Child found? - if ( *(arr+1) == 0 ) { // ..and at end of path? - if ( !newitem ) { // ..and no item specified? - return 0; // ..error: child exists already + if ( child ) { // Child found? + if ( *(arr+1) == 0 ) { // ..and at end of path? + if ( !newitem ) { // ..and no item specified? + return 0; // ..error: child exists already } else { // Child found, end of path, item specified - return child->add(prefs, newitem->label(), newitem); + return child->add(prefs, newitem->label(), newitem); } } // Child found: more path elements to go or item specified? // Descend into child to handle add.. - return child->add(prefs, arr+1, newitem); // recurse + return child->add(prefs, arr+1, newitem); // recurse } // No child found, see if we reached end of path. - // If so, add as an immediate child, done - if ( *(arr+1) == 0 ) // end of path? - return add(prefs, *arr, newitem); // add as immediate child + // If so, add as an immediate child, done + if ( *(arr+1) == 0 ) // end of path? + return add(prefs, *arr, newitem); // add as immediate child // No child found, but more to path? - // If so, create new child to handle add() + // If so, create new child to handle add() Fl_Tree_Item *newchild; - return (newchild=add(prefs, *arr)) // create new immediate child + return (newchild=add(prefs, *arr)) // create new immediate child ? newchild->add(prefs,arr+1,newitem) // it worked? recurse to add - : 0; // failed? error + : 0; // failed? error } /** @@ -403,7 +401,7 @@ Fl_Tree_Item *Fl_Tree_Item::insert(const Fl_Tree_Prefs &prefs, const char *new_l item->label(new_label); item->_parent = this; _children.insert(pos, item); - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry return(item); } @@ -451,7 +449,7 @@ Fl_Tree_Item* Fl_Tree_Item::deparent(int pos) { int Fl_Tree_Item::reparent(Fl_Tree_Item *newchild, int pos) { int ret; if ( (ret = _children.reparent(newchild, this, pos)) < 0 ) return ret; - newchild->parent(this); // take custody + newchild->parent(this); // take custody return 0; } @@ -489,21 +487,21 @@ int Fl_Tree_Item::move(Fl_Tree_Item *item, int op, int pos) { Fl_Tree_Item *from_parent, *to_parent; int from, to; switch (op) { - case 0: // "above" + case 0: // "above" from_parent = this->parent(); to_parent = item->parent(); if ( !from_parent || !to_parent ) return -1; from = from_parent->find_child(this); to = to_parent->find_child(item); break; - case 1: // "below" + case 1: // "below" from_parent = this->parent(); to_parent = item->parent(); if ( !from_parent || !to_parent ) return -1; from = from_parent->find_child(this); to = to_parent->find_child(item); break; - case 2: // "into" + case 2: // "into" from_parent = this->parent(); if ( !from_parent ) return -1; to_parent = item; @@ -515,20 +513,20 @@ int Fl_Tree_Item::move(Fl_Tree_Item *item, int op, int pos) { } if ( !from_parent || !to_parent ) return -1; if ( from < 0 || to < 0 ) return -2; - if ( from_parent == to_parent ) { // same parent? - switch (op) { // 'to' offsets due to scroll + if ( from_parent == to_parent ) { // same parent? + switch (op) { // 'to' offsets due to scroll case 0: if ( from < to && to > 0 ) --to; break; case 1: if ( from > to && to < to_parent->children() ) ++to; break; } - if ( from_parent->move(to, from) < 0 ) // simple move among siblings + if ( from_parent->move(to, from) < 0 ) // simple move among siblings return -4; - } else { // different parent? - if ( to > to_parent->children() ) // try to prevent a reparent() error + } else { // different parent? + if ( to > to_parent->children() ) // try to prevent a reparent() error return -4; - if ( from_parent->deparent(from) == NULL ) // deparent self from current parent + if ( from_parent->deparent(from) == NULL ) // deparent self from current parent return -5; - if ( to_parent->reparent(this, to) < 0 ) { // reparent self to new parent at position 'to' - to_parent->reparent(this, 0); // failed? shouldn't happen, reparent at 0 + if ( to_parent->reparent(this, to) < 0 ) { // reparent self to new parent at position 'to' + to_parent->reparent(this, 0); // failed? shouldn't happen, reparent at 0 return -6; } } @@ -597,8 +595,8 @@ const Fl_Tree_Prefs& Fl_Tree_Item::prefs() const { /// Fl_Tree_Item *Fl_Tree_Item::replace(Fl_Tree_Item *newitem) { Fl_Tree_Item *p = parent(); - if ( !p ) { // no parent? then we're the tree's root.. - _tree->root(newitem); // ..tell tree to replace root + if ( !p ) { // no parent? then we're the tree's root.. + _tree->root(newitem); // ..tell tree to replace root return newitem; } // has parent? ask parent to replace us @@ -620,13 +618,13 @@ Fl_Tree_Item *Fl_Tree_Item::replace(Fl_Tree_Item *newitem) { /// \version 1.3.3 ABI feature /// Fl_Tree_Item *Fl_Tree_Item::replace_child(Fl_Tree_Item *olditem, - Fl_Tree_Item *newitem) { - int pos = find_child(olditem); // find our index for olditem + Fl_Tree_Item *newitem) { + int pos = find_child(olditem); // find our index for olditem if ( pos == -1 ) return(NULL); newitem->_parent = this; // replace in array (handles stitching neighboring items) _children.replace(pos, newitem); - recalc_tree(); // newitem may have changed tree geometry + recalc_tree(); // newitem may have changed tree geometry return newitem; } @@ -638,7 +636,7 @@ int Fl_Tree_Item::remove_child(Fl_Tree_Item *item) { if ( child(t) == item ) { item->clear_children(); _children.remove(t); - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry return(0); } } @@ -657,7 +655,7 @@ int Fl_Tree_Item::remove_child(const char *name) { if ( child(t)->label() ) { if ( strcmp(child(t)->label(), name) == 0 ) { _children.remove(t); - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry return(0); } } @@ -676,7 +674,7 @@ void Fl_Tree_Item::swap_children(int ax, int bx) { } /// Swap two of our immediate children, given item pointers. -/// Use e.g. for sorting. +/// Use e.g. for sorting. /// /// This method is SLOW because it involves linear lookups.<br> /// For speed, use swap_children(int,int) instead. @@ -689,11 +687,11 @@ void Fl_Tree_Item::swap_children(int ax, int bx) { /// int Fl_Tree_Item::swap_children(Fl_Tree_Item *a, Fl_Tree_Item *b) { int ax = -1, bx = -1; - for ( int t=0; t<children(); t++ ) { // find index for a and b + for ( int t=0; t<children(); t++ ) { // find index for a and b if ( _children[t] == a ) { ax = t; if ( bx != -1 ) break; else continue; } if ( _children[t] == b ) { bx = t; if ( ax != -1 ) break; else continue; } } - if ( ax == -1 || bx == -1 ) return(-1); // not found? fail + if ( ax == -1 || bx == -1 ) return(-1); // not found? fail swap_children(ax,bx); return(0); } @@ -708,15 +706,15 @@ void Fl_Tree_Item::draw_horizontal_connector(int x1, int x2, int y, const Fl_Tre fl_color(prefs.connectorcolor()); switch ( prefs.connectorstyle() ) { case FL_TREE_CONNECTOR_SOLID: - y |= 1; // force alignment w/dot pattern + y |= 1; // force alignment w/dot pattern fl_line(x1,y,x2,y); return; - case FL_TREE_CONNECTOR_DOTTED: + case FL_TREE_CONNECTOR_DOTTED: { - y |= 1; // force alignment w/dot pattern + y |= 1; // force alignment w/dot pattern x1 |= 1; for ( int xx=x1; xx<=x2; xx+=2 ) { - fl_point(xx, y); + fl_point(xx, y); } return; } @@ -735,14 +733,14 @@ void Fl_Tree_Item::draw_vertical_connector(int x, int y1, int y2, const Fl_Tree_ fl_color(prefs.connectorcolor()); switch ( prefs.connectorstyle() ) { case FL_TREE_CONNECTOR_SOLID: - y1 |= 1; // force alignment w/dot pattern - y2 |= 1; // force alignment w/dot pattern + y1 |= 1; // force alignment w/dot pattern + y2 |= 1; // force alignment w/dot pattern fl_line(x,y1,x,y2); return; case FL_TREE_CONNECTOR_DOTTED: { - y1 |= 1; // force alignment w/dot pattern - y2 |= 1; // force alignment w/dot pattern + y1 |= 1; // force alignment w/dot pattern + y2 |= 1; // force alignment w/dot pattern for ( int yy=y1; yy<=y2; yy+=2 ) { fl_point(x, yy); } @@ -773,16 +771,16 @@ const Fl_Tree_Item *Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs &prefs, int y return(this); } } else { - if ( event_inside(_xywh) ) { // event within this item? - return(this); // found + if ( event_inside(_xywh) ) { // event within this item? + return(this); // found } } } - if ( is_open() ) { // open? check children of this item + if ( is_open() ) { // open? check children of this item for ( int t=0; t<children(); t++ ) { const Fl_Tree_Item *item; if ( (item = _children[t]->find_clicked(prefs, yonly)) != NULL) // recurse into child for descendents - return(item); // found? + return(item); // found? } } return(0); @@ -792,7 +790,7 @@ const Fl_Tree_Item *Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs &prefs, int y Fl_Tree_Item *Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs &prefs, int yonly) { // "Effective C++, 3rd Ed", p.23. Sola fide, Amen. return(const_cast<Fl_Tree_Item*>( - static_cast<const Fl_Tree_Item &>(*this).find_clicked(prefs, yonly))); + static_cast<const Fl_Tree_Item &>(*this).find_clicked(prefs, yonly))); } static void draw_item_focus(Fl_Boxtype B, Fl_Color fg, Fl_Color bg, int X, int Y, int W, int H) { @@ -848,8 +846,8 @@ int Fl_Tree_Item::calc_item_height(const Fl_Tree_Prefs &prefs) const { if ( ! is_visible() ) return(0); int H = 0; if ( _label ) { - fl_font(_labelfont, _labelsize); // fl_descent() needs this :/ - H = _labelsize + fl_descent() + 1; // at least one pixel space below descender + fl_font(_labelfont, _labelsize); // fl_descent() needs this :/ + H = _labelsize + fl_descent() + 1; // at least one pixel space below descender } if ( widget() && (prefs.item_draw_mode() & FL_TREE_ITEM_HEIGHT_FROM_WIDGET) && @@ -871,8 +869,8 @@ int Fl_Tree_Item::calc_item_height(const Fl_Tree_Prefs &prefs) const { /// Fl_Color Fl_Tree_Item::drawfgcolor() const { return is_selected() ? fl_contrast(_labelfgcolor, tree()->selection_color()) - : (is_active() && tree()->active_r()) ? _labelfgcolor - : fl_inactive(_labelfgcolor); + : (is_active() && tree()->active_r()) ? _labelfgcolor + : fl_inactive(_labelfgcolor); } /// Returns the recommended background color used for drawing this item. @@ -881,10 +879,10 @@ Fl_Color Fl_Tree_Item::drawfgcolor() const { /// Fl_Color Fl_Tree_Item::drawbgcolor() const { const Fl_Color unspecified = 0xffffffff; - return is_selected() ? is_active() && tree()->active_r() ? tree()->selection_color() - : fl_inactive(tree()->selection_color()) - : _labelbgcolor == unspecified ? tree()->color() - : _labelbgcolor; + return is_selected() ? is_active() && tree()->active_r() ? tree()->selection_color() + : fl_inactive(tree()->selection_color()) + : _labelbgcolor == unspecified ? tree()->color() + : _labelbgcolor; } /// Draw the item content @@ -903,7 +901,7 @@ Fl_Color Fl_Tree_Item::drawbgcolor() const { /// // DRAW OUR CUSTOM CONTENT FOR THE ITEM /// int draw_item_content(int render) { /// // Our item's dimensions + text content -/// int X=label_x(), Y=label_y(), W=label_w(), H=label_h(); +/// int X=label_x(), Y=label_y(), W=label_w(), H=label_h(); /// const char *text = label() ? label() : ""; /// // Rendering? Do any drawing that's needed /// if ( render ) { @@ -923,7 +921,7 @@ Fl_Color Fl_Tree_Item::drawbgcolor() const { /// \endcode /// /// You can draw anything you want inside draw_item_content() -/// using any of the fl_draw.H functions, as long as it's +/// using any of the fl_draw.H functions, as long as it's /// within the label's xywh area. /// /// To add instances of your custom item to the tree, you can use: @@ -937,7 +935,7 @@ Fl_Color Fl_Tree_Item::drawbgcolor() const { /// ..or you can insert or replace existing items: /// /// \code -/// // Example #2: using replace() +/// // Example #2: using replace() /// MyTreeItem *marge = new MyTreeItem(..); // class derived from Fl_Tree_Item /// item = tree->add("/Simpsons/Marge"); // create item /// item->replace(mi); // replace it with our own @@ -961,19 +959,19 @@ int Fl_Tree_Item::draw_item_content(int render) { int xmax = label_x(); // Background for this item, only if different from tree's bg if ( render && (bg != tree()->color() || is_selected()) ) { - if ( is_selected() ) { // Selected? Use selectbox() style + if ( is_selected() ) { // Selected? Use selectbox() style fl_draw_box(prefs.selectbox(), - label_x(), label_y(), label_w(), label_h(), bg); - } else { // Not Selected? use plain filled rectangle + label_x(), label_y(), label_w(), label_h(), bg); + } else { // Not Selected? use plain filled rectangle fl_color(bg); fl_rectf(label_x(), label_y(), label_w(), label_h()); } - if ( widget() ) widget()->damage(FL_DAMAGE_ALL); // if there's a child widget, we just damaged it + if ( widget() ) widget()->damage(FL_DAMAGE_ALL); // if there's a child widget, we just damaged it } // Draw label - if ( _label && - ( !widget() || - (prefs.item_draw_mode() & FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET) ) ) { + if ( _label && + ( !widget() || + (prefs.item_draw_mode() & FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET) ) ) { if ( render ) { fl_color(fg); fl_font(_labelfont, _labelsize); @@ -981,9 +979,9 @@ int Fl_Tree_Item::draw_item_content(int render) { int lx = label_x()+(_label ? prefs.labelmarginleft() : 0); int ly = label_y()+(label_h()/2)+(_labelsize/2)-fl_descent()/2; int lw=0, lh=0; - fl_measure(_label, lw, lh); // get box around text (including white space) + fl_measure(_label, lw, lh); // get box around text (including white space) if ( render ) fl_draw(_label, lx, ly); - xmax = lx + lw; // update max width of drawn item + xmax = lx + lw; // update max width of drawn item } return xmax; } @@ -1006,13 +1004,13 @@ int Fl_Tree_Item::draw_item_content(int render) { /// \version 1.3.3 ABI feature: modified parameters /// void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, - int &tree_item_xmax, int lastchild, int render) { + int &tree_item_xmax, int lastchild, int render) { Fl_Tree_Prefs &prefs = _tree->_prefs; - if ( !is_visible() ) return; + if ( !is_visible() ) return; int tree_top = tree()->_tiy; int tree_bot = tree_top + tree()->_tih; - int H = calc_item_height(prefs); // height of item - int H2 = H + prefs.linespacing(); // height of item with line spacing + int H = calc_item_height(prefs); // height of item + int H2 = H + prefs.linespacing(); // height of item with line spacing // Update the xywh of this item _xywh[0] = X; @@ -1045,7 +1043,7 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, // Usericon position int uicon_x = X+(icon_w/2-1+conn_w) + ( (usericon() || prefs.usericon()) - ? prefs.usericonmarginleft() : 0); + ? prefs.usericonmarginleft() : 0); int uicon_w = usericon() ? usericon()->w() : prefs.usericon() ? prefs.usericon()->w() : 0; @@ -1068,23 +1066,23 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, if ( widget() ) { int wx = uicon_x + uicon_w + (_label ? prefs.labelmarginleft() : 0); int wy = label_y(); - int ww = widget()->w(); // use widget's width + int ww = widget()->w(); // use widget's width int wh = (prefs.item_draw_mode() & FL_TREE_ITEM_HEIGHT_FROM_WIDGET) ? widget()->h() : H; - if ( _label && + if ( _label && (prefs.item_draw_mode() & FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET) ) { - fl_font(_labelfont, _labelsize); // fldescent() needs this + fl_font(_labelfont, _labelsize); // fldescent() needs this int lw=0, lh=0; - fl_measure(_label,lw,lh); // get box around text (including white space) + fl_measure(_label,lw,lh); // get box around text (including white space) wx += (lw + prefs.widgetmarginleft()); } if ( widget()->x() != wx || widget()->y() != wy || - widget()->w() != ww || widget()->h() != wh ) { - widget()->resize(wx,wy,ww,wh); // we'll handle redraw below + widget()->w() != ww || widget()->h() != wh ) { + widget()->resize(wx,wy,ww,wh); // we'll handle redraw below } } char clipped = ((Y+H) < tree_top) || (Y>tree_bot) ? 1 : 0; - if (!render) clipped = 0; // NOT rendering? Then don't clip, so we calc unclipped items + if (!render) clipped = 0; // NOT rendering? Then don't clip, so we calc unclipped items char active = (is_active() && tree()->active_r()) ? 1 : 0; char drawthis = ( is_root() && prefs.showroot() == 0 ) ? 0 : 1; if ( !clipped ) { @@ -1094,75 +1092,75 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, // If this item is root, and showroot() is disabled, don't draw. // 'clipped' is an optimization to prevent drawing anything offscreen. // - if ( drawthis ) { // draw this item at all? - if ( (tree()->damage() & ~FL_DAMAGE_CHILD) || !render ) { // non-child damage? - // Draw connectors - if ( render && prefs.connectorstyle() != FL_TREE_CONNECTOR_NONE ) { - // Horiz connector between center of icon and text - // if this is root, the connector should not dangle in thin air on the left - if (is_root()) draw_horizontal_connector(hconn_x_center, hconn_x2, item_y_center, prefs); - else draw_horizontal_connector(hconn_x, hconn_x2, item_y_center, prefs); - // Small vertical line down to children - if ( has_children() && is_open() ) - draw_vertical_connector(hconn_x_center, item_y_center, Y+H2, prefs); - // Connectors for last child - if ( !is_root() ) { - if ( lastchild ) draw_vertical_connector(hconn_x, Y, item_y_center, prefs); - else draw_vertical_connector(hconn_x, Y, Y+H2, prefs); - } - } - // Draw collapse icon - if ( render && has_children() && prefs.showcollapse() ) { - // Draw icon image - if ( is_open() ) { - if ( active ) prefs.closeicon()->draw(icon_x,icon_y); - else prefs.closedeicon()->draw(icon_x,icon_y); - } else { - if ( active ) prefs.openicon()->draw(icon_x,icon_y); - else prefs.opendeicon()->draw(icon_x,icon_y); - } - } - // Draw user icon (if any) - if ( render && usericon() ) { - // Item has user icon? Use it - int uicon_y = item_y_center - (usericon()->h() >> 1); - if ( active ) usericon()->draw(uicon_x,uicon_y); - else if ( userdeicon() ) userdeicon()->draw(uicon_x,uicon_y); - } else if ( render && prefs.usericon() ) { - // Prefs has user icon? Use it - int uicon_y = item_y_center - (prefs.usericon()->h() >> 1); - if ( active ) prefs.usericon()->draw(uicon_x,uicon_y); - else if ( prefs.userdeicon() ) prefs.userdeicon()->draw(uicon_x,uicon_y); - } - // Draw item's content - xmax = draw_item_content(render); - } // end non-child damage + if ( drawthis ) { // draw this item at all? + if ( (tree()->damage() & ~FL_DAMAGE_CHILD) || !render ) { // non-child damage? + // Draw connectors + if ( render && prefs.connectorstyle() != FL_TREE_CONNECTOR_NONE ) { + // Horiz connector between center of icon and text + // if this is root, the connector should not dangle in thin air on the left + if (is_root()) draw_horizontal_connector(hconn_x_center, hconn_x2, item_y_center, prefs); + else draw_horizontal_connector(hconn_x, hconn_x2, item_y_center, prefs); + // Small vertical line down to children + if ( has_children() && is_open() ) + draw_vertical_connector(hconn_x_center, item_y_center, Y+H2, prefs); + // Connectors for last child + if ( !is_root() ) { + if ( lastchild ) draw_vertical_connector(hconn_x, Y, item_y_center, prefs); + else draw_vertical_connector(hconn_x, Y, Y+H2, prefs); + } + } + // Draw collapse icon + if ( render && has_children() && prefs.showcollapse() ) { + // Draw icon image + if ( is_open() ) { + if ( active ) prefs.closeicon()->draw(icon_x,icon_y); + else prefs.closedeicon()->draw(icon_x,icon_y); + } else { + if ( active ) prefs.openicon()->draw(icon_x,icon_y); + else prefs.opendeicon()->draw(icon_x,icon_y); + } + } + // Draw user icon (if any) + if ( render && usericon() ) { + // Item has user icon? Use it + int uicon_y = item_y_center - (usericon()->h() >> 1); + if ( active ) usericon()->draw(uicon_x,uicon_y); + else if ( userdeicon() ) userdeicon()->draw(uicon_x,uicon_y); + } else if ( render && prefs.usericon() ) { + // Prefs has user icon? Use it + int uicon_y = item_y_center - (prefs.usericon()->h() >> 1); + if ( active ) prefs.usericon()->draw(uicon_x,uicon_y); + else if ( prefs.userdeicon() ) prefs.userdeicon()->draw(uicon_x,uicon_y); + } + // Draw item's content + xmax = draw_item_content(render); + } // end non-child damage // Draw child FLTK widget? if ( widget() ) { if (render) - tree()->draw_child(*widget()); // let group handle drawing child - if ( widget()->label() && render ) - tree()->draw_outside_label(*widget());// label too - xmax = widget()->x() + widget()->w(); // update max width of widget + tree()->draw_child(*widget()); // let group handle drawing child + if ( widget()->label() && render ) + tree()->draw_outside_label(*widget());// label too + xmax = widget()->x() + widget()->w(); // update max width of widget } // Draw focus box around item's bg last if ( render && this == itemfocus && - Fl::visible_focus() && - Fl::focus() == tree() && - prefs.selectmode() != FL_TREE_SELECT_NONE ) { - draw_item_focus(FL_NO_BOX,fg,bg,label_x()+1,label_y()+1,label_w()-1,label_h()-1); + Fl::visible_focus() && + Fl::focus() == tree() && + prefs.selectmode() != FL_TREE_SELECT_NONE ) { + draw_item_focus(FL_NO_BOX,fg,bg,label_x()+1,label_y()+1,label_w()-1,label_h()-1); } - } // end drawthis - } // end clipped - if ( drawthis ) Y += H2; // adjust Y (even if clipped) + } // end drawthis + } // end clipped + if ( drawthis ) Y += H2; // adjust Y (even if clipped) // Manage tree_item_xmax if ( xmax > tree_item_xmax ) tree_item_xmax = xmax; // Draw child items (if any) if ( has_children() && is_open() ) { - int child_x = drawthis ? (hconn_x_center - (icon_w/2) + 1) // offset children to right, - : X; // unless didn't drawthis + int child_x = drawthis ? (hconn_x_center - (icon_w/2) + 1) // offset children to right, + : X; // unless didn't drawthis int child_w = W - (child_x-X); int child_y_start = Y; for ( int t=0; t<children(); t++ ) { @@ -1170,7 +1168,7 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, _children[t]->draw(child_x, Y, child_w, itemfocus, tree_item_xmax, is_lastchild, render); } if ( has_children() && is_open() ) { - Y += prefs.openchild_marginbottom(); // offset below open child tree + Y += prefs.openchild_marginbottom(); // offset below open child tree } if ( ! lastchild ) { // Special 'clipped' calculation. (intentional variable shadowing) @@ -1261,7 +1259,7 @@ void Fl_Tree_Item::open() { for ( int t=0; t<_children.total(); t++ ) { _children[t]->show_widgets(); } - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry } /// Close this item and all its children. @@ -1271,7 +1269,7 @@ void Fl_Tree_Item::close() { for ( int t=0; t<_children.total(); t++ ) { _children[t]->hide_widgets(); } - recalc_tree(); // may change tree geometry + recalc_tree(); // may change tree geometry } /// Returns how many levels deep this item is in the hierarchy. @@ -1294,7 +1292,7 @@ int Fl_Tree_Item::depth() const { /// /// This method can be used to walk the tree forward. /// For an example of how to use this method, see Fl_Tree::first(). -/// +/// /// \returns the next item in the tree, or 0 if there's no more items. /// Fl_Tree_Item *Fl_Tree_Item::next() { @@ -1302,26 +1300,26 @@ Fl_Tree_Item *Fl_Tree_Item::next() { if ( c->has_children() ) { return(c->child(0)); } - while ( ( p = c->parent() ) != NULL ) { // loop upwards through parents - if ( c->_next_sibling ) // not last child? - return(c->_next_sibling); // return next child - c = p; // child becomes parent to move up generation - } // loop: moves up to next parent - return(0); // hit root? done + while ( ( p = c->parent() ) != NULL ) { // loop upwards through parents + if ( c->_next_sibling ) // not last child? + return(c->_next_sibling); // return next child + c = p; // child becomes parent to move up generation + } // loop: moves up to next parent + return(0); // hit root? done } /// Return the previous item in the tree. /// /// This method can be used to walk the tree backwards. /// For an example of how to use this method, see Fl_Tree::last(). -/// -/// \returns the previous item in the tree, +/// +/// \returns the previous item in the tree, /// or 0 if there's no item above this one (hit the root). /// Fl_Tree_Item *Fl_Tree_Item::prev() { - if ( !parent() ) return(0); // hit root? done - if ( !_prev_sibling ) { // are we first child? - return(parent()); // return parent + if ( !parent() ) return(0); // hit root? done + if ( !_prev_sibling ) { // are we first child? + return(parent()); // return parent } // Tricky: in the following example our current position // in the tree is 'j', and we need to move "up one" to 'i': @@ -1341,9 +1339,9 @@ Fl_Tree_Item *Fl_Tree_Item::prev() { // 2. Find b's 'last child' (g) |_ while loop // 3. Find g's 'last child' (i) _| // - Fl_Tree_Item *p = _prev_sibling; // focus on our prev sibling - while ( p->has_children() ) { // item has children? - p = p->child(p->children()-1); // descend hierarchy finding deepest 'last child' + Fl_Tree_Item *p = _prev_sibling; // focus on our prev sibling + while ( p->has_children() ) { // item has children? + p = p->child(p->children()-1); // descend hierarchy finding deepest 'last child' } return(p); } @@ -1353,7 +1351,7 @@ Fl_Tree_Item *Fl_Tree_Item::prev() { /// Moves to the next item below us at the same level (sibling). /// Use this to move down the tree without changing depth(). /// effectively skipping over this item's children/descendents. -/// +/// /// \returns item's next sibling, or 0 if none. /// Fl_Tree_Item *Fl_Tree_Item::next_sibling() { @@ -1364,7 +1362,7 @@ Fl_Tree_Item *Fl_Tree_Item::next_sibling() { /// /// Moves to the previous item above us at the same level (sibling). /// Use this to move up the tree without changing depth(). -/// +/// /// \returns This item's previous sibling, or 0 if none. /// Fl_Tree_Item *Fl_Tree_Item::prev_sibling() { @@ -1376,9 +1374,9 @@ Fl_Tree_Item *Fl_Tree_Item::prev_sibling() { /// Call this whenever items in the array are added/removed/moved/swapped/etc. /// \param[in] index Our index# in the parent.<br> /// Special case if index=-1: become an orphan; null out all parent/sibling associations. -/// +/// void Fl_Tree_Item::update_prev_next(int index) { - if ( index == -1 ) { // special case: become an orphan + if ( index == -1 ) { // special case: become an orphan _parent = 0; _prev_sibling = 0; _next_sibling = 0; @@ -1397,13 +1395,13 @@ void Fl_Tree_Item::update_prev_next(int index) { if ( item_prev ) item_prev->_next_sibling = this; if ( item_next ) item_next->_prev_sibling = this; } - -/// Return the next open(), visible() item. + +/// Return the next open(), visible() item. /// (If this item has children and is closed, children are skipped) /// /// This method can be used to walk the tree forward, skipping items /// that are not currently open/visible to the user. -/// +/// /// \returns the next open() visible() item below us, /// or 0 if there's no more items. /// \version 1.3.3 @@ -1424,33 +1422,33 @@ Fl_Tree_Item *Fl_Tree_Item::next_displayed(Fl_Tree_Prefs &prefs) { return next_visible(prefs); } -/// Return the previous open(), visible() item. +/// Return the previous open(), visible() item. /// (If this item above us has children and is closed, its children are skipped) /// -/// This method can be used to walk the tree backward, +/// This method can be used to walk the tree backward, /// skipping items that are not currently open/visible to the user. -/// +/// /// \returns the previous open() visible() item above us, /// or 0 if there's no more items. /// Fl_Tree_Item *Fl_Tree_Item::prev_visible(Fl_Tree_Prefs &prefs) { Fl_Tree_Item *c = this; while ( c ) { - c = c->prev(); // previous item - if ( !c ) break; // no more items? done - if ( c->is_root() ) // root - return((prefs.showroot()&&c->visible()) ? c : 0); // return root if visible - if ( !c->visible() ) continue; // item not visible? skip + c = c->prev(); // previous item + if ( !c ) break; // no more items? done + if ( c->is_root() ) // root + return((prefs.showroot()&&c->visible()) ? c : 0); // return root if visible + if ( !c->visible() ) continue; // item not visible? skip // Check all parents to be sure none are closed. // If closed, move up to that level and repeat until sure none are closed. Fl_Tree_Item *p = c->parent(); while (1) { - if ( !p || p->is_root() ) return(c); // hit top? then we're displayed, return c - if ( p->is_close() ) c = p; // found closed parent? make it current - p = p->parent(); // continue up tree + if ( !p || p->is_root() ) return(c); // hit top? then we're displayed, return c + if ( p->is_close() ) c = p; // found closed parent? make it current + p = p->parent(); // continue up tree } } - return(0); // hit end: no more items + return(0); // hit end: no more items } /// Same as prev_visible(). @@ -1468,7 +1466,7 @@ Fl_Tree_Item *Fl_Tree_Item::prev_displayed(Fl_Tree_Prefs &prefs) { int Fl_Tree_Item::visible_r() const { if ( !visible() ) return(0); for (const Fl_Tree_Item *p=parent(); p; p=p->parent())// move up through parents - if (!p->visible() || p->is_close()) return(0); // any parent not visible or closed? + if (!p->visible() || p->is_close()) return(0); // any parent not visible or closed? return(1); } @@ -1480,7 +1478,3 @@ int Fl_Tree_Item::visible_r() const { void Fl_Tree_Item::recalc_tree() { _tree->recalc_tree(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Tree_Item_Array.cxx b/src/Fl_Tree_Item_Array.cxx index 0503a8000..dca358288 100644 --- a/src/Fl_Tree_Item_Array.cxx +++ b/src/Fl_Tree_Item_Array.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// #include <stdio.h> #include <stdlib.h> @@ -20,18 +18,18 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /// Constructor; creates an empty array. /// /// The optional 'chunksize' can be specified to optimize /// memory allocation for potentially large arrays. Default chunksize is 10. -/// +/// Fl_Tree_Item_Array::Fl_Tree_Item_Array(int new_chunksize) { _items = 0; _total = 0; @@ -54,11 +52,11 @@ Fl_Tree_Item_Array::Fl_Tree_Item_Array(const Fl_Tree_Item_Array* o) { _flags = o->_flags; for ( int t=0; t<o->_total; t++ ) { if ( _flags & MANAGE_ITEM ) { - _items[t] = new Fl_Tree_Item(o->_items[t]); // make new copy of item + _items[t] = new Fl_Tree_Item(o->_items[t]); // make new copy of item ++_total; - _items[t]->update_prev_next(t); // update uses _total's current value + _items[t]->update_prev_next(t); // update uses _total's current value } else { - _items[t] = o->_items[t]; // copy ptr only + _items[t] = o->_items[t]; // copy ptr only ++_total; } } @@ -75,7 +73,7 @@ void Fl_Tree_Item_Array::clear() { if ( _flags & MANAGE_ITEM ) { delete _items[t]; - _items[t] = 0; + _items[t] = 0; } } free((void*)_items); _items = 0; @@ -89,13 +87,13 @@ void Fl_Tree_Item_Array::clear() { // Does NOT change total. // void Fl_Tree_Item_Array::enlarge(int count) { - int newtotal = _total + count; // new total - if ( newtotal >= _size ) { // more than we have allocated? + int newtotal = _total + count; // new total + if ( newtotal >= _size ) { // more than we have allocated? if ( (newtotal/150) > _chunksize ) _chunksize *= 10; // Increase size of array int newsize = _size + _chunksize; Fl_Tree_Item **newitems = (Fl_Tree_Item**)malloc(newsize * sizeof(Fl_Tree_Item*)); - if ( _items ) { + if ( _items ) { // Copy old array -> new, delete old memmove(newitems, _items, _size * sizeof(Fl_Tree_Item*)); free((void*)_items); _items = 0; @@ -119,15 +117,15 @@ void Fl_Tree_Item_Array::insert(int pos, Fl_Tree_Item *new_item) { pos = _total; enlarge(1); // printf("*** POS=%d TOTAL-1=%d NITEMS=%d\n", pos, _total-1, (_total-pos)); - if ( pos <= (_total - 1) ) { // need to move memory around? + if ( pos <= (_total - 1) ) { // need to move memory around? int nitems = _total - pos; memmove(&_items[pos+1], &_items[pos], sizeof(Fl_Tree_Item*) * nitems); - } + } _items[pos] = new_item; _total++; if ( _flags & MANAGE_ITEM ) { - _items[pos]->update_prev_next(pos); // adjust item's prev/next and its neighbors + _items[pos]->update_prev_next(pos); // adjust item's prev/next and its neighbors } } @@ -147,12 +145,12 @@ void Fl_Tree_Item_Array::add(Fl_Tree_Item *val) { /// and the new item will take it's place, and stitched into the linked list. /// void Fl_Tree_Item_Array::replace(int index, Fl_Tree_Item *newitem) { - if ( _items[index] ) { // delete if non-zero + if ( _items[index] ) { // delete if non-zero if ( _flags & MANAGE_ITEM ) // Destroy old item delete _items[index]; } - _items[index] = newitem; // install new item + _items[index] = newitem; // install new item if ( _flags & MANAGE_ITEM ) { // Restitch into linked list @@ -165,21 +163,21 @@ void Fl_Tree_Item_Array::replace(int index, Fl_Tree_Item *newitem) { /// The item will be delete'd (if non-NULL), so its destructor will be called. /// void Fl_Tree_Item_Array::remove(int index) { - if ( _items[index] ) { // delete if non-zero + if ( _items[index] ) { // delete if non-zero if ( _flags & MANAGE_ITEM ) delete _items[index]; } _items[index] = 0; _total--; - for ( int i=index; i<_total; i++ ) { // reshuffle the array + for ( int i=index; i<_total; i++ ) { // reshuffle the array _items[i] = _items[i+1]; } if ( _flags & MANAGE_ITEM ) { - if ( index < _total ) { // removed item not last? - _items[index]->update_prev_next(index); // update next item's prev/next and neighbors - } else if ( ((index-1) >= 0) && // removed item IS last? - ((index-1) < _total)) { + if ( index < _total ) { // removed item not last? + _items[index]->update_prev_next(index); // update next item's prev/next and neighbors + } else if ( ((index-1) >= 0) && // removed item IS last? + ((index-1) < _total)) { _items[index-1]->update_prev_next(index-1);// update prev item's prev/next and neighbors } } @@ -234,8 +232,8 @@ int Fl_Tree_Item_Array::move(int to, int from) { // Move to new position _items[to] = item; // Update all children - for ( int r=0; r<_total; r++ ) // XXX: excessive to do all children, - _items[r]->update_prev_next(r); // XXX: but avoids weird boundary issues + for ( int r=0; r<_total; r++ ) // XXX: excessive to do all children, + _items[r]->update_prev_next(r); // XXX: but avoids weird boundary issues return 0; } @@ -282,7 +280,3 @@ int Fl_Tree_Item_Array::reparent(Fl_Tree_Item *item, Fl_Tree_Item* newparent, in _items[pos]->update_prev_next(pos); // find new siblings return 0; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Tree_Prefs.cxx b/src/Fl_Tree_Prefs.cxx index 48394989c..a42923560 100644 --- a/src/Fl_Tree_Prefs.cxx +++ b/src/Fl_Tree_Prefs.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// ////////////////////// // Fl_Tree_Prefs.cxx @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -96,9 +94,9 @@ int Fl_Darwin_System_Driver::tree_connector_style() { const char * const Fl_System_Driver::tree_open_xpm[] = { "11 11 3 1", - ". c #fefefe", - "# c #444444", - "@ c #000000", + ". c #fefefe", + "# c #444444", + "@ c #000000", "###########", "#.........#", "#.........#", @@ -114,9 +112,9 @@ const char * const Fl_System_Driver::tree_open_xpm[] = { const char * const Fl_System_Driver::tree_close_xpm[] = { "11 11 3 1", -". c #fefefe", -"# c #444444", -"@ c #000000", +". c #fefefe", +"# c #444444", +"@ c #000000", "###########", "#.........#", "#.........#", @@ -209,7 +207,7 @@ Fl_Tree_Prefs::Fl_Tree_Prefs() { _widgetmarginleft = 3; _linespacing = 0; _labelfgcolor = FL_BLACK; - _labelbgcolor = 0xffffffff; // we use this as 'transparent' + _labelbgcolor = 0xffffffff; // we use this as 'transparent' _connectorcolor = Fl_Color(43); _connectorstyle = (Fl_Tree_Connector)Fl::system_driver()->tree_connector_style(); _openimage = Fl::system_driver()->tree_openpixmap(); @@ -244,7 +242,3 @@ Fl_Tree_Prefs::~Fl_Tree_Prefs() { if ( _closedeimage ) delete _closedeimage; if ( _userdeimage ) delete _userdeimage; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Valuator.cxx b/src/Fl_Valuator.cxx index 3be6a29ed..e7bcd2c8b 100644 --- a/src/Fl_Valuator.cxx +++ b/src/Fl_Valuator.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Valuator widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -150,7 +148,7 @@ double Fl_Valuator::increment(double v, int n) { /** Uses internal rules to format the fields numerical value into the character array pointed to by the passed parameter. - + The actual format used depends on the current step value. If the step value has been set to zero then a \%g format is used. If the step value is non-zero, then a \%.*f format is used, @@ -192,7 +190,3 @@ int Fl_Valuator::format(char* buffer) { // MRS: THIS IS A HACK - RECOMMEND ADDING BUFFER SIZE ARGUMENT return snprintf(buffer, 128, "%.*f", c, v); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Value_Input.cxx b/src/Fl_Value_Input.cxx index df5cda5dd..8060b7c00 100644 --- a/src/Fl_Value_Input.cxx +++ b/src/Fl_Value_Input.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Value input widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // FLTK widget for drag-adjusting a floating point value. @@ -94,7 +92,7 @@ int Fl_Value_Input::handle(int event) { Fl_Widget_Tracker wp(&input); input.handle(FL_PUSH); if (wp.exists()) - input.handle(FL_RELEASE); + input.handle(FL_RELEASE); } return 1; case FL_FOCUS: @@ -134,7 +132,3 @@ Fl_Value_Input::~Fl_Value_Input() { if (input.parent() == (Fl_Group *)this) input.parent(0); // *revert* ctor kludge! } - -// -// End of "$Id$". -// diff --git a/src/Fl_Value_Output.cxx b/src/Fl_Value_Output.cxx index 791704149..3274cd114 100644 --- a/src/Fl_Value_Output.cxx +++ b/src/Fl_Value_Output.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Value output widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Fltk widget for drag-adjusting a floating point value. @@ -93,7 +91,3 @@ Fl_Value_Output::Fl_Value_Output(int X, int Y, int W, int H,const char *l) textcolor_ = FL_FOREGROUND_COLOR; soft_ = 0; } - -// -// End of "$Id$". -// diff --git a/src/Fl_Value_Slider.cxx b/src/Fl_Value_Slider.cxx index ac06271cc..8406519dc 100644 --- a/src/Fl_Value_Slider.cxx +++ b/src/Fl_Value_Slider.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Value slider widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -44,9 +42,9 @@ void Fl_Value_Slider::draw() { } if (damage()&FL_DAMAGE_ALL) draw_box(box(),sxx,syy,sww,shh,color()); Fl_Slider::draw(sxx+Fl::box_dx(box()), - syy+Fl::box_dy(box()), - sww-Fl::box_dw(box()), - shh-Fl::box_dh(box())); + syy+Fl::box_dy(box()), + sww-Fl::box_dw(box()), + shh-Fl::box_dh(box())); draw_box(box(),bxx,byy,bww,bhh,color()); char buf[128]; format(buf); @@ -67,10 +65,10 @@ int Fl_Value_Slider::handle(int event) { syy += 25; shh -= 25; } return Fl_Slider::handle(event, - sxx+Fl::box_dx(box()), - syy+Fl::box_dy(box()), - sww-Fl::box_dw(box()), - shh-Fl::box_dh(box())); + sxx+Fl::box_dx(box()), + syy+Fl::box_dy(box()), + sww-Fl::box_dw(box()), + shh-Fl::box_dh(box())); } @@ -78,8 +76,3 @@ Fl_Hor_Value_Slider::Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l) : Fl_Value_Slider(X,Y,W,H,l) { type(FL_HOR_SLIDER); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index 502fe35f7..25a4bb981 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Base widget class for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -84,9 +82,9 @@ static void cleanup_readqueue(Fl_Widget *w) { // Read the entire queue and copy over all valid entries. // The new head will be determined after the last copied entry. - int old_head = obj_head; // save newest entry - int entry = obj_tail; // oldest entry - obj_head = obj_tail; // new queue start + int old_head = obj_head; // save newest entry + int entry = obj_tail; // oldest entry + obj_head = obj_tail; // new queue start for (;;) { Fl_Widget *o = obj_queue[entry++]; if (entry >= QUEUE_SIZE) entry = 0; @@ -111,24 +109,24 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) { x_ = X; y_ = Y; w_ = W; h_ = H; - label_.value = L; + label_.value = L; label_.image = 0; label_.deimage = 0; - label_.type = FL_NORMAL_LABEL; - label_.font = FL_HELVETICA; - label_.size = FL_NORMAL_SIZE; - label_.color = FL_FOREGROUND_COLOR; - label_.align_ = FL_ALIGN_CENTER; + label_.type = FL_NORMAL_LABEL; + label_.font = FL_HELVETICA; + label_.size = FL_NORMAL_SIZE; + label_.color = FL_FOREGROUND_COLOR; + label_.align_ = FL_ALIGN_CENTER; tooltip_ = 0; - callback_ = default_callback; - user_data_ = 0; - type_ = 0; - flags_ = VISIBLE_FOCUS; - damage_ = 0; - box_ = FL_NO_BOX; - color_ = FL_GRAY; - color2_ = FL_GRAY; - when_ = FL_WHEN_RELEASE; + callback_ = default_callback; + user_data_ = 0; + type_ = 0; + flags_ = VISIBLE_FOCUS; + damage_ = 0; + box_ = FL_NO_BOX; + color_ = FL_GRAY; + color2_ = FL_GRAY; + when_ = FL_WHEN_RELEASE; parent_ = 0; if (Fl_Group::current()) Fl_Group::current()->add(this); @@ -310,10 +308,10 @@ void Fl_Widget::copy_label(const char *a) { in your own widget's handle() method. \note It is legal to delete the widget in the callback (i.e. in user code), - but you must not access the widget in the handle() method after - calling do_callback() if the widget was deleted in the callback. - We recommend to use Fl_Widget_Tracker to check whether the widget - was deleted in the callback. + but you must not access the widget in the handle() method after + calling do_callback() if the widget was deleted in the callback. + We recommend to use Fl_Widget_Tracker to check whether the widget + was deleted in the callback. \param[in] widget call the callback with \p widget as the first argument \param[in] arg use \p arg as the user data (second) argument @@ -331,7 +329,3 @@ void Fl_Widget::do_callback(Fl_Widget *widget, void *arg) { if (callback_ != default_callback) clear_changed(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Widget_Surface.cxx b/src/Fl_Widget_Surface.cxx index 7611470e0..f489897ba 100644 --- a/src/Fl_Widget_Surface.cxx +++ b/src/Fl_Widget_Surface.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Drivers code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Widget_Surface.H> @@ -109,7 +107,7 @@ void Fl_Widget_Surface::traverse(Fl_Widget *widget) /** Translates the current graphics origin accounting for the current rotation. - + Each translate() call must be matched by an untranslate() call. Successive translate() calls add up their effects. */ @@ -137,7 +135,7 @@ void Fl_Widget_Surface::origin(int *x, int *y) /** \brief Sets the position of the origin of graphics in the drawable part of the drawing surface. - + Arguments should be expressed relatively to the result of a previous printable_rect() call. That is, <tt>printable_rect(&w, &h); origin(w/2, 0);</tt> sets the graphics origin at the top center of the drawable area. Successive origin() calls don't combine their effects. @@ -151,7 +149,7 @@ void Fl_Widget_Surface::origin(int x, int y) { /** Draws a rectangular part of an on-screen window. - + \param win The window from where to capture. Can be an Fl_Gl_Window. Sub-windows that intersect the rectangle are also captured. \param x The rectangle left \param y The rectangle top @@ -183,7 +181,7 @@ void Fl_Widget_Surface::print_window_part(Fl_Window *win, int x, int y, int w, i /** Computes the width and height of the drawable area of the drawing surface. - + Values are in the same unit as that used by FLTK drawing functions and are unchanged by calls to origin(). If the object is derived from class Fl_Paged_Device, values account for the user-selected paper type and print orientation and are changed by scale() calls. @@ -192,7 +190,7 @@ void Fl_Widget_Surface::print_window_part(Fl_Window *win, int x, int y, int w, i int Fl_Widget_Surface::printable_rect(int *w, int *h) {return 1;} /** Draws a window with its title bar and frame if any. - + \p win_offset_x and \p win_offset_y are optional coordinates of where to position the window top left. Equivalent to draw() 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 framed window. @@ -226,7 +224,3 @@ void Fl_Widget_Surface::draw_decorated_window(Fl_Window *win, int win_offset_x, this->draw(win, win_offset_x + wsides, win_offset_y + toph); if (need_push) Fl_Surface_Device::pop_current(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index db44d0450..dee4b32df 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Window widget class for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,15 +7,15 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // The Fl_Window is a window in the fltk library. -// This is the system-independent portions. The huge amount of +// This is the system-independent portions. The huge amount of // crap you need to do to communicate with X is in Fl_x.cxx, the // equivalent (but totally different) crap for Windows is in Fl_win32.cxx @@ -101,7 +99,7 @@ Fl_Window::~Fl_Window() { This will return sub-windows if there are any, or the parent window if there's no sub-windows. If this widget IS the top-level window, NULL is returned. \retval NULL if no window is associated with this widget. - \note for an Fl_Window widget, this returns its <I>parent</I> window + \note for an Fl_Window widget, this returns its <I>parent</I> window (if any), not <I>this</I> window. \see top_window() */ @@ -119,8 +117,8 @@ Fl_Window *Fl_Widget::window() const { */ Fl_Window *Fl_Widget::top_window() const { const Fl_Widget *w = this; - while (w->parent()) { w = w->parent(); } // walk up the widget hierarchy to top-level item - return const_cast<Fl_Widget*>(w)->as_window(); // return if window, or NULL if not + while (w->parent()) { w = w->parent(); } // walk up the widget hierarchy to top-level item + return const_cast<Fl_Widget*>(w)->as_window(); // return if window, or NULL if not } /** @@ -132,9 +130,9 @@ Fl_Window* Fl_Widget::top_window_offset(int& xoff, int& yoff) const { xoff = yoff = 0; const Fl_Widget *w = this; while (w && w->window()) { - xoff += w->x(); // accumulate offsets + xoff += w->x(); // accumulate offsets yoff += w->y(); - w = w->window(); // walk up window hierarchy + w = w->window(); // walk up window hierarchy } return const_cast<Fl_Widget*>(w)->as_window(); } @@ -153,17 +151,17 @@ int Fl_Window::y_root() const { } void Fl_Window::label(const char *name) { - label(name, iconlabel()); // platform dependent + label(name, iconlabel()); // platform dependent } /** Sets the window titlebar label to a copy of a character string */ void Fl_Window::copy_label(const char *a) { Fl_Widget::copy_label(a); - label(label(), iconlabel()); // platform dependent + label(label(), iconlabel()); // platform dependent } void Fl_Window::iconlabel(const char *iname) { - label(label(), iname); // platform dependent + label(label(), iname); // platform dependent } // the Fl::atclose pointer is provided for back compatibility. You @@ -255,7 +253,7 @@ void Fl_Window::default_xclass(const char *xc) \see Fl_Window::default_xclass(const char *) */ -void Fl_Window::xclass(const char *xc) +void Fl_Window::xclass(const char *xc) { if (xclass_) { free(xclass_); @@ -497,7 +495,7 @@ void Fl_Window::draw() // Other windows do not draw their labels at all, unless drawn by their // parent widgets or by special draw() methods (derived classes). - if (damage() & ~FL_DAMAGE_CHILD) { // draw the entire thing + if (damage() & ~FL_DAMAGE_CHILD) { // draw the entire thing draw_box(box(),0,0,w(),h(),color()); // draw box with x/y = 0 if (image() && (align() & FL_ALIGN_INSIDE)) { // draw the image only @@ -587,7 +585,7 @@ int Fl_Window::handle(int ev) break; } } - + return Fl_Group::handle(ev); } @@ -599,15 +597,15 @@ int Fl_Window::handle(int ev) from the setting of resizable(): <UL> <LI>If resizable() is NULL (this is the default) then the window cannot - be resized and the resize border and max-size control will not be - displayed for the window.</LI> + be resized and the resize border and max-size control will not be + displayed for the window.</LI> <LI>If either dimension of resizable() is less than 100, then that is - considered the minimum size. Otherwise the resizable() has a minimum - size of 100.</LI> + considered the minimum size. Otherwise the resizable() has a minimum + size of 100.</LI> <LI>If either dimension of resizable() is zero, then that is also the - maximum size (so the window cannot resize in that direction).</LI> + maximum size (so the window cannot resize in that direction).</LI> </UL> - + It is undefined what happens if the current size does not fit in the constraints passed to size_range(). @@ -646,11 +644,11 @@ int Fl_Window::screen_num() { /** Assigns a non-rectangular shape to the window. This function gives an arbitrary shape (not just a rectangular region) to an Fl_Window. An Fl_Image of any dimension can be used as mask; it is rescaled to the window's dimension as needed. - + The layout and widgets inside are unaware of the mask shape, and most will act as though the window's rectangular bounding box is available to them. It is up to you to make sure they adhere to the bounds of their masking shape. - + The \p img argument can be an Fl_Bitmap, Fl_Pixmap, Fl_RGB_Image or Fl_Shared_Image: \li With Fl_Bitmap or Fl_Pixmap, the shaped window covers the image part where bitmap bits equal one, or where the pixmap is not fully transparent. @@ -659,7 +657,7 @@ int Fl_Window::screen_num() { \li With an Fl_RGB_Image of depth 1 (gray-scale) or 3 (RGB), the shaped window covers the non-black image part. \li With an Fl_Shared_Image, the shape is determined by rules above applied to the underlying image. The shared image should not have been scaled through Fl_Image::scale(). - + Platform details: \li On the unix/linux platform, the SHAPE extension of the X server is required. This function does control the shape of Fl_Gl_Window instances. @@ -671,12 +669,12 @@ int Fl_Window::screen_num() { with depths 1 or 3, white and black are in and out of the shaped window, respectively, and other colors give intermediate masking scores. This function does nothing with class Fl_Gl_Window. - + The window borders and caption created by the window system are turned off by default. They can be re-enabled by calling Fl_Window::border(1). - + A usage example is found at example/shapedwindow.cxx. - + \version 1.3.3 */ void Fl_Window::shape(const Fl_Image* img) {pWindowDriver->shape(img);} @@ -691,7 +689,3 @@ const Fl_Image* Fl_Window::shape() {return pWindowDriver->shape();} /** Returns true when a window is being rescaled */ bool Fl_Window::is_a_rescale() {return Fl_Window_Driver::is_a_rescale_;} - -// -// End of "$Id$". -// diff --git a/src/Fl_Window_Driver.H b/src/Fl_Window_Driver.H index 2fd8384ee..6d740892c 100644 --- a/src/Fl_Window_Driver.H +++ b/src/Fl_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // A base class for platform specific window handling code // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -44,7 +42,7 @@ class Fl_RGB_Image; \brief A base class for platform specific window handling code. This class is only for internal use by the FLTK library. - + When porting FLTK to a new platform, many mothods in this class provide a minimal default implementation. Some methods must be overridden to make sure that the Graphics Driver will draw into the bitmap associated with @@ -120,7 +118,7 @@ public: void overlay(Fl_Window *o) { if (pWindow->as_overlay_window()) pWindow->as_overlay_window()->overlay_ = o; } - + void resize_after_scale_change(int ns, float old_f, float new_f); // --- window data @@ -165,7 +163,7 @@ public: virtual void show_with_args_end(int argc, char **argv) {} virtual int can_do_overlay(); virtual void redraw_overlay(); - + // --- window cursor stuff virtual int set_cursor(Fl_Cursor); virtual int set_cursor(const Fl_RGB_Image*, int, int); @@ -195,7 +193,3 @@ public: \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx index cafce2628..012fbc75f 100644 --- a/src/Fl_Window_Driver.cxx +++ b/src/Fl_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // A base class for platform specific window handling code // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -153,17 +151,17 @@ void Fl_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_RGB_I // This function is available for use by platform-specific, Fl_Window_Driver-derived classes int Fl_Window_Driver::hide_common() { pWindow->clear_visible(); - + if (!shown()) return 1; - + // remove from the list of windows: Fl_X* ip = Fl_X::i(pWindow); Fl_X** pp = &Fl_X::first; for (; *pp != ip; pp = &(*pp)->next) if (!*pp) return 1; *pp = ip->next; - + pWindow->i = 0; - + // recursively remove any subwindows: for (Fl_X *wi = Fl_X::first; wi;) { Fl_Window* W = wi->w; @@ -173,14 +171,14 @@ int Fl_Window_Driver::hide_common() { wi = Fl_X::first; } else wi = wi->next; } - + if (pWindow == Fl::modal_) { // we are closing the modal window, find next one: Fl_Window* W; for (W = Fl::first_window(); W; W = Fl::next_window(W)) if (W->modal()) break; Fl::modal_ = W; } - + // Make sure no events are sent to this window: fl_throw_focus(pWindow); pWindow->handle(FL_HIDE); @@ -265,7 +263,3 @@ void Fl_Window_Driver::resize_after_scale_change(int ns, float old_f, float new_ \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/Fl_Window_fullscreen.cxx b/src/Fl_Window_fullscreen.cxx index 1dc11f081..ab9e6c6bb 100644 --- a/src/Fl_Window_fullscreen.cxx +++ b/src/Fl_Window_fullscreen.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fullscreen window support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Window.H> @@ -35,7 +33,7 @@ void Fl_Window::border(int b) { the application may lose focus when switching out of fullscreen mode with some window managers. Besides, the API does not say that the FLTK border state should be toggled; it only says that the - borders should not be *visible*. + borders should not be *visible*. */ void Fl_Window::fullscreen() { no_fullscreen_x = x(); @@ -83,7 +81,3 @@ void Fl_Window::fullscreen_screens(int top, int bottom, int left, int right) { if (shown() && fullscreen_active()) pWindowDriver->fullscreen_on(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Window_hotspot.cxx b/src/Fl_Window_hotspot.cxx index 552811770..82a019979 100644 --- a/src/Fl_Window_hotspot.cxx +++ b/src/Fl_Window_hotspot.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Common hotspot routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -62,7 +60,3 @@ void Fl_Window::hotspot(const Fl_Widget *o, int offscreen) { } hotspot(X,Y,offscreen); } - -// -// End of "$Id$". -// diff --git a/src/Fl_Window_iconize.cxx b/src/Fl_Window_iconize.cxx index 6450516bd..9b7d6a270 100644 --- a/src/Fl_Window_iconize.cxx +++ b/src/Fl_Window_iconize.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Window minification code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Window.H> @@ -27,7 +25,3 @@ void Fl_Window::iconize() { pWindowDriver->iconize(); } } - -// -// End of "$Id$". -// diff --git a/src/Fl_Wizard.cxx b/src/Fl_Wizard.cxx index db863c073..5f9e849c1 100644 --- a/src/Fl_Wizard.cxx +++ b/src/Fl_Wizard.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Wizard widget routines. // // Copyright 1997-2010 by Easy Software Products. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: @@ -44,11 +42,11 @@ position and size. <P>The inherited destructor destroys the widget and its children. */ -Fl_Wizard::Fl_Wizard(int xx, // I - Lefthand position - int yy, // I - Upper position - int ww, // I - Width - int hh, // I - Height - const char *l) : // I - Label +Fl_Wizard::Fl_Wizard(int xx, // I - Lefthand position + int yy, // I - Upper position + int ww, // I - Width + int hh, // I - Height + const char *l) : // I - Label Fl_Group(xx, yy, ww, hh, l) { box(FL_THIN_UP_BOX); @@ -60,7 +58,7 @@ Fl_Wizard::Fl_Wizard(int xx, // I - Lefthand position // /** Draws the wizard border and visible child. */ void Fl_Wizard::draw() { - Fl_Widget *kid; // Visible child + Fl_Widget *kid; // Visible child kid = value(); @@ -87,8 +85,8 @@ void Fl_Wizard::draw() { is already visible, this function does nothing. */ void Fl_Wizard::next() { - int num_kids; - Fl_Widget * const *kids; + int num_kids; + Fl_Widget * const *kids; if ((num_kids = children()) == 0) @@ -105,8 +103,8 @@ void Fl_Wizard::next() { /** Shows the previous child.*/ void Fl_Wizard::prev() { - int num_kids; - Fl_Widget * const *kids; + int num_kids; + Fl_Widget * const *kids; if ((num_kids = children()) == 0) @@ -123,9 +121,9 @@ void Fl_Wizard::prev() /** Gets the current visible child widget. */ Fl_Widget* Fl_Wizard::value() { - int num_kids; - Fl_Widget * const *kids; - Fl_Widget *kid; + int num_kids; + Fl_Widget * const *kids; + Fl_Widget *kid; if ((num_kids = children()) == 0) @@ -155,8 +153,8 @@ Fl_Widget* Fl_Wizard::value() /** Sets the child widget that is visible.*/ void Fl_Wizard::value(Fl_Widget *kid) { - int num_kids; - Fl_Widget * const *kids; + int num_kids; + Fl_Widget * const *kids; if ((num_kids = children()) == 0) @@ -178,9 +176,3 @@ void Fl_Wizard::value(Fl_Widget *kid) // show the next pane may leave the cursor set to the I beam, etc... if (window()) window()->cursor(FL_CURSOR_DEFAULT); } - - - -// -// End of "$Id$". -// diff --git a/src/Fl_XBM_Image.cxx b/src/Fl_XBM_Image.cxx index 25f23a4dd..ed08b8270 100644 --- a/src/Fl_XBM_Image.cxx +++ b/src/Fl_XBM_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_XBM_Image routines. // // Copyright 1997-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -35,15 +33,15 @@ // 'Fl_XBM_Image::Fl_XBM_Image()' - Load an XBM file. // -/** +/** The constructor loads the named XBM file from the given name filename. The destructor frees all memory and server resources that are used by the image. */ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { - FILE *f; - uchar *ptr; + FILE *f; + uchar *ptr; if ((f = fl_fopen(name, "rb")) == NULL) return; @@ -55,7 +53,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { for (;;) { if (!fgets(buffer,1024,f)) { fclose(f); - return; + return; } int r = sscanf(buffer,"#define %s %d",junk,&wh[i]); if (r >= 2) break; @@ -89,7 +87,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { unsigned int t; if (sscanf(a," 0x%x",&t)>0) { *ptr++ = (uchar)t; - i ++; + i ++; } while (*a && *a++ != ',') {/*empty*/} } @@ -97,8 +95,3 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { fclose(f); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_XColor.H b/src/Fl_XColor.H index f8d2b49ee..4717620fe 100644 --- a/src/Fl_XColor.H +++ b/src/Fl_XColor.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // X-specific color definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -22,16 +20,12 @@ // one of these for each color in fltk's "colormap": // if overlays are enabled, another one for the overlay struct Fl_XColor { - unsigned char r,g,b; // actual color used by X - unsigned char mapped; // true when XAllocColor done - unsigned long pixel; // the X pixel to use + unsigned char r,g,b; // actual color used by X + unsigned char mapped; // true when XAllocColor done + unsigned long pixel; // the X pixel to use }; extern Fl_XColor fl_xmap[/*overlay*/][256]; // mask & shifts to produce xcolor for truecolor visuals: extern unsigned char fl_redmask, fl_greenmask, fl_bluemask; extern int fl_redshift, fl_greenshift, fl_blueshift, fl_extrashift; - -// -// End of "$Id$". -// diff --git a/src/Fl_XPM_Image.cxx b/src/Fl_XPM_Image.cxx index 1345cbad9..93ef75df2 100644 --- a/src/Fl_XPM_Image.cxx +++ b/src/Fl_XPM_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_XPM_Image routines. // // Copyright 1997-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -35,7 +33,7 @@ // 'hexdigit()' - Convert a hex digit to an integer. // -static int hexdigit(int x) { // I - Hex digit... +static int hexdigit(int x) { // I - Hex digit... if (isdigit(x)) return x-'0'; if (isupper(x)) return x-'A'+10; if (islower(x)) return x-'a'+10; @@ -70,35 +68,35 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) { if (*q == '\\') switch (*++q) { case '\r': case '\n': - if (!fgets(q,(int) (buffer+MAXSIZE+20-q),f)) { /* no problem if we hit EOF */ } break; + if (!fgets(q,(int) (buffer+MAXSIZE+20-q),f)) { /* no problem if we hit EOF */ } break; case 0: - break; + break; case 'x': { - q++; - int n = 0; - for (int x = 0; x < 2; x++) { - int xd = hexdigit(*q); - if (xd > 15) break; - n = (n<<4)+xd; - q++; - } - *myp++ = n; + q++; + int n = 0; + for (int x = 0; x < 2; x++) { + int xd = hexdigit(*q); + if (xd > 15) break; + n = (n<<4)+xd; + q++; + } + *myp++ = n; } break; default: { - int c = *q++; - if (c>='0' && c<='7') { - c -= '0'; - for (int x=0; x<2; x++) { - int xd = hexdigit(*q); - if (xd>7) break; - c = (c<<3)+xd; - q++; - } - } - *myp++ = c; + int c = *q++; + if (c>='0' && c<='7') { + c -= '0'; + for (int x=0; x<2; x++) { + int xd = hexdigit(*q); + if (xd>7) break; + c = (c<<3)+xd; + q++; + } + } + *myp++ = c; } break; } else { - *myp++ = *q++; + *myp++ = *q++; } } *myp++ = 0; @@ -110,7 +108,7 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) { malloc_size += INITIALLINES; } // first line has 4 ints: width, height, ncolors, chars_per_pixel - // followed by color segment: + // followed by color segment: // if ncolors < 0 this is FLTK (non standard) compressed colormap - all colors coded in single line of 4*ncolors bytes // otherwise - ncolor lines of at least chars_per_pixel bytes // followed by pic segment: H lines of at least chars_per_pixel*W bytes @@ -138,8 +136,3 @@ bad_data: delete[] new_data; if (f) fclose(f); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_abort.cxx b/src/Fl_abort.cxx index 2c4bd04fe..bd2771813 100644 --- a/src/Fl_abort.cxx +++ b/src/Fl_abort.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Warning/error message code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // You can also override this by redefining all of these. @@ -25,7 +23,3 @@ void (*Fl::warning)(const char* format, ...) = Fl_System_Driver::warning; void (*Fl::error)(const char* format, ...) = Fl_System_Driver::error; void (*Fl::fatal)(const char* format, ...) = Fl_System_Driver::fatal; - -// -// End of "$Id$". -// diff --git a/src/Fl_add_idle.cxx b/src/Fl_add_idle.cxx index cdebe17fb..f5d588cfb 100644 --- a/src/Fl_add_idle.cxx +++ b/src/Fl_add_idle.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Idle routine support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Allows you to manage an arbitrary set of idle() callbacks. @@ -46,12 +44,12 @@ static void call_idle() { immediately, so if it is in a loop it is called repeatedly, and thus the idle fucntion is called repeatedly). The idle function can be used to get background processing done. - + You can have multiple idle callbacks. To remove an idle callback use Fl::remove_idle(). - + Fl::wait() and Fl::check() call idle callbacks, but Fl::ready() does not. - + The idle callback can call any FLTK functions, including Fl::wait(), Fl::check(), and Fl::ready(). @@ -108,7 +106,3 @@ void Fl::remove_idle(Fl_Idle_Handler cb, void* data) { p->next = freelist; freelist = p; } - -// -// End of "$Id$". -// diff --git a/src/Fl_arg.cxx b/src/Fl_arg.cxx index 4ab6bfe4a..347faee63 100644 --- a/src/Fl_arg.cxx +++ b/src/Fl_arg.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Optional argument initialization code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // OPTIONAL initialization code for a program using FLTK. @@ -49,68 +47,68 @@ extern const char *fl_bg2; /** Parse a single switch from \p argv, starting at word \p i. Returns the number of words eaten (1 or 2, or 0 if it is not - recognized) and adds the same value to \p i. - + recognized) and adds the same value to \p i. + This is the default argument handler used internally by Fl::args(...), but you can use this function if you prefer to step through the standard FLTK switches yourself. - + All standard FLTK switches except -bg2 may be abbreviated to just one letter and case is ignored: - + \li -bg color or -background color <br> Sets the background color using Fl::background(). - + \li -bg2 color or -background2 color <br> Sets the secondary background color using Fl::background2(). - + \li -display host:n.n <br> Sets the X display to use; this option is silently ignored under Windows and MacOS. - + \li -dnd and -nodnd <br> Enables or disables drag and drop text operations using Fl::dnd_text_ops(). - + \li -fg color or -foreground color <br> Sets the foreground color using Fl::foreground(). - + \li -geometry WxH+X+Y <br> Sets the initial window position and size according to the standard X geometry string. - + \li -iconic <br> Iconifies the window using Fl_Window::iconize(). - + \li -kbd and -nokbd <br> Enables or disables visible keyboard focus for non-text widgets using Fl::visible_focus(). - + \li -name string <br> Sets the window class using Fl_Window::xclass(). - + \li -scheme string <br> Sets the widget scheme using Fl::scheme(). - + \li -title string <br> Sets the window title using Fl_Window::label(). - + \li -tooltips and -notooltips <br> Enables or disables tooltips using Fl_Tooltip::enable(). - - + + If your program requires other switches in addition to the standard FLTK options, you will need to pass your own argument handler to Fl::args(int,char**,int&,Fl_Args_Handler) explicitly. @@ -119,7 +117,7 @@ int Fl::arg(int argc, char **argv, int &i) { arg_called = 1; const char *s = argv[i]; - if (!s) {i++; return 1;} // something removed by calling program? + if (!s) {i++; return 1;} // something removed by calling program? // a word that does not start with '-', or a word after a '--', or // the word '-' by itself all start the "non-switch arguments" to @@ -164,7 +162,7 @@ int Fl::arg(int argc, char **argv, int &i) { const char *v = argv[i+1]; if (i >= argc-1 || !v) - return 0; // all the rest need an argument, so if missing it is an error + return 0; // all the rest need an argument, so if missing it is an error if (fl_match(s, "geometry")) { @@ -208,20 +206,20 @@ int Fl::arg(int argc, char **argv, int &i) { /** Parse command line switches using the \p cb argument handler. - + Returns 0 on error, or the number of words processed. - + FLTK provides this as an <i>entirely optional</i> command line switch parser. You don't have to call it if you don't want to. Everything it can do can be done with other calls to FLTK. - + To use the switch parser, call Fl::args(...) near the start of your program. This does \b not open the display, instead switches that need the display open are stashed into static variables. Then you \b must display your first window by calling <tt>window->show(argc,argv)</tt>, which will do anything stored in the static variables. - + Providing an argument handler callback \p cb lets you define your own switches. It is called with the same \p argc and \p argv, and with \p i set to the index of the switch to be processed. @@ -230,33 +228,33 @@ int Fl::arg(int argc, char **argv, int &i) { number of words processed if the switch is recognized, i.e. 1 for just the switch, and more than 1 for the switch plus associated parameters. \p i should be incremented by the same amount. - + The \p cb handler is called \b before any other tests, so <i>you can also override any standard FLTK switch</i> (this is why FLTK can use very short switches instead of the long ones all other toolkits force you to use). See Fl::arg() for descriptions of the standard switches. - + On return \p i is set to the index of the first non-switch. This is either: - + \li The first word that does not start with '-'. \li The word '-' (used by many programs to name stdin as a file) \li The first unrecognized switch (return value is 0). \li \p argc - + The return value is \p i unless an unrecognized switch is found, in which case it is zero. If your program takes no arguments other than switches you should produce an error if the return value is less than \p argc. - - + + A usage string is displayed if Fl::args() detects an invalid argument on the command-line. You can change the message by setting the Fl::help pointer. - + A very simple command line parser can be found in <tt>examples/howto-parse-args.cxx</tt> - + The simpler Fl::args(int argc, char **argv) form is useful if your program does not have command line switches of its own. */ @@ -294,9 +292,9 @@ void Fl_Window::show(int argc, char **argv) { if (!r) resizable(this); // for Windows we assume window is not mapped yet: if (fl & (Fl_System_Driver::fl_XValue | Fl_System_Driver::fl_YValue)) - x(-1), resize(gx,gy,gw,gh); + x(-1), resize(gx,gy,gw,gh); else - size(gw,gh); + size(gw,gh); resizable(r); } } @@ -343,16 +341,12 @@ const char * const Fl::help = helpmsg+13; /** Parse all command line switches matching standard FLTK options only. - + It parses all the switches, and if any are not recognized it calls Fl::abort(Fl::help), i.e. unlike the long form, an unrecognized switch generates an error message and causes the program to exit. - + */ void Fl::args(int argc, char **argv) { int i; if (Fl::args(argc,argv,i) < argc) Fl::error(helpmsg); } - -// -// End of "$Id$". -// diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 8d09c8759..5c094b93f 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS-Cocoa specific code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -50,16 +48,16 @@ extern "C" { #import <Cocoa/Cocoa.h> -// #define DEBUG_SELECT // UNCOMMENT FOR SELECT()/THREAD DEBUGGING +// #define DEBUG_SELECT // UNCOMMENT FOR SELECT()/THREAD DEBUGGING #ifdef DEBUG_SELECT -#include <stdio.h> // testing -#define DEBUGMSG(msg) if ( msg ) fprintf(stderr, msg); -#define DEBUGPERRORMSG(msg) if ( msg ) perror(msg) -#define DEBUGTEXT(txt) txt +#include <stdio.h> // testing +#define DEBUGMSG(msg) if ( msg ) fprintf(stderr, msg); +#define DEBUGPERRORMSG(msg) if ( msg ) perror(msg) +#define DEBUGTEXT(txt) txt #else #define DEBUGMSG(msg) #define DEBUGPERRORMSG(msg) -#define DEBUGTEXT(txt) NULL +#define DEBUGTEXT(txt) NULL #endif /*DEBUG_SELECT*/ // external functions @@ -78,17 +76,17 @@ static void drain_dropped_files_list(void); static NSPoint FLTKtoCocoa(Fl_Window *win, int x, int y, int H); static int get_window_frame_sizes(Fl_Window *win, int *pbx = NULL, int *pby = NULL); -int fl_mac_os_version = Fl_Darwin_System_Driver::calc_mac_os_version(); // the version number of the running Mac OS X (e.g., 100604 for 10.6.4) +int fl_mac_os_version = Fl_Darwin_System_Driver::calc_mac_os_version(); // the version number of the running Mac OS X (e.g., 100604 for 10.6.4) // public variables -void *fl_capture = 0; // (NSWindow*) we need this to compensate for a missing(?) mouse capture +void *fl_capture = 0; // (NSWindow*) we need this to compensate for a missing(?) mouse capture Window fl_window; // forward declarations of variables in this file static int main_screen_height; // height of menubar-containing screen used to convert between Cocoa and FLTK global screen coordinates -// through_drawRect = YES means the drawRect: message was sent to the view, +// through_drawRect = YES means the drawRect: message was sent to the view, // thus the graphics context was prepared by the system -static BOOL through_drawRect = NO; +static BOOL through_drawRect = NO; // through_Fl_X_flush = YES means Fl_Cocoa_Window_Driver::flush() was called static BOOL through_Fl_X_flush = NO; static BOOL views_use_CA = NO; // YES means views are layer-backed, as on macOS 10.14 when linked with SDK 10.14 @@ -178,7 +176,7 @@ void (*fl_unlock_function)() = nothing; // sending a custom OSX 'FLTK data ready event' to the parent thread's // RunApplicationLoop(), so that it triggers the data ready callbacks // in the parent thread. -erco 04/04/04 -// +// #define POLLIN 1 #define POLLOUT 4 #define POLLERR 8 @@ -195,14 +193,14 @@ class DataReady }; int nfds, fd_array_size; FD *fds; - pthread_t tid; // select()'s thread id - + pthread_t tid; // select()'s thread id + // Data that needs to be locked (all start with '_') - pthread_mutex_t _datalock; // data lock - fd_set _fdsets[3]; // r/w/x sets user wants to monitor - int _maxfd; // max fd count to monitor - int _cancelpipe[2]; // pipe used to help cancel thread - + pthread_mutex_t _datalock; // data lock + fd_set _fdsets[3]; // r/w/x sets user wants to monitor + int _maxfd; // max fd count to monitor + int _cancelpipe[2]; // pipe used to help cancel thread + public: DataReady() { @@ -210,34 +208,34 @@ public: fd_array_size = 0; fds = 0; tid = 0; - + pthread_mutex_init(&_datalock, NULL); FD_ZERO(&_fdsets[0]); FD_ZERO(&_fdsets[1]); FD_ZERO(&_fdsets[2]); _cancelpipe[0] = _cancelpipe[1] = 0; _maxfd = -1; } - + ~DataReady() { CancelThread(DEBUGTEXT("DESTRUCTOR\n")); if (fds) { free(fds); fds = 0; } nfds = 0; } - + // Locks // The convention for locks: volatile vars start with '_', - // and must be locked before use. Locked code is prefixed + // and must be locked before use. Locked code is prefixed // with /*LOCK*/ to make painfully obvious esp. in debuggers. -erco // void DataLock() { pthread_mutex_lock(&_datalock); } void DataUnlock() { pthread_mutex_unlock(&_datalock); } - + // Accessors int IsThreadRunning() { return(tid ? 1 : 0); } int GetNfds() { return(nfds); } int GetCancelPipe(int ix) { return(_cancelpipe[ix]); } fd_set GetFdset(int ix) { return(_fdsets[ix]); } - + // Methods void AddFD(int n, int events, void (*cb)(int, void*), void *v); void RemoveFD(int n, int events); @@ -254,7 +252,7 @@ void DataReady::AddFD(int n, int events, void (*cb)(int, void*), void *v) { RemoveFD(n, events); int i = nfds++; - if (i >= fd_array_size) + if (i >= fd_array_size) { fl_open_display(); // necessary for NSApp to be defined and the event loop to work FD *temp; @@ -307,7 +305,7 @@ int DataReady::CheckData(fd_set& r, fd_set& w, fd_set& x) { int ret; DataLock(); - /*LOCK*/ timeval t = { 0, 1 }; // quick check + /*LOCK*/ timeval t = { 0, 1 }; // quick check /*LOCK*/ r = _fdsets[0], w = _fdsets[1], x = _fdsets[2]; /*LOCK*/ ret = ::select(_maxfd+1, &r, &w, &x, &t); DataUnlock(); @@ -341,7 +339,7 @@ void DataReady::HandleData(fd_set& r, fd_set& w, fd_set& x) void* DataReady::DataReadyThread(void *o) { DataReady *self = (DataReady*)o; - while ( 1 ) { // loop until thread cancel or error + while ( 1 ) { // loop until thread cancel or error // Thread safe local copies of data before each select() self->DataLock(); /*LOCK*/ int maxfd = self->_maxfd; @@ -350,25 +348,25 @@ void* DataReady::DataReadyThread(void *o) /*LOCK*/ fd_set x = self->GetFdset(2); /*LOCK*/ int cancelpipe = self->GetCancelPipe(0); /*LOCK*/ if ( cancelpipe > maxfd ) maxfd = cancelpipe; - /*LOCK*/ FD_SET(cancelpipe, &r); // add cancelpipe to fd's to watch + /*LOCK*/ FD_SET(cancelpipe, &r); // add cancelpipe to fd's to watch /*LOCK*/ FD_SET(cancelpipe, &x); self->DataUnlock(); - // timeval t = { 1000, 0 }; // 1000 seconds; - timeval t = { 2, 0 }; // HACK: 2 secs prevents 'hanging' problem + // timeval t = { 1000, 0 }; // 1000 seconds; + timeval t = { 2, 0 }; // HACK: 2 secs prevents 'hanging' problem int ret = ::select(maxfd+1, &r, &w, &x, &t); - pthread_testcancel(); // OSX 10.0.4 and older: needed for parent to cancel + pthread_testcancel(); // OSX 10.0.4 and older: needed for parent to cancel switch ( ret ) { - case 0: // NO DATA + case 0: // NO DATA continue; - case -1: // ERROR + case -1: // ERROR { DEBUGPERRORMSG("CHILD THREAD: select() failed"); - return(NULL); // error? exit thread + return(NULL); // error? exit thread } - default: // DATA READY + default: // DATA READY { - if (FD_ISSET(cancelpipe, &r) || FD_ISSET(cancelpipe, &x)) // cancel? - { return(NULL); } // just exit + if (FD_ISSET(cancelpipe, &r) || FD_ISSET(cancelpipe, &x)) // cancel? + { return(NULL); } // just exit DEBUGMSG("CHILD THREAD: DATA IS READY\n"); NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined @@ -378,7 +376,7 @@ void* DataReady::DataReadyThread(void *o) windowNumber:0 context:NULL subtype:FLTKDataReadyEvent data1:0 data2:0]; [NSApp postEvent:event atStart:NO]; [localPool release]; - return(NULL); // done with thread + return(NULL); // done with thread } } } @@ -389,7 +387,7 @@ void DataReady::StartThread(void) { CancelThread(DEBUGTEXT("STARTING NEW THREAD\n")); DataLock(); - /*LOCK*/ pipe(_cancelpipe); // pipe for sending cancel msg to thread + /*LOCK*/ pipe(_cancelpipe); // pipe for sending cancel msg to thread DataUnlock(); DEBUGMSG("*** START THREAD\n"); pthread_create(&tid, NULL, DataReadyThread, (void*)this); @@ -401,11 +399,11 @@ void DataReady::CancelThread(const char *reason) if ( tid ) { DEBUGMSG("*** CANCEL THREAD: "); DEBUGMSG(reason); - if ( pthread_cancel(tid) == 0 ) { // cancel first + if ( pthread_cancel(tid) == 0 ) { // cancel first DataLock(); - /*LOCK*/ write(_cancelpipe[1], "x", 1); // wake thread from select + /*LOCK*/ write(_cancelpipe[1], "x", 1); // wake thread from select DataUnlock(); - pthread_join(tid, NULL); // wait for thread to finish + pthread_join(tid, NULL); // wait for thread to finish } tid = 0; DEBUGMSG("(JOINED) OK\n"); @@ -444,7 +442,7 @@ int Fl_Cocoa_Screen_Driver::ready() { NSEvent *retval = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:0] - inMode:NSDefaultRunLoopMode dequeue:NO]; + inMode:NSDefaultRunLoopMode dequeue:NO]; return retval != nil; } @@ -452,17 +450,17 @@ int Fl_Cocoa_Screen_Driver::ready() static void processFLTKEvent(void) { fl_lock_function(); dataready.CancelThread(DEBUGTEXT("DATA READY EVENT\n")); - + // CHILD THREAD TELLS US DATA READY // Check to see what's ready, and invoke user's cb's // fd_set r,w,x; switch(dataready.CheckData(r,w,x)) { - case 0: // NO DATA + case 0: // NO DATA break; - case -1: // ERROR + case -1: // ERROR break; - default: // DATA READY + default: // DATA READY dataready.HandleData(r,w,x); break; } @@ -475,7 +473,7 @@ static void processFLTKEvent(void) { * break the current event loop */ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() -{ +{ NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:0 context:NULL subtype:FLTKTimerEvent data1:0 data2:0]; @@ -486,9 +484,9 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() @interface FLWindow : NSWindow { Fl_Window *w; } -- (FLWindow*)initWithFl_W:(Fl_Window *)flw - contentRect:(NSRect)rect - styleMask:(NSUInteger)windowStyle; +- (FLWindow*)initWithFl_W:(Fl_Window *)flw + contentRect:(NSRect)rect + styleMask:(NSUInteger)windowStyle; - (Fl_Window *)getFl_Window; - (void)recursivelySendToSubwindows:(SEL)sel applyToSelf:(BOOL)b; - (void)setSubwindowFrame; @@ -595,9 +593,9 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() } #endif -- (FLWindow*)initWithFl_W:(Fl_Window *)flw - contentRect:(NSRect)rect - styleMask:(NSUInteger)windowStyle +- (FLWindow*)initWithFl_W:(Fl_Window *)flw + contentRect:(NSRect)rect + styleMask:(NSUInteger)windowStyle { self = [super initWithContentRect:rect styleMask:windowStyle backing:NSBackingStoreBuffered defer:NO]; if (self) { @@ -619,16 +617,16 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() - (BOOL)canBecomeKeyWindow { if (Fl::modal_ && (Fl::modal_ != w)) - return NO; // prevent the caption to be redrawn as active on click - // when another modal window is currently the key win + return NO; // prevent the caption to be redrawn as active on click + // when another modal window is currently the key win return !(!w || w->output() || w->tooltip_window() || w->menu_window() || w->parent()); } - (BOOL)canBecomeMainWindow { if (Fl::modal_ && (Fl::modal_ != w)) - return NO; // prevent the caption to be redrawn as active on click - // when another modal window is currently the key win + return NO; // prevent the caption to be redrawn as active on click + // when another modal window is currently the key win return !(!w || w->tooltip_window() || w->menu_window() || w->parent()); } @@ -739,17 +737,17 @@ static int do_queued_events( double time = 0.0 ) { static int got_events; // not sure the static is necessary here got_events = 0; - + // Check for re-entrant condition if ( dataready.IsThreadRunning() ) { dataready.CancelThread(DEBUGTEXT("AVOID REENTRY\n")); } - + // Start thread to watch for data ready if ( dataready.GetNfds() ) { dataready.StartThread(); } - + fl_unlock_function(); NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:time] @@ -759,7 +757,7 @@ static int do_queued_events( double time = 0.0 ) [FLApplication sendEvent:event]; // will then call [NSApplication sendevent:] } fl_lock_function(); - + #if CONSOLIDATE_MOTION if (send_motion && send_motion == fl_xmousewin) { send_motion = 0; @@ -975,9 +973,9 @@ static void cocoaMouseHandler(NSEvent *theEvent) { static int keysym[] = { 0, FL_Button+1, FL_Button+3, FL_Button+2 }; static int px, py; - + fl_lock_function(); - + Fl_Window *window = (Fl_Window*)[(FLWindow*)[theEvent window] getFl_Window]; if ( !window->shown() ) { fl_unlock_function(); @@ -990,9 +988,9 @@ static void cocoaMouseHandler(NSEvent *theEvent) pos.x /= s; pos.y /= s; pos.y = window->h() - pos.y; NSInteger btn = [theEvent buttonNumber] + 1; - NSUInteger mods = [theEvent modifierFlags]; + NSUInteger mods = [theEvent modifierFlags]; int sendEvent = 0; - + NSEventType etype = [theEvent type]; if (etype == NSLeftMouseDown || etype == NSRightMouseDown || etype == NSOtherMouseDown) { if (btn == 1) Fl::e_state |= FL_BUTTON1; @@ -1004,15 +1002,15 @@ static void cocoaMouseHandler(NSEvent *theEvent) else if (btn == 3) Fl::e_state &= ~FL_BUTTON2; else if (btn == 2) Fl::e_state &= ~FL_BUTTON3; } - + switch ( etype ) { case NSLeftMouseDown: case NSRightMouseDown: case NSOtherMouseDown: sendEvent = FL_PUSH; - Fl::e_is_click = 1; + Fl::e_is_click = 1; px = (int)pos.x; py = (int)pos.y; - if ([theEvent clickCount] > 1) + if ([theEvent clickCount] > 1) Fl::e_clicks++; else Fl::e_clicks = 0; @@ -1022,13 +1020,13 @@ static void cocoaMouseHandler(NSEvent *theEvent) case NSOtherMouseUp: if ( !window ) break; if ( !sendEvent ) { - sendEvent = FL_RELEASE; + sendEvent = FL_RELEASE; } Fl::e_keysym = keysym[ btn ]; // fall through case NSMouseMoved: if ( !sendEvent ) { - sendEvent = FL_MOVE; + sendEvent = FL_MOVE; } // fall through case NSLeftMouseDragged: @@ -1036,7 +1034,7 @@ static void cocoaMouseHandler(NSEvent *theEvent) case NSOtherMouseDragged: { if ( !sendEvent ) { sendEvent = FL_MOVE; // Fl::handle will convert into FL_DRAG - if (fabs(pos.x-px)>5 || fabs(pos.y-py)>5) + if (fabs(pos.x-px)>5 || fabs(pos.y-py)>5) Fl::e_is_click = 0; } mods_to_e_state( mods ); @@ -1060,13 +1058,13 @@ static void cocoaMouseHandler(NSEvent *theEvent) default: break; } - + fl_unlock_function(); - + return; } -@interface FLTextView : NSTextView // this subclass is only needed under OS X < 10.6 +@interface FLTextView : NSTextView // this subclass is only needed under OS X < 10.6 { BOOL isActive; } @@ -1100,7 +1098,7 @@ static FLTextView *fltextview_instance = nil; @end -@interface FLWindowDelegate : NSObject +@interface FLWindowDelegate : NSObject #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 <NSWindowDelegate> #endif @@ -1354,7 +1352,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; if (win) Fl::handle(FL_CLOSE, win); // this might or might not close the window fl_unlock_function(); // the system doesn't need to send [fl close] because FLTK does it when needed - return NO; + return NO; } - (void)anyWindowWillClose:(NSNotification *)notif { @@ -1381,7 +1379,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; } @end -@interface FLAppDelegate : NSObject +@interface FLAppDelegate : NSObject #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 <NSApplicationDelegate> #endif @@ -1461,14 +1459,14 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; newDoc = TSMGetActiveDocument(); if (newDoc != currentDoc) { TSMDocumentID doc; - + doc = TSMGetActiveDocument(); - + if (im_enabled) TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag); else { CFArrayRef inputSources; - + inputSources = TISCreateASCIICapableInputSourceList(); TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources); @@ -1616,16 +1614,16 @@ void Fl_Darwin_System_Driver::open_callback(void (*cb)(const char *)) { if (fl_send_system_handlers(theEvent)) return; - NSEventType type = [theEvent type]; + NSEventType type = [theEvent type]; if (type == NSLeftMouseDown) { fl_lock_function(); Fl_Window *grab = Fl::grab(); if (grab) { FLWindow *win = (FLWindow *)[theEvent window]; if ( [win isKindOfClass:[FLWindow class]] && grab != [win getFl_Window]) { - // a click event out of a menu window, so we should close this menu - // done here to catch also clicks on window title bar/resize box - cocoaMouseHandler(theEvent); + // a click event out of a menu window, so we should close this menu + // done here to catch also clicks on window title bar/resize box + cocoaMouseHandler(theEvent); } } fl_unlock_function(); @@ -1686,7 +1684,7 @@ void Fl_Cocoa_Screen_Driver::open_display_platform() { static char beenHereDoneThat = 0; if ( !beenHereDoneThat ) { beenHereDoneThat = 1; - + BOOL need_new_nsapp = (NSApp == nil); if (need_new_nsapp) [NSApplication sharedApplication]; NSAutoreleasePool *localPool; @@ -1706,18 +1704,18 @@ void Fl_Cocoa_Screen_Driver::open_display_platform() { // empty the event queue but keep system events for drag&drop of files at launch NSEvent *ign_event; do ign_event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSSystemDefinedMask) - untilDate:[NSDate dateWithTimeIntervalSinceNow:0] - inMode:NSDefaultRunLoopMode - dequeue:YES]; + untilDate:[NSDate dateWithTimeIntervalSinceNow:0] + inMode:NSDefaultRunLoopMode + dequeue:YES]; while (ign_event); - + if (![NSApp isActive]) foreground_and_activate(); if (![NSApp servicesMenu]) createAppleMenu(); main_screen_height = CGDisplayBounds(CGMainDisplayID()).size.height; [[NSNotificationCenter defaultCenter] addObserver:[FLWindowDelegate singleInstance] - selector:@selector(anyWindowWillClose:) - name:NSWindowWillCloseNotification - object:nil]; + selector:@selector(anyWindowWillClose:) + name:NSWindowWillCloseNotification + object:nil]; [[NSNotificationCenter defaultCenter] addObserver:[FLWindowDelegate singleInstance] selector:@selector(view_did_resize:) name:NSViewFrameDidChangeNotification @@ -1895,9 +1893,9 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { Y = w->y()*s-yoff; W = w->w()*s+dx; H = w->h()*s+dy; - + // Proceed to positioning the window fully inside the screen, if possible - + // let's get a little elaborate here. Mac OS X puts a lot of stuff on the desk // that we want to avoid when positioning our window, namely the Dock and the // top menu bar (and even more stuff in 10.4 Tiger). So we will go through the @@ -1917,7 +1915,7 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { break; } if (i < count) gd = [a objectAtIndex:i]; - + // if the center doesn't fall on a screen, try the top left if (!gd) { for( i = 0; i < count; i++) { @@ -1973,13 +1971,13 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { if ( X < r.origin.x ) X = int(r.origin.x); if ( Y < r.origin.y ) Y = int(r.origin.y); } - + // Return the client area's top left corner in (X,Y) X+=xoff; Y+=yoff; X /= s; Y /= s; - + return ret; } @@ -2007,10 +2005,10 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi } /** How FLTK handles Mac OS text input - + Let myview be the instance of the FLView class that has the keyboard focus. FLView is an FLTK-defined NSView subclass that implements the NSTextInputClient protocol to properly handle text input. It also implements the old NSTextInput - protocol to run with OS <= 10.4. The few NSTextInput protocol methods that differ in signature from the NSTextInputClient + protocol to run with OS <= 10.4. The few NSTextInput protocol methods that differ in signature from the NSTextInputClient protocol transmit the received message to the corresponding NSTextInputClient method. Keyboard input sends keyDown: and performKeyEquivalent: messages to myview. The latter occurs for keys such as @@ -2020,34 +2018,34 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi The performKeyEquivalent: method directly calls Fl::handle(FL_KEYBOARD, focus-window) when the Ctrl or Cmd modifiers are used. If not, it also calls [[myview inputContext] handleEvent:theEvent]. The performKeyEquivalent: method returns YES when the keystroke has been handled and NO otherwise, which allows - shortcuts of the system menu to be processed. Three sorts of messages are then sent back by the system to myview: + shortcuts of the system menu to be processed. Three sorts of messages are then sent back by the system to myview: doCommandBySelector:, setMarkedText: and insertText:. All 3 messages eventually produce Fl::handle(FL_KEYBOARD, win) calls. - The doCommandBySelector: message allows to process events such as new-line, forward and backward delete, arrows, - escape, tab, F1. The message setMarkedText: is sent when marked text, that is, temporary text that gets replaced later - by some other text, is inserted. This happens when a dead key is pressed, and also + The doCommandBySelector: message allows to process events such as new-line, forward and backward delete, arrows, + escape, tab, F1. The message setMarkedText: is sent when marked text, that is, temporary text that gets replaced later + by some other text, is inserted. This happens when a dead key is pressed, and also when entering complex scripts (e.g., Chinese). Fl_Cocoa_Screen_Driver::next_marked_length gives the byte length of marked text before the FL_KEYBOARD event is processed. Fl::compose_state gives this length after this processing. Message insertText: is sent to enter text in the focused widget. If there's marked text, Fl::compose_state is > 0, and this - marked text gets replaced by the inserted text. If there's no marked text, the new text is inserted at the insertion point. - When the character palette is used to enter text, the system sends an insertText: message to myview. + marked text gets replaced by the inserted text. If there's no marked text, the new text is inserted at the insertion point. + When the character palette is used to enter text, the system sends an insertText: message to myview. The in_key_event field of the FLView class allows to differentiate keyboard from palette inputs. - + During processing of the handleEvent message, inserted and marked strings are concatenated in a single string - inserted in a single FL_KEYBOARD event after return from handleEvent. The need_handle member variable of FLView allows - to determine when setMarkedText or insertText strings have been sent during handleEvent processing and must trigger - an FL_KEYBOARD event. Concatenating two insertText operations or an insertText followed by a setMarkedText is possible. - In contrast, setMarkedText followed by insertText or by another setMarkedText isn't correct if concatenated in a single - string. Thus, in such case, the setMarkedText and the next operation produce each an FL_KEYBOARD event. - - OS >= 10.7 contains a feature where pressing and holding certain keys opens a menu window that shows a list + inserted in a single FL_KEYBOARD event after return from handleEvent. The need_handle member variable of FLView allows + to determine when setMarkedText or insertText strings have been sent during handleEvent processing and must trigger + an FL_KEYBOARD event. Concatenating two insertText operations or an insertText followed by a setMarkedText is possible. + In contrast, setMarkedText followed by insertText or by another setMarkedText isn't correct if concatenated in a single + string. Thus, in such case, the setMarkedText and the next operation produce each an FL_KEYBOARD event. + + OS >= 10.7 contains a feature where pressing and holding certain keys opens a menu window that shows a list of possible accented variants of this key. The selectedRange field of the FLView class and the selectedRange, insertText: and setMarkedText: methods of the NSTextInputClient protocol are used to support this feature. - The notion of selected text (!= marked text) is monitored by the selectedRange field. - The -(NSRange)[FLView selectedRange] method is used to control whether an FLTK widget opens accented character windows + The notion of selected text (!= marked text) is monitored by the selectedRange field. + The -(NSRange)[FLView selectedRange] method is used to control whether an FLTK widget opens accented character windows by returning .location = NSNotFound to disable that, or returning the value of the selectedRange field to enable the feature. - When selectedRange.location >= 0, the value of selectedRange.length is meaningful. 0 means no text is currently selected, + When selectedRange.location >= 0, the value of selectedRange.length is meaningful. 0 means no text is currently selected, > 0 means this number of characters before the insertion point are selected. The insertText: method does - selectedRange = NSMakeRange(100, 0); to indicate no text is selected. The setMarkedText: method does + selectedRange = NSMakeRange(100, 0); to indicate no text is selected. The setMarkedText: method does selectedRange = NSMakeRange(100, newSelection.length); to indicate that this length of text is selected. With OS <= 10.5, the NSView class does not implement the inputContext message. [myview process_keydown:theEvent] is @@ -2057,14 +2055,14 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi of the FLTextView class allocated by the -(id)[FLWindowDelegate windowWillReturnFieldEditor: toObject:] method. The -(BOOL)[FLTextInputContext handleEvent:] method emulates the missing 10.6 -(BOOL)[NSTextInputContext handleEvent:] by sending the interpretKeyEvents: message to the FLTextView object. The system sends back doCommandBySelector: and - insertText: messages to the FLTextView object that are transmitted unchanged to myview to be processed as with OS >= 10.6. + insertText: messages to the FLTextView object that are transmitted unchanged to myview to be processed as with OS >= 10.6. The system also sends setMarkedText: messages directly to myview. - - There is furthermore an oddity of dead key processing with OS <= 10.5. It occurs when a dead key followed by a non-accented - key are pressed. Say, for example, that keys '^' followed by 'p' are pressed on a French or German keyboard. Resulting - messages are: [myview setMarkedText:@"^"], [myview insertText:@"^"], [myview insertText:@"p"], [FLTextView insertText:@"^p"]. - The 2nd '^' replaces the marked 1st one, followed by p^p. The resulting text in the widget is "^p^p" instead of the - desired "^p". To avoid that, the FLTextView object is deactivated by the insertText: message and reactivated after + + There is furthermore an oddity of dead key processing with OS <= 10.5. It occurs when a dead key followed by a non-accented + key are pressed. Say, for example, that keys '^' followed by 'p' are pressed on a French or German keyboard. Resulting + messages are: [myview setMarkedText:@"^"], [myview insertText:@"^"], [myview insertText:@"p"], [FLTextView insertText:@"^p"]. + The 2nd '^' replaces the marked 1st one, followed by p^p. The resulting text in the widget is "^p^p" instead of the + desired "^p". To avoid that, the FLTextView object is deactivated by the insertText: message and reactivated after the handleEvent: message has been processed. NSEvent's during a character composition sequence: @@ -2137,7 +2135,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; The global variable views_use_CA is set to YES when such change applies, that is, for apps running under 10.14 and linked to SDK 10.14. When views_use_CA is NO, views are not supposed to be layer-backed. - + Most drawing is done by [FLView drawRect:] which the system calls when a window is created or resized and when Fl_Window_Driver::flush() runs which sends the display message to the view. Within drawRect:, [[NSGraphicsContext currentContext] CGContext] @@ -2148,7 +2146,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; At the beginning of drawRect:, aux_bitmap is copied to the graphics context, then drawRect: does its drawing, finally the view's graphical content as it is at the end of drawRect: is copied back to aux_bitmap. - + A problem arises to support drawing done outside Fl_Window_Driver::flush(), that is, after the app calls Fl_Window::make_current() at any time it wants. That situation is identified by the condition (views_use_CA && !through_drawRect). @@ -2158,7 +2156,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; of the FLView and also calls [view setNeedsDisplay:YES] which instructs the system to run drawRect: at the next event loop. Later, when drawRect: runs, the content of aux_bitmap is copied to drawRect's graphics context and direct_draw is set to NO. - + OpenGL windows remain processed under 10.14 as before. */ @@ -2291,11 +2289,11 @@ static FLTextInputContext* fltextinputcontext_instance = nil; } - (BOOL)acceptsFirstResponder -{ +{ return [[self window] parentWindow] ? NO : YES; // 10.2 } - (BOOL)performKeyEquivalent:(NSEvent*)theEvent -{ +{ //NSLog(@"performKeyEquivalent:"); fl_lock_function(); cocoaKeyboardHandler(theEvent); @@ -2322,7 +2320,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; return handled; } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent -{ +{ Fl_Window *w = [(FLWindow*)[theEvent window] getFl_Window]; Fl_Window *first = Fl::first_window(); return (first == w || !first->modal()); @@ -2417,7 +2415,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; unsigned short keycode = [theEvent keyCode]; if (!macKeyLookUp) macKeyLookUp = Fl_Darwin_System_Driver::compute_macKeyLookUp(); Fl::e_keysym = Fl::e_original_keysym = macKeyLookUp[keycode & 0x7f]; - if ( Fl::e_keysym ) + if ( Fl::e_keysym ) sendEvent = ( prevMods<mods ) ? FL_KEYBOARD : FL_KEYUP; Fl::e_length = 0; Fl::e_text = (char*)""; @@ -2448,18 +2446,18 @@ static FLTextInputContext* fltextinputcontext_instance = nil; int ret = Fl::handle( FL_DND_DRAG, target ); Fl_Cocoa_Screen_Driver::breakMacEventLoop(); fl_unlock_function(); - // if the DND started in the same application, Fl::dnd() will not return until + // if the DND started in the same application, Fl::dnd() will not return until // the DND operation is finished. The call below causes the drop indicator // to be drawn correctly (a full event handling would be better...) Fl::flush(); return ret ? NSDragOperationCopy : NSDragOperationNone; } -- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender +- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender { static char *DragData = NULL; fl_lock_function(); Fl_Window *target = [(FLWindow*)[self window] getFl_Window]; - if ( !Fl::handle( FL_DND_RELEASE, target ) ) { + if ( !Fl::handle( FL_DND_RELEASE, target ) ) { Fl_Cocoa_Screen_Driver::breakMacEventLoop(); fl_unlock_function(); return NO; @@ -2565,7 +2563,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; received = (NSString*)aString; } /*NSLog(@"insertText='%@' l=%d Fl::compose_state=%d range=%d,%d", - received,strlen([received UTF8String]),Fl::compose_state,replacementRange.location,replacementRange.length);*/ + received,strlen([received UTF8String]),Fl::compose_state,replacementRange.location,replacementRange.length);*/ fl_lock_function(); Fl_Window *target = [(FLWindow*)[self window] getFl_Window]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 @@ -2589,7 +2587,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; if (in_key_event && Fl::e_length) [FLView concatEtext:received]; else [FLView prepareEtext:received]; Fl_Cocoa_Screen_Driver::next_marked_length = 0; - // We can get called outside of key events (e.g., from the character palette, from CJK text input). + // We can get called outside of key events (e.g., from the character palette, from CJK text input). BOOL palette = !(in_key_event || Fl::compose_state); if (palette) Fl::e_keysym = 0; // YES if key has text attached @@ -2622,9 +2620,9 @@ static FLTextInputContext* fltextinputcontext_instance = nil; received = (NSString*)aString; } fl_lock_function(); - /*NSLog(@"setMarkedText:%@ l=%d newSelection=%d,%d Fl::compose_state=%d replacement=%d,%d", - received, strlen([received UTF8String]), newSelection.location, newSelection.length, Fl::compose_state, - replacementRange.location, replacementRange.length);*/ + /*NSLog(@"setMarkedText:%@ l=%d newSelection=%d,%d Fl::compose_state=%d replacement=%d,%d", + received, strlen([received UTF8String]), newSelection.location, newSelection.length, Fl::compose_state, + replacementRange.location, replacementRange.length);*/ Fl_Window *target = [(FLWindow*)[self window] getFl_Window]; while (replacementRange.length--) { // delete replacementRange.length characters before insertion point Fl::e_keysym = FL_BackSpace; @@ -2693,7 +2691,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; Fl_Window *wfocus = [(FLWindow*)[self window] getFl_Window]; if (!focus) focus = wfocus; glyphRect.size.width = 0; - + int x, y, height; if (((Fl_Cocoa_Screen_Driver*)Fl::screen_driver())->insertion_point_location(&x, &y, &height)) { glyphRect.origin.x = (CGFloat)x; @@ -2950,7 +2948,7 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() } } int xwm = xp, ywm = yp, bt, bx, by; - + if (!fake_X_wm(w, xwm, ywm, bt, bx, by)) { // menu windows and tooltips if (w->modal()||w->tooltip_window()) { @@ -2964,7 +2962,7 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() else if (w->non_modal()) { winlevel = non_modal_window_level(); } - + if (by+bt) { wp += 2*bx; hp += 2*by+bt; @@ -2977,7 +2975,7 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() xp -= bx; yp -= by+bt; } - + Fl_X *x = new Fl_X; other_xid = 0; // room for doublebuffering image map. On OS X this is only used by overlay windows x->region = 0; @@ -2985,24 +2983,24 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() gc = 0; mapped_to_retina(false); changed_resolution(false); - + NSRect crect; if (w->fullscreen_active()) { int top, bottom, left, right; int sx, sy, sw, sh, X, Y, W, H; - + top = fullscreen_screen_top(); bottom = fullscreen_screen_bottom(); left = fullscreen_screen_left(); right = fullscreen_screen_right(); - + if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { top = Fl::screen_num(w->x(), w->y(), w->w(), w->h()); bottom = top; left = top; right = top; } - + Fl::screen_xywh(sx, sy, sw, sh, top); Y = sy; Fl::screen_xywh(sx, sy, sw, sh, bottom); @@ -3011,9 +3009,9 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() X = sx; Fl::screen_xywh(sx, sy, sw, sh, right); W = sx + sw - X; - + w->resize(X, Y, W, H); - + winstyle = NSBorderlessWindowMask; winlevel = NSStatusWindowLevel; } @@ -3065,7 +3063,7 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() [cw setContentView:myview]; [myview release]; [cw setLevel:winlevel]; - + q_set_window_title(cw, w->label(), w->iconlabel()); NSImage *icon = icon_image; // is a window or default icon present? if (!icon) icon = ((Fl_Cocoa_Screen_Driver*)Fl::screen_driver())->default_icon; @@ -3095,15 +3093,15 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() } // Install DnD handlers [myview registerForDraggedTypes:[NSArray arrayWithObjects:UTF8_pasteboard_type, NSFilenamesPboardType, nil]]; - + if (size_range_set()) size_range(); - + if ( w->border() || (!w->modal() && !w->tooltip_window()) ) { Fl_Tooltip::enter(0); } - + if (w->modal()) Fl::modal_ = w; - + w->set_visible(); if ( w->border() || (!w->modal() && !w->tooltip_window()) ) Fl::handle(FL_FOCUS, w); [cw setDelegate:[FLWindowDelegate singleInstance]]; @@ -3136,7 +3134,7 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow() int old_event = Fl::e_number; w->handle(Fl::e_number = FL_SHOW); Fl::e_number = old_event; - + // if (w->modal()) { Fl::modal_ = w; fl_fix_focus(); } [pool release]; return x; @@ -3221,7 +3219,7 @@ void Fl_Cocoa_Window_Driver::fullscreen_off(int X, int Y, int W, int H) { pWindow->hide(); pWindow->resize(X, Y, W, H); pWindow->show(); - } + } Fl::handle(FL_FULLSCREEN, pWindow); } @@ -3336,29 +3334,29 @@ void Fl_Cocoa_Window_Driver::resize(int X, int Y, int W, int H) { /* * make all drawing go into this window (called by subclass flush() impl.) - + This can be called in 3 different situations: - + 1) When a window is created, resized or moved between low/high resolution displays. macOS sends the drawRect: message to the window view after having prepared the current graphics context to draw to this view. The drawRect: method sets through_drawRect to YES and calls Fl_Window_Driver::flush(). Fl_Window_Driver::flush() calls Fl_Window::flush() that calls Fl_Window::make_current() that uses the graphics context of the window or the layer. The window's draw() function is then executed. - + 2) At each round of the FLTK event loop. Fl::flush() is called, that calls Fl_Cocoa_Window_Driver::flush() on each window that needs drawing. Fl_Cocoa_Window_Driver::flush() sets through_Fl_X_Flush to YES and marks the view as needing display. The view is sent the displayIfNeededIgnoringOpacity or display message which makes the OS send the view the drawRect: message. The program proceeds next as in 1) above. - + 3) An FLTK application can call Fl_Window::make_current() at any time before it draws to a window. This occurs for instance in the idle callback function of the mandelbrot test program. Variables through_Fl_X_flush and through_drawRect equal NO. Before 10.14: The window graphics context is obtained. Subsequent drawing requests go to the window. After 10.14: The layered view is marked as needing display. It will be sent the drawRect: message at the next event loop. Subsequent drawing operations, until drawRect: runs, are sent to view->aux_bitmap. - + CAUTION: it's not possible to call Fl::wait(), Fl::check() nor Fl::ready() while in the draw() function of a widget. Use an idle callback instead. */ @@ -3369,7 +3367,7 @@ void Fl_Cocoa_Window_Driver::make_current() //NSLog(@"region-count=%d damage=%u",i->region?i->region->count:0, pWindow->damage()); fl_window = i->xid; ((Fl_Quartz_Graphics_Driver&)Fl_Graphics_Driver::default_driver()).high_resolution( mapped_to_retina() ); - + if (pWindow->as_overlay_window() && other_xid && changed_resolution()) { destroy_double_buffer(); changed_resolution(false); @@ -3416,7 +3414,7 @@ void Fl_Cocoa_Window_Driver::make_current() if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); // capture gc changes automatically to update the cairo context adequately #endif fl_clip_region( 0 ); - + #if defined(FLTK_USE_CAIRO) // update the cairo_t context if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); @@ -3541,15 +3539,15 @@ static int get_plain_text_from_clipboard(int clipboard) NSInteger len; char *aux_c = NULL; if (![found isEqualToString:UTF8_pasteboard_type]) { - NSString *auxstring; - auxstring = (NSString *)CFStringCreateWithBytes(NULL, - (const UInt8*)[data bytes], - [data length], - [found isEqualToString:@"public.utf16-plain-text"] ? kCFStringEncodingUnicode : kCFStringEncodingMacRoman, - false); - aux_c = strdup([auxstring UTF8String]); - [auxstring release]; - len = strlen(aux_c) + 1; + NSString *auxstring; + auxstring = (NSString *)CFStringCreateWithBytes(NULL, + (const UInt8*)[data bytes], + [data length], + [found isEqualToString:@"public.utf16-plain-text"] ? kCFStringEncodingUnicode : kCFStringEncodingMacRoman, + false); + aux_c = strdup([auxstring UTF8String]); + [auxstring release]; + len = strlen(aux_c) + 1; } else len = [data length] + 1; resize_selection_buffer(len, clipboard); @@ -3564,7 +3562,7 @@ static int get_plain_text_from_clipboard(int clipboard) length = convert_crlf(fl_selection_buffer[clipboard], len - 1); // turn all \r characters into \n: Fl::e_clipboard_type = Fl::clipboard_plain_text; } - } + } return length; } @@ -3697,19 +3695,19 @@ static NSImage *CGBitmapContextToNSImage(CGContextRef c) image = [[NSImage alloc] initWithCGImage:cgimg size:NSZeroSize]; // requires 10.6 CFRelease(cgimg); } - else + else #endif { NSBitmapImageRep *imagerep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL - pixelsWide:CGBitmapContextGetWidth(c) - pixelsHigh:CGBitmapContextGetHeight(c) - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSDeviceRGBColorSpace - bytesPerRow:CGBitmapContextGetBytesPerRow(c) - bitsPerPixel:CGBitmapContextGetBitsPerPixel(c)]; + pixelsWide:CGBitmapContextGetWidth(c) + pixelsHigh:CGBitmapContextGetHeight(c) + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bytesPerRow:CGBitmapContextGetBytesPerRow(c) + bitsPerPixel:CGBitmapContextGetBitsPerPixel(c)]; memcpy([imagerep bitmapData], CGBitmapContextGetData(c), [imagerep bytesPerRow] * [imagerep pixelsHigh]); image = [[NSImage alloc] initWithSize:NSMakeSize([imagerep pixelsWide], [imagerep pixelsHigh])]; [image addRepresentation:imagerep]; @@ -3821,7 +3819,7 @@ int Fl_Cocoa_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int return 1; } -@interface FLaboutItemTarget : NSObject +@interface FLaboutItemTarget : NSObject { } - (BOOL)validateMenuItem:(NSMenuItem *)item; @@ -3840,15 +3838,15 @@ int Fl_Cocoa_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int { NSDictionary *options; options = [NSDictionary dictionaryWithObjectsAndKeys: - [[[NSAttributedString alloc] - initWithString:[NSString stringWithFormat:@" GUI with FLTK %d.%d", - FL_MAJOR_VERSION, FL_MINOR_VERSION ]] autorelease], @"Credits", - nil]; + [[[NSAttributedString alloc] + initWithString:[NSString stringWithFormat:@" GUI with FLTK %d.%d", + FL_MAJOR_VERSION, FL_MINOR_VERSION ]] autorelease], @"Credits", + nil]; [NSApp orderFrontStandardAboutPanelWithOptions:options]; } //#include <FL/Fl_PostScript.H> - (void)printPanel -{ +{ Fl_Printer printer; //Fl_PostScript_File_Device printer; int w, h, ww, wh; @@ -3898,9 +3896,9 @@ static void createAppleMenu(void) NSMenu *mainmenu, *services = nil, *appleMenu; NSMenuItem *menuItem; NSString *title; - + SEL infodictSEL = (fl_mac_os_version >= 100200 ? @selector(localizedInfoDictionary) : @selector(infoDictionary)); - NSString *nsappname = [[[NSBundle mainBundle] performSelector:infodictSEL] objectForKey:@"CFBundleName"]; + NSString *nsappname = [[[NSBundle mainBundle] performSelector:infodictSEL] objectForKey:@"CFBundleName"]; if (nsappname == nil) nsappname = [[NSProcessInfo processInfo] processName]; appleMenu = [[NSMenu alloc] initWithTitle:@""]; @@ -3913,10 +3911,10 @@ static void createAppleMenu(void) // Print front window title = NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::print], nil); if ([title length] > 0) { - menuItem = [appleMenu - addItemWithTitle:title - action:@selector(printPanel) - keyEquivalent:@""]; + menuItem = [appleMenu + addItemWithTitle:title + action:@selector(printPanel) + keyEquivalent:@""]; [menuItem setTarget:about]; [menuItem setEnabled:YES]; [appleMenu addItem:[NSMenuItem separatorItem]]; @@ -3924,30 +3922,30 @@ static void createAppleMenu(void) if (fl_mac_os_version >= 100400) { // services+hide+quit already in menu in OS 10.3 // Services Menu services = [[NSMenu alloc] initWithTitle:@""]; - menuItem = [appleMenu - addItemWithTitle:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::services], nil) - action:nil - keyEquivalent:@""]; + menuItem = [appleMenu + addItemWithTitle:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::services], nil) + action:nil + keyEquivalent:@""]; [appleMenu setSubmenu:services forItem:menuItem]; [appleMenu addItem:[NSMenuItem separatorItem]]; // Hide AppName title = [NSString stringWithFormat:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::hide],nil), nsappname]; - [appleMenu addItemWithTitle:title - action:@selector(hide:) - keyEquivalent:@"h"]; + [appleMenu addItemWithTitle:title + action:@selector(hide:) + keyEquivalent:@"h"]; // Hide Others - menuItem = [appleMenu - addItemWithTitle:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::hide_others] , nil) - action:@selector(hideOtherApplications:) - keyEquivalent:@"h"]; + menuItem = [appleMenu + addItemWithTitle:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::hide_others] , nil) + action:@selector(hideOtherApplications:) + keyEquivalent:@"h"]; [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; // Show All [appleMenu addItemWithTitle:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::show] , nil) - action:@selector(unhideAllApplications:) keyEquivalent:@""]; + action:@selector(unhideAllApplications:) keyEquivalent:@""]; [appleMenu addItem:[NSMenuItem separatorItem]]; // Quit AppName title = [NSString stringWithFormat:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::quit] , nil), - nsappname]; + nsappname]; menuItem = [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; @@ -3959,8 +3957,8 @@ static void createAppleMenu(void) mainmenu = [[NSMenu alloc] initWithTitle:@""]; [mainmenu addItem:menuItem]; if (fl_mac_os_version < 100600) { - // [NSApp setAppleMenu:appleMenu]; - // to avoid compiler warning raised by use of undocumented setAppleMenu : + // [NSApp setAppleMenu:appleMenu]; + // to avoid compiler warning raised by use of undocumented setAppleMenu : [NSApp performSelector:@selector(setAppleMenu:) withObject:appleMenu]; } [NSApp setMainMenu:mainmenu]; @@ -3987,11 +3985,11 @@ static NSImage *imageFromText(const char *text, int *pwidth, int *pheight) fl_font(FL_HELVETICA, 10); p = text; int nl = 0; - while(nl < 100 && (q=strchr(p, '\n')) != NULL) { - nl++; + while(nl < 100 && (q=strchr(p, '\n')) != NULL) { + nl++; w2 = int(fl_width(p, q - p)); if (w2 > width) width = w2; - p = q + 1; + p = q + 1; } if (text[ ltext - 1] != '\n') { nl++; @@ -4067,12 +4065,12 @@ int Fl_Cocoa_Screen_Driver::dnd(int use_selection) CFDataRef text = CFDataCreate(kCFAllocatorDefault, (UInt8*)fl_selection_buffer[0], fl_selection_length[0]); if (text==NULL) return false; NSAutoreleasePool *localPool; - localPool = [[NSAutoreleasePool alloc] init]; + localPool = [[NSAutoreleasePool alloc] init]; Fl_Widget *w = Fl::pushed(); Fl_Window *win = w->top_window(); FLView *myview = (FLView*)[Fl_X::i(win)->xid contentView]; NSEvent *theEvent = [NSApp currentEvent]; - + int width, height; NSImage *image; if (use_selection) { @@ -4081,7 +4079,7 @@ int Fl_Cocoa_Screen_Driver::dnd(int use_selection) } else { image = defaultDragImage(&width, &height); } - + NSPoint pt = [theEvent locationInWindow]; pt.x -= width/2; pt.y -= height/2; @@ -4528,7 +4526,3 @@ void Fl_Cocoa_Screen_Driver::default_icons(const Fl_RGB_Image *icons[], int coun default_icon = rgb_to_nsimage(icons[0]); } } - -// -// End of "$Id$". -// diff --git a/src/Fl_compose.cxx b/src/Fl_compose.cxx index b494f3623..e05819eb2 100644 --- a/src/Fl_compose.cxx +++ b/src/Fl_compose.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Character compose processing for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -31,19 +29,19 @@ int Fl::compose_state = 0; /** Any text editing widget should call this for each FL_KEYBOARD event. Use of this function is very simple. - + <p>If <i>true</i> is returned, then it has modified the Fl::event_text() and Fl::event_length() to a set of <i>bytes</i> to insert (it may be of zero length!). It will also set the "del" parameter to the number of <i>bytes</i> to the left of the cursor to delete, this is used to delete the results of the previous call to Fl::compose(). - + <p>If <i>false</i> is returned, the keys should be treated as function keys, and del is set to zero. You could insert the text anyways, if you don't know what else to do. - - <p>On the Mac OS platform, text input can involve marked text, that is, + + <p>On the Mac OS platform, text input can involve marked text, that is, temporary text replaced by other text during the input process. This occurs, e.g., when using dead keys or when entering CJK characters. Text editing widgets should preferentially signal @@ -53,10 +51,10 @@ int Fl::compose_state = 0; current insertion point. Widgets should also call <tt>void Fl::reset_marked_text()</tt> when processing FL_UNFOCUS events. Optionally, widgets can also call - <tt>void Fl::insertion_point_location(int x, int y, int height)</tt> to indicate the window - coordinates of the bottom of the current insertion point and the line height. - This way, auxiliary windows that help choosing among alternative characters - appear just below the insertion point. If widgets don't do that, + <tt>void Fl::insertion_point_location(int x, int y, int height)</tt> to indicate the window + coordinates of the bottom of the current insertion point and the line height. + This way, auxiliary windows that help choosing among alternative characters + appear just below the insertion point. If widgets don't do that, auxiliary windows appear at the widget's bottom. The Fl_Input and Fl_Text_Editor widgets underline marked text. If none of this is done by a user-defined text editing widget, @@ -64,7 +62,7 @@ int Fl::compose_state = 0; Finally, text editing widgets should call <tt>set_flag(MAC_USE_ACCENTS_MENU);</tt> in their constructor if they want to use the feature introduced with Mac OS 10.7 "Lion" where pressing and holding certain keys on the keyboard opens an accented-character menu window. - + <p>Though the current implementation returns immediately, future versions may take quite awhile, as they may pop up a window or do other user-interface things to allow characters to be selected. @@ -84,7 +82,3 @@ void Fl::compose_reset() Fl::screen_driver()->compose_reset(); } -// -// End of "$Id$" -// - diff --git a/src/Fl_display.cxx b/src/Fl_display.cxx index ea622299f..1a78cba68 100644 --- a/src/Fl_display.cxx +++ b/src/Fl_display.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Display function for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Startup method to set what display to use. @@ -23,19 +21,15 @@ #include "Fl_Screen_Driver.H" /** - \brief Sets the X display to use for all windows. + \brief Sets the X display to use for all windows. - Actually this just sets the environment variable $DISPLAY to the passed string, - so this only works before you show() the first window or otherwise open the + Actually this just sets the environment variable $DISPLAY to the passed string, + so this only works before you show() the first window or otherwise open the display. - + This does nothing on other platforms. */ void Fl::display(const char *d) { screen_driver()->display(d); } - -// -// End of "$Id$". -// diff --git a/src/Fl_get_key.cxx b/src/Fl_get_key.cxx index 5bfbb5f1a..3a6382ff8 100644 --- a/src/Fl_get_key.cxx +++ b/src/Fl_get_key.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Keyboard state routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -52,7 +50,3 @@ int Fl_X11_System_Driver::get_key(int k) { } #endif // FL_CFG_SYS_POSIX - -// -// End of "$Id$". -// diff --git a/src/Fl_get_key_mac.cxx b/src/Fl_get_key_mac.cxx index 6e3ad89c8..93f8e9210 100644 --- a/src/Fl_get_key_mac.cxx +++ b/src/Fl_get_key_mac.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS keyboard state routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Return the current state of a key. Keys are named by fltk symbols, @@ -178,38 +176,38 @@ enum { // convert an FLTK (X) keysym to a MacOS symbol: // This table is in numeric order by FLTK symbol order for binary search. static const struct {unsigned short vk, fltk;} vktab[] = { - { kVK_Space, ' ' }, { kVK_ANSI_Quote, '\'' }, { kVK_ANSI_Comma, ',' }, { kVK_ANSI_Minus, '-' }, { kVK_ANSI_Period, '.' }, { kVK_ANSI_Slash, '/' }, - { kVK_ANSI_0, '0' }, { kVK_ANSI_1, '1' }, { kVK_ANSI_2, '2' }, { kVK_ANSI_3, '3' }, - { kVK_ANSI_4, '4' }, { kVK_ANSI_5, '5' }, { kVK_ANSI_6, '6' }, { kVK_ANSI_7, '7' }, + { kVK_Space, ' ' }, { kVK_ANSI_Quote, '\'' }, { kVK_ANSI_Comma, ',' }, { kVK_ANSI_Minus, '-' }, { kVK_ANSI_Period, '.' }, { kVK_ANSI_Slash, '/' }, + { kVK_ANSI_0, '0' }, { kVK_ANSI_1, '1' }, { kVK_ANSI_2, '2' }, { kVK_ANSI_3, '3' }, + { kVK_ANSI_4, '4' }, { kVK_ANSI_5, '5' }, { kVK_ANSI_6, '6' }, { kVK_ANSI_7, '7' }, { kVK_ANSI_8, '8' }, { kVK_ANSI_9, '9' }, { kVK_ANSI_Semicolon, ';' }, { kVK_ANSI_Equal, '=' }, - { kVK_ANSI_A, 'A' }, { kVK_ANSI_B, 'B' }, { kVK_ANSI_C, 'C' }, { kVK_ANSI_D, 'D' }, - { kVK_ANSI_E, 'E' }, { kVK_ANSI_F, 'F' }, { kVK_ANSI_G, 'G' }, { kVK_ANSI_H, 'H' }, - { kVK_ANSI_I, 'I' }, { kVK_ANSI_J, 'J' }, { kVK_ANSI_K, 'K' }, { kVK_ANSI_L, 'L' }, - { kVK_ANSI_M, 'M' }, { kVK_ANSI_N, 'N' }, { kVK_ANSI_O, 'O' }, { kVK_ANSI_P, 'P' }, - { kVK_ANSI_Q, 'Q' }, { kVK_ANSI_R, 'R' }, { kVK_ANSI_S, 'S' }, { kVK_ANSI_T, 'T' }, - { kVK_ANSI_U, 'U' }, { kVK_ANSI_V, 'V' }, { kVK_ANSI_W, 'W' }, { kVK_ANSI_X, 'X' }, - { kVK_ANSI_Y, 'Y' }, { kVK_ANSI_Z, 'Z' }, - { kVK_ANSI_LeftBracket, '[' }, { kVK_ANSI_Backslash, '\\' }, { kVK_ANSI_RightBracket, ']' }, { kVK_ANSI_Grave, '`' }, + { kVK_ANSI_A, 'A' }, { kVK_ANSI_B, 'B' }, { kVK_ANSI_C, 'C' }, { kVK_ANSI_D, 'D' }, + { kVK_ANSI_E, 'E' }, { kVK_ANSI_F, 'F' }, { kVK_ANSI_G, 'G' }, { kVK_ANSI_H, 'H' }, + { kVK_ANSI_I, 'I' }, { kVK_ANSI_J, 'J' }, { kVK_ANSI_K, 'K' }, { kVK_ANSI_L, 'L' }, + { kVK_ANSI_M, 'M' }, { kVK_ANSI_N, 'N' }, { kVK_ANSI_O, 'O' }, { kVK_ANSI_P, 'P' }, + { kVK_ANSI_Q, 'Q' }, { kVK_ANSI_R, 'R' }, { kVK_ANSI_S, 'S' }, { kVK_ANSI_T, 'T' }, + { kVK_ANSI_U, 'U' }, { kVK_ANSI_V, 'V' }, { kVK_ANSI_W, 'W' }, { kVK_ANSI_X, 'X' }, + { kVK_ANSI_Y, 'Y' }, { kVK_ANSI_Z, 'Z' }, + { kVK_ANSI_LeftBracket, '[' }, { kVK_ANSI_Backslash, '\\' }, { kVK_ANSI_RightBracket, ']' }, { kVK_ANSI_Grave, '`' }, { kVK_VolumeDown, FL_Volume_Down}, { kVK_Mute, FL_Volume_Mute}, { kVK_VolumeUp, FL_Volume_Up}, { kVK_Delete, FL_BackSpace }, { kVK_Tab, FL_Tab }, { kVK_ISO_Section, FL_Iso_Key }, { kVK_Return, FL_Enter }, /*{ 0x7F, FL_Pause }, - { 0x7F, FL_Scroll_Lock },*/ { kVK_Escape, FL_Escape }, + { 0x7F, FL_Scroll_Lock },*/ { kVK_Escape, FL_Escape }, { kVK_JIS_Kana, FL_Kana}, { kVK_JIS_Eisu, FL_Eisu}, { kVK_JIS_Yen, FL_Yen}, { kVK_JIS_Underscore, FL_JIS_Underscore}, { kVK_Home, FL_Home }, { kVK_LeftArrow, FL_Left }, { kVK_UpArrow, FL_Up }, { kVK_RightArrow, FL_Right }, { kVK_DownArrow, FL_Down }, { kVK_PageUp, FL_Page_Up }, { kVK_PageDown, FL_Page_Down }, { kVK_End, FL_End }, /*{ 0x7F, FL_Print }, { 0x7F, FL_Insert },*/ { 0x6e, FL_Menu }, { kVK_Help, FL_Help }, { kVK_ANSI_KeypadClear, FL_Num_Lock }, - { kVK_ANSI_KeypadEnter, FL_KP_Enter }, { kVK_ANSI_KeypadMultiply, FL_KP+'*' }, { kVK_ANSI_KeypadPlus, FL_KP+'+'}, + { kVK_ANSI_KeypadEnter, FL_KP_Enter }, { kVK_ANSI_KeypadMultiply, FL_KP+'*' }, { kVK_ANSI_KeypadPlus, FL_KP+'+'}, { kVK_JIS_KeypadComma, FL_KP+',' }, - { kVK_ANSI_KeypadMinus, FL_KP+'-' }, { kVK_ANSI_KeypadDecimal, FL_KP+'.' }, { kVK_ANSI_KeypadDivide, FL_KP+'/' }, - { kVK_ANSI_Keypad0, FL_KP+'0' }, { kVK_ANSI_Keypad1, FL_KP+'1' }, { kVK_ANSI_Keypad2, FL_KP+'2' }, { kVK_ANSI_Keypad3, FL_KP+'3' }, - { kVK_ANSI_Keypad4, FL_KP+'4' }, { kVK_ANSI_Keypad5, FL_KP+'5' }, { kVK_ANSI_Keypad6, FL_KP+'6' }, { kVK_ANSI_Keypad7, FL_KP+'7' }, - { kVK_ANSI_Keypad8, FL_KP+'8' }, { kVK_ANSI_Keypad9, FL_KP+'9' }, { kVK_ANSI_KeypadEquals, FL_KP+'=' }, - { kVK_F1, FL_F+1 }, { kVK_F2, FL_F+2 }, { kVK_F3, FL_F+3 }, { kVK_F4, FL_F+4 }, - { kVK_F5, FL_F+5 }, { kVK_F6, FL_F+6 }, { kVK_F7, FL_F+7 }, { kVK_F8, FL_F+8 }, - { kVK_F9, FL_F+9 }, { kVK_F10, FL_F+10 }, { kVK_F11, FL_F+11 }, { kVK_F12, FL_F+12 }, - { kVK_F13, FL_F+13 }, { kVK_F14, FL_F+14 }, { kVK_F15, FL_F+15 }, { kVK_F16, FL_F+16 }, - { kVK_F17, FL_F+17 }, { kVK_F18, FL_F+18 }, { kVK_F19, FL_F+19 }, { kVK_F20, FL_F+20 }, - { kVK_Shift, FL_Shift_L }, { kVK_RightShift, FL_Shift_R }, { kVK_Control, FL_Control_L }, { kVK_RightControl, FL_Control_R }, + { kVK_ANSI_KeypadMinus, FL_KP+'-' }, { kVK_ANSI_KeypadDecimal, FL_KP+'.' }, { kVK_ANSI_KeypadDivide, FL_KP+'/' }, + { kVK_ANSI_Keypad0, FL_KP+'0' }, { kVK_ANSI_Keypad1, FL_KP+'1' }, { kVK_ANSI_Keypad2, FL_KP+'2' }, { kVK_ANSI_Keypad3, FL_KP+'3' }, + { kVK_ANSI_Keypad4, FL_KP+'4' }, { kVK_ANSI_Keypad5, FL_KP+'5' }, { kVK_ANSI_Keypad6, FL_KP+'6' }, { kVK_ANSI_Keypad7, FL_KP+'7' }, + { kVK_ANSI_Keypad8, FL_KP+'8' }, { kVK_ANSI_Keypad9, FL_KP+'9' }, { kVK_ANSI_KeypadEquals, FL_KP+'=' }, + { kVK_F1, FL_F+1 }, { kVK_F2, FL_F+2 }, { kVK_F3, FL_F+3 }, { kVK_F4, FL_F+4 }, + { kVK_F5, FL_F+5 }, { kVK_F6, FL_F+6 }, { kVK_F7, FL_F+7 }, { kVK_F8, FL_F+8 }, + { kVK_F9, FL_F+9 }, { kVK_F10, FL_F+10 }, { kVK_F11, FL_F+11 }, { kVK_F12, FL_F+12 }, + { kVK_F13, FL_F+13 }, { kVK_F14, FL_F+14 }, { kVK_F15, FL_F+15 }, { kVK_F16, FL_F+16 }, + { kVK_F17, FL_F+17 }, { kVK_F18, FL_F+18 }, { kVK_F19, FL_F+19 }, { kVK_F20, FL_F+20 }, + { kVK_Shift, FL_Shift_L }, { kVK_RightShift, FL_Shift_R }, { kVK_Control, FL_Control_L }, { kVK_RightControl, FL_Control_R }, { kVK_CapsLock, FL_Caps_Lock }, { kVK_Command, FL_Meta_L }, { 0x36, FL_Meta_R }, { kVK_Option, FL_Alt_L }, { kVK_RightOption, FL_Alt_R }, { kVK_ForwardDelete, FL_Delete } }; @@ -247,7 +245,7 @@ int Fl_Darwin_System_Driver::get_key(int k) { if (&CGEventSourceKeyState != NULL) { return (int)CGEventSourceKeyState(kCGEventSourceStateCombinedSessionState, fltk2mac(k) ); } - else + else #endif { typedef UInt32 fl_KeyMap[4]; @@ -273,7 +271,3 @@ int Fl_Darwin_System_Driver::get_key(int k) { return (b[i>>3]>>(i&7))&1; } } - -// -// End of "$Id$". -// diff --git a/src/Fl_get_key_win32.cxx b/src/Fl_get_key_win32.cxx index fb6a49238..1768ceb81 100644 --- a/src/Fl_get_key_win32.cxx +++ b/src/Fl_get_key_win32.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows keyboard state routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Return the current state of a key. Keys are named by fltk symbols, @@ -28,75 +26,75 @@ // This table is in numeric order by FLTK symbol order for binary search: static const struct {unsigned short vk, fltk;} vktab[] = { - {VK_SPACE, ' '}, - {'1', '!'}, - {0xde, '\"'}, - {'3', '#'}, - {'4', '$'}, - {'5', '%'}, - {'7', '&'}, - {0xde, '\''}, - {'9', '('}, - {'0', ')'}, - {'8', '*'}, - {0xbb, '+'}, - {0xbc, ','}, - {0xbd, '-'}, - {0xbe, '.'}, - {0xbf, '/'}, - {0xba, ':'}, - {0xba, ';'}, - {0xbc, '<'}, - {0xbb, '='}, - {0xbe, '>'}, - {0xbf, '?'}, - {'2', '@'}, - {0xdb, '['}, - {0xdc, '\\'}, - {0xdd, ']'}, - {'6', '^'}, - {0xbd, '_'}, - {0xc0, '`'}, - {0xdb, '{'}, - {0xdc, '|'}, - {0xdd, '}'}, - {0xc0, '~'}, - {VK_BACK, FL_BackSpace}, - {VK_TAB, FL_Tab}, - {VK_CLEAR, 0xff0b/*XK_Clear*/}, - {0xe2 /*VK_OEM_102*/, FL_Iso_Key}, - {VK_RETURN, FL_Enter}, - {VK_PAUSE, FL_Pause}, - {VK_SCROLL, FL_Scroll_Lock}, - {VK_ESCAPE, FL_Escape}, - {VK_HOME, FL_Home}, - {VK_LEFT, FL_Left}, - {VK_UP, FL_Up}, - {VK_RIGHT, FL_Right}, - {VK_DOWN, FL_Down}, - {VK_PRIOR, FL_Page_Up}, - {VK_NEXT, FL_Page_Down}, - {VK_END, FL_End}, - {VK_SNAPSHOT, FL_Print}, - {VK_INSERT, FL_Insert}, - {VK_APPS, FL_Menu}, - {VK_NUMLOCK, FL_Num_Lock}, -//{VK_???, FL_KP_Enter}, - {VK_MULTIPLY, FL_KP+'*'}, - {VK_ADD, FL_KP+'+'}, - {VK_SUBTRACT, FL_KP+'-'}, - {VK_DECIMAL, FL_KP+'.'}, - {VK_DIVIDE, FL_KP+'/'}, - {VK_LSHIFT, FL_Shift_L}, - {VK_RSHIFT, FL_Shift_R}, - {VK_LCONTROL, FL_Control_L}, - {VK_RCONTROL, FL_Control_R}, - {VK_CAPITAL, FL_Caps_Lock}, - {VK_LWIN, FL_Meta_L}, - {VK_RWIN, FL_Meta_R}, - {VK_LMENU, FL_Alt_L}, - {VK_RMENU, FL_Alt_R}, - {VK_DELETE, FL_Delete} + {VK_SPACE, ' '}, + {'1', '!'}, + {0xde, '\"'}, + {'3', '#'}, + {'4', '$'}, + {'5', '%'}, + {'7', '&'}, + {0xde, '\''}, + {'9', '('}, + {'0', ')'}, + {'8', '*'}, + {0xbb, '+'}, + {0xbc, ','}, + {0xbd, '-'}, + {0xbe, '.'}, + {0xbf, '/'}, + {0xba, ':'}, + {0xba, ';'}, + {0xbc, '<'}, + {0xbb, '='}, + {0xbe, '>'}, + {0xbf, '?'}, + {'2', '@'}, + {0xdb, '['}, + {0xdc, '\\'}, + {0xdd, ']'}, + {'6', '^'}, + {0xbd, '_'}, + {0xc0, '`'}, + {0xdb, '{'}, + {0xdc, '|'}, + {0xdd, '}'}, + {0xc0, '~'}, + {VK_BACK, FL_BackSpace}, + {VK_TAB, FL_Tab}, + {VK_CLEAR, 0xff0b/*XK_Clear*/}, + {0xe2 /*VK_OEM_102*/, FL_Iso_Key}, + {VK_RETURN, FL_Enter}, + {VK_PAUSE, FL_Pause}, + {VK_SCROLL, FL_Scroll_Lock}, + {VK_ESCAPE, FL_Escape}, + {VK_HOME, FL_Home}, + {VK_LEFT, FL_Left}, + {VK_UP, FL_Up}, + {VK_RIGHT, FL_Right}, + {VK_DOWN, FL_Down}, + {VK_PRIOR, FL_Page_Up}, + {VK_NEXT, FL_Page_Down}, + {VK_END, FL_End}, + {VK_SNAPSHOT, FL_Print}, + {VK_INSERT, FL_Insert}, + {VK_APPS, FL_Menu}, + {VK_NUMLOCK, FL_Num_Lock}, +//{VK_???, FL_KP_Enter}, + {VK_MULTIPLY, FL_KP+'*'}, + {VK_ADD, FL_KP+'+'}, + {VK_SUBTRACT, FL_KP+'-'}, + {VK_DECIMAL, FL_KP+'.'}, + {VK_DIVIDE, FL_KP+'/'}, + {VK_LSHIFT, FL_Shift_L}, + {VK_RSHIFT, FL_Shift_R}, + {VK_LCONTROL, FL_Control_L}, + {VK_RCONTROL, FL_Control_R}, + {VK_CAPITAL, FL_Caps_Lock}, + {VK_LWIN, FL_Meta_L}, + {VK_RWIN, FL_Meta_R}, + {VK_LMENU, FL_Alt_L}, + {VK_RMENU, FL_Alt_R}, + {VK_DELETE, FL_Delete} }; static int fltk2ms(int fltk) { @@ -124,7 +122,3 @@ int Fl_WinAPI_System_Driver::get_key(int k) { GetKeyboardState(foo); return foo[fltk2ms(k)]&~1; } - -// -// End of "$Id$". -// diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx index baac7dcf0..e1b7fc2f4 100644 --- a/src/Fl_get_system_colors.cxx +++ b/src/Fl_get_system_colors.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // System color support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -31,9 +29,9 @@ #include "tile.xpm" /** - Changes fl_color(FL_BACKGROUND_COLOR) to the given color, - and changes the gray ramp from 32 to 56 to black to white. These are - the colors used as backgrounds by almost all widgets and used to draw + Changes fl_color(FL_BACKGROUND_COLOR) to the given color, + and changes the gray ramp from 32 to 56 to black to white. These are + the colors used as backgrounds by almost all widgets and used to draw the edges of all the boxtypes. */ void Fl::background(uchar r, uchar g, uchar b) { @@ -49,9 +47,9 @@ void Fl::background(uchar r, uchar g, uchar b) { for (int i = 0; i < FL_NUM_GRAY; i++) { double gray = i/(FL_NUM_GRAY-1.0); Fl::set_color(fl_gray_ramp(i), - uchar(pow(gray,powr)*255+.5), - uchar(pow(gray,powg)*255+.5), - uchar(pow(gray,powb)*255+.5)); + uchar(pow(gray,powr)*255+.5), + uchar(pow(gray,powg)*255+.5), + uchar(pow(gray,powb)*255+.5)); } } @@ -65,9 +63,9 @@ void Fl::foreground(uchar r, uchar g, uchar b) { /** - Changes the alternative background color. This color is used as a + Changes the alternative background color. This color is used as a background by Fl_Input and other text widgets. - <P>This call may change fl_color(FL_FOREGROUND_COLOR) if it + <P>This call may change fl_color(FL_FOREGROUND_COLOR) if it does not provide sufficient contrast to FL_BACKGROUND2_COLOR. */ void Fl::background2(uchar r, uchar g, uchar b) { @@ -96,7 +94,7 @@ int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) { This is done by Fl_Window::show(argc,argv) before applying the -fg and -bg switches. - + On X this reads some common values from the Xdefaults database. KDE users can set these values by running the "krdb" program, and newer versions of KDE set this automatically if you check the "apply @@ -112,24 +110,24 @@ void Fl::get_system_colors() #define D1 BORDER_WIDTH #define D2 (BORDER_WIDTH+BORDER_WIDTH) -extern void fl_up_box(int, int, int, int, Fl_Color); -extern void fl_down_box(int, int, int, int, Fl_Color); -extern void fl_thin_up_box(int, int, int, int, Fl_Color); -extern void fl_thin_down_box(int, int, int, int, Fl_Color); -extern void fl_round_up_box(int, int, int, int, Fl_Color); -extern void fl_round_down_box(int, int, int, int, Fl_Color); +extern void fl_up_box(int, int, int, int, Fl_Color); +extern void fl_down_box(int, int, int, int, Fl_Color); +extern void fl_thin_up_box(int, int, int, int, Fl_Color); +extern void fl_thin_down_box(int, int, int, int, Fl_Color); +extern void fl_round_up_box(int, int, int, int, Fl_Color); +extern void fl_round_down_box(int, int, int, int, Fl_Color); -extern void fl_up_frame(int, int, int, int, Fl_Color); -extern void fl_down_frame(int, int, int, int, Fl_Color); -extern void fl_thin_up_frame(int, int, int, int, Fl_Color); -extern void fl_thin_down_frame(int, int, int, int, Fl_Color); +extern void fl_up_frame(int, int, int, int, Fl_Color); +extern void fl_down_frame(int, int, int, int, Fl_Color); +extern void fl_thin_up_frame(int, int, int, int, Fl_Color); +extern void fl_thin_down_frame(int, int, int, int, Fl_Color); #ifndef FL_DOXYGEN -const char *Fl::scheme_ = (const char *)0; // current scheme -Fl_Image *Fl::scheme_bg_ = (Fl_Image *)0; // current background image for the scheme +const char *Fl::scheme_ = (const char *)0; // current scheme +Fl_Image *Fl::scheme_bg_ = (Fl_Image *)0; // current background image for the scheme #endif -static Fl_Pixmap tile(tile_xpm); +static Fl_Pixmap tile(tile_xpm); /** @@ -321,8 +319,3 @@ int Fl::reload_scheme() { return 1; } - - -// -// End of "$Id$". -// diff --git a/src/Fl_grab.cxx b/src/Fl_grab.cxx index 752ccb08c..2913a1642 100644 --- a/src/Fl_grab.cxx +++ b/src/Fl_grab.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Grab/release code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -31,8 +29,3 @@ void Fl::grab(Fl_Window *win) { screen_driver()->grab(win); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx index 7c18b6e9d..732ceb905 100644 --- a/src/Fl_lock.cxx +++ b/src/Fl_lock.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Multi-threading support code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -131,12 +129,12 @@ int Fl::get_awake_handler_(Fl_Awake_Handler &func, void *&data) /** Let the main thread know an update is pending and have it call a specific function. - Registers a function that will be - called by the main thread during the next message handling cycle. - Returns 0 if the callback function was registered, + Registers a function that will be + called by the main thread during the next message handling cycle. + Returns 0 if the callback function was registered, and -1 if registration failed. Over a thousand awake callbacks can be registered simultaneously. - + \see Fl::awake(void* message=0) */ int Fl::awake(Fl_Awake_Handler func, void *data) { @@ -152,19 +150,19 @@ int Fl::awake(Fl_Awake_Handler func, void *data) { data. The main thread must call lock() to initialize the threading support in FLTK. lock() will return non-zero if threading is not available on the platform. - + Child threads must call unlock() when they are done accessing FLTK. - + When the wait() method is waiting for input or timeouts, child threads are given access to FLTK. Similarly, when the main thread needs to do processing, it will wait until all child threads have called unlock() before processing additional data. - + \return 0 if threading is available on the platform; non-zero otherwise. - + See also: \ref advanced_multithreading */ /** \fn void Fl::unlock() @@ -172,26 +170,26 @@ int Fl::awake(Fl_Awake_Handler func, void *data) { using the lock() method. Child threads should call this method as soon as they are finished accessing FLTK. - + See also: \ref advanced_multithreading */ /** \fn void Fl::awake(void* msg) - Sends a message pointer to the main thread, - causing any pending Fl::wait() call to - terminate so that the main thread can retrieve the message and any pending + Sends a message pointer to the main thread, + causing any pending Fl::wait() call to + terminate so that the main thread can retrieve the message and any pending redraws can be processed. - - Multiple calls to Fl::awake() will queue multiple pointers - for the main thread to process, up to a system-defined (typically several - thousand) depth. The default message handler saves the last message which - can be accessed using the + + Multiple calls to Fl::awake() will queue multiple pointers + for the main thread to process, up to a system-defined (typically several + thousand) depth. The default message handler saves the last message which + can be accessed using the Fl::thread_message() function. In the context of a threaded application, a call to Fl::awake() with no argument will trigger event loop handling in the main thread. Since it is not possible to call Fl::flush() from a subsidiary thread, Fl::awake() is the best (and only, really) substitute. - + See also: \ref advanced_multithreading */ #if defined(FL_CFG_SYS_WIN32) @@ -330,7 +328,7 @@ void* Fl_Posix_System_Driver::thread_message() { } static void thread_awake_cb(int fd, void*) { - if (read(fd, &thread_message_, sizeof(void*))==0) { + if (read(fd, &thread_message_, sizeof(void*))==0) { /* This should never happen */ } Fl_Awake_Handler func; @@ -459,7 +457,3 @@ int Fl::lock() { void Fl::unlock() { Fl::system_driver()->unlock(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_own_colormap.cxx b/src/Fl_own_colormap.cxx index cc2ac180d..1615f582f 100644 --- a/src/Fl_own_colormap.cxx +++ b/src/Fl_own_colormap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Private colormap support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Using the default system colormap can be a bad idea on PseudoColor @@ -52,8 +50,8 @@ void Fl_X11_System_Driver::own_colormap() { XQueryColors(fl_display, fl_colormap, colors, 16); // Create a new colormap... fl_colormap = XCreateColormap(fl_display, - RootWindow(fl_display,fl_screen), - fl_visual->visual, AllocNone); + RootWindow(fl_display,fl_screen), + fl_visual->visual, AllocNone); // Copy those first 16 colors to our own colormap: for (i = 0; i < 16; i ++) XAllocColor(fl_display, fl_colormap, colors + i); @@ -66,13 +64,9 @@ void Fl_X11_System_Driver::own_colormap() { Makes FLTK use its <a href="fltk-colormap.png">own colormap</a>. This may make FLTK display better and will reduce conflicts with other programs that want lots of colors. However the colors may flash as you move the cursor between windows. - + <P>This does nothing if the current visual is not colormapped. */ void Fl::own_colormap() { Fl::system_driver()->own_colormap(); } - -// -// End of "$Id$". -// diff --git a/src/Fl_visual.cxx b/src/Fl_visual.cxx index c54d95529..da088cb17 100644 --- a/src/Fl_visual.cxx +++ b/src/Fl_visual.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Visual support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Set the default visual according to passed switches: @@ -27,9 +25,9 @@ if the default visual satisfies the capabilities, or if no visual satisfies the capabilities, or on systems that don't have such brain-dead notions. - + <P>Only the following combinations do anything useful: - + <UL> <LI>Fl::visual(FL_RGB) <BR>Full/true color (if there are several depths FLTK chooses the @@ -43,14 +41,14 @@ available. <BR> </LI> <LI>Fl::visual(FL_DOUBLE|FL_INDEX) - <BR>Hardware double buffering. Call this if you are going to use + <BR>Hardware double buffering. Call this if you are going to use Fl_Double_Window. <BR> </LI> <LI>Fl::visual(FL_DOUBLE|FL_RGB)</LI> <LI>Fl::visual(FL_DOUBLE|FL_RGB8) <BR>Hardware double buffering and full color. </UL> - + <P>This returns true if the system has the capabilities by default or FLTK succeeded in turning them on. Your program will still work even if this returns false (it just won't look as good). @@ -59,8 +57,3 @@ int Fl::visual(int flags) { return screen_driver()->visual(flags); } - - -// -// End of "$Id$". -// diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 4ec2531ff..d234f7afd 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows-specific code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // This file contains Windows-specific code for FLTK which is always linked @@ -81,7 +79,7 @@ void fl_cleanup_dc_list(void); #endif #if !defined(NO_TRACK_MOUSE) -# include <commctrl.h> // TrackMouseEvent +# include <commctrl.h> // TrackMouseEvent #endif #if defined(__GNUC__) @@ -261,7 +259,7 @@ static Fl_Window *track_mouse_win = 0; // current TrackMouseEvent() window #endif #ifndef WHEEL_DELTA -# define WHEEL_DELTA 120 // according to MSDN. +# define WHEEL_DELTA 120 // according to MSDN. #endif // This is only defined on Vista and upwards... @@ -354,7 +352,7 @@ void Fl_WinAPI_System_Driver::remove_fd(int n, int events) { if (fd[i].fd == n) { short e = fd[i].events & ~events; if (!e) - continue; // if no events left, delete this fd + continue; // if no events left, delete this fd fd[i].events = e; } // move it down in the array if necessary: @@ -433,22 +431,22 @@ double Fl_WinAPI_Screen_Driver::wait(double time_to_wait) { if (get_wsock_mod() && s_wsock_select(maxfd + 1, &fdt[0], &fdt[1], &fdt[2], &t)) { // We got something - do the callback! for (int i = 0; i < nfds; i++) { - SOCKET f = fd[i].fd; - short revents = 0; - if (fl_wsk_fd_is_set(f, &fdt[0])) - revents |= FL_READ; - if (fl_wsk_fd_is_set(f, &fdt[1])) - revents |= FL_WRITE; - if (fl_wsk_fd_is_set(f, &fdt[2])) - revents |= FL_EXCEPT; - if (fd[i].events & revents) - fd[i].cb(f, fd[i].arg); + SOCKET f = fd[i].fd; + short revents = 0; + if (fl_wsk_fd_is_set(f, &fdt[0])) + revents |= FL_READ; + if (fl_wsk_fd_is_set(f, &fdt[1])) + revents |= FL_WRITE; + if (fl_wsk_fd_is_set(f, &fdt[2])) + revents |= FL_EXCEPT; + if (fd[i].events & revents) + fd[i].cb(f, fd[i].arg); } time_to_wait = 0.0; // just peek for any messages } else { // we need to check them periodically, so set a short timeout: if (time_to_wait > .001) - time_to_wait = .001; + time_to_wait = .001; } } @@ -673,15 +671,15 @@ public: // Predict size of \r\n conversion buffer for (i = in, lencount = inlen; lencount > 0; lencount--) { if (*i == '\r' && *(i + 1) == '\n' && lencount >= 2) { // leave \r\n untranslated - i += 2; - outlen += 2; - lencount--; + i += 2; + outlen += 2; + lencount--; } else if (*i == '\n') { // \n by itself? leave room to insert \r - i++; - outlen += 2; + i++; + outlen += 2; } else { - ++i; - ++outlen; + ++i; + ++outlen; } } // Alloc conversion buffer + NULL @@ -689,14 +687,14 @@ public: // Handle \n -> \r\n conversion for (i = in, o = out, lencount = inlen; lencount > 0; lencount--) { if (*i == '\r' && *(i + 1) == '\n' && lencount >= 2) { // leave \r\n untranslated - *o++ = *i++; - *o++ = *i++; - lencount--; + *o++ = *i++; + *o++ = *i++; + lencount--; } else if (*i == '\n') { // \n by itself? insert \r - *o++ = '\r'; - *o++ = *i++; + *o++ = '\r'; + *o++ = *i++; } else { - *o++ = *i++; + *o++ = *i++; } } *o++ = 0; @@ -886,9 +884,9 @@ void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch RECT rect = {0, 0, width, height}; Fl_Image_Surface *surf = new Fl_Image_Surface(width, height, 1); Fl_Surface_Device::push_current(surf); - fl_color(FL_WHITE); // draw white background + fl_color(FL_WHITE); // draw white background fl_rectf(0, 0, width, height); - rect.right *= scaling; // apply scaling to the metafile draw operation + rect.right *= scaling; // apply scaling to the metafile draw operation rect.bottom *= scaling; PlayEnhMetaFile((HDC)fl_graphics_driver->gc(), (HENHMETAFILE)h, &rect); // draw metafile to offscreen buffer image = surf->image(); @@ -1008,7 +1006,7 @@ void fl_get_codepage() { HWND fl_capture; static int mouse_event(Fl_Window *window, int what, int button, - WPARAM wParam, LPARAM lParam) { + WPARAM wParam, LPARAM lParam) { static int px, py, pmx, pmy; POINT pt; float scale = Fl_Graphics_Driver::default_driver().scale(); @@ -1042,18 +1040,18 @@ static int mouse_event(Fl_Window *window, int what, int button, switch (what) { case 1: // double-click if (Fl::e_is_click) { - Fl::e_clicks++; - goto J1; + Fl::e_clicks++; + goto J1; } case 0: // single-click Fl::e_clicks = 0; J1: #ifdef USE_CAPTURE_MOUSE_WIN if (!fl_capture) - SetCapture(fl_xid(mouse_window)); // use mouse window + SetCapture(fl_xid(mouse_window)); // use mouse window #else if (!fl_capture) - SetCapture(fl_xid(window)); // use main window + SetCapture(fl_xid(window)); // use main window #endif Fl::e_keysym = FL_Button + button; Fl::e_is_click = 1; @@ -1063,7 +1061,7 @@ static int mouse_event(Fl_Window *window, int what, int button, case 2: // release: if (!fl_capture) - ReleaseCapture(); + ReleaseCapture(); Fl::e_keysym = FL_Button + button; return Fl::handle(FL_RELEASE, window); @@ -1071,11 +1069,11 @@ static int mouse_event(Fl_Window *window, int what, int button, default: // avoid compiler warning // Windows produces extra events even if the mouse does not move, ignore em: if (Fl::e_x_root == pmx && Fl::e_y_root == pmy) - return 1; + return 1; pmx = Fl::e_x_root; pmy = Fl::e_y_root; if (abs(Fl::e_x_root - px) > 5 || abs(Fl::e_y_root - py) > 5) - Fl::e_is_click = 0; + Fl::e_is_click = 0; return Fl::handle(FL_MOVE, window); } } @@ -1086,68 +1084,68 @@ static int mouse_event(Fl_Window *window, int what, int button, static const struct { unsigned short vk, fltk, extended; } vktab[] = { - {VK_BACK, FL_BackSpace}, - {VK_TAB, FL_Tab}, - {VK_CLEAR, FL_KP+'5', 0xff0b/*XK_Clear*/}, - {VK_RETURN, FL_Enter, FL_KP_Enter}, - {VK_SHIFT, FL_Shift_L, FL_Shift_R}, - {VK_CONTROL, FL_Control_L, FL_Control_R}, - {VK_MENU, FL_Alt_L, FL_Alt_R}, - {VK_PAUSE, FL_Pause}, - {VK_CAPITAL, FL_Caps_Lock}, - {VK_ESCAPE, FL_Escape}, - {VK_SPACE, ' '}, - {VK_PRIOR, FL_KP+'9', FL_Page_Up}, - {VK_NEXT, FL_KP+'3', FL_Page_Down}, - {VK_END, FL_KP+'1', FL_End}, - {VK_HOME, FL_KP+'7', FL_Home}, - {VK_LEFT, FL_KP+'4', FL_Left}, - {VK_UP, FL_KP+'8', FL_Up}, - {VK_RIGHT, FL_KP+'6', FL_Right}, - {VK_DOWN, FL_KP+'2', FL_Down}, - {VK_SNAPSHOT, FL_Print}, // does not work on NT - {VK_INSERT, FL_KP+'0', FL_Insert}, - {VK_DELETE, FL_KP+'.', FL_Delete}, - {VK_LWIN, FL_Meta_L}, - {VK_RWIN, FL_Meta_R}, - {VK_APPS, FL_Menu}, + {VK_BACK, FL_BackSpace}, + {VK_TAB, FL_Tab}, + {VK_CLEAR, FL_KP+'5', 0xff0b/*XK_Clear*/}, + {VK_RETURN, FL_Enter, FL_KP_Enter}, + {VK_SHIFT, FL_Shift_L, FL_Shift_R}, + {VK_CONTROL, FL_Control_L, FL_Control_R}, + {VK_MENU, FL_Alt_L, FL_Alt_R}, + {VK_PAUSE, FL_Pause}, + {VK_CAPITAL, FL_Caps_Lock}, + {VK_ESCAPE, FL_Escape}, + {VK_SPACE, ' '}, + {VK_PRIOR, FL_KP+'9', FL_Page_Up}, + {VK_NEXT, FL_KP+'3', FL_Page_Down}, + {VK_END, FL_KP+'1', FL_End}, + {VK_HOME, FL_KP+'7', FL_Home}, + {VK_LEFT, FL_KP+'4', FL_Left}, + {VK_UP, FL_KP+'8', FL_Up}, + {VK_RIGHT, FL_KP+'6', FL_Right}, + {VK_DOWN, FL_KP+'2', FL_Down}, + {VK_SNAPSHOT, FL_Print}, // does not work on NT + {VK_INSERT, FL_KP+'0', FL_Insert}, + {VK_DELETE, FL_KP+'.', FL_Delete}, + {VK_LWIN, FL_Meta_L}, + {VK_RWIN, FL_Meta_R}, + {VK_APPS, FL_Menu}, {VK_SLEEP, FL_Sleep}, - {VK_MULTIPLY, FL_KP+'*'}, - {VK_ADD, FL_KP+'+'}, - {VK_SUBTRACT, FL_KP+'-'}, - {VK_DECIMAL, FL_KP+'.'}, - {VK_DIVIDE, FL_KP+'/'}, - {VK_NUMLOCK, FL_Num_Lock}, - {VK_SCROLL, FL_Scroll_Lock}, + {VK_MULTIPLY, FL_KP+'*'}, + {VK_ADD, FL_KP+'+'}, + {VK_SUBTRACT, FL_KP+'-'}, + {VK_DECIMAL, FL_KP+'.'}, + {VK_DIVIDE, FL_KP+'/'}, + {VK_NUMLOCK, FL_Num_Lock}, + {VK_SCROLL, FL_Scroll_Lock}, #if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500) - {VK_BROWSER_BACK, FL_Back}, - {VK_BROWSER_FORWARD, FL_Forward}, - {VK_BROWSER_REFRESH, FL_Refresh}, - {VK_BROWSER_STOP, FL_Stop}, - {VK_BROWSER_SEARCH, FL_Search}, + {VK_BROWSER_BACK, FL_Back}, + {VK_BROWSER_FORWARD, FL_Forward}, + {VK_BROWSER_REFRESH, FL_Refresh}, + {VK_BROWSER_STOP, FL_Stop}, + {VK_BROWSER_SEARCH, FL_Search}, {VK_BROWSER_FAVORITES, FL_Favorites}, - {VK_BROWSER_HOME, FL_Home_Page}, - {VK_VOLUME_MUTE, FL_Volume_Mute}, - {VK_VOLUME_DOWN, FL_Volume_Down}, - {VK_VOLUME_UP, FL_Volume_Up}, - {VK_MEDIA_NEXT_TRACK, FL_Media_Next}, - {VK_MEDIA_PREV_TRACK, FL_Media_Prev}, - {VK_MEDIA_STOP, FL_Media_Stop}, - {VK_MEDIA_PLAY_PAUSE, FL_Media_Play}, - {VK_LAUNCH_MAIL, FL_Mail}, + {VK_BROWSER_HOME, FL_Home_Page}, + {VK_VOLUME_MUTE, FL_Volume_Mute}, + {VK_VOLUME_DOWN, FL_Volume_Down}, + {VK_VOLUME_UP, FL_Volume_Up}, + {VK_MEDIA_NEXT_TRACK, FL_Media_Next}, + {VK_MEDIA_PREV_TRACK, FL_Media_Prev}, + {VK_MEDIA_STOP, FL_Media_Stop}, + {VK_MEDIA_PLAY_PAUSE, FL_Media_Play}, + {VK_LAUNCH_MAIL, FL_Mail}, #endif - {0xba, ';'}, - {0xbb, '='}, - {0xbc, ','}, - {0xbd, '-'}, - {0xbe, '.'}, - {0xbf, '/'}, - {0xc0, '`'}, - {0xdb, '['}, - {0xdc, '\\'}, - {0xdd, ']'}, - {0xde, '\''}, - {VK_OEM_102, FL_Iso_Key} + {0xba, ';'}, + {0xbb, '='}, + {0xbc, ','}, + {0xbd, '-'}, + {0xbe, '.'}, + {0xbf, '/'}, + {0xc0, '`'}, + {0xdb, '['}, + {0xdc, '\\'}, + {0xdd, ']'}, + {0xde, '\''}, + {VK_OEM_102, FL_Iso_Key} }; static int ms2fltk(WPARAM vk, int extended) { static unsigned short vklut[256]; @@ -1166,7 +1164,7 @@ static int ms2fltk(WPARAM vk, int extended) { } for (i = 0; i < 256; i++) if (!extendedlut[i]) - extendedlut[i] = vklut[i]; + extendedlut[i] = vklut[i]; } return extended ? extendedlut[vk] : vklut[vk]; } @@ -1202,434 +1200,434 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar switch (uMsg) { case WM_DPICHANGED: { // 0x02E0 - if (is_dpi_aware && !Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy) { - RECT r; + if (is_dpi_aware && !Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy) { + RECT r; Fl_WinAPI_Screen_Driver *sd = (Fl_WinAPI_Screen_Driver*)Fl::screen_driver(); int ns = Fl_Window_Driver::driver(window)->screen_num(); sd->dpi[ns][0] = sd->dpi[ns][1] = HIWORD(wParam); - float f = HIWORD(wParam) / 96.; - GetClientRect(hWnd, &r); - float old_f = float(r.right) / window->w(); - Fl::screen_driver()->scale(ns, f); - Fl_Window_Driver::driver(window)->resize_after_scale_change(ns, old_f, f); - } - return 0; + float f = HIWORD(wParam) / 96.; + GetClientRect(hWnd, &r); + float old_f = float(r.right) / window->w(); + Fl::screen_driver()->scale(ns, f); + Fl_Window_Driver::driver(window)->resize_after_scale_change(ns, old_f, f); + } + return 0; } case WM_QUIT: // this should not happen? - Fl::fatal("WM_QUIT message"); + Fl::fatal("WM_QUIT message"); case WM_CLOSE: // user clicked close box - Fl::handle(FL_CLOSE, window); - return 0; + Fl::handle(FL_CLOSE, window); + return 0; case WM_SYNCPAINT: case WM_NCPAINT: case WM_ERASEBKGND: - // Andreas Weitl - WM_SYNCPAINT needs to be passed to DefWindowProc - // so that Windows can generate the proper paint messages... - // Similarly, WM_NCPAINT and WM_ERASEBKGND need this, too... - break; + // Andreas Weitl - WM_SYNCPAINT needs to be passed to DefWindowProc + // so that Windows can generate the proper paint messages... + // Similarly, WM_NCPAINT and WM_ERASEBKGND need this, too... + break; case WM_PAINT: { - Fl_Region R, R2; - Fl_X *i = Fl_X::i(window); - Fl_Window_Driver::driver(window)->wait_for_expose_value = 0; - char redraw_whole_window = false; - if (!i->region && window->damage()) { - // Redraw the whole window... - i->region = CreateRectRgn(0, 0, window->w(), window->h()); - redraw_whole_window = true; - } - - // We need to merge Windows' damage into FLTK's damage. - R = CreateRectRgn(0, 0, 0, 0); - int r = GetUpdateRgn(hWnd, R, 0); - if (r == NULLREGION && !redraw_whole_window) { - DeleteObject(R); - break; - } - - // convert i->region in FLTK units to R2 in drawing units - R2 = Fl_GDI_Graphics_Driver::scale_region(i->region, scale, NULL); - - if (R2) { - // Also tell Windows that we are drawing someplace else as well... - CombineRgn(R2, R2, R, RGN_OR); - DeleteObject(R); - } else { - R2 = R; - } - if (window->type() == FL_DOUBLE_WINDOW) - ValidateRgn(hWnd, 0); - else { - ValidateRgn(hWnd, R2); - } - - // convert R2 in drawing units to i->region in FLTK units - i->region = Fl_GDI_Graphics_Driver::scale_region(R2, 1 / scale, NULL); - - window->clear_damage((uchar)(window->damage() | FL_DAMAGE_EXPOSE)); - // These next two statements should not be here, so that all update - // is deferred until Fl::flush() is called during idle. However Windows - // apparently is very unhappy if we don't obey it and draw right now. - // Very annoying! - fl_GetDC(hWnd); // Make sure we have a DC for this window... - fl_save_pen(); - Fl_Window_Driver::driver(window)->flush(); - fl_restore_pen(); - window->clear_damage(); - return 0; + Fl_Region R, R2; + Fl_X *i = Fl_X::i(window); + Fl_Window_Driver::driver(window)->wait_for_expose_value = 0; + char redraw_whole_window = false; + if (!i->region && window->damage()) { + // Redraw the whole window... + i->region = CreateRectRgn(0, 0, window->w(), window->h()); + redraw_whole_window = true; + } + + // We need to merge Windows' damage into FLTK's damage. + R = CreateRectRgn(0, 0, 0, 0); + int r = GetUpdateRgn(hWnd, R, 0); + if (r == NULLREGION && !redraw_whole_window) { + DeleteObject(R); + break; + } + + // convert i->region in FLTK units to R2 in drawing units + R2 = Fl_GDI_Graphics_Driver::scale_region(i->region, scale, NULL); + + if (R2) { + // Also tell Windows that we are drawing someplace else as well... + CombineRgn(R2, R2, R, RGN_OR); + DeleteObject(R); + } else { + R2 = R; + } + if (window->type() == FL_DOUBLE_WINDOW) + ValidateRgn(hWnd, 0); + else { + ValidateRgn(hWnd, R2); + } + + // convert R2 in drawing units to i->region in FLTK units + i->region = Fl_GDI_Graphics_Driver::scale_region(R2, 1 / scale, NULL); + + window->clear_damage((uchar)(window->damage() | FL_DAMAGE_EXPOSE)); + // These next two statements should not be here, so that all update + // is deferred until Fl::flush() is called during idle. However Windows + // apparently is very unhappy if we don't obey it and draw right now. + // Very annoying! + fl_GetDC(hWnd); // Make sure we have a DC for this window... + fl_save_pen(); + Fl_Window_Driver::driver(window)->flush(); + fl_restore_pen(); + window->clear_damage(); + return 0; } // case WM_PAINT case WM_LBUTTONDOWN: - mouse_event(window, 0, 1, wParam, lParam); - return 0; + mouse_event(window, 0, 1, wParam, lParam); + return 0; case WM_LBUTTONDBLCLK: - mouse_event(window, 1, 1, wParam, lParam); - return 0; + mouse_event(window, 1, 1, wParam, lParam); + return 0; case WM_LBUTTONUP: - mouse_event(window, 2, 1, wParam, lParam); - return 0; + mouse_event(window, 2, 1, wParam, lParam); + return 0; case WM_MBUTTONDOWN: - mouse_event(window, 0, 2, wParam, lParam); - return 0; + mouse_event(window, 0, 2, wParam, lParam); + return 0; case WM_MBUTTONDBLCLK: - mouse_event(window, 1, 2, wParam, lParam); - return 0; + mouse_event(window, 1, 2, wParam, lParam); + return 0; case WM_MBUTTONUP: - mouse_event(window, 2, 2, wParam, lParam); - return 0; + mouse_event(window, 2, 2, wParam, lParam); + return 0; case WM_RBUTTONDOWN: - mouse_event(window, 0, 3, wParam, lParam); - return 0; + mouse_event(window, 0, 3, wParam, lParam); + return 0; case WM_RBUTTONDBLCLK: - mouse_event(window, 1, 3, wParam, lParam); - return 0; + mouse_event(window, 1, 3, wParam, lParam); + return 0; case WM_RBUTTONUP: - mouse_event(window, 2, 3, wParam, lParam); - return 0; + mouse_event(window, 2, 3, wParam, lParam); + return 0; case WM_MOUSEMOVE: #ifdef USE_TRACK_MOUSE - if (track_mouse_win != window) { - TRACKMOUSEEVENT tme; - tme.cbSize = sizeof(TRACKMOUSEEVENT); - tme.dwFlags = TME_LEAVE; - tme.hwndTrack = hWnd; - _TrackMouseEvent(&tme); - track_mouse_win = window; - } -#endif // USE_TRACK_MOUSE - mouse_event(window, 3, 0, wParam, lParam); - return 0; + if (track_mouse_win != window) { + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof(TRACKMOUSEEVENT); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = hWnd; + _TrackMouseEvent(&tme); + track_mouse_win = window; + } +#endif // USE_TRACK_MOUSE + mouse_event(window, 3, 0, wParam, lParam); + return 0; case WM_MOUSELEAVE: - if (track_mouse_win == window) { // we left the top level window ! - Fl_Window *tw = window; - while (tw->parent()) // find top level window - tw = tw->window(); - Fl::belowmouse(0); - Fl::handle(FL_LEAVE, tw); - } - track_mouse_win = 0; // force TrackMouseEvent() restart - break; + if (track_mouse_win == window) { // we left the top level window ! + Fl_Window *tw = window; + while (tw->parent()) // find top level window + tw = tw->window(); + Fl::belowmouse(0); + Fl::handle(FL_LEAVE, tw); + } + track_mouse_win = 0; // force TrackMouseEvent() restart + break; case WM_SETFOCUS: - if ((Fl::modal_) && (Fl::modal_ != window)) { - SetFocus(fl_xid(Fl::modal_)); - return 0; - } - Fl::handle(FL_FOCUS, window); - break; + if ((Fl::modal_) && (Fl::modal_ != window)) { + SetFocus(fl_xid(Fl::modal_)); + return 0; + } + Fl::handle(FL_FOCUS, window); + break; case WM_KILLFOCUS: - Fl::handle(FL_UNFOCUS, window); - Fl::flush(); // it never returns to main loop when deactivated... - break; + Fl::handle(FL_UNFOCUS, window); + Fl::flush(); // it never returns to main loop when deactivated... + break; case WM_SHOWWINDOW: - if (!window->parent()) { - Fl::handle(wParam ? FL_SHOW : FL_HIDE, window); - } - break; + if (!window->parent()) { + Fl::handle(wParam ? FL_SHOW : FL_HIDE, window); + } + break; case WM_ACTIVATEAPP: - // From eric@vfx.sel.sony.com, we should process WM_ACTIVATEAPP - // messages to restore the correct state of the shift/ctrl/alt/lock - // keys... Added control, shift, alt, and meta keys, and changed - // to use GetAsyncKeyState and do it when wParam is 1 - // (that means we have focus...) - if (wParam) { - ulong state = 0; - if (GetAsyncKeyState(VK_CAPITAL)) - state |= FL_CAPS_LOCK; - if (GetAsyncKeyState(VK_NUMLOCK)) - state |= FL_NUM_LOCK; - if (GetAsyncKeyState(VK_SCROLL)) - state |= FL_SCROLL_LOCK; - if (GetAsyncKeyState(VK_CONTROL) & ~1) - state |= FL_CTRL; - if (GetAsyncKeyState(VK_SHIFT) & ~1) - state |= FL_SHIFT; - if (GetAsyncKeyState(VK_MENU)) - state |= FL_ALT; - if ((GetAsyncKeyState(VK_LWIN) | GetAsyncKeyState(VK_RWIN)) & ~1) - state |= FL_META; - Fl::e_state = state; - return 0; - } - break; + // From eric@vfx.sel.sony.com, we should process WM_ACTIVATEAPP + // messages to restore the correct state of the shift/ctrl/alt/lock + // keys... Added control, shift, alt, and meta keys, and changed + // to use GetAsyncKeyState and do it when wParam is 1 + // (that means we have focus...) + if (wParam) { + ulong state = 0; + if (GetAsyncKeyState(VK_CAPITAL)) + state |= FL_CAPS_LOCK; + if (GetAsyncKeyState(VK_NUMLOCK)) + state |= FL_NUM_LOCK; + if (GetAsyncKeyState(VK_SCROLL)) + state |= FL_SCROLL_LOCK; + if (GetAsyncKeyState(VK_CONTROL) & ~1) + state |= FL_CTRL; + if (GetAsyncKeyState(VK_SHIFT) & ~1) + state |= FL_SHIFT; + if (GetAsyncKeyState(VK_MENU)) + state |= FL_ALT; + if ((GetAsyncKeyState(VK_LWIN) | GetAsyncKeyState(VK_RWIN)) & ~1) + state |= FL_META; + Fl::e_state = state; + return 0; + } + break; case WM_INPUTLANGCHANGE: - fl_get_codepage(); - break; + fl_get_codepage(); + break; case WM_IME_COMPOSITION: - // if (!fl_is_nt4() && lParam & GCS_RESULTCLAUSE) { - // HIMC himc = ImmGetContext(hWnd); - // wlen = ImmGetCompositionStringW(himc, GCS_RESULTSTR, - // wbuf, sizeof(wbuf)) / sizeof(short); - // if (wlen < 0) wlen = 0; - // wbuf[wlen] = 0; - // ImmReleaseContext(hWnd, himc); - // } - break; + // if (!fl_is_nt4() && lParam & GCS_RESULTCLAUSE) { + // HIMC himc = ImmGetContext(hWnd); + // wlen = ImmGetCompositionStringW(himc, GCS_RESULTSTR, + // wbuf, sizeof(wbuf)) / sizeof(short); + // if (wlen < 0) wlen = 0; + // wbuf[wlen] = 0; + // ImmReleaseContext(hWnd, himc); + // } + break; case WM_KEYDOWN: case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: - // save the keysym until we figure out the characters: - Fl::e_keysym = Fl::e_original_keysym = ms2fltk(wParam, lParam & (1 << 24)); - // See if TranslateMessage turned it into a WM_*CHAR message: - if (PeekMessageW(&fl_msg, hWnd, WM_CHAR, WM_SYSDEADCHAR, PM_REMOVE)) { - uMsg = fl_msg.message; - wParam = fl_msg.wParam; - lParam = fl_msg.lParam; - } - // FALLTHROUGH ... + // save the keysym until we figure out the characters: + Fl::e_keysym = Fl::e_original_keysym = ms2fltk(wParam, lParam & (1 << 24)); + // See if TranslateMessage turned it into a WM_*CHAR message: + if (PeekMessageW(&fl_msg, hWnd, WM_CHAR, WM_SYSDEADCHAR, PM_REMOVE)) { + uMsg = fl_msg.message; + wParam = fl_msg.wParam; + lParam = fl_msg.lParam; + } + // FALLTHROUGH ... case WM_DEADCHAR: case WM_SYSDEADCHAR: case WM_CHAR: case WM_SYSCHAR: { - ulong state = Fl::e_state & 0xff000000; // keep the mouse button state - // if GetKeyState is expensive we might want to comment some of these out: - if (GetKeyState(VK_SHIFT) & ~1) - state |= FL_SHIFT; - if (GetKeyState(VK_CAPITAL)) - state |= FL_CAPS_LOCK; - if (GetKeyState(VK_CONTROL) & ~1) - state |= FL_CTRL; - // Alt gets reported for the Alt-GR switch on non-English keyboards. - // so we need to check the event as well to get it right: - if ((lParam & (1 << 29)) // same as GetKeyState(VK_MENU) - && uMsg != WM_CHAR) - state |= FL_ALT; - if (GetKeyState(VK_NUMLOCK)) - state |= FL_NUM_LOCK; - if ((GetKeyState(VK_LWIN) | GetKeyState(VK_RWIN)) & ~1) { - // Windows bug? GetKeyState returns garbage if the user hit the - // meta key to pop up start menu. Sigh. - if ((GetAsyncKeyState(VK_LWIN) | GetAsyncKeyState(VK_RWIN)) & ~1) - state |= FL_META; - } - if (GetKeyState(VK_SCROLL)) - state |= FL_SCROLL_LOCK; - Fl::e_state = state; - static char buffer[1024]; - if (uMsg == WM_CHAR || uMsg == WM_SYSCHAR) { - wchar_t u = (wchar_t)wParam; - Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1); - buffer[Fl::e_length] = 0; - } else if (Fl::e_keysym >= FL_KP && Fl::e_keysym <= FL_KP_Last) { - if (state & FL_NUM_LOCK) { - // Convert to regular keypress... - buffer[0] = Fl::e_keysym - FL_KP; - Fl::e_length = 1; - } else { - // Convert to special keypress... - buffer[0] = 0; - Fl::e_length = 0; - switch (Fl::e_keysym) { - case FL_KP + '0': - Fl::e_keysym = FL_Insert; - break; - case FL_KP + '1': - Fl::e_keysym = FL_End; - break; - case FL_KP + '2': - Fl::e_keysym = FL_Down; - break; - case FL_KP + '3': - Fl::e_keysym = FL_Page_Down; - break; - case FL_KP + '4': - Fl::e_keysym = FL_Left; - break; - case FL_KP + '6': - Fl::e_keysym = FL_Right; - break; - case FL_KP + '7': - Fl::e_keysym = FL_Home; - break; - case FL_KP + '8': - Fl::e_keysym = FL_Up; - break; - case FL_KP + '9': - Fl::e_keysym = FL_Page_Up; - break; - case FL_KP + '.': - Fl::e_keysym = FL_Delete; - break; - case FL_KP + '/': - case FL_KP + '*': - case FL_KP + '-': - case FL_KP + '+': - buffer[0] = Fl::e_keysym - FL_KP; - Fl::e_length = 1; - break; - } - } - } else if ((lParam & (1 << 31)) == 0) { + ulong state = Fl::e_state & 0xff000000; // keep the mouse button state + // if GetKeyState is expensive we might want to comment some of these out: + if (GetKeyState(VK_SHIFT) & ~1) + state |= FL_SHIFT; + if (GetKeyState(VK_CAPITAL)) + state |= FL_CAPS_LOCK; + if (GetKeyState(VK_CONTROL) & ~1) + state |= FL_CTRL; + // Alt gets reported for the Alt-GR switch on non-English keyboards. + // so we need to check the event as well to get it right: + if ((lParam & (1 << 29)) // same as GetKeyState(VK_MENU) + && uMsg != WM_CHAR) + state |= FL_ALT; + if (GetKeyState(VK_NUMLOCK)) + state |= FL_NUM_LOCK; + if ((GetKeyState(VK_LWIN) | GetKeyState(VK_RWIN)) & ~1) { + // Windows bug? GetKeyState returns garbage if the user hit the + // meta key to pop up start menu. Sigh. + if ((GetAsyncKeyState(VK_LWIN) | GetAsyncKeyState(VK_RWIN)) & ~1) + state |= FL_META; + } + if (GetKeyState(VK_SCROLL)) + state |= FL_SCROLL_LOCK; + Fl::e_state = state; + static char buffer[1024]; + if (uMsg == WM_CHAR || uMsg == WM_SYSCHAR) { + wchar_t u = (wchar_t)wParam; + Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1); + buffer[Fl::e_length] = 0; + } else if (Fl::e_keysym >= FL_KP && Fl::e_keysym <= FL_KP_Last) { + if (state & FL_NUM_LOCK) { + // Convert to regular keypress... + buffer[0] = Fl::e_keysym - FL_KP; + Fl::e_length = 1; + } else { + // Convert to special keypress... + buffer[0] = 0; + Fl::e_length = 0; + switch (Fl::e_keysym) { + case FL_KP + '0': + Fl::e_keysym = FL_Insert; + break; + case FL_KP + '1': + Fl::e_keysym = FL_End; + break; + case FL_KP + '2': + Fl::e_keysym = FL_Down; + break; + case FL_KP + '3': + Fl::e_keysym = FL_Page_Down; + break; + case FL_KP + '4': + Fl::e_keysym = FL_Left; + break; + case FL_KP + '6': + Fl::e_keysym = FL_Right; + break; + case FL_KP + '7': + Fl::e_keysym = FL_Home; + break; + case FL_KP + '8': + Fl::e_keysym = FL_Up; + break; + case FL_KP + '9': + Fl::e_keysym = FL_Page_Up; + break; + case FL_KP + '.': + Fl::e_keysym = FL_Delete; + break; + case FL_KP + '/': + case FL_KP + '*': + case FL_KP + '-': + case FL_KP + '+': + buffer[0] = Fl::e_keysym - FL_KP; + Fl::e_length = 1; + break; + } + } + } else if ((lParam & (1 << 31)) == 0) { #ifdef FLTK_PREVIEW_DEAD_KEYS - if ((lParam & (1 << 24)) == 0) { // clear if dead key (always?) - wchar_t u = (wchar_t)wParam; - Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1); - buffer[Fl::e_length] = 0; - } else { // set if "extended key" (never printable?) - buffer[0] = 0; - Fl::e_length = 0; - } + if ((lParam & (1 << 24)) == 0) { // clear if dead key (always?) + wchar_t u = (wchar_t)wParam; + Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1); + buffer[Fl::e_length] = 0; + } else { // set if "extended key" (never printable?) + buffer[0] = 0; + Fl::e_length = 0; + } #else - buffer[0] = 0; - Fl::e_length = 0; + buffer[0] = 0; + Fl::e_length = 0; #endif - } - Fl::e_text = buffer; - if (lParam & (1 << 31)) { // key up events. - if (Fl::handle(FL_KEYUP, window)) - return 0; - break; - } - while (window->parent()) - window = window->window(); - if (Fl::handle(FL_KEYBOARD, window)) { - if (uMsg == WM_DEADCHAR || uMsg == WM_SYSDEADCHAR) - Fl::compose_state = 1; - return 0; - } - break; // WM_KEYDOWN ... WM_SYSKEYUP, WM_DEADCHAR ... WM_SYSCHAR + } + Fl::e_text = buffer; + if (lParam & (1 << 31)) { // key up events. + if (Fl::handle(FL_KEYUP, window)) + return 0; + break; + } + while (window->parent()) + window = window->window(); + if (Fl::handle(FL_KEYBOARD, window)) { + if (uMsg == WM_DEADCHAR || uMsg == WM_SYSDEADCHAR) + Fl::compose_state = 1; + return 0; + } + break; // WM_KEYDOWN ... WM_SYSKEYUP, WM_DEADCHAR ... WM_SYSCHAR } // case WM_DEADCHAR ... WM_SYSCHAR case WM_MOUSEWHEEL: { - static int delta = 0; // running total of all motion - delta += (SHORT)(HIWORD(wParam)); - Fl::e_dx = 0; - Fl::e_dy = -delta / WHEEL_DELTA; - delta += Fl::e_dy * WHEEL_DELTA; - if (Fl::e_dy) - Fl::handle(FL_MOUSEWHEEL, window); - return 0; + static int delta = 0; // running total of all motion + delta += (SHORT)(HIWORD(wParam)); + Fl::e_dx = 0; + Fl::e_dy = -delta / WHEEL_DELTA; + delta += Fl::e_dy * WHEEL_DELTA; + if (Fl::e_dy) + Fl::handle(FL_MOUSEWHEEL, window); + return 0; } case WM_MOUSEHWHEEL: { - static int delta = 0; // running total of all motion - delta += (SHORT)(HIWORD(wParam)); - Fl::e_dy = 0; - Fl::e_dx = delta / WHEEL_DELTA; - delta -= Fl::e_dx * WHEEL_DELTA; - if (Fl::e_dx) - Fl::handle(FL_MOUSEWHEEL, window); - return 0; + static int delta = 0; // running total of all motion + delta += (SHORT)(HIWORD(wParam)); + Fl::e_dy = 0; + Fl::e_dx = delta / WHEEL_DELTA; + delta -= Fl::e_dx * WHEEL_DELTA; + if (Fl::e_dx) + Fl::handle(FL_MOUSEWHEEL, window); + return 0; } case WM_GETMINMAXINFO: - Fl_WinAPI_Window_Driver::driver(window)->set_minmax((LPMINMAXINFO)lParam); - break; + Fl_WinAPI_Window_Driver::driver(window)->set_minmax((LPMINMAXINFO)lParam); + break; case WM_SIZE: - if (!window->parent()) { - if (wParam == SIZE_MINIMIZED || wParam == SIZE_MAXHIDE) { - Fl::handle(FL_HIDE, window); - } else { - Fl::handle(FL_SHOW, window); - resize_bug_fix = window; - window->size(ceil(LOWORD(lParam) / scale), ceil(HIWORD(lParam) / scale)); - // fprintf(LOG,"WM_SIZE size(%.0f,%.0f) graph(%d,%d) s=%.2f\n", - // ceil(LOWORD(lParam)/scale),ceil(HIWORD(lParam)/scale), - // LOWORD(lParam),HIWORD(lParam),scale); - } - } - break; + if (!window->parent()) { + if (wParam == SIZE_MINIMIZED || wParam == SIZE_MAXHIDE) { + Fl::handle(FL_HIDE, window); + } else { + Fl::handle(FL_SHOW, window); + resize_bug_fix = window; + window->size(ceil(LOWORD(lParam) / scale), ceil(HIWORD(lParam) / scale)); + // fprintf(LOG,"WM_SIZE size(%.0f,%.0f) graph(%d,%d) s=%.2f\n", + // ceil(LOWORD(lParam)/scale),ceil(HIWORD(lParam)/scale), + // LOWORD(lParam),HIWORD(lParam),scale); + } + } + break; case WM_MOVE: { - if (IsIconic(hWnd)) { - break; - } - resize_bug_fix = window; - int nx = LOWORD(lParam); - int ny = HIWORD(lParam); - if (nx & 0x8000) nx -= 65536; - if (ny & 0x8000) ny -= 65536; - // fprintf(LOG,"WM_MOVE position(%d,%d) s=%.2f\n",int(nx/scale),int(ny/scale),scale); - // detect when window centre changes screen - Fl_WinAPI_Screen_Driver *sd = (Fl_WinAPI_Screen_Driver *)Fl::screen_driver(); - Fl_WinAPI_Window_Driver *wd = Fl_WinAPI_Window_Driver::driver(window); - int olds = wd->screen_num(); - int news = sd->screen_num_unscaled(nx + window->w() * scale / 2, ny + window->h() * scale / 2); - if (news == -1) - news = olds; - float s = sd->scale(news); - // fprintf(LOG,"WM_MOVE olds=%d(%.2f) news=%d(%.2f) busy=%d\n",olds, - // sd->scale(olds),news, s, - // Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy); - // fflush(LOG); - if (olds != news) { - if (s != sd->scale(olds) && - !Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy && - window->user_data() != &Fl_WinAPI_Screen_Driver::transient_scale_display) { - Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy = true; - Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.screen = news; - Fl::add_timeout(1, Fl_WinAPI_Window_Driver::resize_after_screen_change, window); - } - else if (!Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy) - wd->screen_num(news); - } - window->position(nx / scale, ny / scale); - break; + if (IsIconic(hWnd)) { + break; + } + resize_bug_fix = window; + int nx = LOWORD(lParam); + int ny = HIWORD(lParam); + if (nx & 0x8000) nx -= 65536; + if (ny & 0x8000) ny -= 65536; + // fprintf(LOG,"WM_MOVE position(%d,%d) s=%.2f\n",int(nx/scale),int(ny/scale),scale); + // detect when window centre changes screen + Fl_WinAPI_Screen_Driver *sd = (Fl_WinAPI_Screen_Driver *)Fl::screen_driver(); + Fl_WinAPI_Window_Driver *wd = Fl_WinAPI_Window_Driver::driver(window); + int olds = wd->screen_num(); + int news = sd->screen_num_unscaled(nx + window->w() * scale / 2, ny + window->h() * scale / 2); + if (news == -1) + news = olds; + float s = sd->scale(news); + // fprintf(LOG,"WM_MOVE olds=%d(%.2f) news=%d(%.2f) busy=%d\n",olds, + // sd->scale(olds),news, s, + // Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy); + // fflush(LOG); + if (olds != news) { + if (s != sd->scale(olds) && + !Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy && + window->user_data() != &Fl_WinAPI_Screen_Driver::transient_scale_display) { + Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy = true; + Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.screen = news; + Fl::add_timeout(1, Fl_WinAPI_Window_Driver::resize_after_screen_change, window); + } + else if (!Fl_WinAPI_Window_Driver::data_for_resize_window_between_screens_.busy) + wd->screen_num(news); + } + window->position(nx / scale, ny / scale); + break; } // case WM_MOVE case WM_SETCURSOR: - if (LOWORD(lParam) == HTCLIENT) { - while (window->parent()) - window = window->window(); - SetCursor(Fl_WinAPI_Window_Driver::driver(window)->cursor); - return 0; - } - break; + if (LOWORD(lParam) == HTCLIENT) { + while (window->parent()) + window = window->window(); + SetCursor(Fl_WinAPI_Window_Driver::driver(window)->cursor); + return 0; + } + break; #if USE_COLORMAP case WM_QUERYNEWPALETTE: - fl_GetDC(hWnd); - if (fl_select_palette()) - InvalidateRect(hWnd, NULL, FALSE); - break; + fl_GetDC(hWnd); + if (fl_select_palette()) + InvalidateRect(hWnd, NULL, FALSE); + break; case WM_PALETTECHANGED: - if ((HWND)wParam != hWnd && fl_select_palette()) - UpdateColors(fl_GetDC(hWnd)); - break; + if ((HWND)wParam != hWnd && fl_select_palette()) + UpdateColors(fl_GetDC(hWnd)); + break; case WM_CREATE: - fl_GetDC(hWnd); - fl_select_palette(); - break; + fl_GetDC(hWnd); + fl_select_palette(); + break; #endif case WM_DESTROYCLIPBOARD: - fl_i_own_selection[1] = 0; - return 1; + fl_i_own_selection[1] = 0; + return 1; case WM_DISPLAYCHANGE: {// occurs when screen configuration (number, size, position) changes Fl::call_screen_init(); @@ -1641,36 +1639,36 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar return 0; } case WM_CHANGECBCHAIN: - if ((hWnd == clipboard_wnd) && (next_clipboard_wnd == (HWND)wParam)) - next_clipboard_wnd = (HWND)lParam; - else - SendMessage(next_clipboard_wnd, WM_CHANGECBCHAIN, wParam, lParam); - return 0; + if ((hWnd == clipboard_wnd) && (next_clipboard_wnd == (HWND)wParam)) + next_clipboard_wnd = (HWND)lParam; + else + SendMessage(next_clipboard_wnd, WM_CHANGECBCHAIN, wParam, lParam); + return 0; case WM_DRAWCLIPBOARD: - // When the clipboard moves between two FLTK windows, - // fl_i_own_selection will temporarily be false as we are - // processing this message. Hence the need to use fl_find(). - if (!initial_clipboard && !fl_find(GetClipboardOwner())) - fl_trigger_clipboard_notify(1); - initial_clipboard = false; + // When the clipboard moves between two FLTK windows, + // fl_i_own_selection will temporarily be false as we are + // processing this message. Hence the need to use fl_find(). + if (!initial_clipboard && !fl_find(GetClipboardOwner())) + fl_trigger_clipboard_notify(1); + initial_clipboard = false; - if (next_clipboard_wnd) - SendMessage(next_clipboard_wnd, WM_DRAWCLIPBOARD, wParam, lParam); + if (next_clipboard_wnd) + SendMessage(next_clipboard_wnd, WM_DRAWCLIPBOARD, wParam, lParam); - return 0; + return 0; default: - if (Fl::handle(0, 0)) - return 0; - break; + if (Fl::handle(0, 0)) + return 0; + break; } // switch (uMsg) } // if (window) return DefWindowProcW(hWnd, uMsg, wParam, lParam); } /* Implementation note about the API to get the dimensions of the top/left borders and the title bar - + Function fake_X_wm_style() below is used before calling CreateWindowExW() to create a window and before calling SetWindowPos(). Both of these Windows functions need the window size including borders and title bar. Function fake_X_wm_style() uses AdjustWindowRectExForDpi() or @@ -1681,7 +1679,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar Calculates the required size of the window rectangle, based on the desired size of the client rectangle [and the provided DPI]. This window rectangle can then be passed to the CreateWindowEx function to create a window with a client area of the desired size. - + Conversely, Fl_WinAPI_Window_Driver::border_width_title_bar_height() is used to get the true sizes of borders and title bar of a mapped window. The correct API for that is DwmGetWindowAttribute(). @@ -1713,10 +1711,10 @@ static int fake_X_wm_style(const Fl_Window *w, int &X, int &Y, int &bt, int &bx, // fallback to get the best guess which is always available. if (!style) { - HWND hwnd = fl_xid(w); - // request the style flags of this window, as Windows sees them - style = GetWindowLong(hwnd, GWL_STYLE); - styleEx = GetWindowLong(hwnd, GWL_EXSTYLE); + HWND hwnd = fl_xid(w); + // request the style flags of this window, as Windows sees them + style = GetWindowLong(hwnd, GWL_STYLE); + styleEx = GetWindowLong(hwnd, GWL_EXSTYLE); } RECT r; @@ -1725,7 +1723,7 @@ static int fake_X_wm_style(const Fl_Window *w, int &X, int &Y, int &bt, int &bx, r.right = (w->x() + w->w()) * s; r.bottom = (w->y() + w->h()) * s; // get the decoration rectangle for the desired client rectangle - + typedef BOOL(WINAPI* AdjustWindowRectExForDpi_type)(LPRECT, DWORD, BOOL, DWORD, UINT); static AdjustWindowRectExForDpi_type fl_AdjustWindowRectExForDpi = (AdjustWindowRectExForDpi_type)GetProcAddress(LoadLibrary("User32.DLL"), "AdjustWindowRectExForDpi"); @@ -1737,22 +1735,22 @@ static int fake_X_wm_style(const Fl_Window *w, int &X, int &Y, int &bt, int &bx, } else ok = AdjustWindowRectEx(&r, style, FALSE, styleEx); if (ok) { - X = r.left; - Y = r.top; - W = r.right - r.left; - H = r.bottom - r.top; - bx = w->x() * s - r.left; - by = r.bottom - (w->y() + w->h()) * s; // height of the bottom frame - bt = w->y() * s - r.top - by; // height of top caption bar - xoff = bx; - yoff = by + bt; - dx = W - w->w() * s; - dy = H - w->h() * s; - if (w_size_range_set && (w_maxw != w_minw || w_maxh != w_minh)) - ret = 2; - else - ret = 1; - fallback = 0; + X = r.left; + Y = r.top; + W = r.right - r.left; + H = r.bottom - r.top; + bx = w->x() * s - r.left; + by = r.bottom - (w->y() + w->h()) * s; // height of the bottom frame + bt = w->y() * s - r.top - by; // height of top caption bar + xoff = bx; + yoff = by + bt; + dx = W - w->w() * s; + dy = H - w->h() * s; + if (w_size_range_set && (w_maxw != w_minw || w_maxh != w_minh)) + ret = 2; + else + ret = 1; + fallback = 0; } } } @@ -1760,17 +1758,17 @@ static int fake_X_wm_style(const Fl_Window *w, int &X, int &Y, int &bt, int &bx, if (fallback) { if (w->border() && !w->parent()) { if (w_size_range_set && (w_maxw != w_minw || w_maxh != w_minh)) { - ret = 2; - bx = GetSystemMetrics(SM_CXSIZEFRAME); - by = GetSystemMetrics(SM_CYSIZEFRAME); + ret = 2; + bx = GetSystemMetrics(SM_CXSIZEFRAME); + by = GetSystemMetrics(SM_CYSIZEFRAME); } else { - ret = 1; - int padding = GetSystemMetrics(SM_CXPADDEDBORDER); - NONCLIENTMETRICS ncm; - ncm.cbSize = sizeof(NONCLIENTMETRICS); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); - bx = GetSystemMetrics(SM_CXFIXEDFRAME) + (padding ? padding + ncm.iBorderWidth : 0); - by = GetSystemMetrics(SM_CYFIXEDFRAME) + (padding ? padding + ncm.iBorderWidth : 0); + ret = 1; + int padding = GetSystemMetrics(SM_CXPADDEDBORDER); + NONCLIENTMETRICS ncm; + ncm.cbSize = sizeof(NONCLIENTMETRICS); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); + bx = GetSystemMetrics(SM_CXFIXEDFRAME) + (padding ? padding + ncm.iBorderWidth : 0); + by = GetSystemMetrics(SM_CYFIXEDFRAME) + (padding ? padding + ncm.iBorderWidth : 0); } bt = GetSystemMetrics(SM_CYCAPTION); } @@ -1860,7 +1858,7 @@ void Fl_WinAPI_Window_Driver::resize(int X, int Y, int W, int H) { // with no width or height will never get an exposure event Fl_X *i = Fl_X::i(pWindow); if (i && W > 0 && H > 0) - wait_for_expose_value = 1; + wait_for_expose_value = 1; } } else { x(X); @@ -1927,7 +1925,7 @@ public: int i; for (i = 0; i < nName; i++) { if (strcmp(name[i], n) == 0) - return 1; + return 1; } return 0; } @@ -1973,9 +1971,9 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() { // convert UTF-8 class_name to wchar_t for RegisterClassExW and CreateWindowExW fl_utf8toUtf16(class_name, - (unsigned)strlen(class_name), // in - (unsigned short *)class_namew, // out - (unsigned)sizeof(class_namew) / sizeof(wchar_t)); // max. size + (unsigned)strlen(class_name), // in + (unsigned short *)class_namew, // out + (unsigned)sizeof(class_namew) / sizeof(wchar_t)); // max. size if (!class_name_list.has_name(class_name)) { WNDCLASSEXW wcw; @@ -2039,16 +2037,16 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() { } else { if (!size_range_set()) { if (w->resizable()) { - Fl_Widget *o = w->resizable(); - int minw = o->w(); - if (minw > 100) - minw = 100; - int minh = o->h(); - if (minh > 100) - minh = 100; - w->size_range(w->w() - o->w() + minw, w->h() - o->h() + minh, 0, 0); + Fl_Widget *o = w->resizable(); + int minw = o->w(); + if (minw > 100) + minw = 100; + int minh = o->h(); + if (minh > 100) + minh = 100; + w->size_range(w->w() - o->w() + minw, w->h() - o->h() + minh, 0, 0); } else { - w->size_range(w->w(), w->h(), w->w(), w->h()); + w->size_range(w->w(), w->h(), w->w(), w->h()); } } styleEx |= WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT; @@ -2056,31 +2054,31 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() { int wintype = 0; if (w->border() && !w->parent()) { if (size_range_set() && (maxw() != minw() || maxh() != minh())) - wintype = 2; + wintype = 2; else - wintype = 1; + wintype = 1; } switch (wintype) { // No border (used for menus) case 0: - style |= WS_POPUP; - styleEx |= WS_EX_TOOLWINDOW; - break; + style |= WS_POPUP; + styleEx |= WS_EX_TOOLWINDOW; + break; // Thin border and title bar case 1: - style |= WS_DLGFRAME | WS_CAPTION; - if (!w->modal()) - style |= WS_SYSMENU | WS_MINIMIZEBOX; - break; + style |= WS_DLGFRAME | WS_CAPTION; + if (!w->modal()) + style |= WS_SYSMENU | WS_MINIMIZEBOX; + break; // Thick, resizable border and title bar, with maximize button case 2: - style |= WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_CAPTION; - if (!w->modal()) - style |= WS_MINIMIZEBOX; - break; + style |= WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_CAPTION; + if (!w->modal()) + style |= WS_MINIMIZEBOX; + break; } int xwm = xp, ywm = yp, bt, bx, by; // these are in graphical units @@ -2093,10 +2091,10 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() { xp = yp = CW_USEDEFAULT; } else { if (!Fl::grab()) { - xp = xwm; - yp = ywm; - x(xp / s); - y(yp / s); + xp = xwm; + yp = ywm; + x(xp / s); + y(yp / s); } xp -= bx; yp -= by + bt; @@ -2107,10 +2105,10 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() { // find some other window to be "transient for": Fl_Window *w = Fl_X::first->w; while (w->parent()) - w = w->window(); + w = w->window(); parent = fl_xid(w); if (!w->visible()) - showit = 0; + showit = 0; } else if (Fl::grab()) parent = fl_xid(Fl::grab()); } @@ -2136,13 +2134,13 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() { lab[wlen] = 0; } x->xid = CreateWindowExW(styleEx, - class_namew, lab, style, - xp, yp, wp, hp, - parent, - NULL, // menu - fl_display, - NULL // creation parameters - ); + class_namew, lab, style, + xp, yp, wp, hp, + parent, + NULL, // menu + fl_display, + NULL // creation parameters + ); if (lab) free(lab); @@ -2190,7 +2188,7 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() { // If we've captured the mouse, we dont want to activate any // other windows from the code, or we lose the capture. ShowWindow(x->xid, !showit ? SW_SHOWMINNOACTIVE : - (Fl::grab() || (styleEx & WS_EX_TOOLWINDOW)) ? SW_SHOWNOACTIVATE : SW_SHOWNORMAL); + (Fl::grab() || (styleEx & WS_EX_TOOLWINDOW)) ? SW_SHOWNOACTIVATE : SW_SHOWNORMAL); // Register all windows for potential drag'n'drop operations RegisterDragDrop(x->xid, flIDropTarget); @@ -2289,18 +2287,18 @@ static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon, int hotx, in for (int y = 0; y < image->h(); y++) { for (int x = 0; x < image->w(); x++) { switch (image->d()) { - case 1: - *bits = (0xff << 24) | (i[0] << 16) | (i[0] << 8) | i[0]; - break; - case 2: - *bits = (i[1] << 24) | (i[0] << 16) | (i[0] << 8) | i[0]; - break; - case 3: - *bits = (0xff << 24) | (i[0] << 16) | (i[1] << 8) | i[2]; - break; - case 4: - *bits = (i[3] << 24) | (i[0] << 16) | (i[1] << 8) | i[2]; - break; + case 1: + *bits = (0xff << 24) | (i[0] << 16) | (i[0] << 8) | i[0]; + break; + case 2: + *bits = (i[1] << 24) | (i[0] << 16) | (i[0] << 8) | i[0]; + break; + case 3: + *bits = (0xff << 24) | (i[0] << 16) | (i[1] << 8) | i[2]; + break; + case 4: + *bits = (i[3] << 24) | (i[0] << 16) | (i[1] << 8) | i[2]; + break; } i += image->d(); bits++; @@ -2346,11 +2344,11 @@ static const Fl_RGB_Image *find_best_icon(int ideal_width, const Fl_RGB_Image *i best = icons[i]; else { if (best->w() < ideal_width) { - if (icons[i]->w() > best->w()) - best = icons[i]; + if (icons[i]->w() > best->w()) + best = icons[i]; } else { - if ((icons[i]->w() >= ideal_width) && (icons[i]->w() < best->w())) - best = icons[i]; + if ((icons[i]->w() >= ideal_width) && (icons[i]->w() < best->w())) + best = icons[i]; } } } @@ -2450,11 +2448,11 @@ void Fl_WinAPI_Window_Driver::set_icons() { const Fl_RGB_Image *best_big, *best_small; best_big = find_best_icon(GetSystemMetrics(SM_CXICON), - (const Fl_RGB_Image **)icon_->icons, - icon_->count); + (const Fl_RGB_Image **)icon_->icons, + icon_->count); best_small = find_best_icon(GetSystemMetrics(SM_CXSMICON), - (const Fl_RGB_Image **)icon_->icons, - icon_->count); + (const Fl_RGB_Image **)icon_->icons, + icon_->count); if (best_big != NULL) big_icon = image_to_icon(best_big, true, 0, 0); @@ -2490,52 +2488,52 @@ int Fl_WinAPI_Window_Driver::set_cursor(Fl_Cursor c) { else { switch (c) { case FL_CURSOR_ARROW: - n = IDC_ARROW; - break; + n = IDC_ARROW; + break; case FL_CURSOR_CROSS: - n = IDC_CROSS; - break; + n = IDC_CROSS; + break; case FL_CURSOR_WAIT: - n = IDC_WAIT; - break; + n = IDC_WAIT; + break; case FL_CURSOR_INSERT: - n = IDC_IBEAM; - break; + n = IDC_IBEAM; + break; case FL_CURSOR_HAND: - n = IDC_HAND; - break; + n = IDC_HAND; + break; case FL_CURSOR_HELP: - n = IDC_HELP; - break; + n = IDC_HELP; + break; case FL_CURSOR_MOVE: - n = IDC_SIZEALL; - break; + n = IDC_SIZEALL; + break; case FL_CURSOR_N: case FL_CURSOR_S: // FIXME: Should probably have fallbacks for these instead case FL_CURSOR_NS: - n = IDC_SIZENS; - break; + n = IDC_SIZENS; + break; case FL_CURSOR_NE: case FL_CURSOR_SW: // FIXME: Dito. case FL_CURSOR_NESW: - n = IDC_SIZENESW; - break; + n = IDC_SIZENESW; + break; case FL_CURSOR_E: case FL_CURSOR_W: // FIXME: Dito. case FL_CURSOR_WE: - n = IDC_SIZEWE; - break; + n = IDC_SIZEWE; + break; case FL_CURSOR_SE: case FL_CURSOR_NW: // FIXME: Dito. case FL_CURSOR_NWSE: - n = IDC_SIZENWSE; - break; + n = IDC_SIZENWSE; + break; default: - return 0; + return 0; } new_cursor = LoadCursor(NULL, n); @@ -2702,9 +2700,9 @@ void fl_release_dc(HWND w, HDC dc) { RestoreDC(dc, t->saved_dc); ReleaseDC(w, dc); if (!prev) { - win_DC_list = t->next; // delete first item + win_DC_list = t->next; // delete first item } else { - prev->next = t->next; // one in the middle + prev->next = t->next; // one in the middle } delete (t); return; @@ -2855,7 +2853,3 @@ void preparePrintFront(void) { #endif // USE_PRINT_BUTTON #endif // defined(_WIN32) and !defined(FL_DOXYGEN) - -// -// End of "$Id$". -// diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 282fc4cae..a046cde65 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // X specific code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #if !defined(FL_DOXYGEN) @@ -54,7 +52,7 @@ #if USE_XRANDR #include <dlfcn.h> #define RRScreenChangeNotifyMask (1L << 0) // from X11/extensions/Xrandr.h -#define RRScreenChangeNotify 0 // from X11/extensions/Xrandr.h +#define RRScreenChangeNotify 0 // from X11/extensions/Xrandr.h typedef int (*XRRUpdateConfiguration_type)(XEvent *event); static XRRUpdateConfiguration_type XRRUpdateConfiguration_f; static int randrEventBase; // base of RandR-defined events @@ -349,7 +347,7 @@ Atom fl_XdndFinished; //Atom fl_XdndProxy; Atom fl_XdndURIList; static Atom fl_Xatextplainutf; -static Atom fl_Xatextplainutf2; // STR#2930 +static Atom fl_Xatextplainutf2; // STR#2930 static Atom fl_Xatextplain; static Atom fl_XaText; static Atom fl_XaCompoundText; @@ -359,8 +357,8 @@ static Atom fl_XaImageBmp; static Atom fl_XaImagePNG; static Atom fl_INCR; static Atom fl_NET_WM_PID; -static Atom fl_NET_WM_NAME; // utf8 aware window label -static Atom fl_NET_WM_ICON_NAME; // utf8 aware window icon name +static Atom fl_NET_WM_NAME; // utf8 aware window label +static Atom fl_NET_WM_ICON_NAME; // utf8 aware window icon name static Atom fl_NET_SUPPORTING_WM_CHECK; static Atom fl_NET_WM_STATE; static Atom fl_NET_WM_STATE_FULLSCREEN; @@ -651,7 +649,7 @@ void open_display_i(Display* d) { fl_XdndEnter = XInternAtom(d, "XdndEnter", 0); fl_XdndURIList = XInternAtom(d, "text/uri-list", 0); fl_Xatextplainutf = XInternAtom(d, "text/plain;charset=UTF-8",0); - fl_Xatextplainutf2 = XInternAtom(d, "text/plain;charset=utf-8",0); // Firefox/Thunderbird needs this - See STR#2930 + fl_Xatextplainutf2 = XInternAtom(d, "text/plain;charset=utf-8",0); // Firefox/Thunderbird needs this - See STR#2930 fl_Xatextplain = XInternAtom(d, "text/plain", 0); fl_XaText = XInternAtom(d, "TEXT", 0); fl_XaCompoundText = XInternAtom(d, "COMPOUND_TEXT", 0); @@ -829,18 +827,18 @@ int Fl_X11_System_Driver::clipboard_contains(const char *type) win->wait_for_expose(); XConvertSelection(fl_display, CLIPBOARD, TARGETS, CLIPBOARD, fl_xid(win), CurrentTime); XFlush(fl_display); - do { - XNextEvent(fl_display, &event); + do { + XNextEvent(fl_display, &event); if (event.type == SelectionNotify && event.xselection.property == None) return 0; - i++; + i++; } while (i < 20 && event.type != SelectionNotify); if (i >= 20) return 0; XGetWindowProperty(fl_display, - event.xselection.requestor, - event.xselection.property, - 0, 4000, 0, 0, - &actual, &format, &count, &remaining, &portion); + event.xselection.requestor, + event.xselection.property, + 0, 4000, 0, 0, + &actual, &format, &count, &remaining, &portion); if (actual != XA_ATOM) return 0; Atom t; int retval = 0; @@ -848,22 +846,22 @@ int Fl_X11_System_Driver::clipboard_contains(const char *type) for (i = 0; i<count; i++) { // searching for text data t = ((Atom*)portion)[i]; if (t == fl_Xatextplainutf || - t == fl_Xatextplainutf2 || - t == fl_Xatextplain || - t == fl_XaUtf8String) { - retval = 1; - break; + t == fl_Xatextplainutf2 || + t == fl_Xatextplain || + t == fl_XaUtf8String) { + retval = 1; + break; } - } + } } else if (strcmp(type, Fl::clipboard_image) == 0) { for (i = 0; i<count; i++) { // searching for image data t = ((Atom*)portion)[i]; if (t == fl_XaImageBmp || t == fl_XaImagePNG) { - retval = 1; - break; + retval = 1; + break; } - } + } } XFree(portion); return retval; @@ -906,7 +904,7 @@ void fl_sendClientMessage(Window window, Atom message, if (0 == get_xwinprop(....., &nitems, &data) ) { ..success.. } else { ..fail.. } if ( data ) { XFree(data); data=0; } - + Note: 'data' can be non-zero, even if the return value is -1 (error) and should hence be XFree'd *after* the if/else statement, as described above. */ @@ -915,9 +913,9 @@ static int get_xwinprop(Window wnd, Atom prop, long max_length, Atom actual; int format; unsigned long bytes_after; - - if (Success != XGetWindowProperty(fl_display, wnd, prop, 0, max_length, - False, AnyPropertyType, &actual, &format, + + if (Success != XGetWindowProperty(fl_display, wnd, prop, 0, max_length, + False, AnyPropertyType, &actual, &format, nitems, &bytes_after, (unsigned char**)data)) { return -1; } @@ -1211,7 +1209,7 @@ static bool getNextEvent(XEvent *event_return) if(time(NULL) - t > 10.0) { // fprintf(stderr,"Error: The XNextEvent never came...\n"); - return false; + return false; } } XNextEvent(fl_display, event_return); @@ -1223,7 +1221,7 @@ static long getIncrData(uchar* &data, const XSelectionEvent& selevent, long lowe // fprintf(stderr,"Incremental transfer starting due to INCR property\n"); size_t total = 0; XEvent event; - XDeleteProperty(fl_display, selevent.requestor, selevent.property); + XDeleteProperty(fl_display, selevent.requestor, selevent.property); data = (uchar*)realloc(data, lower_bound); for (;;) { @@ -1241,14 +1239,14 @@ static long getIncrData(uchar* &data, const XSelectionEvent& selevent, long lowe // size_t slice_size = 0; do { - XGetWindowProperty(fl_display, selevent.requestor, selevent.property, offset, 70000, True, - AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop); - num_bytes = nitems * (actual_format / 8); - offset += num_bytes/4; - // slice_size += num_bytes; - if (total + num_bytes > (size_t)lower_bound) data = (uchar*)realloc(data, total + num_bytes); - memcpy(data + total, prop, num_bytes); total += num_bytes; - if (prop) XFree(prop); + XGetWindowProperty(fl_display, selevent.requestor, selevent.property, offset, 70000, True, + AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop); + num_bytes = nitems * (actual_format / 8); + offset += num_bytes/4; + // slice_size += num_bytes; + if (total + num_bytes > (size_t)lower_bound) data = (uchar*)realloc(data, total + num_bytes); + memcpy(data + total, prop, num_bytes); total += num_bytes; + if (prop) XFree(prop); } while (bytes_after != 0); // fprintf(stderr,"INCR data size:%ld\n", slice_size); if (num_bytes == 0) break; @@ -1381,7 +1379,7 @@ int fl_handle(const XEvent& thisevent) fl_xim_im = NULL; fl_init_xim(); } else { - XCloseIM(xim_im); // see STR 2185 for comment + XCloseIM(xim_im); // see STR 2185 for comment } return 0; } @@ -1391,8 +1389,8 @@ int fl_handle(const XEvent& thisevent) if (fl_xim_ic && XFilterEvent((XEvent *)&xevent, 0)) return(1); - -#if USE_XRANDR + +#if USE_XRANDR if( XRRUpdateConfiguration_f && xevent.type == randrEventBase + RRScreenChangeNotify) { XRRUpdateConfiguration_f(&xevent); react_to_screen_reconfiguration(); @@ -1407,7 +1405,7 @@ int fl_handle(const XEvent& thisevent) after_display_rescale(&(d->current_xft_dpi)); #endif // USE_XFT } - + switch (xevent.type) { case KeymapNotify: @@ -1445,71 +1443,71 @@ int fl_handle(const XEvent& thisevent) else handle_clipboard_timestamp(0, t); } - XFree(portion); portion = 0; + XFree(portion); portion = 0; return true; } if (actual == TARGETS || actual == XA_ATOM) { - /*for (unsigned i = 0; i<count; i++) { - fprintf(stderr," %s", XGetAtomName(fl_display, ((Atom*)portion)[i]) ); - } - fprintf(stderr,"\n"); - */ - Atom t, type = XA_STRING; - if (Fl::e_clipboard_type == Fl::clipboard_image) { // searching for image data - for (unsigned i = 0; i<count; i++) { - t = ((Atom*)portion)[i]; - if (t == fl_XaImageBmp || t == fl_XaImagePNG) { - type = t; - goto found; - } - } - XFree(portion); - return true; - } - for (unsigned i = 0; i<count; i++) { // searching for text data - t = ((Atom*)portion)[i]; - if (t == fl_Xatextplainutf || - t == fl_Xatextplainutf2 || - t == fl_Xatextplain || - t == fl_XaUtf8String) { - type = t; - break; - } - // rest are only used if no UTF-8 available: - if (t == fl_XaText || - t == fl_XaTextUriList || - t == fl_XaCompoundText) type = t; - } + /*for (unsigned i = 0; i<count; i++) { + fprintf(stderr," %s", XGetAtomName(fl_display, ((Atom*)portion)[i]) ); + } + fprintf(stderr,"\n"); + */ + Atom t, type = XA_STRING; + if (Fl::e_clipboard_type == Fl::clipboard_image) { // searching for image data + for (unsigned i = 0; i<count; i++) { + t = ((Atom*)portion)[i]; + if (t == fl_XaImageBmp || t == fl_XaImagePNG) { + type = t; + goto found; + } + } + XFree(portion); + return true; + } + for (unsigned i = 0; i<count; i++) { // searching for text data + t = ((Atom*)portion)[i]; + if (t == fl_Xatextplainutf || + t == fl_Xatextplainutf2 || + t == fl_Xatextplain || + t == fl_XaUtf8String) { + type = t; + break; + } + // rest are only used if no UTF-8 available: + if (t == fl_XaText || + t == fl_XaTextUriList || + t == fl_XaCompoundText) type = t; + } found: - XFree(portion); portion = 0; - Atom property = xevent.xselection.property; - XConvertSelection(fl_display, property, type, property, - fl_xid(Fl::first_window()), - fl_event_time); - if (type == fl_XaImageBmp) { - Fl::e_clipboard_type = Fl::clipboard_image; - //buffer_format = "image/bmp"; - } - else if (type == fl_XaImagePNG) { - Fl::e_clipboard_type = Fl::clipboard_image; - //buffer_format = "image/png"; - } - else { - Fl::e_clipboard_type = Fl::clipboard_plain_text; - // buffer_format = Fl::clipboard_plain_text; - } - // fprintf(stderr,"used format=%s\n", buffer_format); - return true; + XFree(portion); portion = 0; + Atom property = xevent.xselection.property; + XConvertSelection(fl_display, property, type, property, + fl_xid(Fl::first_window()), + fl_event_time); + if (type == fl_XaImageBmp) { + Fl::e_clipboard_type = Fl::clipboard_image; + //buffer_format = "image/bmp"; + } + else if (type == fl_XaImagePNG) { + Fl::e_clipboard_type = Fl::clipboard_image; + //buffer_format = "image/png"; + } + else { + Fl::e_clipboard_type = Fl::clipboard_plain_text; + // buffer_format = Fl::clipboard_plain_text; + } + // fprintf(stderr,"used format=%s\n", buffer_format); + return true; } - if (actual == fl_INCR) { - bytesread = getIncrData(sn_buffer, xevent.xselection, *(long*)portion); - XFree(portion); - break; - } - // Make sure we got something sane... + if (actual == fl_INCR) { + bytesread = getIncrData(sn_buffer, xevent.xselection, *(long*)portion); + XFree(portion); + break; + } + // Make sure we got something sane... if ((portion == NULL) || (format != 8) || (count == 0)) { - if (portion) { XFree(portion); portion = 0; } + if (portion) { XFree(portion); portion = 0; } return true; } sn_buffer = (unsigned char*)realloc(sn_buffer, bytesread+count+remaining+1); @@ -1534,9 +1532,9 @@ int fl_handle(const XEvent& thisevent) if (fd == -1) return 0; uchar *p = sn_buffer; ssize_t towrite = bytesread, written; while (towrite) { - written = write(fd, p, towrite); - p += written; towrite -= written; - } + written = write(fd, p, towrite); + p += written; towrite -= written; + } close(fd); free(sn_buffer); sn_buffer = 0; shared = Fl_Shared_Image::get(tmp_fname); @@ -1589,48 +1587,48 @@ int fl_handle(const XEvent& thisevent) e.property = fl_xevent->xselectionrequest.property; if (fl_selection_type[clipboard] == Fl::clipboard_plain_text) { if (e.target == TARGETS) { - Atom a[3] = {fl_XaUtf8String, XA_STRING, fl_XaText}; - XChangeProperty(fl_display, e.requestor, e.property, - XA_ATOM, atom_bits, 0, (unsigned char*)a, 3); + Atom a[3] = {fl_XaUtf8String, XA_STRING, fl_XaText}; + XChangeProperty(fl_display, e.requestor, e.property, + XA_ATOM, atom_bits, 0, (unsigned char*)a, 3); } else { - if (/*e.target == XA_STRING &&*/ fl_selection_length[clipboard]) { - if (e.target == fl_XaUtf8String || - e.target == XA_STRING || - e.target == fl_XaCompoundText || - e.target == fl_XaText || - e.target == fl_Xatextplain || - e.target == fl_Xatextplainutf || - e.target == fl_Xatextplainutf2) { - // clobber the target type, this seems to make some applications - // behave that insist on asking for XA_TEXT instead of UTF8_STRING - // Does not change XA_STRING as that breaks xclipboard. - if (e.target != XA_STRING) e.target = fl_XaUtf8String; - XChangeProperty(fl_display, e.requestor, e.property, - e.target, 8, 0, - (unsigned char *)fl_selection_buffer[clipboard], - fl_selection_length[clipboard]); - } - } else { - // char* x = XGetAtomName(fl_display,e.target); - // fprintf(stderr,"selection request of %s\n",x); - // XFree(x); - e.property = 0; - } + if (/*e.target == XA_STRING &&*/ fl_selection_length[clipboard]) { + if (e.target == fl_XaUtf8String || + e.target == XA_STRING || + e.target == fl_XaCompoundText || + e.target == fl_XaText || + e.target == fl_Xatextplain || + e.target == fl_Xatextplainutf || + e.target == fl_Xatextplainutf2) { + // clobber the target type, this seems to make some applications + // behave that insist on asking for XA_TEXT instead of UTF8_STRING + // Does not change XA_STRING as that breaks xclipboard. + if (e.target != XA_STRING) e.target = fl_XaUtf8String; + XChangeProperty(fl_display, e.requestor, e.property, + e.target, 8, 0, + (unsigned char *)fl_selection_buffer[clipboard], + fl_selection_length[clipboard]); + } + } else { + // char* x = XGetAtomName(fl_display,e.target); + // fprintf(stderr,"selection request of %s\n",x); + // XFree(x); + e.property = 0; + } } } else { // image in clipboard if (e.target == TARGETS) { - Atom a[1] = {fl_XaImageBmp}; - XChangeProperty(fl_display, e.requestor, e.property, - XA_ATOM, atom_bits, 0, (unsigned char*)a, 1); + Atom a[1] = {fl_XaImageBmp}; + XChangeProperty(fl_display, e.requestor, e.property, + XA_ATOM, atom_bits, 0, (unsigned char*)a, 1); } else { - if (e.target == fl_XaImageBmp && fl_selection_length[clipboard]) { - XChangeProperty(fl_display, e.requestor, e.property, - e.target, 8, 0, - (unsigned char *)fl_selection_buffer[clipboard], - fl_selection_length[clipboard]); - } else { - e.property = 0; - } + if (e.target == fl_XaImageBmp && fl_selection_length[clipboard]) { + XChangeProperty(fl_display, e.requestor, e.property, + e.target, 8, 0, + (unsigned char *)fl_selection_buffer[clipboard], + fl_selection_length[clipboard]); + } else { + e.property = 0; + } } } XSendEvent(fl_display, e.requestor, 0, 0, (XEvent *)&e);} @@ -1661,13 +1659,13 @@ int fl_handle(const XEvent& thisevent) Fl::handle(FL_CLOSE, window); Fl_X* X = Fl_X::i(window); if (X) { // indicates the FLTK window was not closed - X->xid = (Window)0; // indicates the X11 window was already destroyed - window->hide(); - int oldx = window->x(), oldy = window->y(); - window->position(0, 0); - window->position(oldx, oldy); - window->show(); // recreate the X11 window in support of the FLTK window - } + X->xid = (Window)0; // indicates the X11 window was already destroyed + window->hide(); + int oldx = window->x(), oldy = window->y(); + window->position(0, 0); + window->position(oldx, oldy); + window->show(); // recreate the X11 window in support of the FLTK window + } return 1; } case ClientMessage: { @@ -1691,7 +1689,7 @@ int fl_handle(const XEvent& thisevent) if (actual != XA_ATOM || format != 32 || count<4 || !cm_buffer) { if ( cm_buffer ) { XFree(cm_buffer); cm_buffer = 0; } goto FAILED; - } + } delete [] fl_dnd_source_types; fl_dnd_source_types = new Atom[count+1]; for (unsigned i = 0; i < count; i++) { @@ -1715,17 +1713,17 @@ int fl_handle(const XEvent& thisevent) for (i = 0; fl_dnd_source_types[i]; i ++) { Atom t = ((Atom*)fl_dnd_source_types)[i]; //printf("fl_dnd_source_types[%d]=%ld(%s)\n",i,t,XGetAtomName(fl_display,t)); - if (t == fl_Xatextplainutf || // "text/plain;charset=UTF-8" - t == fl_Xatextplainutf2 || // "text/plain;charset=utf-8" -- See STR#2930 - t == fl_Xatextplain || // "text/plain" - t == fl_XaUtf8String) { // "UTF8_STRING" + if (t == fl_Xatextplainutf || // "text/plain;charset=UTF-8" + t == fl_Xatextplainutf2 || // "text/plain;charset=utf-8" -- See STR#2930 + t == fl_Xatextplain || // "text/plain" + t == fl_XaUtf8String) { // "UTF8_STRING" type = t; break; - } + } // rest are only used if no UTF-8 available: - if (t == fl_XaText || // "TEXT" - t == fl_XaTextUriList || // "text/uri-list" - t == fl_XaCompoundText) type = t; // "COMPOUND_TEXT" + if (t == fl_XaText || // "TEXT" + t == fl_XaTextUriList || // "text/uri-list" + t == fl_XaCompoundText) type = t; // "COMPOUND_TEXT" } fl_dnd_type = type; @@ -1853,17 +1851,17 @@ int fl_handle(const XEvent& thisevent) int len; if (fl_xim_ic) { - Status status; - len = XUtf8LookupString(fl_xim_ic, (XKeyPressedEvent *)&xevent.xkey, - kp_buffer, kp_buffer_len, &keysym, &status); - - while (status == XBufferOverflow && kp_buffer_len < 50000) { - kp_buffer_len = kp_buffer_len * 5 + 1; - kp_buffer = (char*)realloc(kp_buffer, kp_buffer_len); - len = XUtf8LookupString(fl_xim_ic, (XKeyPressedEvent *)&xevent.xkey, - kp_buffer, kp_buffer_len, &keysym, &status); - } - keysym = fl_KeycodeToKeysym(fl_display, keycode, 0); + Status status; + len = XUtf8LookupString(fl_xim_ic, (XKeyPressedEvent *)&xevent.xkey, + kp_buffer, kp_buffer_len, &keysym, &status); + + while (status == XBufferOverflow && kp_buffer_len < 50000) { + kp_buffer_len = kp_buffer_len * 5 + 1; + kp_buffer = (char*)realloc(kp_buffer, kp_buffer_len); + len = XUtf8LookupString(fl_xim_ic, (XKeyPressedEvent *)&xevent.xkey, + kp_buffer, kp_buffer_len, &keysym, &status); + } + keysym = fl_KeycodeToKeysym(fl_display, keycode, 0); } else { //static XComposeStatus compose; len = XLookupString((XKeyEvent*)&(xevent.xkey), @@ -1943,67 +1941,67 @@ int fl_handle(const XEvent& thisevent) // Windows keys should be mapped to for X11. So we need to help out a // bit and map all variants to the same FLTK key... switch (keysym) { - case XK_Meta_L: - case XK_Hyper_L: - case XK_Super_L: - keysym = FL_Meta_L; - break; - case XK_Meta_R: - case XK_Hyper_R: - case XK_Super_R: - keysym = FL_Meta_R; - break; + case XK_Meta_L: + case XK_Hyper_L: + case XK_Super_L: + keysym = FL_Meta_L; + break; + case XK_Meta_R: + case XK_Hyper_R: + case XK_Super_R: + keysym = FL_Meta_R; + break; } // Convert the multimedia keys to safer, portable values switch (keysym) { // XF names come from X11/XF86keysym.h case 0x1008FF11: // XF86XK_AudioLowerVolume: - keysym = FL_Volume_Down; - break; + keysym = FL_Volume_Down; + break; case 0x1008FF12: // XF86XK_AudioMute: - keysym = FL_Volume_Mute; - break; + keysym = FL_Volume_Mute; + break; case 0x1008FF13: // XF86XK_AudioRaiseVolume: - keysym = FL_Volume_Up; - break; + keysym = FL_Volume_Up; + break; case 0x1008FF14: // XF86XK_AudioPlay: - keysym = FL_Media_Play; - break; + keysym = FL_Media_Play; + break; case 0x1008FF15: // XF86XK_AudioStop: - keysym = FL_Media_Stop; - break; + keysym = FL_Media_Stop; + break; case 0x1008FF16: // XF86XK_AudioPrev: - keysym = FL_Media_Prev; - break; + keysym = FL_Media_Prev; + break; case 0x1008FF17: // XF86XK_AudioNext: - keysym = FL_Media_Next; - break; + keysym = FL_Media_Next; + break; case 0x1008FF18: // XF86XK_HomePage: - keysym = FL_Home_Page; - break; + keysym = FL_Home_Page; + break; case 0x1008FF19: // XF86XK_Mail: - keysym = FL_Mail; - break; + keysym = FL_Mail; + break; case 0x1008FF1B: // XF86XK_Search: - keysym = FL_Search; - break; + keysym = FL_Search; + break; case 0x1008FF26: // XF86XK_Back: - keysym = FL_Back; - break; + keysym = FL_Back; + break; case 0x1008FF27: // XF86XK_Forward: - keysym = FL_Forward; - break; + keysym = FL_Forward; + break; case 0x1008FF28: // XF86XK_Stop: - keysym = FL_Stop; - break; + keysym = FL_Stop; + break; case 0x1008FF29: // XF86XK_Refresh: - keysym = FL_Refresh; - break; + keysym = FL_Refresh; + break; case 0x1008FF2F: // XF86XK_Sleep: - keysym = FL_Sleep; - break; + keysym = FL_Sleep; + break; case 0x1008FF30: // XF86XK_Favorites: - keysym = FL_Favorites; - break; + keysym = FL_Favorites; + break; } // We have to get rid of the XK_KP_function keys, because they are // not produced on Windoze and thus case statements tend not to check @@ -2041,7 +2039,7 @@ int fl_handle(const XEvent& thisevent) set_event_xy(window); Fl::e_is_click = 0; } break; - + case ButtonPress: Fl::e_keysym = FL_Button + xevent.xbutton.button; set_event_xy(window); @@ -2053,11 +2051,11 @@ int fl_handle(const XEvent& thisevent) Fl::e_dy = +1; // Down event = FL_MOUSEWHEEL; } else if (xevent.xbutton.button == 6) { - Fl::e_dx = -1; // Left - event = FL_MOUSEWHEEL; + Fl::e_dx = -1; // Left + event = FL_MOUSEWHEEL; } else if (xevent.xbutton.button == 7) { - Fl::e_dx = +1; // Right - event = FL_MOUSEWHEEL; + Fl::e_dx = +1; // Right + event = FL_MOUSEWHEEL; } else { Fl::e_state |= (FL_BUTTON1 << (xevent.xbutton.button-1)); event = FL_PUSH; @@ -2074,14 +2072,14 @@ int fl_handle(const XEvent& thisevent) if (xevent.xproperty.state != PropertyDelete) { unsigned long nitems; unsigned long *words = 0; - if (0 == get_xwinprop(xid, fl_NET_WM_STATE, 64, &nitems, &words) ) { + if (0 == get_xwinprop(xid, fl_NET_WM_STATE, 64, &nitems, &words) ) { for (unsigned long item = 0; item < nitems; item++) { if (words[item] == fl_NET_WM_STATE_FULLSCREEN) { fullscreen_state = 1; } } } - if ( words ) { XFree(words); words = 0; } + if ( words ) { XFree(words); words = 0; } } if (window->fullscreen_active() && !fullscreen_state) { window->_clear_fullscreen(); @@ -2130,7 +2128,7 @@ int fl_handle(const XEvent& thisevent) in_a_window = true; { XIMStyles *xim_styles = NULL; if(!fl_xim_im || XGetIMValues(fl_xim_im, XNQueryInputStyle, &xim_styles, NULL, NULL)) { - fl_init_xim(); + fl_init_xim(); } if (xim_styles) XFree(xim_styles); } @@ -2186,7 +2184,7 @@ int fl_handle(const XEvent& thisevent) // tell Fl_Window about it and set flag to prevent echoing: resize_bug_fix = window; -#if USE_XFT +#if USE_XFT if (!Fl_X11_Window_Driver::data_for_resize_window_between_screens_.busy && ( ceil(W/s) != window->w() || ceil(H/s) != window->h() ) ) { window->resize(X/s, Y/s, ceil(W/s), ceil(H/s)); @@ -2379,19 +2377,19 @@ void Fl_X11_Window_Driver::activate_window() { void Fl_X11_Window_Driver::fullscreen_on() { if (Fl_X11_Screen_Driver::ewmh_supported()) { int top, bottom, left, right; - + top = fullscreen_screen_top(); bottom = fullscreen_screen_bottom(); left = fullscreen_screen_left(); right = fullscreen_screen_right(); - + if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { top = screen_num(); bottom = top; left = top; right = top; } - + send_wm_event(fl_xid(pWindow), fl_NET_WM_FULLSCREEN_MONITORS, top, bottom, left, right); send_wm_state_event(fl_xid(pWindow), 1, fl_NET_WM_STATE_FULLSCREEN); @@ -2547,8 +2545,8 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) } // For the non-EWMH fullscreen case, we cannot use the code above, // since we do not want save_under, do not want to turn off the - // border, and cannot grab without an existing window. Besides, - // there is no clear_override(). + // border, and cannot grab without an existing window. Besides, + // there is no clear_override(). if (win->fullscreen_active() && !Fl_X11_Screen_Driver::ewmh_supported()) { int sx, sy, sw, sh; attr.override_redirect = 1; @@ -2604,7 +2602,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) long pid; pid = getpid(); XChangeProperty(fl_display, xp->xid, fl_NET_WM_PID, - XA_CARDINAL, 32, 0, (unsigned char *)&pid, 1); + XA_CARDINAL, 32, 0, (unsigned char *)&pid, 1); if (!win->parent() && !attr.override_redirect) { // Communicate all kinds 'o junk to the X Window Manager: @@ -2762,7 +2760,7 @@ void Fl_X11_Window_Driver::sendxjunk() { hints->width_inc = 0; hints->height_inc = 0; } - + hints->win_gravity = StaticGravity; // see the file /usr/include/X11/Xm/MwmUtil.h: @@ -3054,10 +3052,10 @@ void Fl_X11_Window_Driver::label(const char *name, const char *iname) { if (!iname) iname = fl_filename_name(name); int inamelen = strlen(iname); Window win = fl_xid(pWindow); - XChangeProperty(fl_display, win, fl_NET_WM_NAME, fl_XaUtf8String, 8, 0, (uchar*)name, namelen); // utf8 - XChangeProperty(fl_display, win, XA_WM_NAME, XA_STRING, 8, 0, (uchar*)name, namelen); // non-utf8 - XChangeProperty(fl_display, win, fl_NET_WM_ICON_NAME, fl_XaUtf8String, 8, 0, (uchar*)iname, inamelen); // utf8 - XChangeProperty(fl_display, win, XA_WM_ICON_NAME, XA_STRING, 8, 0, (uchar*)iname, inamelen); // non-utf8 + XChangeProperty(fl_display, win, fl_NET_WM_NAME, fl_XaUtf8String, 8, 0, (uchar*)name, namelen); // utf8 + XChangeProperty(fl_display, win, XA_WM_NAME, XA_STRING, 8, 0, (uchar*)name, namelen); // non-utf8 + XChangeProperty(fl_display, win, fl_NET_WM_ICON_NAME, fl_XaUtf8String, 8, 0, (uchar*)iname, inamelen); // utf8 + XChangeProperty(fl_display, win, XA_WM_ICON_NAME, XA_STRING, 8, 0, (uchar*)iname, inamelen); // non-utf8 } } @@ -3125,7 +3123,7 @@ void printFront(Fl_Widget *o, void *data) printer.rotate(ROTATE); printer.print_widget( win, - win->w()/2, - win->h()/2 ); //printer.print_window_part( win, 0,0, win->w(), win->h(), - win->w()/2, - win->h()/2 ); -#else +#else printer.print_window(win); //printer.print_window_part( win, 0,0, win->w(), win->h(), 0,0 ); #endif @@ -3165,7 +3163,3 @@ static int unused = prepare_print_button(); #endif // USE_PRINT_BUTTON #endif // !defined(FL_DOXYGEN) - -// -// End of "$Id$". -// diff --git a/src/Makefile b/src/Makefile index 92215fbae..0cbde688f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,4 @@ # -# "$Id$" -# # Library Makefile for the Fast Light Tool Kit (FLTK). # # Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # # Note: see ../configure.in and/or ../makeinclude for definition of @@ -982,7 +980,3 @@ uninstall: $(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \ $(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\ fi - -# -# End of "$Id$". -# diff --git a/src/Xutf8.h b/src/Xutf8.h index 050226500..207c879b6 100644 --- a/src/Xutf8.h +++ b/src/Xutf8.h @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2010 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #if ! ( defined(_Xutf8_h) || defined(FL_DOXYGEN) ) @@ -28,55 +27,55 @@ extern "C" { #include <FL/Fl_Export.H> typedef struct { - int nb_font; - char **font_name_list; - int *encodings; - XFontStruct **fonts; - Font fid; - int ascent; - int descent; - int *ranges; + int nb_font; + char **font_name_list; + int *encodings; + XFontStruct **fonts; + Font fid; + int ascent; + int descent; + int *ranges; } XUtf8FontStruct; XUtf8FontStruct * XCreateUtf8FontStruct ( - Display *dpy, - const char *base_font_name_list); + Display *dpy, + const char *base_font_name_list); void XUtf8DrawString( - Display *display, - Drawable d, + Display *display, + Drawable d, XUtf8FontStruct *font_set, - GC gc, - int x, - int y, - const char *string, - int num_bytes); + GC gc, + int x, + int y, + const char *string, + int num_bytes); void XUtf8_measure_extents( - Display *display, - Drawable d, + Display *display, + Drawable d, XUtf8FontStruct *font_set, - GC gc, - int *xx, - int *yy, - int *ww, - int *hh, - const char *string, - int num_bytes); + GC gc, + int *xx, + int *yy, + int *ww, + int *hh, + const char *string, + int num_bytes); void XUtf8DrawRtlString( - Display *display, - Drawable d, + Display *display, + Drawable d, XUtf8FontStruct *font_set, - GC gc, - int x, - int y, - const char *string, - int num_bytes); + GC gc, + int x, + int y, + const char *string, + int num_bytes); void XUtf8DrawImageString( @@ -92,12 +91,12 @@ XUtf8DrawImageString( int XUtf8TextWidth( XUtf8FontStruct *font_set, - const char *string, - int num_bytes); + const char *string, + int num_bytes); int XUtf8UcsWidth( - XUtf8FontStruct *font_set, - unsigned int ucs); + XUtf8FontStruct *font_set, + unsigned int ucs); FL_EXPORT int fl_XGetUtf8FontAndGlyph( @@ -108,40 +107,40 @@ fl_XGetUtf8FontAndGlyph( void XFreeUtf8FontStruct( - Display *dpy, - XUtf8FontStruct *font_set); + Display *dpy, + XUtf8FontStruct *font_set); int XConvertUtf8ToUcs( - const unsigned char *buf, - int len, - unsigned int *ucs); + const unsigned char *buf, + int len, + unsigned int *ucs); int XConvertUcsToUtf8( - unsigned int ucs, - char *buf); + unsigned int ucs, + char *buf); int XUtf8CharByteLen( - const unsigned char *buf, - int len); + const unsigned char *buf, + int len); int XCountUtf8Char( - const unsigned char *buf, - int len); + const unsigned char *buf, + int len); int XFastConvertUtf8ToUcs( - const unsigned char *buf, - int len, - unsigned int *ucs); + const unsigned char *buf, + int len, + unsigned int *ucs); long XKeysymToUcs( - KeySym keysym); + KeySym keysym); #ifdef X_HAVE_UTF8_STRING #define XUtf8LookupString Xutf8LookupString @@ -161,7 +160,3 @@ XUtf8LookupString( # endif #endif - -/* - * End of "$Id$". - */ diff --git a/src/cgdebug.h b/src/cgdebug.h index 0aa1e24d9..2ff2a9aa3 100644 --- a/src/cgdebug.h +++ b/src/cgdebug.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // OS X Core Graphics debugging help for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,14 +7,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -// This file allows easier debugging of Mac OS X Core Graphics +// This file allows easier debugging of Mac OS X Core Graphics // code. This file is normally not included into any FLTK builds, // but since it has proven to be tremendously useful in debugging // the FLTK port to "Quartz", I decided to add this file in case @@ -28,8 +26,8 @@ // // Running "./configure" will remove this line from "config.h". // -// When used erreanously, Core Graphics prints warnings to -// stderr. This is helpful, however it is not possible to +// When used erreanously, Core Graphics prints warnings to +// stderr. This is helpful, however it is not possible to // associate a line number or source file with the warning message. // This headr file outputs a trace of CG calls, interweaveing // them with CG warnings. @@ -74,13 +72,13 @@ //+StrokePath //+TranslateCTM -inline OSStatus dbgLocation(const char *file, int line) +inline OSStatus dbgLocation(const char *file, int line) { fprintf(stderr, "%s:%d ", file, line); return 0; } -inline OSStatus dbgEndl() +inline OSStatus dbgEndl() { fprintf(stderr, "\n"); return 0; @@ -107,7 +105,7 @@ inline void dbgCGContextFillRect(CGContextRef a, CGRect b) dbgCGContextFillRect(a, b); \ fprintf(stderr, "\n"); } -inline OSStatus dbgQDEndCGContext(CGrafPtr a, CGContextRef *b) +inline OSStatus dbgQDEndCGContext(CGrafPtr a, CGContextRef *b) { return QDEndCGContext(a, b); } @@ -117,7 +115,7 @@ inline OSStatus dbgQDEndCGContext(CGrafPtr a, CGContextRef *b) dbgQDEndCGContext(a, b) + \ dbgEndl() ) -inline OSStatus dbgQDBeginCGContext(CGrafPtr a, CGContextRef *b) +inline OSStatus dbgQDBeginCGContext(CGrafPtr a, CGContextRef *b) { return QDBeginCGContext(a, b); } @@ -127,7 +125,7 @@ inline OSStatus dbgQDBeginCGContext(CGrafPtr a, CGContextRef *b) dbgQDBeginCGContext(a, b) + \ dbgEndl() ) -inline void dbgClipCGContextToRegion(CGContextRef a, const Rect *b, RgnHandle c) +inline void dbgClipCGContextToRegion(CGContextRef a, const Rect *b, RgnHandle c) { ClipCGContextToRegion(a, b, c); } @@ -148,7 +146,7 @@ inline void dbgCGContextMoveToPoint(CGContextRef context, float x, float y) fprintf(stderr, "\n"); } inline void dbgCGContextFillPath(CGContextRef context) -{ +{ CGContextFillPath(context); } @@ -158,7 +156,7 @@ inline void dbgCGContextFillPath(CGContextRef context) fprintf(stderr, "\n"); } inline void dbgCGContextClosePath(CGContextRef context) -{ +{ CGContextClosePath(context); } @@ -168,7 +166,7 @@ inline void dbgCGContextClosePath(CGContextRef context) fprintf(stderr, "\n"); } inline void dbgCGContextFlush(CGContextRef context) -{ +{ CGContextFlush(context); } @@ -178,7 +176,7 @@ inline void dbgCGContextFlush(CGContextRef context) fprintf(stderr, "\n"); } inline void dbgCGContextSaveGState(CGContextRef context) -{ +{ CGContextSaveGState(context); } @@ -188,7 +186,7 @@ inline void dbgCGContextSaveGState(CGContextRef context) fprintf(stderr, "\n"); } inline void dbgCGContextRestoreGState(CGContextRef context) -{ +{ CGContextRestoreGState(context); } @@ -200,7 +198,3 @@ inline void dbgCGContextRestoreGState(CGContextRef context) #endif -// -// End of "$Id$". -// - diff --git a/src/cmap.cxx b/src/cmap.cxx index 0825a50f5..7484d7642 100644 --- a/src/cmap.cxx +++ b/src/cmap.cxx @@ -7,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// https://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -44,31 +44,31 @@ static short cmap[256][3] = { // 3-bit colormap: - { 0, 0, 0}, // black - {III, 0, 0}, // red - { 0,III, 0}, // green - {III,III, 0}, // yellow - { 0, 0,III}, // blue - {III, 0,III}, // magenta - { 0,III,III}, // cyan - {III,III,III}, // white + { 0, 0, 0}, // black + {III, 0, 0}, // red + { 0,III, 0}, // green + {III,III, 0}, // yellow + { 0, 0,III}, // blue + {III, 0,III}, // magenta + { 0,III,III}, // cyan + {III,III,III}, // white // pastel versions of those colors, from SGI's standard color map: - { 85, 85, 85}, // 1/3 gray - {198,113,113}, // salmon? pale red? - {113,198,113}, // pale green - {142,142, 56}, // khaki - {113,113,198}, // pale blue - {142, 56,142}, // purple, orchid, pale magenta - { 56,142,142}, // cadet blue, aquamarine, pale cyan + { 85, 85, 85}, // 1/3 gray + {198,113,113}, // salmon? pale red? + {113,198,113}, // pale green + {142,142, 56}, // khaki + {113,113,198}, // pale blue + {142, 56,142}, // purple, orchid, pale magenta + { 56,142,142}, // cadet blue, aquamarine, pale cyan // The next location (15) is used for FL_SELECTION_COLOR. It formerly was // 2/3 gray but this is changed to be the Windows blue color. This allows // the default behavior on both X and Windows to match: - // {170,170,170}, // old 2/3 gray color + // {170,170,170}, // old 2/3 gray color - { 0, 0,128}, // 15 = FL_SELECTION_COLOR + { 0, 0,128}, // 15 = FL_SELECTION_COLOR // These next 16 (index 16 - 31) are the FL_FREE_COLOR area. In some // versions of fltk these were filled with random colors that a Irix 5.3 @@ -77,7 +77,7 @@ static short cmap[256][3] = { // This version uses colors that NewTek has assigned for their GUI // (from George Yohng): - {168,168,152}, // 16 = FL_FREE_COLOR + {168,168,152}, // 16 = FL_FREE_COLOR {232,232,216}, {104,104, 88}, {152,168,168}, @@ -92,7 +92,7 @@ static short cmap[256][3] = { {144,144,144}, {192,192,192}, { 80, 80, 80}, - {160,160,160}, // 31 + {160,160,160}, // 31 // The rest of the colormap is a gray ramp and table, filled in below: }; @@ -149,10 +149,10 @@ int main() { for (b = 0; b < 5; b++) { for (r = 0; r < 5; r++) { for (g = 0; g < 8; g++) { - cmap[i][0] = r * 255 / 4; - cmap[i][1] = g * 255 / 7; - cmap[i][2] = b * 255 / 4; - i++; + cmap[i][0] = r * 255 / 4; + cmap[i][1] = g * 255 / 7; + cmap[i][2] = b * 255 / 4; + i++; } } } @@ -170,11 +170,11 @@ int main() { printf("// the file \"COPYING\" which should have been included with this file. If this\n"); printf("// file is missing or damaged, see the license at:\n"); printf("//\n"); - printf("// https://www.fltk.org/COPYING.php\n"); + printf("// https://www.fltk.org/COPYING.php\n"); printf("//\n"); - printf("// Please report all bugs and problems on the following page:\n"); + printf("// Please see the following page on how to report bugs and issues:\n"); printf("//\n"); - printf("// https://www.fltk.org/str.php\n"); + printf("// https://www.fltk.org/bugs.php\n"); printf("//\n"); // write color map values @@ -195,7 +195,3 @@ int main() { return 0; } - -// -// End of "$Id$". -// diff --git a/src/config_lib.h b/src/config_lib.h index b4a80e918..bbcfb75f5 100644 --- a/src/config_lib.h +++ b/src/config_lib.h @@ -1,9 +1,17 @@ /* - * "$Id$" - * * Configuration file for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2018 by Bill Spitzak and others. + * Copyright 1998-2020 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: + * + * https://www.fltk.org/COPYING.php + * + * Please see the following page on how to report bugs and issues: + * + * https://www.fltk.org/bugs.php */ #ifndef FL_CONFIG_LIB_H @@ -78,7 +86,3 @@ #endif - -/* - * End of "$Id$". - */ diff --git a/src/drivers/Android/Fl_Android_Application.H b/src/drivers/Android/Fl_Android_Application.H index cb20decf9..e511b6748 100644 --- a/src/drivers/Android/Fl_Android_Application.H +++ b/src/drivers/Android/Fl_Android_Application.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android Native Application interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -270,7 +268,3 @@ private: #endif // FL_ANDROID_APPLICATION_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Application.cxx b/src/drivers/Android/Fl_Android_Application.cxx index 015cc5cee..87053543a 100644 --- a/src/drivers/Android/Fl_Android_Application.cxx +++ b/src/drivers/Android/Fl_Android_Application.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android Native Application interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -842,8 +840,3 @@ Fl_Android_Java::~Fl_Android_Java() pJavaVM->DetachCurrentThread(); } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Clipping.H b/src/drivers/Android/Fl_Android_Graphics_Clipping.H index 863c1d51b..dbec82f18 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Clipping.H +++ b/src/drivers/Android/Fl_Android_Graphics_Clipping.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Graphics regions and clipping for the Fast Light Tool Kit (FLTK). // // Copyright 2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -183,7 +181,3 @@ protected: #endif // FL_ANDROID_GRAPHICS_CLIPPING_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx b/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx index 4de919922..eaae68c50 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Clipping.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Clipping region routines for the Fast Light Tool Kit (FLTK). // // Copyright 2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -808,8 +806,3 @@ int Fl_Android_Graphics_Driver::not_clipped(int x, int y, int w, int h) return 1; } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.H b/src/drivers/Android/Fl_Android_Graphics_Driver.H index 26d0c8509..1c54a0ff2 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver.H +++ b/src/drivers/Android/Fl_Android_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -352,7 +350,3 @@ public: #endif // FL_ANDROID_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx index db40dc729..b15c677b7 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Graphics routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -1270,8 +1268,3 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) { fl_color(r,g,b); fl_rectf(x,y,w,h); } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Font.H b/src/drivers/Android/Fl_Android_Graphics_Font.H index 0f39700b3..b07ba7d3c 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Font.H +++ b/src/drivers/Android/Fl_Android_Graphics_Font.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FL_ANDROID_GRAPHICS_FONT_H @@ -132,7 +130,3 @@ public: #endif // FL_ANDROID_GRAPHICS_FONT_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Graphics_Font.cxx b/src/drivers/Android/Fl_Android_Graphics_Font.cxx index ac4a026c4..48e61525c 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Font.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Graphics routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -797,8 +795,3 @@ void Fl_Android_Graphics_Driver::font_name(int num, const char *name) s->fontname[0] = 0; } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx b/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx index 33aa6507a..f15cc1c80 100644 --- a/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -115,7 +113,3 @@ void Fl_GDI_Image_Surface_Driver::end_current_(Fl_Surface_Device*) } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Screen_Driver.H b/src/drivers/Android/Fl_Android_Screen_Driver.H index 636e91dee..f5fab6750 100644 --- a/src/drivers/Android/Fl_Android_Screen_Driver.H +++ b/src/drivers/Android/Fl_Android_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -37,7 +35,7 @@ extern void (*fl_lock_function)(); class Fl_Window; -class FL_EXPORT Fl_Android_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_Android_Screen_Driver : public Fl_Screen_Driver { // easy access to the super class typedef Fl_Screen_Driver super; @@ -139,7 +137,7 @@ public: virtual void disable_im(); virtual void open_display_platform(); virtual void offscreen_size(Fl_Offscreen off, int &width, int &height); -#if defined(FLTK_HIDPI_SUPPORT) +#if defined(FLTK_HIDPI_SUPPORT) virtual APP_SCALING_CAPABILITY rescalable() { return PER_SCREEN_APP_SCALING; } @@ -176,7 +174,3 @@ public: }; #endif // FL_ANDROID_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Screen_Driver.cxx b/src/drivers/Android/Fl_Android_Screen_Driver.cxx index ef6957382..b37421cc8 100644 --- a/src/drivers/Android/Fl_Android_Screen_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android screen interface for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -568,8 +566,3 @@ void Fl_Android_Screen_Driver::grab(Fl_Window* win) \} \endcond */ - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx b/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx index c708040ec..9aaf0df7f 100644 --- a/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx +++ b/src/drivers/Android/Fl_Android_Screen_Keyboard.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Android screen interface for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -212,7 +210,7 @@ static int android_to_fltk_modifiers(int a) int Fl_Android_Screen_Driver::handle_keyboard_event(AInputQueue *queue, AInputEvent *event) { /* -int32_t AKeyEvent_getAction (const AInputEvent *key_event) +int32_t AKeyEvent_getAction (const AInputEvent *key_event) { AKEY_EVENT_ACTION_DOWN = 0, AKEY_EVENT_ACTION_UP = 1, AKEY_EVENT_ACTION_MULTIPLE = 2 } > Reading up on ACTION_MULTIPLE also explains how to deal with > special or sequences of characters: @@ -221,14 +219,14 @@ int32_t AKeyEvent_getAction (const AInputEvent *key_event) > executed. Otherwise, if the key code is KEYCODE_UNKNOWN, then this > is a sequence of characters as returned by getCharacters()." -int32_t AKeyEvent_getFlags (const AInputEvent *key_event) +int32_t AKeyEvent_getFlags (const AInputEvent *key_event) { AKEY_EVENT_FLAG_WOKE_HERE = 0x1, AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2, AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4, AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8, AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10, AKEY_EVENT_FLAG_CANCELED = 0x20, AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40, AKEY_EVENT_FLAG_LONG_PRESS = 0x80, AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100, AKEY_EVENT_FLAG_TRACKING = 0x200, AKEY_EVENT_FLAG_FALLBACK = 0x400 } -int32_t AKeyEvent_getKeyCode (const AInputEvent *key_event) +int32_t AKeyEvent_getKeyCode (const AInputEvent *key_event) { AKEYCODE_UNKNOWN = 0, AKEYCODE_SOFT_LEFT = 1, AKEYCODE_SOFT_RIGHT = 2, AKEYCODE_HOME = 3, AKEYCODE_BACK = 4, AKEYCODE_CALL = 5, AKEYCODE_ENDCALL = 6, AKEYCODE_0 = 7, @@ -240,10 +238,10 @@ int32_t AKeyEvent_getKeyCode (const AInputEvent *key_event) AKEYCODE_CLEAR = 28, AKEYCODE_A = 29, AKEYCODE_B = 30, AKEYCODE_C = 31, AKEYCODE_D = 32, AKEYCODE_E = 33, AKEYCODE_F = 34, AKEYCODE_G = 35, ... -int32_t AKeyEvent_getScanCode (const AInputEvent *key_event) +int32_t AKeyEvent_getScanCode (const AInputEvent *key_event) { AKEY_STATE_UNKNOWN = -1, AKEY_STATE_UP = 0, AKEY_STATE_DOWN = 1, AKEY_STATE_VIRTUAL = 2 } -int32_t AKeyEvent_getMetaState (const AInputEvent *key_event) +int32_t AKeyEvent_getMetaState (const AInputEvent *key_event) { AMETA_NONE = 0, AMETA_ALT_ON = 0x02, AMETA_ALT_LEFT_ON = 0x10, AMETA_ALT_RIGHT_ON = 0x20, AMETA_SHIFT_ON = 0x01, AMETA_SHIFT_LEFT_ON = 0x40, AMETA_SHIFT_RIGHT_ON = 0x80, AMETA_SYM_ON = 0x04, @@ -252,9 +250,9 @@ int32_t AKeyEvent_getMetaState (const AInputEvent *key_event) AMETA_NUM_LOCK_ON = 0x200000, AMETA_SCROLL_LOCK_ON = 0x400000 } -int32_t AKeyEvent_getRepeatCount (const AInputEvent *key_event) -int64_t AKeyEvent_getDownTime (const AInputEvent *key_event) -int64_t AKeyEvent_getEventTime (const AInputEvent *key_event) +int32_t AKeyEvent_getRepeatCount (const AInputEvent *key_event) +int64_t AKeyEvent_getDownTime (const AInputEvent *key_event) +int64_t AKeyEvent_getEventTime (const AInputEvent *key_event) */ Fl_Android_Application::log_i("Key event: action=%d keyCode=%d metaState=0x%x scanCode=%d", AKeyEvent_getAction(event), @@ -452,9 +450,3 @@ void Fl_Android_Screen_Driver::release_keyboard() ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS); } } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_System_Driver.H b/src/drivers/Android/Fl_Android_System_Driver.H index e3ccb41bd..2a8682ddb 100644 --- a/src/drivers/Android/Fl_Android_System_Driver.H +++ b/src/drivers/Android/Fl_Android_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android system driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -123,7 +121,3 @@ public: }; #endif // FL_ANDROID_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_System_Driver.cxx b/src/drivers/Android/Fl_Android_System_Driver.cxx index 0c7185370..e6aa970e4 100644 --- a/src/drivers/Android/Fl_Android_System_Driver.cxx +++ b/src/drivers/Android/Fl_Android_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android system driver. // // Copyright 2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -95,12 +93,12 @@ extern "C" { Pseudo doxygen docs (static function intentionally not documented): - param[in] utf8 input string (UTF-8) - param[in,out] wbuf in: pointer to output string buffer - out: new string (the pointer may be changed) - param[in] lg optional: input string length (default = -1) + param[in] utf8 input string (UTF-8) + param[in,out] wbuf in: pointer to output string buffer + out: new string (the pointer may be changed) + param[in] lg optional: input string length (default = -1) - returns pointer to string buffer + returns pointer to string buffer */ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { unsigned len = (lg >= 0) ? (unsigned)lg : (unsigned)strlen(utf8); @@ -132,11 +130,11 @@ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { Pseudo doxygen docs (static function intentionally not documented): - param[in] wstr input string (wide character, UTF-16) - param[in,out] utf8 in: pointer to output string buffer - out: new string (pointer may be changed) + param[in] wstr input string (wide character, UTF-16) + param[in,out] utf8 in: pointer to output string buffer + out: new string (pointer may be changed) - returns pointer to string buffer + returns pointer to string buffer */ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { unsigned len = (unsigned)wcslen(wstr); @@ -152,7 +150,7 @@ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { /* Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -237,7 +235,7 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { # else wchar_t **ar; utf8_to_wchar(file, wbuf); - + int i = 0, n = 0; while (argv[i]) {i++; n++;} ar = (wchar_t **)malloc(sizeof(wchar_t *) * (n + 1)); @@ -252,14 +250,14 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { i++; } ar[n] = NULL; - _wexecvp(wbuf, ar); // STR #3040 + _wexecvp(wbuf, ar); // STR #3040 i = 0; while (i < n) { free(ar[i]); i++; } free(ar); - return -1; // STR #3040 + return -1; // STR #3040 #endif } @@ -360,7 +358,7 @@ char *fl_locale_to_utf8(const char *s, int len, UINT codepage) } if (codepage < 1) codepage = fl_codepage; buf[l] = 0; - + l = MultiByteToWideChar(codepage, 0, s, len, (WCHAR*)wbufa, buf_len); if (l < 0) l = 0; wbufa[l] = 0; @@ -501,16 +499,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr char *start = temp; char *end = temp+strlen(temp); int ret = 0; - for (char *a=temp; a<end; ) { // for each slash component + for (char *a=temp; a<end; ) { // for each slash component char *e; for (e=a; e<end && !isdirsep(*e); e++) {/*empty*/} // find next slash const char *value = 0; // this will point at substitute value switch (*a) { - case '~': // a home directory name - if (e <= a+1) { // current user's directory + case '~': // a home directory name + if (e <= a+1) { // current user's directory value = getenv("HOME"); } break; - case '$': /* an environment variable */ + case '$': /* an environment variable */ {char t = *e; *(char *)e = 0; value = getenv(a+1); *(char *)e = t;} break; } @@ -537,16 +535,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr } int // O - 0 if no change, 1 if changed -Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename +Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename int tolen, // I - Size of "to" buffer const char *from, // I - Absolute filename const char *base) // I - Find path relative to this path { - char *newslash; // Directory separator - const char *slash; // Directory separator + char *newslash; // Directory separator + const char *slash; // Directory separator char *cwd = 0L, *cwd_buf = 0L; if (base) cwd = cwd_buf = strdup(base); - + // return if "from" is not an absolute path if (from[0] == '\0' || (!isdirsep(*from) && !isalpha(*from) && from[1] != ':' && @@ -555,7 +553,7 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // return if "cwd" is not an absolute path if (!cwd || cwd[0] == '\0' || (!isdirsep(*cwd) && !isalpha(*cwd) && cwd[1] != ':' && @@ -564,18 +562,18 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // convert all backslashes into forward slashes for (newslash = strchr(cwd, '\\'); newslash; newslash = strchr(newslash + 1, '\\')) *newslash = '/'; - + // test for the exact same string and return "." if so if (!strcasecmp(from, cwd)) { strlcpy(to, ".", tolen); free(cwd_buf); return (1); } - + // test for the same drive. Return the absolute path if not if (tolower(*from & 255) != tolower(*cwd & 255)) { // Not the same drive... @@ -583,44 +581,44 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename free(cwd_buf); return 0; } - + // compare the path name without the drive prefix from += 2; cwd += 2; - + // compare both path names until we find a difference for (slash = from, newslash = cwd; *slash != '\0' && *newslash != '\0'; slash ++, newslash ++) if (isdirsep(*slash) && isdirsep(*newslash)) continue; else if (tolower(*slash & 255) != tolower(*newslash & 255)) break; - + // skip over trailing slashes if ( *newslash == '\0' && *slash != '\0' && !isdirsep(*slash) &&(newslash==cwd || !isdirsep(newslash[-1])) ) newslash--; - + // now go back to the first character of the first differing paths segment while (!isdirsep(*slash) && slash > from) slash --; if (isdirsep(*slash)) slash ++; - + // do the same for the current dir if (isdirsep(*newslash)) newslash --; if (*newslash != '\0') while (!isdirsep(*newslash) && newslash > cwd) newslash --; - + // prepare the destination buffer to[0] = '\0'; to[tolen - 1] = '\0'; - + // now add a "previous dir" sequence for every following slash in the cwd while (*newslash != '\0') { if (isdirsep(*newslash)) strlcat(to, "../", tolen); newslash ++; } - + // finally add the differing path from "from" strlcat(to, slash, tolen); - + free(cwd_buf); return 1; } @@ -666,9 +664,9 @@ int Fl_WinAPI_System_Driver::filename_absolute(char *to, int tolen, const char * int Fl_WinAPI_System_Driver::filename_isdir(const char *n) { - struct _stat s; - char fn[FL_PATH_MAX]; - int length; + struct _stat s; + char fn[FL_PATH_MAX]; + int length; length = (int) strlen(n); // This workaround brought to you by the fine folks at Microsoft! // (read lots of sarcasm in that...) @@ -709,7 +707,7 @@ const char *Fl_WinAPI_System_Driver::filename_ext(const char *buf) { int Fl_WinAPI_System_Driver::open_uri(const char *uri, char *msg, int msglen) { - if (msg) snprintf(msg, msglen, "open %s", uri); + if (msg) snprintf(msg, msglen, "open %s", uri); return (int)(ShellExecute(HWND_DESKTOP, "open", uri, NULL, NULL, SW_SHOW) > (void *)32); } @@ -732,7 +730,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows // // Normal Windows code uses drive bits... // - DWORD drives; // Drive available bits + DWORD drives; // Drive available bits drives = GetLogicalDrives(); for (int i = 'A'; i <= 'Z'; i ++, drives >>= 1) if (drives & 1) @@ -771,19 +769,19 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) UUID ud; UUID *pu = &ud; int got_uuid = 0; - - if (!hMod) { // first time in? + + if (!hMod) { // first time in? hMod = LoadLibrary("Rpcrt4.dll"); } - - if (hMod) { // do we have a usable handle to Rpcrt4.dll? + + if (hMod) { // do we have a usable handle to Rpcrt4.dll? uuid_func uuid_crt = (uuid_func)GetProcAddress(hMod, "UuidCreate"); if (uuid_crt != NULL) { RPC_STATUS rpc_res = uuid_crt(pu); if ( // is the return status OK for our needs? - (rpc_res == RPC_S_OK) || // all is well + (rpc_res == RPC_S_OK) || // all is well (rpc_res == RPC_S_UUID_LOCAL_ONLY) || // only unique to this machine - (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique + (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique ) { got_uuid = -1; sprintf(uuidBuffer, "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -793,14 +791,14 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) } } } - if (got_uuid == 0) { // did not make a UUID - use fallback logic + if (got_uuid == 0) { // did not make a UUID - use fallback logic unsigned char b[16]; - time_t t = time(0); // first 4 byte + time_t t = time(0); // first 4 byte b[0] = (unsigned char)t; b[1] = (unsigned char)(t>>8); b[2] = (unsigned char)(t>>16); b[3] = (unsigned char)(t>>24); - int r = rand(); // four more bytes + int r = rand(); // four more bytes b[4] = (unsigned char)r; b[5] = (unsigned char)(r>>8); b[6] = (unsigned char)(r>>16); @@ -834,8 +832,8 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) char *Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application) { -# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" -# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" static char filename[ FL_PATH_MAX ]; filename[0] = 0; size_t appDataLen = strlen(vendor) + strlen(application) + 8; @@ -941,7 +939,3 @@ void Fl_WinAPI_System_Driver::gettime(time_t *sec, int *usec) { } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Window_Driver.H b/src/drivers/Android/Fl_Android_Window_Driver.H index 4f92c8283..865fa518e 100644 --- a/src/drivers/Android/Fl_Android_Window_Driver.H +++ b/src/drivers/Android/Fl_Android_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -33,13 +31,13 @@ There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ @@ -143,7 +141,3 @@ public: #endif // FL_ANDROID_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/Fl_Android_Window_Driver.cxx b/src/drivers/Android/Fl_Android_Window_Driver.cxx index d3e1147bd..cac79426e 100644 --- a/src/drivers/Android/Fl_Android_Window_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android window driver. // // Copyright 2018-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -402,13 +400,13 @@ static HRGN bitmap2region(Fl_Image* image) { /* Does this need to be dynamically determined, perhaps? */ const int ALLOC_UNIT = 100; DWORD maxRects = ALLOC_UNIT; - + RGNDATA* pData = (RGNDATA*)malloc(sizeof(RGNDATAHEADER)+(sizeof(RECT)*maxRects)); pData->rdh.dwSize = sizeof(RGNDATAHEADER); pData->rdh.iType = RDH_RECTANGLES; pData->rdh.nCount = pData->rdh.nRgnSize = 0; SetRect(&pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0); - + const int bytesPerLine = (image->w() + 7)/8; BYTE* p, *data = (BYTE*)*image->data(); for (int y = 0; y < image->h(); y++) { @@ -551,7 +549,7 @@ void Fl_WinAPI_Window_Driver::flush_overlay() void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { free_icons(); - + if (count > 0) { icon_->icons = new Fl_RGB_Image*[count]; icon_->count = count; @@ -559,7 +557,7 @@ void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { for (int i = 0;i < count;i++) icon_->icons[i] = (Fl_RGB_Image*)((Fl_RGB_Image*)icons[i])->copy(); } - + if (Fl_X::i(pWindow)) set_icons(); } @@ -594,7 +592,7 @@ void Fl_WinAPI_Window_Driver::free_icons() { void Fl_WinAPI_Window_Driver::make_current() { fl_GetDC(fl_xid(pWindow)); - + #if USE_COLORMAP // Windows maintains a hardware and software color palette; the // SelectPalette() call updates the current soft->hard mapping @@ -602,7 +600,7 @@ void Fl_WinAPI_Window_Driver::make_current() { // code does any drawing... fl_select_palette(); #endif // USE_COLORMAP - + fl_graphics_driver->clip_region(0); ((Fl_GDI_Graphics_Driver*)fl_graphics_driver)->scale(Fl::screen_driver()->scale(screen_num())); } @@ -653,7 +651,7 @@ void Fl_WinAPI_Window_Driver::hide() { } if (hide_common()) return; - + // make sure any custom icons get freed // icons(NULL, 0); // free_icons() is called by the Fl_Window destructor // this little trick keeps the current clipboard alive, even if we are about @@ -673,9 +671,9 @@ void Fl_WinAPI_Window_Driver::hide() { if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0); # endif } - + if (ip->region) Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region); - + // this little trickery seems to avoid the popup window stacking problem HWND p = GetForegroundWindow(); if (p==GetParent(ip->xid)) { @@ -716,19 +714,19 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { Fl_Window *w = pWindow; int top, bottom, left, right; int sx, sy, sw, sh; - + top = fullscreen_screen_top(); bottom = fullscreen_screen_bottom(); left = fullscreen_screen_left(); right = fullscreen_screen_right(); - + if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { top = screen_num(); bottom = top; left = top; right = top; } - + Fl::screen_xywh(sx, sy, sw, sh, top); Y = sy; Fl::screen_xywh(sx, sy, sw, sh, bottom); @@ -737,11 +735,11 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { X = sx; Fl::screen_xywh(sx, sy, sw, sh, right); W = sx + sw - X; - + DWORD flags = GetWindowLong(fl_xid(w), GWL_STYLE); flags = flags & ~(WS_THICKFRAME|WS_CAPTION); SetWindowLong(fl_xid(w), GWL_STYLE, flags); - + // SWP_NOSENDCHANGING is so that we can override size limits float s = Fl::screen_driver()->scale(screen_num()); SetWindowPos(fl_xid(w), HWND_TOP, X*s, Y*s, W*s, H*s, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); @@ -826,7 +824,3 @@ void Fl_WinAPI_Window_Driver::resize_after_screen_change(void *data) { } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Android/README.txt b/src/drivers/Android/README.txt index 650c07f68..f2bccf651 100644 --- a/src/drivers/Android/README.txt +++ b/src/drivers/Android/README.txt @@ -3,7 +3,7 @@ WonkoBook:Android matt$ svn ps svn:keywords "author date id revision" Fl_Android_Application.* property 'svn:keywords' set on 'Fl_Android_Application.cpp' property 'svn:keywords' set on 'Fl_Android_Application.h' -WonkoBook:Android matt$ svn pg svn:eol-style Fl_Font.H +WonkoBook:Android matt$ svn pg svn:eol-style Fl_Font.H native WonkoBook:Android matt$ svn ps svn:eol-style "native" Fl_Android_Application.* property 'svn:eol-style' set on 'Fl_Android_Application.cpp' diff --git a/src/drivers/Android/stb_truetype.h b/src/drivers/Android/stb_truetype.h index a08e929f9..e2efae228 100644 --- a/src/drivers/Android/stb_truetype.h +++ b/src/drivers/Android/stb_truetype.h @@ -46,7 +46,7 @@ // Rob Loach Cort Stratton // Kenney Phillis Jr. github:oyvindjam // Brian Costabile github:vassvik -// +// // VERSION HISTORY // // 1.19 (2018-02-11) GPOS kerning, STBTT_fmod @@ -206,7 +206,7 @@ // // Advancing for the next character: // Call GlyphHMetrics, and compute 'current_point += SF * advance'. -// +// // // ADVANCED USAGE // @@ -251,7 +251,7 @@ // Curve tesselation 120 LOC \__ 550 LOC Bitmap creation // Bitmap management 100 LOC / // Baked bitmap interface 70 LOC / -// Font name matching & access 150 LOC ---- 150 +// Font name matching & access 150 LOC ---- 150 // C runtime library abstraction 60 LOC ---- 60 // // @@ -344,7 +344,7 @@ int main(int argc, char **argv) } return 0; } -#endif +#endif // // Output: // @@ -358,9 +358,9 @@ int main(int argc, char **argv) // :@@. M@M // @@@o@@@@ // :M@@V:@@. -// +// ////////////////////////////////////////////////////////////////////////////// -// +// // Complete program: print "Hello World!" banner, with bugs // #if 0 @@ -653,7 +653,7 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, cons // Calling these functions in sequence is roughly equivalent to calling // stbtt_PackFontRanges(). If you more control over the packing of multiple // fonts, or if you want to pack custom data into a font texture, take a look -// at the source to of stbtt_PackFontRanges() and create a custom version +// at the source to of stbtt_PackFontRanges() and create a custom version // using these functions, e.g. call GatherRects multiple times, // building up a single array of rects, then call PackRects once, // then call RenderIntoRects repeatedly. This may result in a @@ -959,7 +959,7 @@ STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, floa // and computing from that can allow drop-out prevention). // // The algorithm has not been optimized at all, so expect it to be slow -// if computing lots of characters or very large sizes. +// if computing lots of characters or very large sizes. @@ -1716,7 +1716,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s if (i != 0) num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - // now start the new one + // now start the new one start_off = !(flags & 1); if (start_off) { // if we start off with an off-curve point, then when we need to find a point on the curve @@ -1769,7 +1769,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s int comp_num_verts = 0, i; stbtt_vertex *comp_verts = 0, *tmp = 0; float mtx[6] = {1,0,0,1,0,0}, m, n; - + flags = ttSHORT(comp); comp+=2; gidx = ttSHORT(comp); comp+=2; @@ -1799,7 +1799,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; } - + // Find transformation scales. m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); @@ -2727,7 +2727,7 @@ static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, i float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); STBTT_assert(z != NULL); if (!z) return z; - + // round dx down to avoid overshooting if (dxdy < 0) z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); @@ -2805,7 +2805,7 @@ static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__ac } } } - + e = e->next; } } @@ -3527,7 +3527,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info { int ix0,iy0,ix1,iy1; stbtt__bitmap gbm; - stbtt_vertex *vertices; + stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); if (scale_x == 0) scale_x = scale_y; @@ -3550,7 +3550,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info if (height) *height = gbm.h; if (xoff ) *xoff = ix0; if (yoff ) *yoff = iy0; - + if (gbm.w && gbm.h) { gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); if (gbm.pixels) { @@ -3561,7 +3561,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info } STBTT_free(vertices, info->userdata); return gbm.pixels; -} +} STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) { @@ -3573,7 +3573,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigne int ix0,iy0; stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - stbtt__bitmap gbm; + stbtt__bitmap gbm; stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); gbm.pixels = output; @@ -3595,7 +3595,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char * STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint) { @@ -3610,7 +3610,7 @@ STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, uns STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) { @@ -3735,7 +3735,7 @@ static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *no con->y = 0; con->bottom_y = 0; STBTT__NOTUSED(nodes); - STBTT__NOTUSED(num_nodes); + STBTT__NOTUSED(num_nodes); } static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) @@ -4110,7 +4110,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char n = 0; for (i=0; i < num_ranges; ++i) n += ranges[i].num_chars; - + rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); if (rects == NULL) return 0; @@ -4121,7 +4121,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); stbtt_PackFontRangesPackRects(spc, rects, n); - + return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); STBTT_free(rects, spc->user_allocator_context); @@ -4269,7 +4269,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y; if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) + if (x_inter < x) winding += (y0 < y1) ? 1 : -1; } } @@ -4295,7 +4295,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex y1 = (int)verts[i ].y; if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) + if (x_inter < x) winding += (y0 < y1) ? 1 : -1; } } else { @@ -4307,7 +4307,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex if (hits[1][0] < 0) winding += (hits[1][1] < 0 ? -1 : 1); } - } + } } } return winding; @@ -4388,7 +4388,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc // invert for y-downwards bitmaps scale_y = -scale_y; - + { int x,y,i,j; float *precompute; @@ -4537,7 +4537,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc STBTT_free(verts, info->userdata); } return data; -} +} STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) { @@ -4555,7 +4555,7 @@ STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata) // // check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) { stbtt_int32 i=0; @@ -4594,7 +4594,7 @@ static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, s return i; } -static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) +static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) { return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); } @@ -4723,7 +4723,7 @@ STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index) { - return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); + return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); } STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data) @@ -4816,38 +4816,38 @@ This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------ ALTERNATIVE A - MIT License Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ ALTERNATIVE B - Public Domain (www.unlicense.org) This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ diff --git a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm index 4fa639d6a..ab3d90fb0 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm +++ b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm @@ -1,6 +1,4 @@ // -// "$Id$" -// // Mac OS X-specific printing support (objective-c++) for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Paged_Device.H> @@ -132,9 +130,9 @@ int Fl_Cocoa_Printer_Driver::begin_job (int pagecount, int *frompage, int *topag pageFormat = (PMPageFormat)[info PMPageFormat];//from 10.5 printSettings = (PMPrintSettings)[info PMPrintSettings];//from 10.5 UInt32 from32, to32; - PMGetFirstPage(printSettings, &from32); + PMGetFirstPage(printSettings, &from32); if (frompage) *frompage = (int)from32; - PMGetLastPage(printSettings, &to32); + PMGetLastPage(printSettings, &to32); if (topage) { *topage = (int)to32; if (*topage > pagecount && pagecount > 0) *topage = pagecount; @@ -176,9 +174,9 @@ int Fl_Cocoa_Printer_Driver::begin_job (int pagecount, int *frompage, int *topag return 1; } UInt32 from32, to32; - PMGetFirstPage(printSettings, &from32); + PMGetFirstPage(printSettings, &from32); if (frompage) *frompage = (int)from32; - PMGetLastPage(printSettings, &to32); + PMGetLastPage(printSettings, &to32); if (topage) *topage = (int)to32; if(topage && *topage > pagecount) *topage = pagecount; CFStringRef mystring[1]; @@ -234,10 +232,10 @@ int Fl_Cocoa_Printer_Driver::printable_rect(int *w, int *h) OSStatus status; PMRect pmRect; int x, y; - + status = PMGetAdjustedPageRect(pageFormat, &pmRect); if (status != noErr) return 1; - + x = (int)pmRect.left; y = (int)pmRect.top; *w = int((int)(pmRect.right - x) / scale_x + 1); @@ -303,7 +301,7 @@ void Fl_Cocoa_Printer_Driver::untranslate(void) } int Fl_Cocoa_Printer_Driver::begin_page (void) -{ +{ OSStatus status = PMSessionBeginPageNoDialog(printSession, pageFormat, NULL); CGContextRef gc; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 @@ -330,11 +328,11 @@ int Fl_Cocoa_Printer_Driver::begin_page (void) PMPaperGetMargins(paper, &margins); PMOrientation orientation; PMGetOrientation(pageFormat, &orientation); - + status = PMGetAdjustedPageRect(pageFormat, &pmRect); double h = pmRect.bottom - pmRect.top; x_offset = 0; - y_offset = 0; + y_offset = 0; angle = 0; scale_x = scale_y = 1; win_scale_x = win_scale_y = 1; @@ -354,7 +352,7 @@ int Fl_Cocoa_Printer_Driver::begin_page (void) } int Fl_Cocoa_Printer_Driver::end_page (void) -{ +{ CGContextRef gc = (CGContextRef)driver()->gc(); CGContextFlush(gc); CGContextRestoreGState(gc); @@ -368,7 +366,7 @@ int Fl_Cocoa_Printer_Driver::end_page (void) void Fl_Cocoa_Printer_Driver::end_job (void) { OSStatus status; - + status = PMSessionError(printSession); if (status != noErr) { fl_alert ("PM Session error %d", (int)status); @@ -471,7 +469,3 @@ void Fl_Cocoa_Printer_Driver::draw_decorated_window(Fl_Window *win, int x_offset [title release]; this->print_widget(win, x_offset, y_offset + bt); // print the window inner part } - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H index 97dd28a77..23af18f6f 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa Screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -29,9 +27,9 @@ /* Move everything here that manages the native screen interface. - + There is exactly one screen driver in the system. - + - screen configuration and sizes - multiple screens - native dialog boxes @@ -47,7 +45,7 @@ class Fl_RGB_Image; class NSImage; #endif -class FL_EXPORT Fl_Cocoa_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_Cocoa_Screen_Driver : public Fl_Screen_Driver { protected: struct XRectangle {int x, y, width, height;}; @@ -101,7 +99,7 @@ public: // --- compute dimensions of an Fl_Offscreen virtual void offscreen_size(Fl_Offscreen o, int &width, int &height); virtual float retina_factor() { return 2; } - + virtual APP_SCALING_CAPABILITY rescalable() { return SYSTEMWIDE_APP_SCALING; } virtual float scale(int n) {return scale_;} virtual void scale(int n, float f) { scale_ = f;} @@ -113,7 +111,3 @@ private: #endif // FL_COCOA_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 71743d7cb..bf85d0efc 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa Screen interface. // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -44,7 +42,7 @@ int Fl_Cocoa_Screen_Driver::next_marked_length = 0; /** Creates a driver that manages all screen and display related calls. - + This function must be implemented once for every platform. */ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() @@ -265,72 +263,72 @@ int Fl_Cocoa_Screen_Driver::input_widget_handle_key(int key, unsigned mods, unsi { switch (key) { case FL_Delete: { - if (mods==0) return input->kf_delete_char_right(); // Delete (OSX-HIG,TE,SA,WOX) - if (mods==FL_CTRL) return input->kf_delete_char_right(); // Ctrl-Delete (??? TE,!SA,!WOX) - if (mods==FL_ALT) return input->kf_delete_word_right(); // Alt-Delete (OSX-HIG,TE,SA) - return 0; // ignore other combos, pass to parent + if (mods==0) return input->kf_delete_char_right(); // Delete (OSX-HIG,TE,SA,WOX) + if (mods==FL_CTRL) return input->kf_delete_char_right(); // Ctrl-Delete (??? TE,!SA,!WOX) + if (mods==FL_ALT) return input->kf_delete_word_right(); // Alt-Delete (OSX-HIG,TE,SA) + return 0; // ignore other combos, pass to parent } - + case FL_Left: - if (mods==0) return input->kf_move_char_left(); // Left (OSX-HIG) - if (mods==FL_ALT) return input->kf_move_word_left(); // Alt-Left (OSX-HIG) - if (mods==FL_META) return input->kf_move_sol(); // Meta-Left (OSX-HIG) - if (mods==FL_CTRL) return input->kf_move_sol(); // Ctrl-Left (TE/SA) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_char_left(); // Left (OSX-HIG) + if (mods==FL_ALT) return input->kf_move_word_left(); // Alt-Left (OSX-HIG) + if (mods==FL_META) return input->kf_move_sol(); // Meta-Left (OSX-HIG) + if (mods==FL_CTRL) return input->kf_move_sol(); // Ctrl-Left (TE/SA) + return 0; // ignore other combos, pass to parent + case FL_Right: - if (mods==0) return input->kf_move_char_right(); // Right (OSX-HIG) - if (mods==FL_ALT) return input->kf_move_word_right(); // Alt-Right (OSX-HIG) - if (mods==FL_META) return input->kf_move_eol(); // Meta-Right (OSX-HIG) - if (mods==FL_CTRL) return input->kf_move_eol(); // Ctrl-Right (TE/SA) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_move_char_right(); // Right (OSX-HIG) + if (mods==FL_ALT) return input->kf_move_word_right(); // Alt-Right (OSX-HIG) + if (mods==FL_META) return input->kf_move_eol(); // Meta-Right (OSX-HIG) + if (mods==FL_CTRL) return input->kf_move_eol(); // Ctrl-Right (TE/SA) + return 0; // ignore other combos, pass to parent + case FL_Up: - if (mods==0) return input->kf_lines_up(1); // Up (OSX-HIG) - if (mods==FL_CTRL) return input->kf_page_up(); // Ctrl-Up (TE !HIG) - if (mods==FL_ALT) return input->kf_move_up_and_sol(); // Alt-Up (OSX-HIG) - if (mods==FL_META) return input->kf_top(); // Meta-Up (OSX-HIG) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_lines_up(1); // Up (OSX-HIG) + if (mods==FL_CTRL) return input->kf_page_up(); // Ctrl-Up (TE !HIG) + if (mods==FL_ALT) return input->kf_move_up_and_sol(); // Alt-Up (OSX-HIG) + if (mods==FL_META) return input->kf_top(); // Meta-Up (OSX-HIG) + return 0; // ignore other combos, pass to parent + case FL_Down: - if (mods==0) return input->kf_lines_down(1); // Dn (OSX-HIG) - if (mods==FL_CTRL) return input->kf_page_down(); // Ctrl-Dn (TE !HIG) - if (mods==FL_ALT) return input->kf_move_down_and_eol(); // Alt-Dn (OSX-HIG) - if (mods==FL_META) return input->kf_bottom(); // Meta-Dn (OSX-HIG) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_lines_down(1); // Dn (OSX-HIG) + if (mods==FL_CTRL) return input->kf_page_down(); // Ctrl-Dn (TE !HIG) + if (mods==FL_ALT) return input->kf_move_down_and_eol(); // Alt-Dn (OSX-HIG) + if (mods==FL_META) return input->kf_bottom(); // Meta-Dn (OSX-HIG) + return 0; // ignore other combos, pass to parent + case FL_Page_Up: // Fl_Input has no scroll control, so instead we move the cursor by one page // OSX-HIG recommends Alt increase one semantic unit, Meta next higher.. - if (mods==0) return input->kf_page_up(); // PgUp (OSX-HIG) - if (mods==FL_ALT) return input->kf_page_up(); // Alt-PageUp (OSX-HIG) - if (mods==FL_META) return input->kf_top(); // Meta-PageUp (OSX-HIG,!TE) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_page_up(); // PgUp (OSX-HIG) + if (mods==FL_ALT) return input->kf_page_up(); // Alt-PageUp (OSX-HIG) + if (mods==FL_META) return input->kf_top(); // Meta-PageUp (OSX-HIG,!TE) + return 0; // ignore other combos, pass to parent + case FL_Page_Down: // Fl_Input has no scroll control, so instead we move the cursor by one page // OSX-HIG recommends Alt increase one semantic unit, Meta next higher.. - if (mods==0) return input->kf_page_down(); // PgDn (OSX-HIG) - if (mods==FL_ALT) return input->kf_page_down(); // Alt-PageDn (OSX-HIG) - if (mods==FL_META) return input->kf_bottom(); // Meta-PageDn (OSX-HIG,!TE) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_page_down(); // PgDn (OSX-HIG) + if (mods==FL_ALT) return input->kf_page_down(); // Alt-PageDn (OSX-HIG) + if (mods==FL_META) return input->kf_bottom(); // Meta-PageDn (OSX-HIG,!TE) + return 0; // ignore other combos, pass to parent + case FL_Home: - if (mods==0) return input->kf_top(); // Home (OSX-HIG) - if (mods==FL_ALT) return input->kf_top(); // Alt-Home (???) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_top(); // Home (OSX-HIG) + if (mods==FL_ALT) return input->kf_top(); // Alt-Home (???) + return 0; // ignore other combos, pass to parent + case FL_End: - if (mods==0) return input->kf_bottom(); // End (OSX-HIG) - if (mods==FL_ALT) return input->kf_bottom(); // Alt-End (???) - return 0; // ignore other combos, pass to parent - + if (mods==0) return input->kf_bottom(); // End (OSX-HIG) + if (mods==FL_ALT) return input->kf_bottom(); // Alt-End (???) + return 0; // ignore other combos, pass to parent + case FL_BackSpace: - if (mods==0) return input->kf_delete_char_left(); // Backspace (OSX-HIG) - if (mods==FL_CTRL) return input->kf_delete_char_left(); // Ctrl-Backspace (TE/SA) - if (mods==FL_ALT) return input->kf_delete_word_left(); // Alt-Backspace (OSX-HIG) - if (mods==FL_META) return input->kf_delete_sol(); // Meta-Backspace (OSX-HIG,!TE) - return 0; // ignore other combos, pass to parent + if (mods==0) return input->kf_delete_char_left(); // Backspace (OSX-HIG) + if (mods==FL_CTRL) return input->kf_delete_char_left(); // Ctrl-Backspace (TE/SA) + if (mods==FL_ALT) return input->kf_delete_word_left(); // Alt-Backspace (OSX-HIG) + if (mods==FL_META) return input->kf_delete_sol(); // Meta-Backspace (OSX-HIG,!TE) + return 0; // ignore other combos, pass to parent } return -1; } @@ -460,7 +458,7 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) if (current_timer && current_timer->pending == 0) delete_timer(*current_timer); current_timer = NULL; - + Fl_Cocoa_Screen_Driver::breakMacEventLoop(); fl_unlock_function(); } @@ -550,7 +548,3 @@ void Fl_Cocoa_Screen_Driver::remove_timeout(Fl_Timeout_Handler cb, void* data) } } } - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H index 9ef5d46c9..dedc7bb34 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -57,13 +55,13 @@ class NSOpenGLPixelFormat; There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ struct Fl_Window_Driver::shape_data_type { @@ -144,7 +142,7 @@ public: CALayer *get_titlebar_layer(); static void draw_layer_to_context(CALayer *layer, CGContextRef gc, int w, int h); virtual int scroll(int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, void (*draw_area)(void*, int,int,int,int), void* data); - + // these functions are OpenGL-related and use objective-c // they are put here to avoid libfltk_gl dependency in Fl_cocoa.mm static NSOpenGLContext* create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window); @@ -155,14 +153,10 @@ public: static void GLcontext_makecurrent(NSOpenGLContext*); // uses Objective-c static void GL_cleardrawable(void); // uses Objective-c static void gl_start(NSOpenGLContext*); // uses Objective-c - + //icons virtual void icons(const Fl_RGB_Image *icons[], int count); NSImage *icon_image; }; #endif // FL_COCOA_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 0611e630e..97ff298f3 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver. // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -359,7 +357,3 @@ void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl top->scale(w(),htop, s <1 ? 0 : 1, 1); CGContextRelease(auxgc); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H b/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H index 7502947d2..27f34e226 100644 --- a/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H +++ b/src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of class Fl_MacOS_Sys_Menu_Bar_Driver for the Fast Light Tool Kit (FLTK). // // Copyright 2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef Fl_MacOS_Sys_Menu_Bar_Driver_H @@ -49,7 +47,3 @@ public: #endif /* Fl_MacOS_Sys_Menu_Bar_Driver_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index 6f1625739..ee7ab30ea 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Darwin system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -86,7 +84,3 @@ public: }; #endif // FL_DARWIN_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index 548b0287a..51a416b87 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Darwin system driver. // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_Darwin_System_Driver.H" @@ -92,7 +90,7 @@ const char *Fl_Darwin_System_Driver::control_name() { /* Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -159,7 +157,7 @@ int Fl_Darwin_System_Driver::filename_list(const char *d, dirent ***list, int (* // Use memcpy for speed since we already know the length of the string... memcpy(fullname, d, dirlen+1); char *name = fullname + dirlen; - if (name!=fullname && name[-1]!='/') *name++ = '/'; + if (name!=fullname && name[-1]!='/') *name++ = '/'; for (i=0; i<n; i++) { int newlen; dirent *de = (*list)[i]; @@ -190,7 +188,7 @@ int Fl_Darwin_System_Driver::filename_list(const char *d, dirent ***list, int (* int Fl_Darwin_System_Driver::open_uri(const char *uri, char *msg, int msglen) { - char *argv[3]; // Command-line arguments + char *argv[3]; // Command-line arguments argv[0] = (char*)"open"; argv[1] = (char*)uri; argv[2] = (char*)0; @@ -201,20 +199,20 @@ int Fl_Darwin_System_Driver::open_uri(const char *uri, char *msg, int msglen) int Fl_Darwin_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, char *filename, int lname, Fl_File_Icon *icon) { // MacOS X and Darwin use getfsstat() system call... - int numfs; // Number of file systems - struct statfs *fs; // Buffer for file system info + int numfs; // Number of file systems + struct statfs *fs; // Buffer for file system info int num_files = 0; - + // We always have the root filesystem. browser->add("/", icon); - + // Get the mounted filesystems... numfs = getfsstat(NULL, 0, MNT_NOWAIT); if (numfs > 0) { // We have file systems, get them... fs = new struct statfs[numfs]; getfsstat(fs, sizeof(struct statfs) * numfs, MNT_NOWAIT); - + // Add filesystems to the list... for (int i = 0; i < numfs; i ++) { // Ignore "/", "/dev", and "/.vol"... @@ -225,7 +223,7 @@ int Fl_Darwin_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows } num_files ++; } - + // Free the memory used for the file system info array... delete[] fs; } @@ -261,7 +259,3 @@ const char *Fl_Darwin_System_Driver::filename_name( const char *name ) } return q; } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_Font.H b/src/drivers/GDI/Fl_Font.H index b530ec422..f636bb2f4 100644 --- a/src/drivers/GDI/Fl_Font.H +++ b/src/drivers/GDI/Fl_Font.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Two internal fltk data structures: @@ -42,7 +40,3 @@ public: extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx index 7a8f24c6c..9d7591712 100644 --- a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -89,7 +87,7 @@ Fl_GDI_Copy_Surface_Driver::~Fl_GDI_Copy_Surface_Driver() { SetClipboardData(CF_BITMAP, surf->offscreen()); Fl_Surface_Device::pop_current(); delete surf; - + CloseClipboard (); } DeleteEnhMetaFile(hmf); @@ -116,7 +114,3 @@ void Fl_GDI_Copy_Surface_Driver::untranslate() { ((Fl_GDI_Graphics_Driver*)driver())->untranslate_all(); } #endif // FL_CFG_GFX_GDI - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index 626049aeb..7dd947f6e 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -171,7 +169,3 @@ public: #endif // FL_GDI_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx index 078800e75..1e0b11c82 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -294,7 +292,3 @@ Fl_Region Fl_GDI_Graphics_Driver::scale_clip(float f) { void Fl_GDI_Graphics_Driver::set_current_() { restore_clip(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx index 9d4b0b354..6055ab1a5 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -60,7 +58,3 @@ void Fl_GDI_Graphics_Driver::pie_unscaled(float x, float y, float w, float h, do } else Pie(gc_, x, y, x+w, y+h, xa, ya, xb, yb); } else Pie(gc_, x, y, x+w, y+h, xa, ya, xb, yb); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx index 9df0c8a39..9e6466e92 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MSWidnows' GDI color functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // The fltk "colormap". This allows ui colors to be stored in 8-bit @@ -101,11 +99,11 @@ void Fl_GDI_Graphics_Driver::color(Fl_Color i) { if (!xmap.pen || xmap.pwidth != tw) { #if USE_COLORMAP if (fl_palette) { - set_xmap(xmap, PALETTEINDEX(i), tw); + set_xmap(xmap, PALETTEINDEX(i), tw); } else { #endif - unsigned c = fl_cmap[i]; - set_xmap(xmap, RGB(uchar(c>>24), uchar(c>>16), uchar(c>>8)), tw); + unsigned c = fl_cmap[i]; + set_xmap(xmap, RGB(uchar(c>>24), uchar(c>>16), uchar(c>>8)), tw); #if USE_COLORMAP } #endif @@ -158,10 +156,10 @@ HBRUSH fl_brush_action(int action) { if (brushes[i].brush == NULL) goto CREATE_BRUSH; if ( (++brushes[i].usage) > 32000 ) { // keep a usage statistic for (int j=0; j<FL_N_BRUSH; j++) { - if (brushes[j].usage>16000) - brushes[j].usage -= 16000; - else - brushes[j].usage = 0; + if (brushes[j].usage>16000) + brushes[j].usage -= 16000; + else + brushes[j].usage = 0; } } return brushes[i].brush; @@ -170,8 +168,8 @@ HBRUSH fl_brush_action(int action) { for (i=0; i<FL_N_BRUSH; i++) { if (brushes[i].brush == NULL) goto CREATE_BRUSH; if (brushes[i].usage<umin) { - umin = brushes[i].usage; - imin = i; + umin = brushes[i].usage; + imin = i; } } i = imin; @@ -247,7 +245,3 @@ fl_select_palette(void) } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx index 7127682cc..1e2b492f3 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows font utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef WIN32_LEAN_AND_MEAN @@ -221,19 +219,19 @@ Fl_GDI_Font_Descriptor::Fl_GDI_Font_Descriptor(const char* name, Fl_Fontsize fsi } fid = CreateFont( -fsize, // negative makes it use "char size" - 0, // logical average character width - fl_angle_*10, // angle of escapement - fl_angle_*10, // base-line orientation angle + 0, // logical average character width + fl_angle_*10, // angle of escapement + fl_angle_*10, // base-line orientation angle weight, italic, - FALSE, // underline attribute flag - FALSE, // strikeout attribute flag + FALSE, // underline attribute flag + FALSE, // strikeout attribute flag DEFAULT_CHARSET, // character set identifier - OUT_DEFAULT_PRECIS, // output precision + OUT_DEFAULT_PRECIS, // output precision CLIP_DEFAULT_PRECIS,// clipping precision - DEFAULT_QUALITY, // output quality - DEFAULT_PITCH, // pitch and family - name // pointer to typeface name string + DEFAULT_QUALITY, // output quality + DEFAULT_PITCH, // pitch and family + name // pointer to typeface name string ); angle = fl_angle_; HDC gc = (HDC)fl_graphics_driver->gc(); @@ -395,7 +393,7 @@ double Fl_GDI_Graphics_Driver::width_unscaled(unsigned int c) { for (int i = 0; i < 0x0400; i++) fl_fontsize->width[r][i] = -1; } else { if ( fl_fontsize->width[r][c&0x03FF] >= 0 ) { // already cached - return (double) fl_fontsize->width[r][c & 0x03FF]; + return (double) fl_fontsize->width[r][c & 0x03FF]; } } unsigned short ii = r * 0x400; @@ -633,7 +631,3 @@ void Fl_GDI_Graphics_Driver::rtl_draw_unscaled(const char* c, int n, int x, int SetTextColor(gc_, oldColor); } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index 0533b3b5f..6bc9ad82d 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows image drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // I hope a simple and portable method of drawing color and monochrome @@ -110,8 +108,8 @@ static void monodither(uchar* to, const uchar* from, int w, int delta) { static int fl_abs(int v) { return v<0 ? -v : v; } static void innards(const uchar *buf, int X, int Y, int W, int H, - int delta, int linedelta, int depth, - Fl_Draw_Image_Cb cb, void* userdata, HDC gc) + int delta, int linedelta, int depth, + Fl_Draw_Image_Cb cb, void* userdata, HDC gc) { char indexed = 0; @@ -120,7 +118,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, #endif if (depth==0) depth = 3; - if (indexed || !fl_can_do_alpha_blending()) + if (indexed || !fl_can_do_alpha_blending()) depth = (depth-1)|1; if (!linedelta) linedelta = W*fl_abs(delta); @@ -149,9 +147,9 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, } else #endif if (depth<3) { - RGBQUAD *bmi_colors = &bmi.bmiColors[0]; // suppress warning (STR #3199) + RGBQUAD *bmi_colors = &bmi.bmiColors[0]; // suppress warning (STR #3199) for (int i=0; i<256; i++) { - bmi_colors[i].rgbBlue = (uchar)i; // bmi.bmiColors[i]... + bmi_colors[i].rgbBlue = (uchar)i; // bmi.bmiColors[i]... bmi_colors[i].rgbGreen = (uchar)i; bmi_colors[i].rgbRed = (uchar)i; bmi_colors[i].rgbReserved = (uchar)0; // must be zero @@ -170,7 +168,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, pixelsize = 4; } int linesize = (pixelsize*w+3)&~3; - + static U32* buffer; static long buffer_size; int blocking = h; @@ -201,85 +199,85 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, for (k = 0; j<h && k<blocking; k++, j++) { const uchar* from; if (!buf) { // run the converter: - cb(userdata, x-X, y-Y+j, w, (uchar*)line_buffer); - from = (uchar*)line_buffer; + cb(userdata, x-X, y-Y+j, w, (uchar*)line_buffer); + from = (uchar*)line_buffer; } else { - from = buf; - buf += linedelta; + from = buf; + buf += linedelta; } uchar *to = (uchar*)buffer+(blocking-k-1)*linesize; #if USE_COLORMAP if (indexed) { - if (depth<3) - monodither(to, from, w, delta); - else - dither(to, from, w, delta); - to += w; + if (depth<3) + monodither(to, from, w, delta); + else + dither(to, from, w, delta); + to += w; } else #endif { int i; switch (depth) { - case 1: + case 1: for (i=w; i--; from += delta) *to++ = *from; break; case 2: - for (i=w; i--; from += delta, to += 4) { - uchar a = from[1]; - uchar gray = (from[0]*a)>>8; - to[0] = gray; - to[1] = gray; - to[2] = gray; - to[3] = a; + for (i=w; i--; from += delta, to += 4) { + uchar a = from[1]; + uchar gray = (from[0]*a)>>8; + to[0] = gray; + to[1] = gray; + to[2] = gray; + to[3] = a; } break; case 3: - for (i=w; i--; from += delta, to += 3) { - uchar r = from[0]; - to[0] = from[2]; - to[1] = from[1]; - to[2] = r; + for (i=w; i--; from += delta, to += 3) { + uchar r = from[0]; + to[0] = from[2]; + to[1] = from[1]; + to[2] = r; } - break; + break; case 4: - for (i=w; i--; from += delta, to += 4) { + for (i=w; i--; from += delta, to += 4) { uchar a = from[3]; - uchar r = from[0]; - to[0] = (from[2]*a)>>8; - to[1] = (from[1]*a)>>8; - to[2] = (r*a)>>8; - to[3] = from[3]; + uchar r = from[0]; + to[0] = (from[2]*a)>>8; + to[1] = (from[1]*a)>>8; + to[2] = (r*a)>>8; + to[3] = from[3]; } - break; - } + break; + } } } if (fl_graphics_driver->has_feature(Fl_Graphics_Driver::PRINTER)) { // if print context, device and logical units are not equal, so SetDIBitsToDevice // does not do the expected job, whereas StretchDIBits does it. StretchDIBits(gc, x, y+j-k, w, k, 0, 0, w, k, - (LPSTR)((uchar*)buffer+(blocking-k)*linesize), - &bmi, + (LPSTR)((uchar*)buffer+(blocking-k)*linesize), + &bmi, #if USE_COLORMAP - indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS + indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS #else - DIB_RGB_COLORS + DIB_RGB_COLORS #endif - , SRCCOPY ); + , SRCCOPY ); delete[] buffer; buffer = NULL; buffer_size = 0; } else { SetDIBitsToDevice(gc, x, y+j-k, w, k, 0, 0, 0, k, - (LPSTR)((uchar*)buffer+(blocking-k)*linesize), - &bmi, + (LPSTR)((uchar*)buffer+(blocking-k)*linesize), + &bmi, #if USE_COLORMAP - indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS + indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS #else - DIB_RGB_COLORS + DIB_RGB_COLORS #endif - ); + ); } } } @@ -294,7 +292,7 @@ void Fl_GDI_Graphics_Driver::draw_image_unscaled(const uchar* buf, int x, int y, } void Fl_GDI_Graphics_Driver::draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) { d ^= FL_IMAGE_WITH_ALPHA; innards(0,x,y,w,h,d,0,(d<3&&d>-3),cb,data, gc_); @@ -313,7 +311,7 @@ void Fl_GDI_Graphics_Driver::draw_image_mono_unscaled(const uchar* buf, int x, i } void Fl_GDI_Graphics_Driver::draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) { d ^= FL_IMAGE_WITH_ALPHA; innards(0,x,y,w,h,d,0,1,cb,data, gc_); @@ -347,9 +345,9 @@ Fl_Bitmask Fl_GDI_Graphics_Driver::create_bitmask(int w, int h, const uchar *dat static uchar loNibble[16] = { 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e, 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f }; - int np = GetDeviceCaps(gc_, PLANES); //: was always one on sample machines + int np = GetDeviceCaps(gc_, PLANES); //: was always one on sample machines int bpp = GetDeviceCaps(gc_, BITSPIXEL);//: 1,4,8,16,24,32 and more odd stuff? - int Bpr = (bpp*w+7)/8; //: bytes per row + int Bpr = (bpp*w+7)/8; //: bytes per row int pad = Bpr&1, w1 = (w+7)/8, shr = ((w-1)&7)+1; if (bpp==4) shr = (shr+1)/2; uchar *newarray = new uchar[(Bpr+pad)*h]; @@ -391,7 +389,7 @@ Fl_Bitmask Fl_GDI_Graphics_Driver::create_bitmask(int w, int h, const uchar *dat bm = CreateBitmap(w, h, np, bpp, newarray); delete[] newarray; - + return bm; } @@ -601,7 +599,7 @@ static Fl_Bitmask fl_create_bitmap(int w, int h, const uchar *data) { const uchar* src = data; uchar* dest = newarray; Fl_Bitmask bm; - static uchar reverse[16] = /* Bit reversal lookup table */ + static uchar reverse[16] = /* Bit reversal lookup table */ { 0x00, 0x88, 0x44, 0xcc, 0x22, 0xaa, 0x66, 0xee, 0x11, 0x99, 0x55, 0xdd, 0x33, 0xbb, 0x77, 0xff }; @@ -613,9 +611,9 @@ static Fl_Bitmask fl_create_bitmap(int w, int h, const uchar *data) { } bm = CreateBitmap(w, h, 1, 1, newarray); - + delete[] newarray; - + return bm; } @@ -716,7 +714,3 @@ void Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img) { void Fl_GDI_Graphics_Driver::uncache_pixmap(fl_uintptr_t offscreen) { DeleteObject((Fl_Offscreen)offscreen); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx index 41cca4fb0..e71fa65d7 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line style code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -61,7 +59,3 @@ void Fl_GDI_Graphics_Driver::line_style_unscaled(int style, float width, char* d DeleteObject(fl_current_xmap->pen); fl_current_xmap->pen = newpen; } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx index 3e5d6bfb9..6bb526b6c 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -197,7 +195,7 @@ int Fl_GDI_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, ret = 2; } else if (EqualRgn(temp, rr)) { // complete ret = 0; - } else { // partial intersection + } else { // partial intersection RECT rect; GetRgnBox(temp, &rect); if (Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) { // if print context, convert coords from device to logical @@ -239,7 +237,3 @@ void Fl_GDI_Graphics_Driver::restore_clip() { if (r) unscale_clip(r); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx index caace8b39..c556121cc 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,18 +7,18 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** \file Fl_GDI_Graphics_Driver_vertex.cxx \brief Portable drawing code for drawing arbitrary shapes with - simple 2D transformations, implemented for Windows GDI. + simple 2D transformations, implemented for Windows GDI. */ #include "Fl_GDI_Graphics_Driver.H" @@ -99,9 +97,5 @@ void Fl_GDI_Graphics_Driver::ellipse_unscaled(double xt, double yt, double rx, d SelectObject(gc_, fl_brush()); Pie(gc_, llx, lly, llx+w, lly+h, 0,0, 0,0); } else - Arc(gc_, llx, lly, llx+w, lly+h, 0,0, 0,0); + Arc(gc_, llx, lly, llx+w, lly+h, 0,0, 0,0); } - -// -// End of "$Id$". -// diff --git a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx index 43fe15dcb..a7b9f1e8c 100644 --- a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -102,8 +100,3 @@ void Fl_GDI_Image_Surface_Driver::end_current() fl_window = pre_window; Fl_Surface_Device::end_current(); } - - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H index 7afa7d8cb..8e6d1c8bb 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H +++ b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of class Fl_OpenGL_Display_Device for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Device.H> @@ -32,7 +30,3 @@ public: static Fl_OpenGL_Display_Device *display_device(); static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window*, int, int, int, int); }; - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx index 4accea0a7..acd74bc95 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // implementation of class Fl_OpenGL_Display_Device for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -132,13 +130,10 @@ Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window *glw, memcpy(q, tmp, mByteWidth); } delete[] tmp; - + Fl_RGB_Image *img = new Fl_RGB_Image(baseAddress, w, h, 3, mByteWidth); img->alloc_array = 1; return img; } #endif -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H index 36ecab45d..f5de05333 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of OpenGL graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -93,7 +91,3 @@ public: }; #endif // FL_OPENGL_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx index 5544b136e..f543c93ca 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,25 +7,21 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Note: -// This file doesn't contribute any code to the library. -// It is kept as a placeholder for future usage. -// This file is not compiled (as of Aug 2017) +// This file doesn't contribute any code to the library. +// It is kept as a placeholder for future usage. +// This file is not compiled (as of Aug 2017) // -// Fl_OpenGL_Graphics_Driver is implemented in several files -// named Fl_OpenGL_Graphics_Driver_*.cxx. -// This may be changed in the future. +// Fl_OpenGL_Graphics_Driver is implemented in several files +// named Fl_OpenGL_Graphics_Driver_*.cxx. +// This may be changed in the future. #include <FL/gl.h> #include "Fl_OpenGL_Graphics_Driver.H" - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx index c0fd58aea..c4efee207 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -66,7 +64,3 @@ void Fl_OpenGL_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) } glEnd(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx index f6586aa85..f6fcbb8a4 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Color functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -71,7 +69,3 @@ void Fl_OpenGL_Graphics_Driver::color(uchar r,uchar g,uchar b) { Fl_Graphics_Driver::color( fl_rgb_color(r, g, b) ); glColor3ub(r,g,b); } - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx index 59bb7b268..24ce5396b 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Standard X11 font selection code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,18 +7,18 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* This module implements a lowest-common-denominator font for OpenGL. It will always work, even if the main graphics library does not support rendering text into a texture buffer. - + The font is limited to a single face and ASCII characters. It is drawn using lines which makes it arbitrarily scalable. I am trying to keep font data really compact. @@ -215,8 +213,3 @@ void Fl_OpenGL_Graphics_Driver::text_extents(const char *str, int n, int& dx, in } #endif - - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx index 047cfba0d..8b5bf35a1 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line style code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -58,7 +56,3 @@ void Fl_OpenGL_Graphics_Driver::line_style(int style, int width, char* dashes) { glEnable(GL_LINE_STIPPLE); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx index a0ce203ea..049a6060a 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -185,8 +183,3 @@ void Fl_OpenGL_Graphics_Driver::restore_clip() { // TODO: implement OpenGL clipping fl_clip_state_number++; } - - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx index 894ab35c1..0a627bea6 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -123,11 +121,7 @@ void Fl_OpenGL_Graphics_Driver::circle(double cx, double cy, double r) { y += ty * tangetial_factor; x *= radial_factor; y *= radial_factor; - } - glEnd(); + } + glEnd(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Graphics_Driver.H b/src/drivers/Pico/Fl_Pico_Graphics_Driver.H index 354472ee0..93550f80c 100644 --- a/src/drivers/Pico/Fl_Pico_Graphics_Driver.H +++ b/src/drivers/Pico/Fl_Pico_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of the Pico minimal graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -211,7 +209,3 @@ class Fl_Pico_Graphics_Driver : public Fl_Graphics_Driver { }; #endif // FL_PICO_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx b/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx index ace311323..f6f306e78 100644 --- a/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -335,8 +333,8 @@ void Fl_Pico_Graphics_Driver::circle(double x, double y, double r) int i = segs; if (i) { - double epsilon = A/i; // Arc length for equal-size steps - double cos_e = cos(epsilon); // Rotation coefficients + double epsilon = A/i; // Arc length for equal-size steps + double cos_e = cos(epsilon); // Rotation coefficients double sin_e = sin(epsilon); do { double Xnew = cos_e*X + sin_e*Y; @@ -506,9 +504,3 @@ void Fl_Pico_Graphics_Driver::draw(const char *str, int n, int x, int y) x += size_*0.5; } } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Screen_Driver.H b/src/drivers/Pico/Fl_Pico_Screen_Driver.H index 5c4126668..7f03cb60f 100644 --- a/src/drivers/Pico/Fl_Pico_Screen_Driver.H +++ b/src/drivers/Pico/Fl_Pico_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico Screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -58,7 +56,3 @@ public: #endif // FL_PICO_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx b/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx index 912e92144..9b316c92f 100644 --- a/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Screen interface based on Pico // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -132,8 +130,3 @@ int Fl_Pico_Screen_Driver::has_timeout(Fl_Timeout_Handler cb, void *argp) void Fl_Pico_Screen_Driver::remove_timeout(Fl_Timeout_Handler cb, void *argp) { } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_System_Driver.H b/src/drivers/Pico/Fl_Pico_System_Driver.H index 740ceceb1..5e3551b4c 100644 --- a/src/drivers/Pico/Fl_Pico_System_Driver.H +++ b/src/drivers/Pico/Fl_Pico_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FL_PICO_SYSTEM_DRIVER_H @@ -32,7 +30,3 @@ public: }; #endif /* FL_PICO_SYSTEM_DRIVER_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_System_Driver.cxx b/src/drivers/Pico/Fl_Pico_System_Driver.cxx index 59ace9ec4..1dfb262ab 100644 --- a/src/drivers/Pico/Fl_Pico_System_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,17 +8,12 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_Pico_System_Driver.H" #include "../../flstring.h" - - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Window_Driver.H b/src/drivers/Pico/Fl_Pico_Window_Driver.H index 73b361a18..9601852bb 100644 --- a/src/drivers/Pico/Fl_Pico_Window_Driver.H +++ b/src/drivers/Pico/Fl_Pico_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Pico Window interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -41,7 +39,3 @@ public: #endif // FL_PICO_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Pico/Fl_Pico_Window_Driver.cxx b/src/drivers/Pico/Fl_Pico_Window_Driver.cxx index a9b7034af..bbff4c6aa 100644 --- a/src/drivers/Pico/Fl_Pico_Window_Driver.cxx +++ b/src/drivers/Pico/Fl_Pico_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Window interface based on Pico // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -46,7 +44,3 @@ int Fl_Pico_Window_Driver::decorated_h() { return h(); } - -// -// End of "$Id$". -// \ No newline at end of file diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H index 93af14e51..8c18fd3dd 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H @@ -1,6 +1,4 @@ -// -// "$Id$" // // Definition of the Pico Android graphics driver // for the Fast Light Tool Kit (FLTK). @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -119,7 +117,3 @@ public: }; #endif // FL_PICOANDROID_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx index 2639f9a65..e398f92b4 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -97,9 +95,3 @@ void Fl_PicoAndroid_Graphics_Driver::point(int x, int y) glDrawArrays(GL_POINTS, 0, 1); glDisableClientState(GL_VERTEX_ARRAY); } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H index 3b4b9960c..1163296cf 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Screen interface based on Pico // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -58,7 +56,7 @@ class FL_EXPORT Fl_PicoAndroid_Screen_Driver : public Fl_Pico_Screen_Driver int32_t handleInputEvent(struct android_app* app, AInputEvent* event); void initDisplay(); void termDisplay(); - + public: void drawFrame(); @@ -66,14 +64,10 @@ public: Fl_PicoAndroid_Screen_Driver(); virtual ~Fl_PicoAndroid_Screen_Driver(); virtual double wait(double time_to_wait); - + public: void android_main(struct android_app* state); }; #endif // FL_PICOANDROID_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx index 6ab2d5025..63b60fe1f 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Screen interface based on Pico // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // http://developer.android.com/ndk/reference/group___native_activity.html @@ -443,7 +441,7 @@ double Fl_PicoAndroid_Screen_Driver::wait(double time_to_wait) /* - The following code should not be here! + The following code should not be here! All this must be refactored into the driver system! */ @@ -458,7 +456,7 @@ Fl_Fontdesc* fl_fonts = NULL; Undefined symbols for architecture x86_64: */ -#if !defined(FL_DOXYGEN) // *FIXME* silence Doxygen warnings +#if !defined(FL_DOXYGEN) // *FIXME* silence Doxygen warnings void fl_set_spot(int, int, int, int, int, int, Fl_Window*) { } void fl_reset_spot() { } @@ -562,10 +560,3 @@ drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.o:Fl_PicoAndroid_Window_Driver. drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.o:Fl_PicoAndroid_Window_Driver.cxx:vtable for Fl_PicoAndroid_Window_Driver: error: undefined reference to 'Fl_PicoAndroid_Window_Driver::flush_overlay()' #endif - - - -// -// End of "$Id$". -// - diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H index 47d1a584e..813c2fb5b 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Window interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -55,7 +53,3 @@ public: #endif // FL_PICOSDL_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx index 0fdad34bd..ade460f8e 100644 --- a/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx +++ b/src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android Window interface based on SDL // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -122,7 +120,3 @@ void Fl_PicoAndroid_Window_Driver::flush() scr->drawFrame(); } #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H index 7f7dbde9e..eb8944286 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H @@ -1,6 +1,4 @@ -// -// "$Id$" // // Definition of the Pico minimal SDL graphics driver // for the Fast Light Tool Kit (FLTK). @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -118,7 +116,3 @@ public: }; #endif // FL_PICOSDL_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx index 771a13339..a8f1d07fc 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -68,9 +66,3 @@ void Fl_PicoSDL_Graphics_Driver::point(int x, int y) SDL_SetRenderDrawColor((SDL_Renderer*)fl_window, r, g, b, SDL_ALPHA_OPAQUE); SDL_RenderDrawPoint((SDL_Renderer*)fl_window, x, y); } - - - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H index 1dc2a85e0..54b47a182 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Screen interface based on Pico // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -38,7 +36,3 @@ public: #endif // FL_PICOSDL_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx index abd70c4cc..10f7ecacf 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Screen interface based on Pico // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -135,10 +133,3 @@ double Fl_PicoSDL_Screen_Driver::wait(double time_to_wait) } return 0.0; } - - - -// -// End of "$Id$". -// - diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx index 028f02324..47afd61e8 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // System routines for the Fast Light Tool Kit (FLTK). // // Copyright 2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -30,7 +28,3 @@ Fl_System_Driver *Fl_System_Driver::newSystemDriver() { return new Fl_System_Driver(); } - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H index ef765e9c3..8714285dc 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Window interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -44,14 +42,10 @@ public: virtual Fl_X *makeWindow(); virtual void make_current(); virtual void draw_end(); - + // --- window management // virtual void flush(); }; #endif // FL_PICOSDL_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx index 2335f799c..a61890243 100644 --- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx +++ b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of SDL Window interface based on SDL // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -104,8 +102,3 @@ void Fl_PicoSDL_Window_Driver::show() { makeWindow(); } } - - -// -// End of "$Id$". -// diff --git a/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx b/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx index bf206070e..dbb966a76 100644 --- a/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // PostScript priting support for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -54,14 +52,14 @@ public: typedef struct _GtkPrintJob GtkPrintJob; typedef struct _GtkWidget GtkWidget; struct GError; - + GtkPrintJob *pjob; // data shared between begin_job() and end_job() char tmpfilename[50]; // name of temporary PostScript file containing to-be-printed data virtual int begin_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message=NULL); virtual void end_job(); static bool probe_for_GTK(); static void *ptr_gtk; // points to the GTK dynamic lib or NULL - + typedef GtkPrintUnixDialog* (*gtk_print_unix_dialog_new_t)(const char*, void*); typedef int (*gtk_dialog_run_t)(GtkDialog*); typedef GtkPrintSettings *(*gtk_print_unix_dialog_get_settings_t)(GtkPrintUnixDialog*); @@ -106,7 +104,7 @@ bool Fl_GTK_Printer_Driver::probe_for_GTK() { int Fl_GTK_Printer_Driver::begin_job(int pagecount, int *firstpage, int *lastpage, char **perr_message) { enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4; enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT ; - + GtkPrintUnixDialog *pdialog = CALL_GTK(gtk_print_unix_dialog_new)(Fl_Printer::dialog_title, NULL); //2.10 if (dlsym(ptr_gtk, "gtk_get_major_version") || !CALL_GTK(gtk_check_version)(2, 18, 0)) CALL_GTK(gtk_print_unix_dialog_set_embed_page_setup)(pdialog, true); //2.18 @@ -236,7 +234,7 @@ Fl_Paged_Device* Fl_Printer::newPrinterDriver(void) int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, char **perr_message) { enum Fl_Paged_Device::Page_Format format; enum Fl_Paged_Device::Page_Layout layout; - + // first test version for print dialog if (!print_panel) make_print_panel(); printing_style style = print_load(); @@ -247,12 +245,12 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, { char tmp[10]; snprintf(tmp, sizeof(tmp), "%d", pages); print_to->value(tmp); } print_panel->show(); // this is modal while (print_panel->shown()) Fl::wait(); - + if (!print_start) // user clicked cancel return 1; - + // get options - + switch (print_page_size->value()) { case 0: format = Fl_Paged_Device::LETTER; @@ -281,7 +279,7 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, default: format = Fl_Paged_Device::A4; } - + { // page range choice int from = 1, to = pages; if (print_pages->value()) { @@ -295,29 +293,29 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, if (lastpage) *lastpage = to; if (pages > 0) pages = to - from + 1; } - + if (print_output_mode[0]->value()) layout = Fl_Paged_Device::PORTRAIT; else if (print_output_mode[1]->value()) layout = Fl_Paged_Device::LANDSCAPE; else if (print_output_mode[2]->value()) layout = Fl_Paged_Device::PORTRAIT; else layout = Fl_Paged_Device::LANDSCAPE; - - int print_pipe = print_choice->value(); // 0 = print to file, >0 = printer (pipe) - + + int print_pipe = print_choice->value(); // 0 = print to file, >0 = printer (pipe) + const char *media = print_page_size->text(print_page_size->value()); const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data(); if (!print_pipe) printer = "<File>"; - + if (!print_pipe) // fall back to file printing return Fl_PostScript_File_Device::begin_job (pages, format, layout); - + // Print: pipe the output into the lp command... - + char command[1024]; if (style == SystemV) snprintf(command, sizeof(command), "lp -s -d %s -n %d -t '%s' -o media=%s", printer, print_collate_button->value() ? 1 : (int)(print_copies->value() + 0.5), "FLTK", media); else snprintf(command, sizeof(command), "lpr -h -P%s -#%d -T FLTK ", printer, print_collate_button->value() ? 1 : (int)(print_copies->value() + 0.5)); - + Fl_PostScript_Graphics_Driver *ps = driver(); ps->output = popen(command, "w"); if (!ps->output) { @@ -333,8 +331,3 @@ int Fl_Posix_Printer_Driver::begin_job(int pages, int *firstpage, int *lastpage, } #endif // defined(FL_CFG_PRN_PS) && !defined(FL_NO_PRINT_SUPPORT) - - -// -// End of "$Id$". -// diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.H b/src/drivers/Posix/Fl_Posix_System_Driver.H index 407fa0270..55255b83f 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.H +++ b/src/drivers/Posix/Fl_Posix_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of POSIX system driver // for the Fast Light Tool Kit (FLTK). // @@ -12,9 +10,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -79,7 +77,3 @@ public: }; #endif // FL_POSIX_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index 0cb16e585..d39ea6c82 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Darwin system driver. // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -90,7 +88,7 @@ void *Fl_Posix_System_Driver::dlopen(const char *filename) int Fl_Posix_System_Driver::file_type(const char *filename) { int filetype; - struct stat fileinfo; // Information on file + struct stat fileinfo; // Information on file if (!::stat(filename, &fileinfo)) { if (S_ISDIR(fileinfo.st_mode)) @@ -128,7 +126,3 @@ void Fl_Posix_System_Driver::gettime(time_t *sec, int *usec) { *sec = tv.tv_sec; *usec = tv.tv_usec; } - -// -// End of "$Id$". -// diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx index d04b27af3..b7b10da8e 100644 --- a/src/drivers/PostScript/Fl_PostScript.cxx +++ b/src/drivers/PostScript/Fl_PostScript.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Classes Fl_PostScript_File_Device and Fl_PostScript_Graphics_Driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems to: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -73,7 +71,7 @@ Fl_PostScript_Graphics_Driver *Fl_PostScript_File_Device::driver() int Fl_PostScript_File_Device::begin_job (int pagecount, enum Fl_Paged_Device::Page_Format format, - enum Fl_Paged_Device::Page_Layout layout) + enum Fl_Paged_Device::Page_Layout layout) { Fl_Native_File_Chooser fnfc; fnfc.title(Fl_PostScript_File_Device::file_chooser_title); @@ -135,7 +133,7 @@ int Fl_PostScript_Graphics_Driver::clocale_printf(const char *format, ...) return retval; } -// Prolog string +// Prolog string static const char * prolog = "/L { /y2 exch def\n" @@ -201,7 +199,7 @@ static const char * prolog = "/A85RLE { /ASCII85Decode filter /RunLengthDecode filter } bind def\n" // ASCII85Decode followed by RunLengthDecode filters -// color images +// color images "/CI { GS /py exch def /px exch def /sy exch def /sx exch def\n" "translate \n" @@ -211,7 +209,7 @@ static const char * prolog = " colorimage GR\n" "} bind def\n" -// gray images +// gray images "/GI { GS /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" @@ -223,7 +221,7 @@ static const char * prolog = "image GR\n" "} bind def\n" -// single-color bitmask +// single-color bitmask "/MI { GS /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" @@ -234,7 +232,7 @@ static const char * prolog = "} bind def\n" -// path +// path "/BFP { newpath moveto } def\n" "/BP { newpath } bind def \n" @@ -243,7 +241,7 @@ static const char * prolog = "/MT { moveto } bind def \n" "/LT { lineto } bind def \n" "/EFP { closepath fill } bind def\n" //was:stroke -"/ELP { stroke } bind def\n" +"/ELP { stroke } bind def\n" "/ECP { closepath stroke } bind def\n" // Closed (loop) "/LW { setlinewidth } bind def\n" @@ -287,7 +285,7 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1 "end\n" "IDD image GR} bind def\n" -// gray image dict +// gray image dict "/GII {GS /inter exch def /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" "sx sy scale\n" @@ -367,13 +365,13 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1 "/Times-RomanExt /Times-Roman ToLatinExtA /Times-BoldExt /Times-Bold ToLatinExtA \n" "/Times-ItalicExt /Times-Italic ToLatinExtA /Times-BoldItalicExt /Times-BoldItalic ToLatinExtA \n" -// proc to create a Type 0 font with 2-byte encoding +// proc to create a Type 0 font with 2-byte encoding // that merges a text font with ISO encoding + same font with LatinExtA encoding "/To2byte { 6 dict begin /FontType 0 def \n" "/FDepVector 3 1 roll findfont exch findfont 2 array astore def \n" "/FontMatrix [1 0 0 1 0 0] def /FMapType 6 def /Encoding [ 0 1 0 ] def\n" // 100: Hexa count of ISO array; A7: hexa count of LatinExtA array -"/SubsVector < 01 0100 00A7 > def\n" +"/SubsVector < 01 0100 00A7 > def\n" "currentdict end definefont pop } def\n" // create Type 0 versions of standard fonts "/Helvetica2B /HelveticaExt /Helvetica To2byte \n" @@ -431,7 +429,7 @@ static const char * prolog_2_pixmap = // prolog relevant only if lang_level == static const char * prolog_3 = // prolog relevant only if lang_level >2 -// masked color images +// masked color images "/CIM {GS /inter exch def /my exch def /mx exch def /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" "sx sy scale\n" @@ -455,7 +453,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "/IMD 8 dict def\n" "IMD begin\n" "/ImageType 1 def\n" -"/Width mx def\n" +"/Width mx def\n" "/Height my def\n" "/BitsPerComponent 1 def\n" // "/Interpolate inter def\n" @@ -472,7 +470,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "} bind def\n" -// masked gray images +// masked gray images "/GIM {GS /inter exch def /my exch def /mx exch def /py exch def /px exch def /sy exch def /sx exch def \n" "translate \n" "sx sy scale\n" @@ -497,7 +495,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "IMD begin\n" "/ImageType 1 def\n" -"/Width mx def\n" +"/Width mx def\n" "/Height my def\n" "/BitsPerComponent 1 def\n" "/ImageMatrix [ mx 0 0 my neg 0 my ] def\n" @@ -516,9 +514,9 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2 "\n" ; -// end prolog +// end prolog -int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, +int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::Page_Layout layout) //returns 0 iff OK { @@ -539,7 +537,7 @@ int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, pw_ = Fl_Paged_Device::page_formats[format].width; ph_ = Fl_Paged_Device::page_formats[format].height; } - + fputs("%!PS-Adobe-3.0\n", output); fputs("%%Creator: FLTK\n", output); if (lang_level_>1) @@ -572,12 +570,12 @@ int Fl_PostScript_Graphics_Driver::start_postscript (int pagecount, fputs("/CR { GR } bind def\n", output); } page_policy_ = 1; - - + + fputs("%%EndProlog\n",output); if (lang_level_ >= 2) fprintf(output,"<< /Policies << /Pagesize 1 >> >> setpagedevice\n"); - + reset(); nPages=0; return 0; @@ -633,13 +631,13 @@ void Fl_PostScript_Graphics_Driver::reset(){ linestyle_=FL_SOLID; strcpy(linedash_,""); Clip *c=clip_; ////just not to have memory leaks for badly writen code (forgotten clip popping) - + while(c){ clip_=clip_->prev; delete c; c=clip_; } - + } void Fl_PostScript_Graphics_Driver::page_policy(int p){ @@ -653,7 +651,7 @@ void Fl_PostScript_Graphics_Driver::page_policy(int p){ void Fl_PostScript_Graphics_Driver::page(double pw, double ph, int media) { - + if (nPages){ fprintf(output, "CR\nGR\nGR\nGR\nSP\nrestore\n"); } @@ -665,7 +663,7 @@ void Fl_PostScript_Graphics_Driver::page(double pw, double ph, int media) { }else{ fprintf(output, "%%%%PageOrientation: Portrait\n"); } - + fprintf(output, "%%%%BeginPageSetup\n"); if((media & Fl_Paged_Device::MEDIA) &&(lang_level_>1)){ int r = media & Fl_Paged_Device::REVERSED; @@ -673,31 +671,31 @@ void Fl_PostScript_Graphics_Driver::page(double pw, double ph, int media) { fprintf(output, "<< /PageSize [%i %i] /Orientation %i>> setpagedevice\n", (int)(pw+.5), (int)(ph+.5), r); } fprintf(output, "%%%%EndPageSetup\n"); - + /* pw_ = pw; ph_ = ph;*/ reset(); - + fprintf(output, "save\n"); fprintf(output, "GS\n"); clocale_printf( "%g %g TR\n", (double)0 /*lm_*/ , ph_ /* - tm_*/); fprintf(output, "1 -1 SC\n"); line_style(0); fprintf(output, "GS\n"); - + if (!((media & Fl_Paged_Device::MEDIA) &&(lang_level_>1))){ if (pw > ph) { if(media & Fl_Paged_Device::REVERSED) { fprintf(output, "-90 rotate %i 0 translate\n", int(-pw)); - } + } else { fprintf(output, "90 rotate -%i -%i translate\n", (lang_level_ == 2 ? int(pw - ph) : 0), int(ph)); - } + } } else { - if(media & Fl_Paged_Device::REVERSED) - fprintf(output, "180 rotate %i %i translate\n", int(-pw), int(-ph)); - } + if(media & Fl_Paged_Device::REVERSED) + fprintf(output, "180 rotate %i %i translate\n", int(-pw), int(-ph)); + } } fprintf(output, "GS\nCS\n"); } @@ -761,7 +759,7 @@ void Fl_PostScript_Graphics_Driver::xyline(int x, int y, int x1, int y2, int x3) void Fl_PostScript_Graphics_Driver::xyline(int x, int y, int x1, int y2){ - + fprintf(output, "GS\n"); fprintf(output,"BP\n"); fprintf(output, "%i %i MT\n", x , y); @@ -777,13 +775,13 @@ void Fl_PostScript_Graphics_Driver::xyline(int x, int y, int x1){ fprintf(output, "%i %i MT\n", x , y); fprintf(output, "%i %i LT\n", x1 , y ); fprintf(output, "ELP\n"); - + fprintf(output, "GR\n"); } void Fl_PostScript_Graphics_Driver::yxline(int x, int y, int y1, int x2, int y3){ fprintf(output, "GS\n"); - + fprintf(output,"BP\n"); fprintf(output,"%i %i MT\n", x , y); fprintf(output, "%i %i LT\n", x , y1 ); @@ -850,7 +848,7 @@ void Fl_PostScript_Graphics_Driver::polygon(int x0, int y0, int x1, int y1, int fprintf(output, "%i %i LT\n", x1 , y1 ); fprintf(output, "%i %i LT\n", x2 , y2 ); fprintf(output, "%i %i LT\n", x3 , y3 ); - + fprintf(output, "EFP\n"); fprintf(output, "GR\n"); } @@ -880,14 +878,14 @@ static const double dashes_cap[5][7]={ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashes){ //line_styled_=1; - + linewidth_=width; linestyle_=style; //dashes_= dashes; if(dashes){ if(dashes != linedash_) strcpy(linedash_,dashes); - + }else linedash_[0]=0; char width0 = 0; @@ -895,22 +893,22 @@ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashe width=1; //for screen drawing compatibility width0=1; } - + fprintf(output, "%i setlinewidth\n", width); - + if(!style && (!dashes || !(*dashes)) && width0) //system lines style = FL_CAP_SQUARE; - + int cap = (style &0xf00) >> 8; if(cap) cap--; fprintf(output,"%i setlinecap\n", cap); - + int join = (style & 0xf000) >> 12; - + if(join) join--; fprintf(output,"%i setlinejoin\n", join); - - + + fprintf(output, "["); if(dashes && *dashes){ while(*dashes){ @@ -925,10 +923,10 @@ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashe dt++; } }else{ - + const int *ds = dashes_flat[style & 0xff]; while (*ds >= 0){ - fprintf(output, "%i ",width * (*ds)); + fprintf(output, "%i ",width * (*ds)); ds++; } } @@ -937,7 +935,7 @@ void Fl_PostScript_Graphics_Driver::line_style(int style, int width, char* dashe } static const char *_fontNames[] = { -"Helvetica2B", +"Helvetica2B", "Helvetica-Bold2B", "Helvetica-Oblique2B", "Helvetica-BoldOblique2B", @@ -1037,10 +1035,10 @@ static uchar *calc_mask(uchar *img, int w, int h, Fl_Color bg) if (r != red || g != green || b != blue) byte |= bit; bit = bit>>1; // shift bit one step to the right if (bit == 0) { // single set bit has fallen out - *q++ = byte; // enter byte in mask - byte = 0; // reset next mask byte to zero - bit = 0x80; // and this byte - } + *q++ = byte; // enter byte in mask + byte = 0; // reset next mask byte to zero + bit = 0x80; // and this byte + } } if (bit != 0x80) *q++ = byte; // enter last columns' byte in mask } @@ -1104,16 +1102,16 @@ void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int static int is_in_table(unsigned utf) { unsigned i; static unsigned extra_table_roman[] = { // unicodes/*names*/ of other characters from PostScript standard fonts - 0x192/*florin*/, 0x2C6/*circumflex*/, 0x2C7/*caron*/, + 0x192/*florin*/, 0x2C6/*circumflex*/, 0x2C7/*caron*/, 0x2D8/*breve*/, 0x2D9/*dotaccent*/, 0x2DA/*ring*/, 0x2DB/*ogonek*/, 0x2DC/*tilde*/, 0x2DD/*hungarumlaut*/, - 0x2013/*endash*/, 0x2014/*emdash*/, 0x2018/*quoteleft*/, 0x2019/*quoteright*/, - 0x201A/*quotesinglbase*/, 0x201C/*quotedblleft*/, 0x201D/*quotedblright*/, 0x201E/*quotedblbase*/, + 0x2013/*endash*/, 0x2014/*emdash*/, 0x2018/*quoteleft*/, 0x2019/*quoteright*/, + 0x201A/*quotesinglbase*/, 0x201C/*quotedblleft*/, 0x201D/*quotedblright*/, 0x201E/*quotedblbase*/, 0x2020/*dagger*/, 0x2021/*daggerdbl*/, 0x2022/*bullet*/, - 0x2026/*ellipsis*/, 0x2030/*perthousand*/, 0x2039/*guilsinglleft*/, 0x203A/*guilsinglright*/, - 0x2044/*fraction*/, 0x20AC/*Euro*/, 0x2122/*trademark*/, + 0x2026/*ellipsis*/, 0x2030/*perthousand*/, 0x2039/*guilsinglleft*/, 0x203A/*guilsinglright*/, + 0x2044/*fraction*/, 0x20AC/*Euro*/, 0x2122/*trademark*/, 0x2202/*partialdiff*/, 0x2206/*Delta*/, 0x2211/*summation*/, 0x221A/*radical*/, - 0x221E/*infinity*/, 0x2260/*notequal*/, 0x2264/*lessequal*/, - 0x2265/*greaterequal*/, + 0x221E/*infinity*/, 0x2260/*notequal*/, 0x2264/*lessequal*/, + 0x2265/*greaterequal*/, 0x25CA/*lozenge*/, 0xFB01/*fi*/, 0xFB02/*fl*/, 0xF8FF/*apple*/ }; @@ -1186,7 +1184,7 @@ void Fl_PostScript_Graphics_Driver::reconcat(){ void Fl_PostScript_Graphics_Driver::begin_points(){ fprintf(output, "GS\n"); concat(); - + fprintf(output, "BP\n"); gap_=1; shape_=POINTS; @@ -1236,7 +1234,7 @@ void Fl_PostScript_Graphics_Driver::curve(double x, double y, double x1, double else clocale_printf("%g %g LT\n", x , y); gap_=0; - + clocale_printf("%g %g %g %g %g %g curveto \n", x1 , y1 , x2 , y2 , x3 , y3); } @@ -1251,9 +1249,9 @@ void Fl_PostScript_Graphics_Driver::circle(double x, double y, double r){ // fprintf(output, "ELP\n"); fprintf(output, "GR\n"); }else - + clocale_printf("%g %g %g 0 360 arc\n", x , y , r); - + } void Fl_PostScript_Graphics_Driver::arc(double x, double y, double r, double start, double a){ @@ -1263,7 +1261,7 @@ void Fl_PostScript_Graphics_Driver::arc(double x, double y, double r, double sta clocale_printf("%g %g %g %g %g arc\n", x , y , r , -start, -a); else clocale_printf("%g %g %g %g %g arcn\n", x , y , r , -start, -a); - + } void Fl_PostScript_Graphics_Driver::arc(int x, int y, int w, int h, double a1, double a2) { @@ -1278,7 +1276,7 @@ void Fl_PostScript_Graphics_Driver::arc(int x, int y, int w, int h, double a1, d clocale_printf("%g %g SC\n", 2.0/(w-1) , 2.0/(h-1) ); clocale_printf("%g %g TR\n", -x - w/2.0 +0.5 , -y - h/2.0 +0.5); end_line(); - + // fprintf(output, "%g setlinewidth\n", 2/sqrt(w*h)); // fprintf(output, "ELP\n"); // fprintf(output, 2.0/w , 2.0/w , " SC\n"; @@ -1321,7 +1319,7 @@ void Fl_PostScript_Graphics_Driver::end_loop(){ } void Fl_PostScript_Graphics_Driver::end_polygon(){ - + gap_=1; reconcat(); fprintf(output, "EFP\n"); @@ -1350,7 +1348,7 @@ void Fl_PostScript_Graphics_Driver::push_clip(int x, int y, int w, int h) { if(lang_level_<3) recover(); clocale_printf("%g %g %i %i CL\n", clip_->x-0.5 , clip_->y-0.5 , clip_->w , clip_->h); - + } void Fl_PostScript_Graphics_Driver::push_no_clip() { @@ -1390,9 +1388,9 @@ int Fl_PostScript_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, if (y > (Y=clip_->y)) {Y=y; ret=1;} if ((x+w) < (clip_->x+clip_->w)) { W=x+w-X; - + ret=1; - + }else W = clip_->x + clip_->w - X; if(W<0){ @@ -1474,7 +1472,7 @@ void Fl_PostScript_File_Device::scale (float s_x, float s_y) ps->scale_x = s_x; ps->scale_y = s_y; ps->clocale_printf("GR GR GS %d %d TR %f %f SC %f rotate GS\n", - ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, ps->angle); + ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, ps->angle); } void Fl_PostScript_File_Device::rotate (float rot_angle) @@ -1482,7 +1480,7 @@ void Fl_PostScript_File_Device::rotate (float rot_angle) Fl_PostScript_Graphics_Driver *ps = driver(); ps->angle = - rot_angle; ps->clocale_printf("GR GR GS %d %d TR %f %f SC %d %d TR %f rotate GS\n", - ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, x_offset, y_offset, ps->angle); + ps->left_margin, ps->top_margin, ps->scale_x, ps->scale_y, x_offset, y_offset, ps->angle); } void Fl_PostScript_File_Device::translate(int x, int y) @@ -1625,7 +1623,3 @@ void Fl_EPS_File_Surface::untranslate() } #endif // !defined(FL_NO_PRINT_SUPPORT) - -// -// End of "$Id$". -// diff --git a/src/drivers/PostScript/Fl_PostScript_image.cxx b/src/drivers/PostScript/Fl_PostScript_image.cxx index 7c977bdf7..43f9b36c2 100644 --- a/src/drivers/PostScript/Fl_PostScript_image.cxx +++ b/src/drivers/PostScript/Fl_PostScript_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Postscript image drawing implementation for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -191,7 +189,7 @@ void Fl_PostScript_Graphics_Driver::close_rle85(void *data) // stop doing RLE+AS // End of implementation of the /RunLengthEncode + /ASCII85Encode PostScript filter // - + int Fl_PostScript_Graphics_Driver::alpha_mask(const uchar * data, int w, int h, int D, int LD){ mask = 0; @@ -405,12 +403,12 @@ void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data } else { fprintf(output , "%g %g %g %g %i %i CI", x , y+h , w , -h , iw , ih); } - + int LD=iw*D; uchar *rgbdata=new uchar[LD]; uchar *curmask=mask; void *big = prepare_rle85(); - + if (level2_mask) { for (j = ih - 1; j >= 0; j--) { // output full image data call(data, 0, j, iw, rgbdata); @@ -448,7 +446,7 @@ void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data uchar r = curdata[0]; uchar g = curdata[1]; uchar b = curdata[2]; - + if (lang_level_<3 && D>3) { //can do mixing using bg_* colors) unsigned int a2 = curdata[3]; //must be int unsigned int a = 255-a2; @@ -456,11 +454,11 @@ void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data g = (a2 * g + bg_g * a)/255; b = (a2 * b + bg_b * a)/255; } - + write_rle85(r, big); write_rle85(g, big); write_rle85(b, big); curdata +=D; } - + } } close_rle85(big); @@ -631,7 +629,3 @@ int Fl_PostScript_Graphics_Driver::scale_for_image_(Fl_Image *img, int XP, int Y } #endif // !defined(FL_DOXYGEN) && !defined(FL_NO_PRINT_SUPPORT) - -// -// End of "$Id$" -// diff --git a/src/drivers/Quartz/Fl_Font.H b/src/drivers/Quartz/Fl_Font.H index e6c56a75c..36f7e2543 100644 --- a/src/drivers/Quartz/Fl_Font.H +++ b/src/drivers/Quartz/Fl_Font.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Two internal fltk data structures: @@ -46,7 +44,3 @@ public: extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H index 087a9fe4c..e97304fe3 100644 --- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H +++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Quartz graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -39,7 +37,3 @@ protected: }; #endif /* Fl_Quartz_Copy_Surface_Driver_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx index bf8efceb6..a1377a556 100644 --- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -100,12 +98,8 @@ void Fl_Quartz_Copy_Surface_Driver::draw_decorated_window(Fl_Window *win, int x_ float s = Fl::screen_scale(win->screen_num()); CGContextScaleCTM(gc, 1/s, s >= 1 ? -1/s : -1); Fl_Cocoa_Window_Driver::draw_layer_to_context(layer, gc, win->w() * s, bt*s); - CGContextRestoreGState(gc); + CGContextRestoreGState(gc); draw(win, x_offset, y_offset + bt); // print the window inner part } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H index 80d0bd615..6f511c6e4 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Quartz graphics driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -162,7 +160,7 @@ protected: virtual Fl_Font set_fonts(const char* xstarname); void set_fontname_in_fontdesc(Fl_Fontdesc *f); virtual void uncache_pixmap(fl_uintptr_t p); - + #if HAS_ATSU && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 enum {use_CoreText = 1, use_ATSU}; static int CoreText_or_ATSU; @@ -196,7 +194,3 @@ public: }; #endif // FL_QUARTZ_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index e0383cebd..4ea518c9a 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -39,7 +37,7 @@ void Fl_Quartz_Graphics_Driver::init_CoreText_or_ATSU() } else { CoreText_or_ATSU = use_CoreText; CoreText_or_ATSU_draw = &Fl_Quartz_Graphics_Driver::draw_CoreText; - CoreText_or_ATSU_width = &Fl_Quartz_Graphics_Driver::width_CoreText; + CoreText_or_ATSU_width = &Fl_Quartz_Graphics_Driver::width_CoreText; } } #endif @@ -155,7 +153,3 @@ void Fl_Quartz_Graphics_Driver::XDestroyRegion(Fl_Region r) { free(r); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx index f20b4135d..2cc7a12e6 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -70,7 +68,3 @@ void Fl_Quartz_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx index 8164b9188..cd03a8c04 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS color functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -79,7 +77,3 @@ void Fl_Quartz_Graphics_Driver::set_color(Fl_Color i, unsigned c) { } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx index 6dcfd7ca2..c528f2721 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS font selection routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* Implementation of support for two text drawing APIs: Core Text (current) and ATSU (legacy) @@ -234,9 +232,9 @@ static UniChar *mac_Utf8_to_Utf16(const char *txt, int len, int *new_len) if (wlen >= utfWlen) { utfWlen = wlen + 100; - if (utfWbuf) free(utfWbuf); + if (utfWbuf) free(utfWbuf); utfWbuf = (UniChar*)malloc((utfWlen)*sizeof(UniChar)); - wlen = fl_utf8toUtf16(txt, len, (unsigned short*)utfWbuf, utfWlen); + wlen = fl_utf8toUtf16(txt, len, (unsigned short*)utfWbuf, utfWlen); } *new_len = wlen; return utfWbuf; @@ -522,15 +520,15 @@ double Fl_Quartz_Graphics_Driver::ADD_SUFFIX(width, _CoreText)(const UniChar* tx CGSize advance_size; CGGlyph glyph; for (int j = 0; j < block; j++) { // loop over the block - // ii spans all characters of this block - bool b = CTFontGetGlyphsForCharacters(fl_fontsize->fontref, &ii, &glyph, 1); - if (b) - CTFontGetAdvancesForGlyphs(fl_fontsize->fontref, kCTFontHorizontalOrientation, &glyph, &advance_size, 1); - else - advance_size.width = -1e9; // calculate this later - // the width of one character of this block of characters - fl_fontsize->width[r][j] = advance_size.width; - ii++; + // ii spans all characters of this block + bool b = CTFontGetGlyphsForCharacters(fl_fontsize->fontref, &ii, &glyph, 1); + if (b) + CTFontGetAdvancesForGlyphs(fl_fontsize->fontref, kCTFontHorizontalOrientation, &glyph, &advance_size, 1); + else + advance_size.width = -1e9; // calculate this later + // the width of one character of this block of characters + fl_fontsize->width[r][j] = advance_size.width; + ii++; } } // sum the widths of all characters of txt @@ -542,12 +540,12 @@ double Fl_Quartz_Graphics_Driver::ADD_SUFFIX(width, _CoreText)(const UniChar* tx bool must_release = false; bool b = CTFontGetGlyphsForCharacters(font2, &uni, &glyph, 1); if (!b) { // the current font doesn't contain this char - CFStringRef str = CFStringCreateWithCharactersNoCopy(NULL, &uni, 1, kCFAllocatorNull); - // find a font that contains it - font2 = CTFontCreateForString(font2, str, CFRangeMake(0,1)); - must_release = true; - CFRelease(str); - b = CTFontGetGlyphsForCharacters(font2, &uni, &glyph, 1); + CFStringRef str = CFStringCreateWithCharactersNoCopy(NULL, &uni, 1, kCFAllocatorNull); + // find a font that contains it + font2 = CTFontCreateForString(font2, str, CFRangeMake(0,1)); + must_release = true; + CFRelease(str); + b = CTFontGetGlyphsForCharacters(font2, &uni, &glyph, 1); } if (b) CTFontGetAdvancesForGlyphs(font2, kCTFontHorizontalOrientation, &glyph, &advance_size, 1); else advance_size.width = 0.; @@ -847,13 +845,13 @@ Fl_Font Fl_Quartz_Graphics_Driver::ADD_SUFFIX(set_fonts, _ATSU)(const char* xsta for (ItemCount idx = 0; idx < oFontCount; idx++) { // ByteCount actualLength = 0; - // Ptr oName; + // Ptr oName; // How to get the name - Apples docs say call this twice, once to get the length, then again // to get the actual name... // ATSUFindFontName (oFontIDs[idx], kFontFullName, kFontMacintoshPlatform, kFontRomanScript, kFontEnglishLanguage, // 0, NULL, &actualLength, NULL); // Now actualLength tells us the length of buffer we need - // oName = (Ptr)malloc(actualLength + 8); + // oName = (Ptr)malloc(actualLength + 8); // But who's got time for that nonsense? Let's just hard code a fixed buffer (urgh!) ByteCount actualLength = 511; char oName[512]; @@ -865,7 +863,7 @@ Fl_Font Fl_Quartz_Graphics_Driver::ADD_SUFFIX(set_fonts, _ATSU)(const char* xsta else oName[actualLength] = 0; Fl::set_font((Fl_Font)(fl_free_font++), strdup(oName)); - // free(oName); + // free(oName); } free(oFontIDs); return (Fl_Font)fl_free_font; @@ -874,7 +872,3 @@ Fl_Font Fl_Quartz_Graphics_Driver::ADD_SUFFIX(set_fonts, _ATSU)(const char* xsta #endif // HAS_ATSU #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index 5060c2009..98c37617c 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // MacOS image drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -50,8 +48,8 @@ static void dataReleaseCB(void *info, const void *data, size_t size) userdata: ? */ static void innards(const uchar *buf, int X, int Y, int W, int H, - int delta, int linedelta, int mono, - Fl_Draw_Image_Cb cb, void* userdata, CGContextRef gc, Fl_Quartz_Graphics_Driver *driver) + int delta, int linedelta, int mono, + Fl_Draw_Image_Cb cb, void* userdata, CGContextRef gc, Fl_Quartz_Graphics_Driver *driver) { if (!linedelta) linedelta = W*abs(delta); @@ -65,14 +63,14 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, tmpBuf = new uchar[ H*W*abs(delta) ]; if (cb) { for (int i=0; i<H; i++) { - cb(userdata, 0, i, W, tmpBuf+i*W*abs(delta)); + cb(userdata, 0, i, W, tmpBuf+i*W*abs(delta)); } } else { uchar *p = tmpBuf; for (int i=0; i<H; i++) { - memcpy(p, buf+i*abs(linedelta), W*abs(delta)); - p += W*abs(delta); - } + memcpy(p, buf+i*abs(linedelta), W*abs(delta)); + p += W*abs(delta); + } } array = (void*)tmpBuf; linedelta = W*abs(delta); @@ -86,8 +84,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, // a release callback is necessary when the gc is a print context because the image data // must be kept until the page is closed. Thus tmpBuf can't be deleted here. It's too early. CGDataProviderRef src = CGDataProviderCreateWithData( 0L, array, abs(linedelta)*H, - tmpBuf ? dataReleaseCB : NULL - ); + tmpBuf ? dataReleaseCB : NULL + ); CGImageRef img = CGImageCreate( W, H, 8, 8*abs(delta), abs(linedelta), lut, abs(delta)&1?kCGImageAlphaNone:kCGImageAlphaLast, src, 0L, false, kCGRenderingIntentDefault); @@ -115,14 +113,14 @@ void Fl_Quartz_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w innards(buf,x,y,w,h,d,l,(d<3&&d>-3),0,0,gc_,this); } void Fl_Quartz_Graphics_Driver::draw_image(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { innards(0,x,y,w,h,d,0,(d<3&&d>-3),cb,data,gc_,this); } void Fl_Quartz_Graphics_Driver::draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){ innards(buf,x,y,w,h,d,l,1,0,0,gc_,this); } void Fl_Quartz_Graphics_Driver::draw_image_mono(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { innards(0,x,y,w,h,d,0,1,cb,data,gc_,this); } @@ -211,7 +209,7 @@ void Fl_Quartz_Graphics_Driver::draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int if (!*id(pxm)) { cache(pxm); } - + CGImageRef cgimg = (CGImageRef)*Fl_Graphics_Driver::id(pxm); draw_CGImage(cgimg, X,Y,W,H, cx,cy, pxm->w(), pxm->h()); } @@ -290,7 +288,3 @@ void Fl_Quartz_Graphics_Driver::draw_CGImage(CGImageRef cgimg, int x, int y, int void Fl_Quartz_Graphics_Driver::uncache_pixmap(fl_uintptr_t pixmap_ref) { CGImageRelease((CGImageRef)pixmap_ref); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx index 1945ea55d..8dfa3090c 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line style code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -44,7 +42,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { static CGLineJoin Join[4] = { kCGLineJoinMiter, kCGLineJoinMiter, kCGLineJoinRound, kCGLineJoinBevel }; if (width<1) width = 1; - quartz_line_width_ = (float)width; + quartz_line_width_ = (float)width; quartz_line_cap_ = Cap[(style>>8)&3]; // when printing kCGLineCapSquare seems better for solid lines if ( Fl_Surface_Device::surface() != Fl_Display_Device::display_device() @@ -53,7 +51,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { quartz_line_cap_ = kCGLineCapSquare; } quartz_line_join_ = Join[(style>>12)&3]; - char *d = dashes; + char *d = dashes; static CGFloat pattern[16]; if (d && *d) { CGFloat *pDst = pattern; @@ -65,7 +63,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { // adjust lengths to account for cap: if (style & 0x200) { dash = char(2*width); - dot = 1; + dot = 1; gap = char(2*width-1); } else { dash = char(3*width); @@ -88,7 +86,3 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx index 8266f16e8..caf4277c4 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -302,7 +300,3 @@ void Fl_Quartz_Graphics_Driver::restore_clip() { #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx index 4a63b364d..5ee8f924f 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -42,7 +40,7 @@ void Fl_Quartz_Graphics_Driver::vertex(double x,double y) { void Fl_Quartz_Graphics_Driver::end_points() { if (quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(gc_, true); - for (int i=0; i<n; i++) { + for (int i=0; i<n; i++) { CGContextMoveToPoint(gc_, p[i].x, p[i].y); CGContextAddLineToPoint(gc_, p[i].x, p[i].y); CGContextStrokePath(gc_); @@ -79,7 +77,7 @@ void Fl_Quartz_Graphics_Driver::end_polygon() { if (n<=1) return; CGContextSetShouldAntialias(gc_, true); CGContextMoveToPoint(gc_, p[0].x, p[0].y); - for (int i=1; i<n; i++) + for (int i=1; i<n; i++) CGContextAddLineToPoint(gc_, p[i].x, p[i].y); CGContextClosePath(gc_); CGContextFillPath(gc_); @@ -153,7 +151,3 @@ void Fl_Quartz_Graphics_Driver::fixloop() { // remove equal points from closed #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index c0ac388d0..61068cf87 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -76,7 +74,7 @@ Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int driver()->scale(s); } CGContextSetShouldAntialias(offscreen, false); - CGContextTranslateCTM(offscreen, 0, height); + CGContextTranslateCTM(offscreen, 0, height); CGContextScaleCTM(offscreen, 1.0f, -1.0f); CGContextSaveGState(offscreen); CGContextSetRGBFillColor(offscreen, 1, 1, 1, 0); @@ -132,7 +130,3 @@ void Fl_Quartz_Image_Surface_Driver::end_current() } #endif // FL_CFG_GFX_QUARTZ - -// -// End of "$Id$". -// diff --git a/src/drivers/SVG/Fl_SVG_File_Surface.cxx b/src/drivers/SVG/Fl_SVG_File_Surface.cxx index d6cf7f4b7..d0946da8b 100644 --- a/src/drivers/SVG/Fl_SVG_File_Surface.cxx +++ b/src/drivers/SVG/Fl_SVG_File_Surface.cxx @@ -9,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Complete implementation to draw into an SVG file using the standard FLTK drawing API. @@ -157,13 +157,13 @@ Fl_SVG_Graphics_Driver::~Fl_SVG_Graphics_Driver() void Fl_SVG_Graphics_Driver::rect(int x, int y, int w, int h) { fprintf(out_, "<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" " - "fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" stroke-dasharray=\"%s\"" + "fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\" stroke-dasharray=\"%s\"" " stroke-linecap=\"%s\" stroke-linejoin=\"%s\"/>\n", x, y, w-1, h-1, red_, green_, blue_, width_, dasharray_, linecap_, linejoin_); } void Fl_SVG_Graphics_Driver::rectf(int x, int y, int w, int h) { fprintf(out_, "<rect x=\"%.3f\" y=\"%.3f\" width=\"%d\" height=\"%d\" " - "fill=\"rgb(%u,%u,%u)\" />\n", x-.5, y-.5, w, h, red_, green_, blue_); + "fill=\"rgb(%u,%u,%u)\" />\n", x-.5, y-.5, w, h, red_, green_, blue_); } void Fl_SVG_Graphics_Driver::point(int x, int y) { @@ -171,10 +171,10 @@ void Fl_SVG_Graphics_Driver::point(int x, int y) { } void Fl_SVG_Graphics_Driver::line(int x1, int y1, int x2, int y2) { - fprintf(out_, - "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" " - "style=\"stroke:rgb(%u,%u,%u);stroke-width:%d;stroke-linecap:%s;stroke-linejoin:%s;stroke-dasharray:%s\" />\n", - x1,y1,x2,y2, red_, green_, blue_, width_, linecap_, linejoin_, dasharray_); + fprintf(out_, + "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" " + "style=\"stroke:rgb(%u,%u,%u);stroke-width:%d;stroke-linecap:%s;stroke-linejoin:%s;stroke-dasharray:%s\" />\n", + x1,y1,x2,y2, red_, green_, blue_, width_, linecap_, linejoin_, dasharray_); } void Fl_SVG_Graphics_Driver::font_(int ft, int s) { @@ -185,7 +185,7 @@ void Fl_SVG_Graphics_Driver::font_(int ft, int s) { else family_ = "Times"; int modulo = ft % 4; int use_bold = modulo == 1 || modulo == 3; - int use_italic = modulo >= 2; + int use_italic = modulo >= 2; bold_ = ( use_bold ? " font-weight=\"bold\"" : "" ); style_ = ( use_italic ? " font-style=\"italic\"" : "" ); if (use_italic && famnum != 2) style_ = " font-style=\"oblique\""; @@ -306,11 +306,11 @@ Fl_SVG_File_Surface::Fl_SVG_File_Surface(int w, int h, FILE *f) : Fl_Widget_Surf float s = (win ? Fl::screen_scale(win->screen_num()) : 1); int sw = w * s, sh = h * s; fprintf(f, - "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n" - "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n" - "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" - "<svg width=\"%dpx\" height=\"%dpx\" viewBox=\"0 0 %d %d\"\n" - "xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n", sw, sh, sw, sh); + "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n" + "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n" + "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" + "<svg width=\"%dpx\" height=\"%dpx\" viewBox=\"0 0 %d %d\"\n" + "xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n", sw, sh, sw, sh); width_ = w; height_ = h; fprintf(f, "<g transform=\"scale(%f)\">\n", s); fputs("<g transform=\"translate(0,0)\">\n", f); @@ -1017,7 +1017,3 @@ void Fl_SVG_File_Surface::untranslate() {} int Fl_SVG_File_Surface::printable_rect(int *w, int *h) {return 0;} #endif // FLTK_USE_SVG - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx index 59c15685f..2e808f1f5 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Printing support for Windows for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../GDI/Fl_GDI_Graphics_Driver.H" @@ -72,12 +70,12 @@ Fl_WinAPI_Printer_Driver::~Fl_WinAPI_Printer_Driver(void) { static void WIN_SetupPrinterDeviceContext(HDC prHDC) { if ( !prHDC ) return; - + fl_window = 0; SetGraphicsMode(prHDC, GM_ADVANCED); // to allow for rotations SetMapMode(prHDC, MM_ANISOTROPIC); SetTextAlign(prHDC, TA_BASELINE|TA_LEFT); - SetBkMode(prHDC, TRANSPARENT); + SetBkMode(prHDC, TRANSPARENT); // this matches 720 logical units to the number of device units in 10 inches of paper // thus the logical unit is the point (= 1/72 inch) SetWindowExtEx(prHDC, 720, 720, NULL); @@ -92,7 +90,7 @@ int Fl_WinAPI_Printer_Driver::begin_job (int pagecount, int *frompage, int *topa DOCINFO di; char docName [256]; int err = 0; - + abortPrint = FALSE; memset (&pd, 0, sizeof (PRINTDLG)); pd.lStructSize = sizeof (PRINTDLG); @@ -166,7 +164,7 @@ void Fl_WinAPI_Printer_Driver::end_job (void) if (! abortPrint) { prerr = EndDoc (hPr); if (prerr < 0) { - fl_alert ("EndDoc error %d", prerr); + fl_alert ("EndDoc error %d", prerr); } } DeleteDC (hPr); @@ -184,14 +182,14 @@ void Fl_WinAPI_Printer_Driver::absolute_printable_rect(int *x, int *y, int *w, i { POINT physPageSize; POINT pixelsPerInch; - XFORM transform; - + XFORM transform; + if (hPr == NULL) return; HDC gc = (HDC)driver()->gc(); GetWorldTransform(gc, &transform); ModifyWorldTransform(gc, NULL, MWT_IDENTITY); SetWindowOrgEx(gc, 0, 0, NULL); - + physPageSize.x = GetDeviceCaps(hPr, HORZRES); physPageSize.y = GetDeviceCaps(hPr, VERTRES); DPtoLP(hPr, &physPageSize, 1); @@ -204,7 +202,7 @@ void Fl_WinAPI_Printer_Driver::absolute_printable_rect(int *x, int *y, int *w, i *w -= (pixelsPerInch.x / 2); top_margin = (pixelsPerInch.y / 4); *h -= (pixelsPerInch.y / 2); - + *x = left_margin; *y = top_margin; origin(x_offset, y_offset); @@ -231,7 +229,7 @@ int Fl_WinAPI_Printer_Driver::printable_rect(int *w, int *h) int Fl_WinAPI_Printer_Driver::begin_page (void) { int rsult, w, h; - + rsult = 0; if (hPr != NULL) { WIN_SetupPrinterDeviceContext (hPr); @@ -279,7 +277,7 @@ void Fl_WinAPI_Printer_Driver::rotate (float rot_angle) int Fl_WinAPI_Printer_Driver::end_page (void) { int rsult; - + rsult = 0; if (hPr != NULL) { prerr = EndPage (hPr); @@ -332,7 +330,3 @@ void Fl_WinAPI_Printer_Driver::origin(int *x, int *y) { Fl_Paged_Device::origin(x, y); } - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H index 11a923331..2964375f1 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Windows screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -31,7 +29,7 @@ class Fl_Window; -class FL_EXPORT Fl_WinAPI_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_WinAPI_Screen_Driver : public Fl_Screen_Driver { protected: RECT screens[MAX_SCREENS]; @@ -97,7 +95,3 @@ public: #endif // FL_WINAPI_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index f87ae8df3..f65404922 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows screen interface for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -315,10 +313,10 @@ static void getsyscolor(int what, const char* arg, void (*func)(uchar,uchar,ucha void Fl_WinAPI_Screen_Driver::get_system_colors() { - if (!bg2_set) getsyscolor(COLOR_WINDOW, fl_bg2,Fl::background2); - if (!fg_set) getsyscolor(COLOR_WINDOWTEXT, fl_fg, Fl::foreground); - if (!bg_set) getsyscolor(COLOR_BTNFACE, fl_bg, Fl::background); - getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color); + if (!bg2_set) getsyscolor(COLOR_WINDOW, fl_bg2,Fl::background2); + if (!fg_set) getsyscolor(COLOR_WINDOWTEXT, fl_fg, Fl::foreground); + if (!bg_set) getsyscolor(COLOR_BTNFACE, fl_bg, Fl::background); + getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color); } @@ -484,10 +482,10 @@ int Fl_WinAPI_Screen_Driver::compose(int &del) { Fl_RGB_Image * // O - image or NULL if failed Fl_WinAPI_Screen_Driver::read_win_rectangle( - int X, // I - Left position - int Y, // I - Top position - int w, // I - Width of area to read - int h, // I - Height of area to read + int X, // I - Left position + int Y, // I - Top position + int w, // I - Width of area to read + int h, // I - Height of area to read Fl_Window *win, // I - window to capture from or NULL to capture from current offscreen bool may_capture_subwins, bool *did_capture_subwins) { @@ -505,26 +503,26 @@ Fl_WinAPI_Screen_Driver::read_win_rectangle( Fl_RGB_Image *Fl_WinAPI_Screen_Driver::read_win_rectangle_unscaled(int X, int Y, int w, int h, Fl_Window *win) { - int d = 3; // Depth of image + int d = 3; // Depth of image int alpha = 0; uchar *p = NULL; - // Allocate the image data array as needed... + // Allocate the image data array as needed... const uchar *oldp = p; if (!p) p = new uchar[w * h * d]; - + // Initialize the default colors/alpha in the whole image... memset(p, alpha, w * h * d); - + // Grab all of the pixels in the image... - + // Assure that we are not trying to read non-existing data. If it is so, the // function should still work, but the out-of-bounds part of the image is // untouched (initialized with the alpha value or 0 (black), resp.). - + int ww = w; // We need the original width for output data line size - + int shift_x = 0; // X target shift if X modified int shift_y = 0; // Y target shift if X modified - + if (X < 0) { shift_x = -X; w += X; @@ -535,64 +533,64 @@ Fl_RGB_Image *Fl_WinAPI_Screen_Driver::read_win_rectangle_unscaled(int X, int Y, h += Y; Y = 0; } - - if (h < 1 || w < 1) return 0/*p*/; // nothing to copy - - int line_size = ((3*w+3)/4) * 4; // each line is aligned on a DWORD (4 bytes) - uchar *dib = new uchar[line_size*h]; // create temporary buffer to read DIB - + + if (h < 1 || w < 1) return 0/*p*/; // nothing to copy + + int line_size = ((3*w+3)/4) * 4; // each line is aligned on a DWORD (4 bytes) + uchar *dib = new uchar[line_size*h]; // create temporary buffer to read DIB + // fill in bitmap info for GetDIBits - + BITMAPINFO bi; bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth = w; - bi.bmiHeader.biHeight = -h; // negative => top-down DIB + bi.bmiHeader.biHeight = -h; // negative => top-down DIB bi.bmiHeader.biPlanes = 1; - bi.bmiHeader.biBitCount = 24; // 24 bits RGB + bi.bmiHeader.biBitCount = 24; // 24 bits RGB bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = 0; bi.bmiHeader.biXPelsPerMeter = 0; bi.bmiHeader.biYPelsPerMeter = 0; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; - + // copy bitmap from original DC (Window, Fl_Offscreen, ...) if (win && Fl_Window::current() != win) win->make_current(); HDC gc = (HDC)fl_graphics_driver->gc(); HDC hdc = CreateCompatibleDC(gc); HBITMAP hbm = CreateCompatibleBitmap(gc,w,h); - - int save_dc = SaveDC(hdc); // save context for cleanup - SelectObject(hdc,hbm); // select bitmap - BitBlt(hdc,0,0,w,h,gc,X,Y,SRCCOPY); // copy image section to DDB - + + int save_dc = SaveDC(hdc); // save context for cleanup + SelectObject(hdc,hbm); // select bitmap + BitBlt(hdc,0,0,w,h,gc,X,Y,SRCCOPY); // copy image section to DDB + // copy RGB image data to the allocated DIB - + GetDIBits(hdc, hbm, 0, h, dib, (BITMAPINFO *)&bi, DIB_RGB_COLORS); - + // finally copy the image data to the user buffer - + for (int j = 0; j<h; j++) { - const uchar *src = dib + j * line_size; // source line - uchar *tg = p + (j + shift_y) * d * ww + shift_x * d; // target line + const uchar *src = dib + j * line_size; // source line + uchar *tg = p + (j + shift_y) * d * ww + shift_x * d; // target line for (int i = 0; i<w; i++) { uchar b = *src++; uchar g = *src++; - *tg++ = *src++; // R - *tg++ = g; // G - *tg++ = b; // B + *tg++ = *src++; // R + *tg++ = g; // G + *tg++ = b; // B if (alpha) - *tg++ = alpha; // alpha + *tg++ = alpha; // alpha } } - + // free used GDI and other structures - - RestoreDC(hdc,save_dc); // reset DC + + RestoreDC(hdc,save_dc); // reset DC DeleteDC(hdc); DeleteObject(hbm); - delete[] dib; // delete DIB temporary buffer - + delete[] dib; // delete DIB temporary buffer + Fl_RGB_Image *rgb = new Fl_RGB_Image(p, w, h, d); if (!oldp) rgb->alloc_array = 1; return rgb; @@ -622,7 +620,3 @@ int Fl_WinAPI_Screen_Driver::screen_num_unscaled(int x, int y) } return screen; } - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H index d4b12fc34..e6446923d 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Windows system driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -117,7 +115,3 @@ public: }; #endif // FL_WINAPI_SYSTEM_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx index 10c6a7b38..ab20cfe32 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Windows system driver for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -92,12 +90,12 @@ extern "C" { Pseudo doxygen docs (static function intentionally not documented): - param[in] utf8 input string (UTF-8) - param[in,out] wbuf in: pointer to output string buffer - out: new string (the pointer may be changed) - param[in] lg optional: input string length (default = -1) + param[in] utf8 input string (UTF-8) + param[in,out] wbuf in: pointer to output string buffer + out: new string (the pointer may be changed) + param[in] lg optional: input string length (default = -1) - returns pointer to string buffer + returns pointer to string buffer */ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { unsigned len = (lg >= 0) ? (unsigned)lg : (unsigned)strlen(utf8); @@ -129,11 +127,11 @@ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { Pseudo doxygen docs (static function intentionally not documented): - param[in] wstr input string (wide character, UTF-16) - param[in,out] utf8 in: pointer to output string buffer - out: new string (pointer may be changed) + param[in] wstr input string (wide character, UTF-16) + param[in,out] utf8 in: pointer to output string buffer + out: new string (pointer may be changed) - returns pointer to string buffer + returns pointer to string buffer */ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { unsigned len = (unsigned)wcslen(wstr); @@ -146,7 +144,7 @@ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { /* Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -239,7 +237,7 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { # else wchar_t **ar; utf8_to_wchar(file, wbuf); - + int i = 0, n = 0; while (argv[i]) {i++; n++;} ar = (wchar_t **)malloc(sizeof(wchar_t *) * (n + 1)); @@ -254,14 +252,14 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { i++; } ar[n] = NULL; - _wexecvp(wbuf, ar); // STR #3040 + _wexecvp(wbuf, ar); // STR #3040 i = 0; while (i < n) { free(ar[i]); i++; } free(ar); - return -1; // STR #3040 + return -1; // STR #3040 #endif } @@ -362,7 +360,7 @@ char *fl_locale_to_utf8(const char *s, int len, UINT codepage) } if (codepage < 1) codepage = fl_codepage; buf[l] = 0; - + l = MultiByteToWideChar(codepage, 0, s, len, (WCHAR*)wbufa, buf_len); if (l < 0) l = 0; wbufa[l] = 0; @@ -503,16 +501,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr char *start = temp; char *end = temp+strlen(temp); int ret = 0; - for (char *a=temp; a<end; ) { // for each slash component + for (char *a=temp; a<end; ) { // for each slash component char *e; for (e=a; e<end && !isdirsep(*e); e++) {/*empty*/} // find next slash const char *value = 0; // this will point at substitute value switch (*a) { - case '~': // a home directory name - if (e <= a+1) { // current user's directory + case '~': // a home directory name + if (e <= a+1) { // current user's directory value = getenv("HOME"); } break; - case '$': /* an environment variable */ + case '$': /* an environment variable */ {char t = *e; *(char *)e = 0; value = getenv(a+1); *(char *)e = t;} break; } @@ -539,16 +537,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr } int // O - 0 if no change, 1 if changed -Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename +Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename int tolen, // I - Size of "to" buffer const char *from, // I - Absolute filename const char *base) // I - Find path relative to this path { - char *newslash; // Directory separator - const char *slash; // Directory separator + char *newslash; // Directory separator + const char *slash; // Directory separator char *cwd = 0L, *cwd_buf = 0L; if (base) cwd = cwd_buf = strdup(base); - + // return if "from" is not an absolute path if (from[0] == '\0' || (!isdirsep(*from) && !isalpha(*from) && from[1] != ':' && @@ -557,7 +555,7 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // return if "cwd" is not an absolute path if (!cwd || cwd[0] == '\0' || (!isdirsep(*cwd) && !isalpha(*cwd) && cwd[1] != ':' && @@ -566,18 +564,18 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename if (cwd_buf) free(cwd_buf); return 0; } - + // convert all backslashes into forward slashes for (newslash = strchr(cwd, '\\'); newslash; newslash = strchr(newslash + 1, '\\')) *newslash = '/'; - + // test for the exact same string and return "." if so if (!strcasecmp(from, cwd)) { strlcpy(to, ".", tolen); free(cwd_buf); return (1); } - + // test for the same drive. Return the absolute path if not if (tolower(*from & 255) != tolower(*cwd & 255)) { // Not the same drive... @@ -585,44 +583,44 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename free(cwd_buf); return 0; } - + // compare the path name without the drive prefix from += 2; cwd += 2; - + // compare both path names until we find a difference for (slash = from, newslash = cwd; *slash != '\0' && *newslash != '\0'; slash ++, newslash ++) if (isdirsep(*slash) && isdirsep(*newslash)) continue; else if (tolower(*slash & 255) != tolower(*newslash & 255)) break; - + // skip over trailing slashes if ( *newslash == '\0' && *slash != '\0' && !isdirsep(*slash) &&(newslash==cwd || !isdirsep(newslash[-1])) ) newslash--; - + // now go back to the first character of the first differing paths segment while (!isdirsep(*slash) && slash > from) slash --; if (isdirsep(*slash)) slash ++; - + // do the same for the current dir if (isdirsep(*newslash)) newslash --; if (*newslash != '\0') while (!isdirsep(*newslash) && newslash > cwd) newslash --; - + // prepare the destination buffer to[0] = '\0'; to[tolen - 1] = '\0'; - + // now add a "previous dir" sequence for every following slash in the cwd while (*newslash != '\0') { if (isdirsep(*newslash)) strlcat(to, "../", tolen); newslash ++; } - + // finally add the differing path from "from" strlcat(to, slash, tolen); - + free(cwd_buf); return 1; } @@ -668,9 +666,9 @@ int Fl_WinAPI_System_Driver::filename_absolute(char *to, int tolen, const char * int Fl_WinAPI_System_Driver::filename_isdir(const char *n) { - struct _stat s; - char fn[FL_PATH_MAX]; - int length; + struct _stat s; + char fn[FL_PATH_MAX]; + int length; length = (int) strlen(n); // This workaround brought to you by the fine folks at Microsoft! // (read lots of sarcasm in that...) @@ -711,7 +709,7 @@ const char *Fl_WinAPI_System_Driver::filename_ext(const char *buf) { int Fl_WinAPI_System_Driver::open_uri(const char *uri, char *msg, int msglen) { - if (msg) snprintf(msg, msglen, "open %s", uri); + if (msg) snprintf(msg, msglen, "open %s", uri); return (int)(ShellExecute(HWND_DESKTOP, "open", uri, NULL, NULL, SW_SHOW) > (void *)32); } @@ -734,7 +732,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows // // Normal Windows code uses drive bits... // - DWORD drives; // Drive available bits + DWORD drives; // Drive available bits drives = GetLogicalDrives(); for (int i = 'A'; i <= 'Z'; i ++, drives >>= 1) if (drives & 1) @@ -773,19 +771,19 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) UUID ud; UUID *pu = &ud; int got_uuid = 0; - - if (!hMod) { // first time in? + + if (!hMod) { // first time in? hMod = LoadLibrary("Rpcrt4.dll"); } - - if (hMod) { // do we have a usable handle to Rpcrt4.dll? + + if (hMod) { // do we have a usable handle to Rpcrt4.dll? uuid_func uuid_crt = (uuid_func)GetProcAddress(hMod, "UuidCreate"); if (uuid_crt != NULL) { RPC_STATUS rpc_res = uuid_crt(pu); if ( // is the return status OK for our needs? - (rpc_res == RPC_S_OK) || // all is well + (rpc_res == RPC_S_OK) || // all is well (rpc_res == RPC_S_UUID_LOCAL_ONLY) || // only unique to this machine - (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique + (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique ) { got_uuid = -1; sprintf(uuidBuffer, "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -795,14 +793,14 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) } } } - if (got_uuid == 0) { // did not make a UUID - use fallback logic + if (got_uuid == 0) { // did not make a UUID - use fallback logic unsigned char b[16]; - time_t t = time(0); // first 4 byte + time_t t = time(0); // first 4 byte b[0] = (unsigned char)t; b[1] = (unsigned char)(t>>8); b[2] = (unsigned char)(t>>16); b[3] = (unsigned char)(t>>24); - int r = rand(); // four more bytes + int r = rand(); // four more bytes b[4] = (unsigned char)r; b[5] = (unsigned char)(r>>8); b[6] = (unsigned char)(r>>16); @@ -836,8 +834,8 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) char *Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application) { -# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" -# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" static char *filename = 0L; // make enough room for a UTF16 pathname if (!filename) filename = (char*)::malloc(2*FL_PATH_MAX); @@ -847,7 +845,7 @@ char *Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Pre DWORD nn; LONG err; HKEY key; - + switch (root&Fl_Preferences::ROOT_MASK) { case Fl_Preferences::SYSTEM: err = RegOpenKeyW( HKEY_LOCAL_MACHINE, FLPREFS_RESOURCEW, &key ); @@ -953,7 +951,3 @@ void Fl_WinAPI_System_Driver::gettime(time_t *sec, int *usec) { *sec = t.time; *usec = t.millitm * 1000; } - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index e9c35d62b..89f83a955 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -33,13 +31,13 @@ There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ @@ -124,7 +122,3 @@ public: #endif // FL_WINAPI_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index 09b677fff..aa20c0c7f 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Apple Cocoa window driver. // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -209,13 +207,13 @@ static HRGN bitmap2region(Fl_Image* image) { /* Does this need to be dynamically determined, perhaps? */ const int ALLOC_UNIT = 100; DWORD maxRects = ALLOC_UNIT; - + RGNDATA* pData = (RGNDATA*)malloc(sizeof(RGNDATAHEADER)+(sizeof(RECT)*maxRects)); pData->rdh.dwSize = sizeof(RGNDATAHEADER); pData->rdh.iType = RDH_RECTANGLES; pData->rdh.nCount = pData->rdh.nRgnSize = 0; SetRect(&pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0); - + const int bytesPerLine = (image->w() + 7)/8; BYTE* p, *data = (BYTE*)*image->data(); for (int y = 0; y < image->h(); y++) { @@ -374,7 +372,7 @@ void Fl_WinAPI_Window_Driver::flush_overlay() void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { free_icons(); - + if (count > 0) { icon_->icons = new Fl_RGB_Image*[count]; icon_->count = count; @@ -384,7 +382,7 @@ void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { icon_->icons[i]->normalize(); } } - + if (Fl_X::i(pWindow)) set_icons(); } @@ -419,7 +417,7 @@ void Fl_WinAPI_Window_Driver::free_icons() { void Fl_WinAPI_Window_Driver::make_current() { fl_GetDC(fl_xid(pWindow)); - + #if USE_COLORMAP // Windows maintains a hardware and software color palette; the // SelectPalette() call updates the current soft->hard mapping @@ -427,7 +425,7 @@ void Fl_WinAPI_Window_Driver::make_current() { // code does any drawing... fl_select_palette(); #endif // USE_COLORMAP - + fl_graphics_driver->clip_region(0); ((Fl_GDI_Graphics_Driver*)fl_graphics_driver)->scale(Fl::screen_driver()->scale(screen_num())); } @@ -478,7 +476,7 @@ void Fl_WinAPI_Window_Driver::hide() { } if (hide_common()) return; - + // make sure any custom icons get freed // icons(NULL, 0); // free_icons() is called by the Fl_Window destructor // this little trick keeps the current clipboard alive, even if we are about @@ -498,9 +496,9 @@ void Fl_WinAPI_Window_Driver::hide() { if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0); # endif } - + if (ip->region) Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region); - + // this little trickery seems to avoid the popup window stacking problem HWND p = GetForegroundWindow(); if (p==GetParent(ip->xid)) { @@ -541,19 +539,19 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { Fl_Window *w = pWindow; int top, bottom, left, right; int sx, sy, sw, sh; - + top = fullscreen_screen_top(); bottom = fullscreen_screen_bottom(); left = fullscreen_screen_left(); right = fullscreen_screen_right(); - + if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { top = screen_num(); bottom = top; left = top; right = top; } - + Fl::screen_xywh(sx, sy, sw, sh, top); Y = sy; Fl::screen_xywh(sx, sy, sw, sh, bottom); @@ -562,11 +560,11 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { X = sx; Fl::screen_xywh(sx, sy, sw, sh, right); W = sx + sw - X; - + DWORD flags = GetWindowLong(fl_xid(w), GWL_STYLE); flags = flags & ~(WS_THICKFRAME|WS_CAPTION); SetWindowLong(fl_xid(w), GWL_STYLE, flags); - + // SWP_NOSENDCHANGING is so that we can override size limits float s = Fl::screen_driver()->scale(screen_num()); SetWindowPos(fl_xid(w), HWND_TOP, X*s, Y*s, W*s, H*s, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); @@ -709,7 +707,3 @@ void Fl_WinAPI_Window_Driver::resize_after_screen_change(void *data) { const Fl_Image* Fl_WinAPI_Window_Driver::shape() { return shape_data_ ? shape_data_->shape_ : NULL; } - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H index 09b043c71..c25337e0f 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.H +++ b/src/drivers/X11/Fl_X11_Screen_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 Screen interface // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -31,7 +29,7 @@ class Fl_Window; -class FL_EXPORT Fl_X11_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_X11_Screen_Driver : public Fl_Screen_Driver { friend class Fl_Screen_Driver; protected: @@ -59,7 +57,7 @@ public: virtual void desktop_scale_factor(); int screen_num_unscaled(int x, int y); #endif - + static int ewmh_supported(); static void copy_image(const unsigned char* data, int W, int H, int destination); // --- display management @@ -108,7 +106,3 @@ public: #endif // FL_X11_SCREEN_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index b93d22ac6..a09768975 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 Screen interface // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -109,7 +107,7 @@ static double missed_timeout_by; /** Creates a driver that manages all screen and display related calls. - + This function must be implemented once for every platform. */ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() @@ -197,7 +195,7 @@ int Fl_X11_Screen_Driver::visual(int flags) static int fl_workarea_xywh[4] = { -1, -1, -1, -1 }; -void Fl_X11_Screen_Driver::init_workarea() +void Fl_X11_Screen_Driver::init_workarea() { Atom actual; unsigned long count, remaining; @@ -323,8 +321,8 @@ void Fl_X11_Screen_Driver::init() { screens[i].width = xsi[i].width; screens[i].height = xsi[i].height; if (dpi_by_randr) { - dpi[i][0] = dpih; - dpi[i][1] = dpiv; + dpi[i][0] = dpih; + dpi[i][1] = dpiv; } else { int mm = DisplayWidthMM(fl_display, fl_screen); dpi[i][0] = mm ? screens[i].width*25.4f/mm : 0.0f; @@ -350,13 +348,13 @@ void Fl_X11_Screen_Driver::init() { screens[i].scale = 1; #endif if (dpi_by_randr) { - dpi[i][0] = dpih; - dpi[i][1] = dpiv; + dpi[i][0] = dpih; + dpi[i][1] = dpiv; } else { - int mm = DisplayWidthMM(fl_display, i); - dpi[i][0] = mm ? screens[i].width*25.4f/mm : 0.0f; - mm = DisplayHeightMM(fl_display, fl_screen); - dpi[i][1] = mm ? screens[i].height*25.4f/mm : 0.0f; + int mm = DisplayWidthMM(fl_display, i); + dpi[i][0] = mm ? screens[i].width*25.4f/mm : 0.0f; + mm = DisplayHeightMM(fl_display, fl_screen); + dpi[i][1] = mm ? screens[i].height*25.4f/mm : 0.0f; } } } @@ -533,8 +531,8 @@ void Fl_X11_Screen_Driver::grab(Fl_Window* win) GrabModeAsync, fl_event_time); } - Fl::grab_ = win; // FIXME: Fl::grab_ "should be private", but we need - // a way to *set* the variable from the driver! + Fl::grab_ = win; // FIXME: Fl::grab_ "should be private", but we need + // a way to *set* the variable from the driver! } else { if (Fl::grab()) { // We must keep the grab in the non-EWMH fullscreen case @@ -545,8 +543,8 @@ void Fl_X11_Screen_Driver::grab(Fl_Window* win) // this flush is done in case the picked menu item goes into // an infinite loop, so we don't leave the X server locked up: XFlush(fl_display); - Fl::grab_ = 0; // FIXME: Fl::grab_ "should be private", but we need - // a way to *set* the variable from the driver! + Fl::grab_ = 0; // FIXME: Fl::grab_ "should be private", but we need + // a way to *set* the variable from the driver! fl_fix_focus(); } } @@ -602,11 +600,11 @@ void Fl_X11_Screen_Driver::get_system_colors() if (Fl::first_window()) key1 = Fl::first_window()->xclass(); if (!key1) key1 = "fltk"; if (!bg2_set) - getsyscolor("Text","background", fl_bg2, "#ffffff", Fl::background2); + getsyscolor("Text","background", fl_bg2, "#ffffff", Fl::background2); if (!fg_set) - getsyscolor(key1, "foreground", fl_fg, "#000000", Fl::foreground); + getsyscolor(key1, "foreground", fl_fg, "#000000", Fl::foreground); if (!bg_set) - getsyscolor(key1, "background", fl_bg, "#c0c0c0", Fl::background); + getsyscolor(key1, "background", fl_bg, "#c0c0c0", Fl::background); getsyscolor("Text", "selectBackground", 0, "#000080", set_selection_color); } @@ -670,8 +668,8 @@ int Fl_X11_Screen_Driver::has_timeout(Fl_Timeout_Handler cb, void *argp) { Removes a timeout callback. It is harmless to remove a timeout callback that no longer exists. - \note This version removes all matching timeouts, not just the first one. - This may change in the future. + \note This version removes all matching timeouts, not just the first one. + This may change in the future. */ void Fl_X11_Screen_Driver::remove_timeout(Fl_Timeout_Handler cb, void *argp) { for (Timeout** p = &first_timeout; *p;) { @@ -720,7 +718,7 @@ fl_subimage_offsets(int a, int aw, int b, int bw, int &obw) { int off; int ob; - + if (b >= a) { ob = b; off = 0; @@ -728,15 +726,15 @@ fl_subimage_offsets(int a, int aw, int b, int bw, int &obw) ob = a; off = a - b; } - + bw -= off; - + if (ob + bw <= a + aw) { obw = bw; } else { obw = (a + aw) - ob; } - + return off; } @@ -750,23 +748,23 @@ extern "C" { Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int h, Fl_Window *win, bool may_capture_subwins, bool *did_capture_subwins) { - XImage *image; // Captured image - int i, maxindex; // Looping vars - int x, y; // Current X & Y in image - int d; // Depth of image - unsigned char *line, // Array to hold image row - *line_ptr; // Pointer to current line image - unsigned char *pixel; // Current color value - XColor colors[4096]; // Colors from the colormap... - unsigned char cvals[4096][3]; // Color values from the colormap... - unsigned index_mask, - index_shift, - red_mask, - red_shift, - green_mask, - green_shift, - blue_mask, - blue_shift; + XImage *image; // Captured image + int i, maxindex; // Looping vars + int x, y; // Current X & Y in image + int d; // Depth of image + unsigned char *line, // Array to hold image row + *line_ptr; // Pointer to current line image + unsigned char *pixel; // Current color value + XColor colors[4096]; // Colors from the colormap... + unsigned char cvals[4096][3]; // Color values from the colormap... + unsigned index_mask, + index_shift, + red_mask, + red_shift, + green_mask, + green_shift, + blue_mask, + blue_shift; // // Under X11 we have the option of the XGetImage() interface or SGI's // ReadDisplay extension which does all of the really hard work for @@ -774,12 +772,12 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int // int allow_outside = w < 0; // negative w allows negative X or Y, that is, window frame if (w < 0) w = - w; - + Window xid = (win && !allow_outside ? fl_xid(win) : fl_window); float s = allow_outside ? Fl::screen_driver()->scale(win->screen_num()) : Fl_Surface_Device::surface()->driver()->scale(); int ws = w * s, hs = h * s, Xs = X*s, Ys = Y*s; - + # ifdef __sgi if (XReadDisplayQueryExtension(fl_display, &i, &i)) { image = XReadDisplay(fl_display, xid, Xs, Ys, ws, hs, 0, NULL); @@ -787,12 +785,12 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int # else image = 0; # endif // __sgi - + if (!image) { // fetch absolute coordinates int dx, dy, sx, sy, sw, sh; Window child_win; - + if (win) { XTranslateCoordinates(fl_display, xid, RootWindow(fl_display, fl_screen), Xs, Ys, &dx, &dy, &child_win); @@ -821,7 +819,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int noffx = fl_subimage_offsets(sx, sw, dx, ws, nw); noffy = fl_subimage_offsets(sy, sh, dy, hs, nh); if (nw <= 0 || nh <= 0) return 0; - + // allocate the image int bpp = fl_visual->depth + ((fl_visual->depth / 8) % 2) * 8; char* buf = (char*)malloc((bpp / 8) * ws * hs); @@ -831,7 +829,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int if (buf) free(buf); return 0; } - + XErrorHandler old_handler = XSetErrorHandler(xgetimageerrhandler); XImage *subimg = XGetSubImage(fl_display, xid, Xs + noffx, Ys + noffy, nw, nh, AllPlanes, ZPixmap, image, noffx, noffy); @@ -842,13 +840,13 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } } - + if (!image) return 0; if (s != 1) { w = ws; h = hs; } - + #ifdef DEBUG printf("width = %d\n", image->width); printf("height = %d\n", image->height); @@ -867,23 +865,23 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int printf("blue_mask = %08x\n", image->blue_mask); printf("map_entries = %d\n", fl_visual->visual->map_entries); #endif // DEBUG - + d = 3; uchar *p = NULL; // Allocate the image data array as needed... const uchar *oldp = p; if (!p) p = new uchar[w * h * d]; - + // Initialize the default colors/alpha in the whole image... memset(p, 0, w * h * d); - + // Check that we have valid mask/shift values... if (!image->red_mask && image->bits_per_pixel > 12) { // Greater than 12 bits must be TrueColor... image->red_mask = fl_visual->visual->red_mask; image->green_mask = fl_visual->visual->green_mask; image->blue_mask = fl_visual->visual->blue_mask; - + #ifdef DEBUG // Defined in Fl_Xlib_Graphics_Driver_color.cxx extern uchar fl_redmask, fl_greenmask, fl_bluemask; @@ -900,27 +898,27 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int printf("blue_mask = %08x\n", image->blue_mask); #endif // DEBUG } - + // Check if we have colormap image... if (!image->red_mask) { // Get the colormap entries for this window... maxindex = fl_visual->visual->map_entries; - + for (i = 0; i < maxindex; i ++) colors[i].pixel = i; - + XQueryColors(fl_display, fl_colormap, colors, maxindex); - + for (i = 0; i < maxindex; i ++) { cvals[i][0] = colors[i].red >> 8; cvals[i][1] = colors[i].green >> 8; cvals[i][2] = colors[i].blue >> 8; } - + // Read the pixels and output an RGB image... for (y = 0; y < image->height; y ++) { pixel = (unsigned char *)(image->data + y * image->bytes_per_line); line = p + y * w * d; - + switch (image->bits_per_pixel) { case 1 : for (x = image->width, line_ptr = line, index_mask = 128; @@ -935,7 +933,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int line_ptr[1] = cvals[0][1]; line_ptr[2] = cvals[0][2]; } - + if (index_mask > 1) { index_mask >>= 1; } else { @@ -944,17 +942,17 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 2 : for (x = image->width, line_ptr = line, index_shift = 6; x > 0; x --, line_ptr += d) { i = (*pixel >> index_shift) & 3; - + line_ptr[0] = cvals[i][0]; line_ptr[1] = cvals[i][1]; line_ptr[2] = cvals[i][2]; - + if (index_shift > 0) { index_shift -= 2; } else { @@ -963,18 +961,18 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 4 : for (x = image->width, line_ptr = line, index_shift = 4; x > 0; x --, line_ptr += d) { if (index_shift == 4) i = (*pixel >> 4) & 15; else i = *pixel & 15; - + line_ptr[0] = cvals[i][0]; line_ptr[1] = cvals[i][1]; line_ptr[2] = cvals[i][2]; - + if (index_shift > 0) { index_shift = 0; } else { @@ -983,7 +981,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 8 : for (x = image->width, line_ptr = line; x > 0; @@ -993,7 +991,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int line_ptr[2] = cvals[*pixel][2]; } break; - + case 12 : for (x = image->width, line_ptr = line, index_shift = 0; x > 0; @@ -1003,11 +1001,11 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } else { i = ((pixel[1] << 8) | pixel[2]) & 4095; } - + line_ptr[0] = cvals[i][0]; line_ptr[1] = cvals[i][1]; line_ptr[2] = cvals[i][2]; - + if (index_shift == 0) { index_shift = 4; } else { @@ -1022,46 +1020,46 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int // RGB(A) image, so figure out the shifts & masks... red_mask = image->red_mask; red_shift = 0; - + while ((red_mask & 1) == 0) { red_mask >>= 1; red_shift ++; } - + green_mask = image->green_mask; green_shift = 0; - + while ((green_mask & 1) == 0) { green_mask >>= 1; green_shift ++; } - + blue_mask = image->blue_mask; blue_shift = 0; - + while ((blue_mask & 1) == 0) { blue_mask >>= 1; blue_shift ++; } - + // Read the pixels and output an RGB image... for (y = 0; y < image->height; y ++) { pixel = (unsigned char *)(image->data + y * image->bytes_per_line); line = p + y * w * d; - + switch (image->bits_per_pixel) { case 8 : for (x = image->width, line_ptr = line; x > 0; x --, line_ptr += d, pixel ++) { i = *pixel; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; } break; - + case 12 : for (x = image->width, line_ptr = line, index_shift = 0; x > 0; @@ -1071,11 +1069,11 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } else { i = ((pixel[1] << 8) | pixel[2]) & 4095; } - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; - + if (index_shift == 0) { index_shift = 4; } else { @@ -1084,7 +1082,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } break; - + case 16 : if (image->byte_order == LSBFirst) { // Little-endian... @@ -1092,7 +1090,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 2) { i = (pixel[1] << 8) | pixel[0]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1103,14 +1101,14 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 2) { i = (pixel[0] << 8) | pixel[1]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; } } break; - + case 24 : if (image->byte_order == LSBFirst) { // Little-endian... @@ -1118,7 +1116,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 3) { i = (((pixel[2] << 8) | pixel[1]) << 8) | pixel[0]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1129,14 +1127,14 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 3) { i = (((pixel[0] << 8) | pixel[1]) << 8) | pixel[2]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; } } break; - + case 32 : if (image->byte_order == LSBFirst) { // Little-endian... @@ -1144,7 +1142,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 4) { i = (((((pixel[3] << 8) | pixel[2]) << 8) | pixel[1]) << 8) | pixel[0]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1155,7 +1153,7 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int x > 0; x --, line_ptr += d, pixel += 4) { i = (((((pixel[0] << 8) | pixel[1]) << 8) | pixel[2]) << 8) | pixel[3]; - + line_ptr[0] = 255 * ((i >> red_shift) & red_mask) / red_mask; line_ptr[1] = 255 * ((i >> green_shift) & green_mask) / green_mask; line_ptr[2] = 255 * ((i >> blue_shift) & blue_mask) / blue_mask; @@ -1165,10 +1163,10 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int } } } - + // Destroy the X image we've read and return the RGB(A) image... XDestroyImage(image); - + Fl_RGB_Image *rgb = new Fl_RGB_Image(p, w, h, d); if (!oldp) rgb->alloc_array = 1; return rgb; @@ -1191,7 +1189,7 @@ int Fl_X11_Screen_Driver::screen_num_unscaled(int x, int y) { int screen = -1; if (num_screens < 0) init(); - + for (int i = 0; i < num_screens; i ++) { int sx = screens[i].x_org, sy = screens[i].y_org, sw = screens[i].width, sh = screens[i].height; if ((x >= sx) && (x < (sx+sw)) && (y >= sy) && (y < (sy+sh))) { @@ -1247,7 +1245,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons // in the gsettings database. /* returns true under Ubuntu or Debian or FreeBSD and when the gnome scaling value has been found - + Ubuntu: Change the gnome scaling factor with: System Settings ==> Displays ==> Scale for menu and title bars @@ -1255,10 +1253,10 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons gsettings get com.ubuntu.user-interface scale-factor Example value: {'VGA-0': 10} Its type is "a{si}". This value should be divided by 8 to get the correct scaling factor. - + In Ubuntu 18, file $HOME/.config/monitors.xml contains the gnome scaling factor value, and FLTK reads that. - + Debian or FreeBSD : Change the gnome scaling factor with: Tweak tools ==> Windows ==> Window scaling @@ -1266,19 +1264,19 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons gsettings get org.gnome.settings-daemon.plugins.xsettings overrides Example value: {'Gdk/WindowScalingFactor': <2>} Its type is "a{sv}" and v itself is of type i - + It's also possible to use 'Tweak tools' under Ubuntu. With the standard Ubuntu desktop, the modified value goes to "org.gnome.settings-daemon.plugins.xsettings" as above. - + With Gnome session flashback under Ubuntu 'Tweak tools' puts the scaling value (1 or 2) in "org.gnome.desktop.interface scaling-factor". Read the current gnome scaling factor with: gsettings get org.gnome.desktop.interface scaling-factor Its type is "u" - - Thus, under Ubuntu, we read the 3 possible factor values and + + Thus, under Ubuntu, we read the 3 possible factor values and return the first value different from 1 to get the scaling factor. - + ================================================================================================= Ubuntu | default ubuntu desktop | System Settings => Displays => Scale for menu and title bars com.ubuntu.user-interface scale-factor @@ -1303,12 +1301,12 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons void *gobj = dlopen("libgobject-2.0.so", RTLD_LAZY); //fprintf(stderr,"glib=%p gio=%p gobj=%p\n",glib,gio,gobj); if (!glib || !gio || !gobj) return false; - + // define pters to used functions and variables g_settings_list_schemas_ftype g_settings_list_schemas_f = (g_settings_list_schemas_ftype)dlsym(gio, "g_settings_list_schemas"); // 2.26 g_settings_new_f = (g_settings_new_ftype)dlsym(gio, "g_settings_new"); // 2.26 g_settings_get_value_f = - (g_settings_get_value_ftype)dlsym(gio, "g_settings_get_value"); // 2.26 + (g_settings_get_value_ftype)dlsym(gio, "g_settings_get_value"); // 2.26 if (!g_settings_list_schemas_f || !g_settings_new_f || !g_settings_get_value_f) return false; g_variant_get_ftype g_variant_get_f = (g_variant_get_ftype)dlsym(glib, "g_variant_get"); //2.24 g_variant_iter_loop_ftype g_variant_iter_loop_f = (g_variant_iter_loop_ftype)dlsym(glib, "g_variant_iter_loop"); // 2.24 @@ -1320,7 +1318,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons //g_variant_get_type_ftype g_variant_get_type_f = (g_variant_get_type_ftype)dlsym(glib, "g_variant_get_type"); // 2.24 const unsigned *glib_major_version = (const unsigned *)dlsym(glib, "glib_major_version"); const unsigned *glib_minor_version = (const unsigned *)dlsym(glib, "glib_minor_version"); - + // call dynamic lib functions if (*glib_major_version * 1000 + *glib_minor_version < 2036) { typedef void (*init_ftype)(void); @@ -1331,7 +1329,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons float ubuntu_f = 1, ubuntu_desktop_f = 1, gnome_f = 1; bool found = false; void *gvar; - + bool ubuntu = false; // determine whether we run Ubuntu char line[400] = ""; @@ -1341,7 +1339,7 @@ static void* value_of_key_in_schema(const char **known, const char *schema, cons fclose(in); if (s && strstr(line, "Ubuntu")) ubuntu = true; } - + if (ubuntu) { gvar = value_of_key_in_schema(known, "com.ubuntu.user-interface", "scale-factor"); if (gvar) { @@ -1419,7 +1417,3 @@ void Fl_X11_Screen_Driver::desktop_scale_factor() } #endif // USE_XFT - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_System_Driver.H b/src/drivers/X11/Fl_X11_System_Driver.H index 138959d75..7c2306a28 100644 --- a/src/drivers/X11/Fl_X11_System_Driver.H +++ b/src/drivers/X11/Fl_X11_System_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Posix system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FL_X11_SYSTEM_DRIVER_H @@ -46,7 +44,7 @@ public: virtual void newUUID(char *uuidBuffer); virtual char *preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application); - virtual int preferences_need_protection_check() {return 1;} + virtual int preferences_need_protection_check() {return 1;} virtual int utf8locale(); // this one is in Fl_own_colormap.cxx virtual void own_colormap(); @@ -70,7 +68,3 @@ public: }; #endif /* FL_X11_SYSTEM_DRIVER_H */ - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_System_Driver.cxx b/src/drivers/X11/Fl_X11_System_Driver.cxx index 4914c1a29..0714ff753 100644 --- a/src/drivers/X11/Fl_X11_System_Driver.cxx +++ b/src/drivers/X11/Fl_X11_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Posix system driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_X11_System_Driver.H" @@ -65,7 +63,7 @@ extern "C" { /** Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -92,33 +90,33 @@ int Fl_X11_System_Driver::clocale_printf(FILE *output, const char *format, va_li // Find a program in the path... static char *path_find(const char *program, char *filename, int filesize) { - const char *path; // Search path - char *ptr, // Pointer into filename - *end; // End of filename buffer - - + const char *path; // Search path + char *ptr, // Pointer into filename + *end; // End of filename buffer + + if ((path = fl_getenv("PATH")) == NULL) path = "/bin:/usr/bin"; - + for (ptr = filename, end = filename + filesize - 1; *path; path ++) { if (*path == ':') { if (ptr > filename && ptr[-1] != '/' && ptr < end) *ptr++ = '/'; - + strlcpy(ptr, program, end - ptr + 1); - + if (!access(filename, X_OK)) return filename; - + ptr = filename; } else if (ptr < end) *ptr++ = *path; } - + if (ptr > filename) { if (ptr[-1] != '/' && ptr < end) *ptr++ = '/'; - + strlcpy(ptr, program, end - ptr + 1); - + if (!access(filename, X_OK)) return filename; } - + return 0; } @@ -136,10 +134,10 @@ int Fl_X11_System_Driver::open_uri(const char *uri, char *msg, int msglen) // Note that we specifically do not support the MAILER and // BROWSER environment variables because we have no idea whether // we need to run the listed commands in a terminal program. - char command[FL_PATH_MAX], // Command to run... - *argv[4], // Command-line arguments - remote[1024]; // Remote-mode command... - const char * const *commands; // Array of commands to check... + char command[FL_PATH_MAX], // Command to run... + *argv[4], // Command-line arguments + remote[1024]; // Remote-mode command... + const char * const *commands; // Array of commands to check... int i; static const char * const browsers[] = { "xdg-open", // Portland @@ -170,35 +168,35 @@ int Fl_X11_System_Driver::open_uri(const char *uri, char *msg, int msglen) "konqueror", // KDE NULL }; - + // Figure out which commands to check for... if (!strncmp(uri, "file://", 7)) commands = managers; else if (!strncmp(uri, "mailto:", 7) || !strncmp(uri, "news:", 5)) commands = readers; else commands = browsers; - + // Find the command to run... for (i = 0; commands[i]; i ++) if (path_find(commands[i], command, sizeof(command))) break; - + if (!commands[i]) { if (msg) { snprintf(msg, msglen, "No helper application found for \"%s\"", uri); } - + return 0; } - + // Handle command-specific arguments... argv[0] = (char *)commands[i]; - + if (!strcmp(commands[i], "firefox") || !strcmp(commands[i], "mozilla") || !strcmp(commands[i], "netscape") || !strcmp(commands[i], "thunderbird")) { // program -remote openURL(uri) snprintf(remote, sizeof(remote), "openURL(%s)", uri); - + argv[1] = (char *)"-remote"; argv[2] = remote; argv[3] = 0; @@ -212,16 +210,16 @@ int Fl_X11_System_Driver::open_uri(const char *uri, char *msg, int msglen) argv[1] = (char *)uri; argv[2] = 0; } - + if (msg) { strlcpy(msg, argv[0], msglen); - + for (i = 1; argv[i]; i ++) { strlcat(msg, " ", msglen); strlcat(msg, argv[i], msglen); } } - + return run_program(command, argv, msg, msglen) != 0; } @@ -236,7 +234,7 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, int res = -1, len; char *list = NULL, *name; struct vmount *vp; - + // We always have the root filesystem add("/", icon); // Get the required buffer size for the vmount structures @@ -274,7 +272,7 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, // http://www.daemon-systems.org/man/getmntinfo.3.html int res = -1; struct statvfs *list; - + // We always have the root filesystem browser->add("/", icon); # ifdef HAVE_PTHREAD @@ -303,8 +301,8 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, // // UNIX code uses /etc/fstab or similar... // - FILE *mtab; // /etc/mtab or /etc/mnttab file - char line[FL_PATH_MAX]; // Input line + FILE *mtab; // /etc/mtab or /etc/mnttab file + char line[FL_PATH_MAX]; // Input line // Every Unix has a root filesystem '/'. // This ensures that the user don't get an empty @@ -317,15 +315,15 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, // // Note: this misses automounted filesystems on FreeBSD if absent from /etc/fstab // - - mtab = fopen("/etc/mnttab", "r"); // Fairly standard + + mtab = fopen("/etc/mnttab", "r"); // Fairly standard if (mtab == NULL) - mtab = fopen("/etc/mtab", "r"); // More standard + mtab = fopen("/etc/mtab", "r"); // More standard if (mtab == NULL) - mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list + mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list if (mtab == NULL) - mtab = fopen("/etc/vfstab", "r"); // Alternate full list file - + mtab = fopen("/etc/vfstab", "r"); // Alternate full list file + if (mtab != NULL) { while (fgets(line, sizeof(line), mtab) != NULL) @@ -336,15 +334,15 @@ int Fl_X11_System_Driver::file_browser_load_filesystem(Fl_File_Browser *browser, continue; if (strcmp("/", filename) == 0) continue; // "/" was added before - + // Add a trailing slash (except for the root filesystem) strlcat(filename, "/", lname); - + // printf("Fl_File_Browser::load() - adding \"%s\" to list...\n", filename); browser->add(filename, icon); num_files ++; } - + fclose(mtab); } #endif // _AIX || ... @@ -357,17 +355,17 @@ void Fl_X11_System_Driver::newUUID(char *uuidBuffer) // #include <uuid/uuid.h> // void uuid_generate(uuid_t out); unsigned char b[16]; - time_t t = time(0); // first 4 byte + time_t t = time(0); // first 4 byte b[0] = (unsigned char)t; b[1] = (unsigned char)(t>>8); b[2] = (unsigned char)(t>>16); b[3] = (unsigned char)(t>>24); - int r = rand(); // four more bytes + int r = rand(); // four more bytes b[4] = (unsigned char)r; b[5] = (unsigned char)(r>>8); b[6] = (unsigned char)(r>>16); b[7] = (unsigned char)(r>>24); - unsigned long a = (unsigned long)&t; // four more bytes + unsigned long a = (unsigned long)&t; // four more bytes b[8] = (unsigned char)a; b[9] = (unsigned char)(a>>8); b[10] = (unsigned char)(a>>16); @@ -390,7 +388,7 @@ void Fl_X11_System_Driver::newUUID(char *uuidBuffer) b[10] = v.a[2]; b[11] = v.a[3]; # endif - char name[80]; // last four bytes + char name[80]; // last four bytes gethostname(name, 79); memcpy(b+12, name, 4); sprintf(uuidBuffer, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -425,7 +423,7 @@ char *Fl_X11_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Prefer strcpy(filename, "/etc/fltk/"); break; } - + // Make sure that the parameters are not NULL if ( (vendor==0L) || (vendor[0]==0) ) vendor = "unknown"; @@ -449,12 +447,12 @@ int Fl_X11_System_Driver::XParseGeometry(const char* string, int* x, int* y, int Fl_X11_System_Driver::filename_list(const char *d, dirent ***list, int (*sort)(struct dirent **, struct dirent **) ) { int dirlen; char *dirloc; - + // Assume that locale encoding is no less dense than UTF-8 dirlen = strlen(d); dirloc = (char *)malloc(dirlen + 1); fl_utf8to_mb(d, dirlen, dirloc, dirlen + 1); - + #ifndef HAVE_SCANDIR // This version is when we define our own scandir int n = fl_scandir(dirloc, list, 0, sort); @@ -475,31 +473,31 @@ int Fl_X11_System_Driver::filename_list(const char *d, dirent ***list, int (*sor // changes: int n = scandir(dirloc, list, 0, (int(*)(const void*,const void*))sort); #endif - + free(dirloc); - + // convert every filename to UTF-8, and append a '/' to all // filenames that are directories int i; char *fullname = (char*)malloc(dirlen+FL_PATH_MAX+3); // Add enough extra for two /'s and a nul // Use memcpy for speed since we already know the length of the string... memcpy(fullname, d, dirlen+1); - + char *name = fullname + dirlen; if (name!=fullname && name[-1]!='/') *name++ = '/'; - + for (i=0; i<n; i++) { int newlen; dirent *de = (*list)[i]; int len = strlen(de->d_name); newlen = fl_utf8from_mb(NULL, 0, de->d_name, len); dirent *newde = (dirent*)malloc(de->d_name - (char*)de + newlen + 2); // Add space for a / and a nul - + // Conversion to UTF-8 memcpy(newde, de, de->d_name - (char*)de); fl_utf8from_mb(newde->d_name, newlen + 1, de->d_name, len); - + // Check if dir (checks done on "old" name as we need to interact with // the underlying OS) if (de->d_name[len-1]!='/' && len<=FL_PATH_MAX) { @@ -511,12 +509,12 @@ int Fl_X11_System_Driver::filename_list(const char *d, dirent ***list, int (*sor *dst = 0; } } - + free(de); (*list)[i] = newde; } free(fullname); - + return n; } @@ -619,7 +617,3 @@ const char *Fl_X11_System_Driver::shortcut_add_key_name(unsigned key, char *p, c } #endif // !defined(FL_DOXYGEN) - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H index 604b7d622..098808c72 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.H +++ b/src/drivers/X11/Fl_X11_Window_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 window driver // for the Fast Light Tool Kit (FLTK). // @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -35,13 +33,13 @@ class Fl_Bitmap; There is one window driver for each Fl_Window. Window drivers manage window actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated + drawing and rendering is managed by the Surface device and the associated graphics driver. - window specific event handling - window types and styles, depth, etc. - decorations - + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ @@ -86,7 +84,7 @@ private: char backbuffer_bad; void flush_double_dbe(int erase_overlay); #endif - + public: Fl_X11_Window_Driver(Fl_Window*); virtual ~Fl_X11_Window_Driver(); @@ -95,7 +93,7 @@ public: virtual int screen_num(); static void resize_after_screen_change(void *data); #endif // USE_XFT - + // --- window data virtual int decorated_w(); virtual int decorated_h(); @@ -144,7 +142,3 @@ public: #endif // FL_X11_WINDOW_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index 50a013ba6..19fc70b09 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of X11 window driver. // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -34,8 +32,8 @@ #if HAVE_DLFCN_H #include <dlfcn.h> #endif -#define ShapeBounding 0 -#define ShapeSet 0 +#define ShapeBounding 0 +#define ShapeSet 0 #if HAVE_OVERLAY extern XVisualInfo *fl_find_overlay_visual(); @@ -89,7 +87,7 @@ void Fl_X11_Window_Driver::flush_double_dbe(int erase_overlay) if (i->region) {Fl_Graphics_Driver::default_driver().XDestroyRegion(i->region); i->region = 0;} pWindow->clear_damage(FL_DAMAGE_ALL); backbuffer_bad = 0; - } + } // Redraw as needed... if (pWindow->damage()) { fl_clip_region(i->region); i->region = 0; @@ -181,7 +179,7 @@ int Fl_X11_Window_Driver::decorated_h() int Fl_X11_Window_Driver::decorated_w() { int w, h; - + decorated_win_size(w, h); return w; } @@ -191,8 +189,8 @@ void Fl_X11_Window_Driver::take_focus() { Fl_X *i = Fl_X::i(pWindow); if (!Fl_X11_Screen_Driver::ewmh_supported()) - pWindow->show(); // Old WMs, XMapRaised - else if (i) // New WMs use the NETWM attribute: + pWindow->show(); // Old WMs, XMapRaised + else if (i) // New WMs use the NETWM attribute: activate_window(); } @@ -351,7 +349,7 @@ void Fl_X11_Window_Driver::combine_mask() void Fl_X11_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { free_icons(); - + if (count > 0) { icon_->icons = new Fl_RGB_Image*[count]; icon_->count = count; @@ -361,7 +359,7 @@ void Fl_X11_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { icon_->icons[i]->normalize(); } } - + if (Fl_X::i(pWindow)) set_icons(); } @@ -392,7 +390,7 @@ void Fl_X11_Window_Driver::free_icons() { (or NULL if a particular border is absent). Returned images can be deleted after use. Their depth and size may be platform-dependent. The top and bottom images extend from left of the left border to right of the right border. - + This function exploits a feature of Fl_X11_Screen_Driver::read_win_rectangle() which, when called with negative 3rd argument, captures the window decoration. Other requirement to capture the window decoration: @@ -449,7 +447,7 @@ void Fl_X11_Window_Driver::make_current() { #if USE_XFT ((Fl_Xlib_Graphics_Driver*)fl_graphics_driver)->scale(Fl::screen_driver()->scale(screen_num())); #endif - + #ifdef FLTK_USE_CAIRO // update the cairo_t context if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); @@ -529,20 +527,20 @@ void Fl_X11_Window_Driver::decoration_sizes(int *top, int *left, int *right, in void Fl_X11_Window_Driver::show_with_args_begin() { // Get defaults for drag-n-drop and focus... const char *key = 0, *val; - + if (Fl::first_window()) key = Fl::first_window()->xclass(); if (!key) key = "fltk"; - + val = XGetDefault(fl_display, key, "dndTextOps"); if (val) Fl::dnd_text_ops(strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0 || strcasecmp(val, "yes") == 0); - + val = XGetDefault(fl_display, key, "tooltips"); if (val) Fl_Tooltip::enable(strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0 || strcasecmp(val, "yes") == 0); - + val = XGetDefault(fl_display, key, "visibleFocus"); if (val) Fl::visible_focus(strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0 || @@ -624,7 +622,7 @@ void Fl_X11_Window_Driver::redraw_overlay() { overlay(new _Fl_Overlay(0,0,w(),h())); Fl_Group::current(0); } else { - overlay(pWindow); // fake the overlay + overlay(pWindow); // fake the overlay } } if (shown()) { @@ -712,8 +710,3 @@ int Fl_X11_Window_Driver::screen_num() { return screen_num_ >= 0 ? screen_num_ : 0; } #endif // USE_XFT - - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Font.H b/src/drivers/Xlib/Fl_Font.H index 49917b6d3..3b220e5d3 100644 --- a/src/drivers/Xlib/Fl_Font.H +++ b/src/drivers/Xlib/Fl_Font.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Two internal fltk data structures: @@ -44,7 +42,7 @@ public: int angle; FL_EXPORT Fl_Xlib_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle); # else - XUtf8FontStruct* font; // X UTF-8 font information + XUtf8FontStruct* font; // X UTF-8 font information FL_EXPORT Fl_Xlib_Font_Descriptor(const char* xfontname); # endif # if HAVE_GL @@ -58,17 +56,13 @@ public: #if !USE_XFT struct Fl_Xlib_Fontdesc { // replaces Fl_Fontdesc const char *name; - char fontname[128]; // "Pretty" font name - Fl_Font_Descriptor *first; // linked list of sizes of this style - char **xlist; // matched X font names - int n; // size of xlist, negative = don't free xlist! + char fontname[128]; // "Pretty" font name + Fl_Font_Descriptor *first; // linked list of sizes of this style + char **xlist; // matched X font names + int n; // size of xlist, negative = don't free xlist! }; #endif extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx index 18176a0a6..373cf9e4d 100644 --- a/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -95,7 +93,3 @@ void Fl_Xlib_Copy_Surface_Driver::untranslate() { } #endif // FL_CFG_GFX_XLIB - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H index 784bc8d02..322b45c68 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of class Fl_Xlib_Graphics_Driver for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -218,7 +216,3 @@ protected: }; #endif // FL_XLIB_GRAPHICS_DRIVER_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx index 3a1ff8361..c98cb546f 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -292,7 +290,3 @@ int Fl_Xlib_Graphics_Driver::pfd_array_length = FL_FREE_FONT; PangoFontDescription **Fl_Xlib_Graphics_Driver::pfd_array = (PangoFontDescription**)calloc(pfd_array_length, sizeof(PangoFontDescription*)); #endif - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx index dc35080b3..381ac0d97 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -38,7 +36,3 @@ void Fl_Xlib_Graphics_Driver::pie_unscaled(float x,float y,float w,float h,doubl XDrawArc(fl_display, fl_window, gc_, x,y,w-1,h-1, int(a1*64),int((a2-a1)*64)); XFillArc(fl_display, fl_window, gc_, x,y,w-1,h-1, int(a1*64),int((a2-a1)*64)); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx index f13bfc190..937ed7c50 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Color functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Implementation of fl_color(i), fl_color(r,g,b). @@ -44,14 +42,14 @@ extern unsigned fl_cmap[256]; // defined in fl_color.cxx // figure_out_visual() calculates masks & shifts for generating // pixels in true-color visuals: -uchar fl_redmask; /**< color mask used in current color map handling */ -uchar fl_greenmask; /**< color mask used in current color map handling */ -uchar fl_bluemask; /**< color mask used in current color map handling */ +uchar fl_redmask; /**< color mask used in current color map handling */ +uchar fl_greenmask; /**< color mask used in current color map handling */ +uchar fl_bluemask; /**< color mask used in current color map handling */ -int fl_redshift; /**< color shift used in current color map handling */ -int fl_greenshift; /**< color shift used in current color map handling */ -int fl_blueshift; /**< color shift used in current color map handling */ -int fl_extrashift; /**< color shift used in current color map handling */ +int fl_redshift; /**< color shift used in current color map handling */ +int fl_greenshift; /**< color shift used in current color map handling */ +int fl_blueshift; /**< color shift used in current color map handling */ +int fl_extrashift; /**< color shift used in current color map handling */ static uchar beenhere; @@ -345,7 +343,3 @@ void Fl_Xlib_Graphics_Driver::set_color(Fl_Color i, unsigned c) { /** \} */ - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx index 2e615e241..8b3784566 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // X11 font utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Select fonts from the FLTK font table. @@ -67,9 +65,9 @@ static int attribute(int n, const char *p) { if (!*p || *p=='-' || *p=='*') return 0; if (n == 3) { // weight if (!strncmp(p,"normal",6) || - !strncmp(p,"light",5) || - !strncmp(p,"medium",6) || - !strncmp(p,"book",4)) return 0; + !strncmp(p,"light",5) || + !strncmp(p,"medium",6) || + !strncmp(p,"book",4)) return 0; if (!strncmp(p,"bold",4) || !strncmp(p,"demi",4)) return FL_BOLD; } else if (n == 4) { // slant if (*p == 'r') return 0; @@ -108,12 +106,12 @@ const char* Fl_Xlib_Graphics_Driver::get_font_name(Fl_Font fnum, int* ap) { if (strstr(p,"bold")) type = FL_BOLD; if (strstr(p,"ital")) type |= FL_ITALIC; for (;*p; p++) { - if (*p == '*' || *p == ' ' || *p == '-') { - do p++; while (*p == '*' || *p == ' ' || *p == '-'); - if (!*p) break; - if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; - } - if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = *p; + if (*p == '*' || *p == ' ' || *p == '-') { + do p++; while (*p == '*' || *p == ' ' || *p == '-'); + if (!*p) break; + if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; + } + if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = *p; } *o = 0; @@ -122,35 +120,35 @@ const char* Fl_Xlib_Graphics_Driver::get_font_name(Fl_Font fnum, int* ap) { // get the family: const char *x = fl_font_word(p,2); if (*x) x++; if (*x=='*') x++; if (!*x) { - if (ap) *ap = 0; - return p; + if (ap) *ap = 0; + return p; } const char *e = fl_font_word(x,1); if ((e - x) < (int)(ENDOFBUFFER - 1)) { - // MRS: we want strncpy here, not strlcpy... - strncpy(o,x,e-x); - o += e-x; + // MRS: we want strncpy here, not strlcpy... + strncpy(o,x,e-x); + o += e-x; } else { - strlcpy(f->fontname, x, ENDOFBUFFER); - o = f->fontname+ENDOFBUFFER-1; + strlcpy(f->fontname, x, ENDOFBUFFER); + o = f->fontname+ENDOFBUFFER-1; } // collect all the attribute words: for (int n = 3; n <= 6; n++) { - // get the next word: - if (*e) e++; x = e; e = fl_font_word(x,1); - int t = attribute(n,x); - if (t < 0) { - if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; - if ((e - x) < (int)(ENDOFBUFFER - (o - f->fontname) - 1)) { - // MRS: we want strncpy here, not strlcpy... - strncpy(o,x,e-x); - o += e-x; - } else { - strlcpy(o,x, ENDOFBUFFER - (o - f->fontname) - 1); - o = f->fontname+ENDOFBUFFER-1; - } - } else type |= t; + // get the next word: + if (*e) e++; x = e; e = fl_font_word(x,1); + int t = attribute(n,x); + if (t < 0) { + if (o < (f->fontname + ENDOFBUFFER - 1)) *o++ = ' '; + if ((e - x) < (int)(ENDOFBUFFER - (o - f->fontname) - 1)) { + // MRS: we want strncpy here, not strlcpy... + strncpy(o,x,e-x); + o += e-x; + } else { + strlcpy(o,x, ENDOFBUFFER - (o - f->fontname) - 1); + o = f->fontname+ENDOFBUFFER-1; + } + } else type |= t; } // skip over the '*' for the size and get the registry-encoding: @@ -181,15 +179,15 @@ static int ultrasort(const void *aa, const void *bb) { int ret = 0; for (;;) { if (isdigit(*a) && isdigit(*b)) { - int na = strtol(a, (char **)&a, 10); - int nb = strtol(b, (char **)&b, 10); - if (!ret) ret = na-nb; + int na = strtol(a, (char **)&a, 10); + int nb = strtol(b, (char **)&b, 10); + if (!ret) ret = na-nb; } else if (*a != *b) { - return (*a-*b); + return (*a-*b); } else if (!*a) { - return ret; + return ret; } else { - a++; b++; + a++; b++; } } } else { @@ -290,26 +288,26 @@ Fl_Font Fl_Xlib_Graphics_Driver::set_fonts(const char* xstarname) { int size = to_canonical(canon, p, sizeof(canon)); if (size >= 0) { for (;;) { // find all matching fonts: - if (i >= xlistsize) break; - const char *q = xlist[i]; - char this_canon[1024]; - if (to_canonical(this_canon, q, sizeof(this_canon)) < 0) break; - if (strcmp(canon, this_canon)) break; - i++; + if (i >= xlistsize) break; + const char *q = xlist[i]; + char this_canon[1024]; + if (to_canonical(this_canon, q, sizeof(this_canon)) < 0) break; + if (strcmp(canon, this_canon)) break; + i++; } /*if (*p=='-' || i > first_xlist+1)*/ p = canon; } unsigned int j; for (j = 0;; j++) { /*if (j < FL_FREE_FONT) { - // see if it is one of our built-in fonts: - // if so, set the list of x fonts, since we have it anyway - if (fl_fonts[j].name && !strcmp(fl_fonts[j].name, p)) break; + // see if it is one of our built-in fonts: + // if so, set the list of x fonts, since we have it anyway + if (fl_fonts[j].name && !strcmp(fl_fonts[j].name, p)) break; } else */{ - j = fl_free_font++; - if (p == canon) p = strdup(p); else used_xlist = 1; - Fl::set_font((Fl_Font)j, p); - break; + j = fl_free_font++; + if (p == canon) p = strdup(p); else used_xlist = 1; + Fl::set_font((Fl_Font)j, p); + break; } } Fl_Xlib_Fontdesc *s = ((Fl_Xlib_Fontdesc*)fl_fonts)+j; @@ -346,9 +344,9 @@ int Fl_Xlib_Graphics_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) { int n; for (n = numsizes-1; n > 0; n--) if (sizes[n-1] < s) break; if (sizes[n] != s) { - for (int m = numsizes; m > n; m--) sizes[m] = sizes[m-1]; - sizes[n] = s; - numsizes++; + for (int m = numsizes; m > n; m--) sizes[m] = sizes[m-1]; + sizes[n] = s; + numsizes++; } } } @@ -484,9 +482,9 @@ static const char *find_best_font(const char *fname, int size) { strcpy(namebuffer+l,c); name = namebuffer; ptsize = size; - } else if (!ptsize || // no fonts yet - (thissize < ptsize && ptsize > size) || // current font too big - (thissize > ptsize && thissize <= size) // current too small + } else if (!ptsize || // no fonts yet + (thissize < ptsize && ptsize > size) || // current font too big + (thissize > ptsize && thissize <= size) // current too small ) { name = thisname; ptsize = thissize; @@ -497,9 +495,9 @@ static const char *find_best_font(const char *fname, int size) { // if (ptsize != size) { // see if we already found this unscalable font: // for (f = s->first; f; f = f->next) { // if (f->minsize <= ptsize && f->maxsize >= ptsize) { -// if (f->minsize > size) f->minsize = size; -// if (f->maxsize < size) f->maxsize = size; -// return f; +// if (f->minsize > size) f->minsize = size; +// if (f->maxsize < size) f->maxsize = size; +// return f; // } // } // } @@ -673,8 +671,8 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(int angle, const char *str, int n, i if (!warning && angle != 0) { warning = 1; fprintf(stderr, - "libfltk: rotated text not implemented by X backend.\n" - " You should use the Xft backend. Check USE_XFT in config.h.\n"); + "libfltk: rotated text not implemented by X backend.\n" + " You should use the Xft backend. Check USE_XFT in config.h.\n"); } this->draw(str, n, (int)x, (int)y); } @@ -713,7 +711,3 @@ float Fl_Xlib_Graphics_Driver::scale_bitmap_for_PostScript() { } #endif // FL_DOXYGEN - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx index ee36e1cf6..5a80904ab 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // More font utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef FL_DOXYGEN @@ -276,7 +274,7 @@ static void make_raw_name(char *raw, char *pretty) mods |= BOLD; } goto NEXT_STYLE; - + case 'L': if (strncasecmp(style, "Light", 5) == 0) { @@ -564,13 +562,13 @@ static XftFont* fontopen(const char* name, /*Fl_Fontsize*/double size, bool core nxt++; // first char of next name } - // Add the current name to the match pattern - XftPatternAddString(fnt_pat, XFT_FAMILY, curr); + // Add the current name to the match pattern + XftPatternAddString(fnt_pat, XFT_FAMILY, curr); if(nxt) curr = nxt; // move onto next name (if it exists) - // Now do a cut-down version of the FLTK name conversion. - // NOTE: we only use the slant and weight of the first name, - // subsequent names we ignore this for... But we still need to do the check. + // Now do a cut-down version of the FLTK name conversion. + // NOTE: we only use the slant and weight of the first name, + // subsequent names we ignore this for... But we still need to do the check. switch (*curr++) { case 'I': break; // italic case 'P': // bold-italic (falls-through) @@ -615,28 +613,28 @@ static XftFont* fontopen(const char* name, /*Fl_Fontsize*/double size, bool core #if 0 // the XftResult never seems to get set to anything... abandon this code? switch(match_result) { // how good a match is this font for our request? case XftResultMatch: - puts("Object exists with the specified ID"); - break; + puts("Object exists with the specified ID"); + break; case XftResultTypeMismatch: - puts("Object exists, but the type does not match"); - break; + puts("Object exists, but the type does not match"); + break; case XftResultNoId: - puts("Object exists, but has fewer values than specified"); - break; + puts("Object exists, but has fewer values than specified"); + break; case FcResultOutOfMemory: - puts("FcResult: Malloc failed"); - break; + puts("FcResult: Malloc failed"); + break; case XftResultNoMatch: - puts("Object does not exist at all"); - break; + puts("Object does not exist at all"); + break; default: - printf("Invalid XftResult status %d \n", match_result); - break; + printf("Invalid XftResult status %d \n", match_result); + break; } #endif @@ -801,21 +799,21 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(const char *str, int n, int x, int y if (fl_overlay) { if (!draw_) draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window, - fl_overlay_visual->visual, fl_overlay_colormap); + fl_overlay_visual->visual, fl_overlay_colormap); else //if (draw_overlay_window != fl_window) XftDrawChange(draw_, draw_overlay_window = fl_window); } else #endif if (!draw_) draw_ = XftDrawCreate(fl_display, draw_window = fl_window, - fl_visual->visual, fl_colormap); + fl_visual->visual, fl_colormap); else //if (draw_window != fl_window) XftDrawChange(draw_, draw_window = fl_window); Region region = fl_clip_region(); if (!(region && XEmptyRegion(region))) { XftDrawSetClip(draw_, region); - + // Use fltk's color allocator, copy the results to match what // XftCollorAllocValue returns: XftColor color; @@ -825,7 +823,7 @@ void Fl_Xlib_Graphics_Driver::draw_unscaled(const char *str, int n, int x, int y color.color.green = ((int)g)*0x101; color.color.blue = ((int)b)*0x101; color.color.alpha = 0xffff; - + const wchar_t *buffer = utf8reformat(str, n); #ifdef __CYGWIN__ XftDrawString16(draw_, &color, ((Fl_Xlib_Font_Descriptor*)font_descriptor())->font, x1, y1, (XftChar16 *)buffer, n); @@ -847,14 +845,14 @@ void Fl_Xlib_Graphics_Driver::drawUCS4(const void *str, int n, int x, int y) { if (fl_overlay) { if (!draw_) draw_ = XftDrawCreate(fl_display, draw_overlay_window = fl_window, - fl_overlay_visual->visual, fl_overlay_colormap); + fl_overlay_visual->visual, fl_overlay_colormap); else //if (draw_overlay_window != fl_window) XftDrawChange(draw_, draw_overlay_window = fl_window); } else #endif if (!draw_) draw_ = XftDrawCreate(fl_display, draw_window = fl_window, - fl_visual->visual, fl_colormap); + fl_visual->visual, fl_colormap); else //if (draw_window != fl_window) XftDrawChange(draw_, draw_window = fl_window); @@ -934,7 +932,7 @@ extern "C" { int Fl_Xlib_Graphics_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) { Fl_Fontdesc *s = fl_fonts+fnum; if (!s->name) s = fl_fonts; // empty slot in table, use entry 0 - + fl_open_display(); XftFontSet* fs = XftListFonts(fl_display, fl_screen, XFT_FAMILY, XftTypeString, s->name+1, @@ -1301,7 +1299,7 @@ void Fl_Xlib_Graphics_Driver::do_draw(int from_right, const char *str, int n, in Region region = clip_region(); if (region && XEmptyRegion(region)) return; if (!playout_) context(); - + char *str2 = NULL; const char *tmpv = (const char *)memchr(str, '\n', n); if (tmpv == str + n - 1) { // ignore final '\n' @@ -1339,7 +1337,7 @@ void Fl_Xlib_Graphics_Driver::do_draw(int from_right, const char *str, int n, in else XftDrawChange(draw_, draw_window = fl_window); XftDrawSetClip(draw_, region); - + int dx, dy, w, h, y_correction, desc = descent_unscaled(), lheight = height_unscaled(); fl_pango_layout_get_pixel_extents(playout_, dx, dy, w, h, desc, lheight, y_correction); if (from_right) { @@ -1465,7 +1463,3 @@ Fl_Xlib_Font_Descriptor::Fl_Xlib_Font_Descriptor(const char* name, Fl_Fontsize f #endif // USE_PANGO #endif // FL_DOXYGEN - -// -// End of "$Id$" -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index 8fed7834b..b379a8e88 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Image drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // I hope a simple and portable method of drawing color and monochrome @@ -60,7 +58,7 @@ #include <X11/extensions/Xrender.h> #endif -static XImage xi; // template used to pass info to X +static XImage xi; // template used to pass info to X static int bytes_per_pixel; static int scanline_add; static int scanline_mask; @@ -68,8 +66,8 @@ static int scanline_mask; static void (*converter)(const uchar *from, uchar *to, int w, int delta); static void (*mono_converter)(const uchar *from, uchar *to, int w, int delta); -static int dir; // direction-alternator -static int ri,gi,bi; // saved error-diffusion value +static int dir; // direction-alternator +static int ri,gi,bi; // saved error-diffusion value # if USE_COLORMAP //////////////////////////////////////////////////////////////// @@ -468,9 +466,9 @@ static void figure_out_visual() { # define MAXBUFFER 0x40000 // 256k static void innards(const uchar *buf, int X, int Y, int W, int H, - int delta, int linedelta, int mono, - Fl_Draw_Image_Cb cb, void* userdata, - const bool alpha, GC gc) + int delta, int linedelta, int mono, + Fl_Draw_Image_Cb cb, void* userdata, + const bool alpha, GC gc) { if (!linedelta) linedelta = W*abs(delta); @@ -509,7 +507,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, // This can set bytes_per_line negative if image is bottom-to-top // I tested it on Linux, but it may fail on other Xlib implementations: if (buf && ( -# if 0 // set this to 1 to allow 32-bit shortcut +# if 0 // set this to 1 to allow 32-bit shortcut delta == 4 && # if WORDS_BIGENDIAN conv == rgbx_converter @@ -526,7 +524,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, } else { int linesize = ((w*bytes_per_pixel+scanline_add)&scanline_mask)/sizeof(STORETYPE); int blocking = h; - static STORETYPE *buffer; // our storage, always word aligned + static STORETYPE *buffer; // our storage, always word aligned static long buffer_size; {int size = linesize*h; if (size > MAXBUFFER) { @@ -543,26 +541,26 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, if (buf) { buf += delta*dx+linedelta*dy; for (int j=0; j<h; ) { - STORETYPE *to = buffer; - int k; - for (k = 0; j<h && k<blocking; k++, j++) { - conv(buf, (uchar*)to, w, delta); - buf += linedelta; - to += linesize; - } - XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); + STORETYPE *to = buffer; + int k; + for (k = 0; j<h && k<blocking; k++, j++) { + conv(buf, (uchar*)to, w, delta); + buf += linedelta; + to += linesize; + } + XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); } } else { STORETYPE* linebuf = new STORETYPE[(W*delta+(sizeof(STORETYPE)-1))/sizeof(STORETYPE)]; for (int j=0; j<h; ) { - STORETYPE *to = buffer; - int k; - for (k = 0; j<h && k<blocking; k++, j++) { - cb(userdata, dx, dy+j, w, (uchar*)linebuf); - conv((uchar*)linebuf, (uchar*)to, w, delta); - to += linesize; - } - XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); + STORETYPE *to = buffer; + int k; + for (k = 0; j<h && k<blocking; k++, j++) { + cb(userdata, dx, dy+j, w, (uchar*)linebuf); + conv((uchar*)linebuf, (uchar*)to, w, delta); + to += linesize; + } + XPutImage(fl_display,fl_window,gc, &xi, 0, 0, X+dx, Y+dy+j-k, w, k); } delete[] linebuf; @@ -586,7 +584,7 @@ void Fl_Xlib_Graphics_Driver::draw_image_unscaled(const uchar* buf, int x, int y } void Fl_Xlib_Graphics_Driver::draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { const bool alpha = !!(abs(d) & FL_IMAGE_WITH_ALPHA); if (alpha) d ^= FL_IMAGE_WITH_ALPHA; @@ -600,7 +598,7 @@ void Fl_Xlib_Graphics_Driver::draw_image_mono_unscaled(const uchar* buf, int x, } void Fl_Xlib_Graphics_Driver::draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, - int x, int y, int w, int h,int d) { + int x, int y, int w, int h,int d) { innards(0,x+offset_x_*scale(),y+offset_y_*scale(),w,h,d,0,1,cb,data,0,gc_); } @@ -892,7 +890,3 @@ void Fl_Xlib_Graphics_Driver::cache(Fl_Pixmap *pxm) { void Fl_Xlib_Graphics_Driver::uncache_pixmap(fl_uintptr_t offscreen) { XFreePixmap(fl_display, (Fl_Offscreen)offscreen); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx index 703c92ccf..606b82920 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line style code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -47,9 +45,9 @@ void Fl_Xlib_Graphics_Driver::line_style_unscaled(int style, float width, char* } char* p = dashes = buf; switch (style & 0xff) { - case FL_DASH: *p++ = dash; *p++ = gap; break; - case FL_DOT: *p++ = dot; *p++ = gap; break; - case FL_DASHDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; break; + case FL_DASH: *p++ = dash; *p++ = gap; break; + case FL_DOT: *p++ = dot; *p++ = gap; break; + case FL_DASHDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; break; case FL_DASHDOTDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; *p++ = dot; *p++ = gap; break; } ndashes = p-buf; @@ -59,11 +57,7 @@ if (*dashes == 0) ndashes = 0;//against error with very small scaling static int Join[4] = {JoinMiter, JoinMiter, JoinRound, JoinBevel}; XSetLineAttributes(fl_display, gc_, line_width_, - ndashes ? LineOnOffDash : LineSolid, - Cap[(style>>8)&3], Join[(style>>12)&3]); + ndashes ? LineOnOffDash : LineSolid, + Cap[(style>>8)&3], Join[(style>>12)&3]); if (ndashes) XSetDashes(fl_display, gc_, 0, dashes, ndashes); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx index af6b19c9a..ab591da09 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -140,8 +138,8 @@ int Fl_Xlib_Graphics_Driver::clip_line(int &x1, int &y1, int &x2, int &y2) { window corner, but with a line width so that a part of the line should be visible (in this case 2 of 5 pixels): - fl_line_style (FL_SOLID,5); // line width = 5 - fl_rect (-1,-1,100,100); // top/left: 2 pixels visible + fl_line_style (FL_SOLID,5); // line width = 5 + fl_rect (-1,-1,100,100); // top/left: 2 pixels visible In this example case, no clipping would be done, because X can handle it and clip unneeded pixels. @@ -156,9 +154,9 @@ int Fl_Xlib_Graphics_Driver::clip_line(int &x1, int &y1, int &x2, int &y2) { /* clip_rect() returns 1 if the area is invisible (clipped) because ... - (a) w <= 0 or h <= 0 i.e. nothing is visible - (b) x+w < clip_min() or y+h < clip_min() i.e. left of or above visible area - (c) x > clip_max() or y > clip_max() i.e. right of or below visible area + (a) w <= 0 or h <= 0 i.e. nothing is visible + (b) x+w < clip_min() or y+h < clip_min() i.e. left of or above visible area + (c) x > clip_max() or y > clip_max() i.e. right of or below visible area clip_min() and clip_max() are the minimal and maximal x/y coordinate values used for clipping. @@ -175,9 +173,9 @@ int Fl_Xlib_Graphics_Driver::clip_line(int &x1, int &y1, int &x2, int &y2) { int Fl_Xlib_Graphics_Driver::clip_rect(int &x, int &y, int &w, int &h) { - if (w <= 0 || h <= 0) return 1; // (a) - if (x+w < clip_min() || y+h < clip_min()) return 1; // (b) - if (x > clip_max() || y > clip_max()) return 1; // (c) + if (w <= 0 || h <= 0) return 1; // (a) + if (x+w < clip_min() || y+h < clip_min()) return 1; // (b) + if (x > clip_max() || y > clip_max()) return 1; // (c) if (x < clip_min()) { w -= (clip_min()-x); x = clip_min(); } if (y < clip_min()) { h -= (clip_min()-y); y = clip_min(); } @@ -197,8 +195,8 @@ int Fl_Xlib_Graphics_Driver::clip_rect(int &x, int &y, int &w, int &h) { Fl_Region Fl_Xlib_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) { XRectangle R; Fl_Region r = XCreateRegion(); // create an empty region - if (clip_rect(x, y, w, h)) // outside valid coordinate space - return r; // empty region + if (clip_rect(x, y, w, h)) // outside valid coordinate space + return r; // empty region R.x = x; R.y = y; R.width = w; R.height = h; XUnionRectWithRegion(&R, r, r); return r; @@ -392,7 +390,7 @@ int Fl_Xlib_Graphics_Driver::not_clipped(int x, int y, int w, int h) { Fl_Region r = rstack[rstackptr]; if (!r) return 1; // get rid of coordinates outside the 16-bit range the X calls take. - if (clip_rect(x,y,w,h)) return 0; // clipped + if (clip_rect(x,y,w,h)) return 0; // clipped return XRectInRegion(r, x, y, w, h); } @@ -408,7 +406,3 @@ void Fl_Xlib_Graphics_Driver::restore_clip() { else XSetClipMask(fl_display, gc_, 0); } } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx index 94164c36f..f94b685c0 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -95,7 +93,3 @@ void Fl_Xlib_Graphics_Driver::ellipse_unscaled(double xt, double yt, double rx, (what == POLYGON ? XFillArc : XDrawArc) (fl_display, fl_window, gc_, llx, lly, w, h, 0, 360*64); } - -// -// End of "$Id$". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx index 1f6aa0c1c..89fe4a100 100644 --- a/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Draw-to-image code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_Xlib_Graphics_Driver.H" @@ -82,7 +80,3 @@ void Fl_Xlib_Image_Surface_Driver::end_current() fl_window = pre_window; Fl_Surface_Device::end_current(); } - -// -// End of "$Id$". -// diff --git a/src/dump_compose.c b/src/dump_compose.c index fe41991cf..315a4a54d 100644 --- a/src/dump_compose.c +++ b/src/dump_compose.c @@ -14,11 +14,11 @@ int main() { for (y = 0; y<6; y++) { const char *p = compose_pairs + (16*y+x)*2; if (p[1] == ' ') - printf("<td><code>%c </code>   %c\n", - p[0],(p-compose_pairs)/2+0xA0); + printf("<td><code>%c </code>   %c\n", + p[0],(p-compose_pairs)/2+0xA0); else - printf("<td><code>%c%c</code>   %c\n", - p[0],p[1],(p-compose_pairs)/2+0xA0); + printf("<td><code>%c%c</code>   %c\n", + p[0],p[1],(p-compose_pairs)/2+0xA0); } printf("<tr>"); } diff --git a/src/filename_absolute.cxx b/src/filename_absolute.cxx index 19c1d97a6..67beb50c3 100644 --- a/src/filename_absolute.cxx +++ b/src/filename_absolute.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Filename expansion routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* expand a file name by prepending current directory, deleting . and @@ -40,7 +38,7 @@ inline int isdirsep(char c) {return c == '/';} fl_filename_absolute(out, sizeof(out), "../log/messages"); // out="/var/log/messages" \endcode \param[out] to resulting absolute filename - \param[in] tolen size of the absolute filename buffer + \param[in] tolen size of the absolute filename buffer \param[in] from relative filename \return 0 if no change, non zero otherwise */ @@ -114,16 +112,16 @@ int Fl_System_Driver::filename_absolute(char *to, int tolen, const char *from) { fl_filename_relative(out, sizeof(out), "../foo.txt"); // out="../foo.txt", return=0 (no change) \endcode \param[out] to resulting relative filename - \param[in] tolen size of the relative filename buffer + \param[in] tolen size of the relative filename buffer \param[in] from absolute filename \return 0 if no change, non zero otherwise */ -int // O - 0 if no change, 1 if changed -fl_filename_relative(char *to, // O - Relative filename - int tolen, // I - Size of "to" buffer +int // O - 0 if no change, 1 if changed +fl_filename_relative(char *to, // O - Relative filename + int tolen, // I - Size of "to" buffer const char *from) // I - Absolute filename { - char cwd_buf[FL_PATH_MAX]; // Current directory + char cwd_buf[FL_PATH_MAX]; // Current directory // get the current directory and return if we can't if (!fl_getcwd(cwd_buf, sizeof(cwd_buf))) { strlcpy(to, from, tolen); @@ -135,14 +133,14 @@ fl_filename_relative(char *to, // O - Relative filename /** Makes a filename relative to any other directory. \param[out] to resulting relative filename - \param[in] tolen size of the relative filename buffer + \param[in] tolen size of the relative filename buffer \param[in] from absolute filename \param[in] base relative to this absolute path \return 0 if no change, non zero otherwise */ -int // O - 0 if no change, 1 if changed -fl_filename_relative(char *to, // O - Relative filename - int tolen, // I - Size of "to" buffer +int // O - 0 if no change, 1 if changed +fl_filename_relative(char *to, // O - Relative filename + int tolen, // I - Size of "to" buffer const char *from, // I - Absolute filename const char *base) { // I - Find path relative to this path return Fl::system_driver()->filename_relative(to, tolen, from, base); @@ -156,72 +154,72 @@ fl_filename_relative(char *to, // O - Relative filename */ int // O - 0 if no change, 1 if changed -Fl_System_Driver::filename_relative(char *to, // O - Relative filename +Fl_System_Driver::filename_relative(char *to, // O - Relative filename int tolen, // I - Size of "to" buffer const char *from, // I - Absolute filename const char *base) // I - Find path relative to this path { - char *newslash; // Directory separator - const char *slash; // Directory separator + char *newslash; // Directory separator + const char *slash; // Directory separator char *cwd = 0L, *cwd_buf = 0L; if (base) cwd = cwd_buf = strdup(base); - + // return if "from" is not an absolute path if (from[0] == '\0' || !isdirsep(*from)) { strlcpy(to, from, tolen); if (cwd_buf) free(cwd_buf); return 0; } - + // return if "cwd" is not an absolute path if (!cwd || cwd[0] == '\0' || !isdirsep(*cwd)) { strlcpy(to, from, tolen); if (cwd_buf) free(cwd_buf); return 0; } - + // test for the exact same string and return "." if so if (!strcmp(from, cwd)) { strlcpy(to, ".", tolen); free(cwd_buf); return (1); } - + // compare both path names until we find a difference for (slash = from, newslash = cwd; *slash != '\0' && *newslash != '\0'; slash ++, newslash ++) if (isdirsep(*slash) && isdirsep(*newslash)) continue; else if (*slash != *newslash) break; - + // skip over trailing slashes if ( *newslash == '\0' && *slash != '\0' && !isdirsep(*slash) &&(newslash==cwd || !isdirsep(newslash[-1])) ) newslash--; - + // now go back to the first character of the first differing paths segment while (!isdirsep(*slash) && slash > from) slash --; if (isdirsep(*slash)) slash ++; - + // do the same for the current dir if (isdirsep(*newslash)) newslash --; if (*newslash != '\0') while (!isdirsep(*newslash) && newslash > cwd) newslash --; - + // prepare the destination buffer to[0] = '\0'; to[tolen - 1] = '\0'; - + // now add a "previous dir" sequence for every following slash in the cwd while (*newslash != '\0') { if (isdirsep(*newslash)) strlcat(to, "../", tolen); - + newslash ++; } - + // finally add the differing path from "from" strlcat(to, slash, tolen); - + free(cwd_buf); return 1; } @@ -230,7 +228,3 @@ Fl_System_Driver::filename_relative(char *to, // O - Relative filename \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/filename_expand.cxx b/src/filename_expand.cxx index 412bafd41..e5741e9ed 100644 --- a/src/filename_expand.cxx +++ b/src/filename_expand.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Filename expansion routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_System_Driver.H" @@ -37,14 +35,10 @@ fl_filename_expand(out, sizeof(out), "$TMPDIR/foo.txt"); // out="/var/tmp/foo.txt" \endcode \param[out] to resulting expanded filename - \param[in] tolen size of the expanded filename buffer + \param[in] tolen size of the expanded filename buffer \param[in] from filename containing shell variables \return 0 if no change, non zero otherwise */ int fl_filename_expand(char *to,int tolen, const char *from) { return Fl::system_driver()->filename_expand(to, tolen, from); } - -// -// End of "$Id$". -// diff --git a/src/filename_ext.cxx b/src/filename_ext.cxx index 2d3f7ea0a..201e7383f 100644 --- a/src/filename_ext.cxx +++ b/src/filename_ext.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Filename extension routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "Fl_System_Driver.H" @@ -63,7 +61,3 @@ const char *Fl_System_Driver::filename_ext(const char *buf) { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/filename_isdir.cxx b/src/filename_isdir.cxx index 5488f9131..fad66b3c7 100644 --- a/src/filename_isdir.cxx +++ b/src/filename_isdir.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Directory detection routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Used by fl_file_chooser @@ -28,8 +26,8 @@ \code #include <FL/filename.H> [..] - fl_filename_isdir("/etc"); // returns non-zero - fl_filename_isdir("/etc/hosts"); // returns 0 + fl_filename_isdir("/etc"); // returns non-zero + fl_filename_isdir("/etc/hosts"); // returns 0 \endcode \param[in] n the filename to parse \return non zero if file exists and is a directory, zero otherwise @@ -60,9 +58,9 @@ int Fl_System_Driver::filename_isdir_quick(const char* n) { int Fl_System_Driver::filename_isdir(const char* n) { - struct stat s; - char fn[FL_PATH_MAX]; - int length; + struct stat s; + char fn[FL_PATH_MAX]; + int length; length = (int) strlen(n); // Matt: Just in case, we strip the slash for other operating // systems as well, avoid bugs by sloppy implementations @@ -80,7 +78,3 @@ int Fl_System_Driver::filename_isdir(const char* n) { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/filename_list.cxx b/src/filename_list.cxx index 0cd2a551c..2ad240996 100644 --- a/src/filename_list.cxx +++ b/src/filename_list.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Filename list routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Wrapper for scandir with const-correct function prototypes. @@ -72,26 +70,22 @@ int fl_filename_list(const char *d, dirent ***list, Fl_File_Sort_F *sort) { /** \brief Free the list of filenames that is generated by fl_filename_list(). - + Free everything that was allocated by a previous call to fl_filename_list(). Use the return values as parameters for this function. - + \param[in,out] list table containing the resulting directory listing \param[in] n number of entries in the list */ void fl_filename_free_list(struct dirent ***list, int n) { if (n<0) return; - + int i; for (i = 0; i < n; i ++) { if ((*list)[i]) free((*list)[i]); - } + } free(*list); *list = 0; } - -// -// End of "$Id$". -// diff --git a/src/filename_match.cxx b/src/filename_match.cxx index d793b6b1c..debc9d909 100644 --- a/src/filename_match.cxx +++ b/src/filename_match.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pattern matching routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* Adapted from Rich Salz. */ @@ -21,11 +19,11 @@ #include <ctype.h> /** - Checks if a string \p s matches a pattern \p p. + Checks if a string \p s matches a pattern \p p. The following syntax is used for the pattern: - * matches any sequence of 0 or more characters. - ? matches any single character. - - [set] matches any character in the set. Set can contain any single characters, or a-z to represent a range. + - [set] matches any character in the set. Set can contain any single characters, or a-z to represent a range. To match ] or - they must be the first characters. To match ^ or ! they must not be the first characters. - [^set] or [!set] matches any character not in the set. - {X|Y|Z} or {X,Y,Z} matches any one of the subexpressions literally. @@ -38,7 +36,7 @@ \endcode \param[in] s the string to check for a match - \param[in] p the string pattern + \param[in] p the string pattern \return non zero if the string matches the pattern */ int fl_filename_match(const char *s, const char *p) { @@ -47,29 +45,29 @@ int fl_filename_match(const char *s, const char *p) { for (;;) { switch(*p++) { - case '?' : // match any single character + case '?' : // match any single character if (!*s++) return 0; break; - case '*' : // match 0-n of any characters + case '*' : // match 0-n of any characters if (!*p) return 1; // do trailing * quickly while (!fl_filename_match(s, p)) if (!*s++) return 0; return 1; - case '[': { // match one character in set of form [abc-d] or [^a-b] + case '[': { // match one character in set of form [abc-d] or [^a-b] if (!*s) return 0; int reverse = (*p=='^' || *p=='!'); if (reverse) p++; matched = 0; char last = 0; while (*p) { - if (*p=='-' && last) { - if (*s <= *++p && *s >= last ) matched = 1; - last = 0; - } else { - if (*s == *p) matched = 1; - } - last = *p++; - if (*p==']') break; + if (*p=='-' && last) { + if (*s <= *++p && *s >= last ) matched = 1; + last = 0; + } else { + if (*s == *p) matched = 1; + } + last = *p++; + if (*p==']') break; } if (matched == reverse) return 0; s++; p++;} @@ -87,23 +85,23 @@ int fl_filename_match(const char *s, const char *p) { case 0: return 0; } } - case '|': // skip rest of |pattern|pattern} when called recursively + case '|': // skip rest of |pattern|pattern} when called recursively case ',': for (matched = 0; *p && matched >= 0;) { - switch (*p++) { - case '\\': if (*p) p++; break; - case '{': matched++; break; - case '}': matched--; break; - } + switch (*p++) { + case '\\': if (*p) p++; break; + case '{': matched++; break; + case '}': matched--; break; + } } break; case '}': break; - case 0: // end of pattern + case 0: // end of pattern return !*s; - case '\\': // quote next character + case '\\': // quote next character if (*p) p++; /* FALLTHROUGH */ default: @@ -113,7 +111,3 @@ int fl_filename_match(const char *s, const char *p) { } } } - -// -// End of "$Id$". -// diff --git a/src/filename_setext.cxx b/src/filename_setext.cxx index c8a516f27..1dfd83726 100644 --- a/src/filename_setext.cxx +++ b/src/filename_setext.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Filename extension routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Replace .ext with new extension @@ -44,8 +42,3 @@ char *fl_filename_setext(char *buf, int buflen, const char *ext) { } else *q = 0; return(buf); } - - -// -// End of "$Id$". -// diff --git a/src/fl_arc.cxx b/src/fl_arc.cxx index f234711f3..58857c811 100644 --- a/src/fl_arc.cxx +++ b/src/fl_arc.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -28,7 +26,7 @@ #include <FL/fl_draw.H> #include <FL/math.h> -// avoid problems with some platforms that don't +// avoid problems with some platforms that don't // implement hypot. static double _fl_hypot(double x, double y) { return sqrt(x*x + y*y); @@ -52,35 +50,35 @@ static double _fl_hypot(double x, double y) { void Fl_Graphics_Driver::arc(double x, double y, double r, double start, double end) { // draw start point accurately: - - double A = start*(M_PI/180); // Initial angle (radians) - double X = r*cos(A); // Initial displacement, (X,Y) - double Y = -r*sin(A); // from center to initial point - fl_vertex(x+X,y+Y); // Insert initial point + + double A = start*(M_PI/180); // Initial angle (radians) + double X = r*cos(A); // Initial displacement, (X,Y) + double Y = -r*sin(A); // from center to initial point + fl_vertex(x+X,y+Y); // Insert initial point // Maximum arc length to approximate with chord with error <= 0.125 - + double epsilon; { double r1 = _fl_hypot(fl_transform_dx(r,0), // Horizontal "radius" - fl_transform_dy(r,0)); + fl_transform_dy(r,0)); double r2 = _fl_hypot(fl_transform_dx(0,r), // Vertical "radius" - fl_transform_dy(0,r)); - - if (r1 > r2) r1 = r2; // r1 = minimum "radius" - if (r1 < 2.) r1 = 2.; // radius for circa 9 chords/circle - - epsilon = 2*acos(1.0 - 0.125/r1); // Maximum arc angle + fl_transform_dy(0,r)); + + if (r1 > r2) r1 = r2; // r1 = minimum "radius" + if (r1 < 2.) r1 = 2.; // radius for circa 9 chords/circle + + epsilon = 2*acos(1.0 - 0.125/r1); // Maximum arc angle } - A = end*(M_PI/180) - A; // Displacement angle (radians) - int i = int(ceil(fabs(A)/epsilon)); // Segments in approximation - + A = end*(M_PI/180) - A; // Displacement angle (radians) + int i = int(ceil(fabs(A)/epsilon)); // Segments in approximation + if (i) { - epsilon = A/i; // Arc length for equal-size steps - double cos_e = cos(epsilon); // Rotation coefficients + epsilon = A/i; // Arc length for equal-size steps + double cos_e = cos(epsilon); // Rotation coefficients double sin_e = sin(epsilon); do { double Xnew = cos_e*X + sin_e*Y; - Y = -sin_e*X + cos_e*Y; + Y = -sin_e*X + cos_e*Y; fl_vertex(x + (X=Xnew), y + Y); } while (--i); } @@ -90,7 +88,3 @@ void Fl_Graphics_Driver::arc(double x, double y, double r, double start, double \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 8943468a1..ecd853bd5 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Standard dialog functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// https://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -127,12 +125,12 @@ static Fl_Window *makeform() { */ static void resizeform() { - int i; - int message_w, message_h; - int text_height; - int button_w[3], button_h[3]; - int x, w, h, max_w, max_h; - const int icon_size = 50; + int i; + int message_w, message_h; + int text_height; + int button_w[3], button_h[3]; + int x, w, h, max_w, max_h; + const int icon_size = 50; message_form->size(410,103); @@ -197,7 +195,7 @@ static void resizeform() { // printf("button %d (%s) is %dx%d+%d,%d\n", i, button[i]->label(), // button[i]->w(), button[i]->h(), -// button[i]->x(), button[i]->y()); +// button[i]->x(), button[i]->y()); } message_form->init_sizes(); } @@ -457,7 +455,7 @@ int fl_choice(const char*fmt,const char *b0,const char *b1,const char *b2,...){ Fl_Widget *fl_message_icon() {makeform(); return icon;} static const char* input_innards(const char* fmt, va_list ap, - const char* defstr, uchar type) { + const char* defstr, uchar type) { makeform(); message_form->size(410,103); message->position(60,10); @@ -537,8 +535,8 @@ const char *fl_password(const char *fmt, const char *defstr, ...) { \note \#include <FL/fl_ask.H> - \param[in] x Preferred X position - \param[in] y Preferred Y position + \param[in] x Preferred X position + \param[in] y Preferred Y position \param[in] center 1 = centered, 0 = absolute \see int fl_message_position(int *x, int *y) @@ -561,7 +559,7 @@ void fl_message_position(const int x, const int y, const int center) { \note \#include <FL/fl_ask.H> - \param[in] widget Widget or window to position the message box over. + \param[in] widget Widget or window to position the message box over. \see int fl_message_position(int x, int y, int center) */ @@ -580,10 +578,10 @@ void fl_message_position(Fl_Widget *widget) { \param[out] x Preferred X position, returns -1 if not set \param[out] y Preferred Y position, returns -1 if not set - \returns whether position is currently set or not - \retval 0 position is not set (may be hotspot or not) - \retval 1 position is set (window position) - \retval 2 position is set (message box centered) + \returns whether position is currently set or not + \retval 0 position is not set (may be hotspot or not) + \retval 1 position is set (window position) + \retval 2 position is set (message box centered) \see fl_message_position(int, int) \see fl_message_hotspot(int) @@ -605,8 +603,8 @@ int fl_message_position(int *x, int *y) { The default is \e enabled, so that the default button is the hotspot and appears at the mouse position. \note \#include <FL/fl_ask.H> - \param[in] enable non-zero enables hotspot behavior, - 0 disables hotspot + \param[in] enable non-zero enables hotspot behavior, + 0 disables hotspot */ void fl_message_hotspot(int enable) { enableHotspot = enable ? 1 : 0; @@ -617,7 +615,7 @@ void fl_message_hotspot(int enable) { fl_ask(), fl_choice(), fl_input(), fl_password() to follow the mouse pointer. \note \#include <FL/fl_ask.H> - \return 0 if disable, non-zero otherwise + \return 0 if disable, non-zero otherwise \see fl_message_hotspot(int) */ int fl_message_hotspot(void) { @@ -637,7 +635,7 @@ int fl_message_hotspot(void) { that call. \note \#include <FL/fl_ask.H> - \param[in] title window label, string copied internally + \param[in] title window label, string copied internally */ void fl_message_title(const char *title) { makeform(); @@ -658,7 +656,7 @@ void fl_message_title(const char *title) { local variable or free the string immediately after this call. \note \#include <FL/fl_ask.H> - \param[in] title default window label, string copied internally + \param[in] title default window label, string copied internally */ void fl_message_title_default(const char *title) { if (message_title_default) { @@ -670,7 +668,3 @@ void fl_message_title_default(const char *title) { } /** @} */ - -// -// End of "$Id$". -// diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx index 449c01c53..2d30ff421 100644 --- a/src/fl_boxtype.cxx +++ b/src/fl_boxtype.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Box drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -269,7 +267,7 @@ void fl_rectbound(int x, int y, int w, int h, Fl_Color bgcolor) { Fl::set_box_color(bgcolor); fl_rectf(x+1, y+1, w-2, h-2); } -#define fl_border_box fl_rectbound /**< allow consistent naming */ +#define fl_border_box fl_rectbound /**< allow consistent naming */ /** Draws a frame of type FL_BORDER_FRAME. @@ -287,70 +285,70 @@ static struct { int set; } fl_box_table[256] = { // must match list in Enumerations.H!!! - {fl_no_box, 0,0,0,0,1}, - {fl_flat_box, 0,0,0,0,1}, // FL_FLAT_BOX - {fl_up_box, D1,D1,D2,D2,1}, - {fl_down_box, D1,D1,D2,D2,1}, - {fl_up_frame, D1,D1,D2,D2,1}, - {fl_down_frame, D1,D1,D2,D2,1}, - {fl_thin_up_box, 1,1,2,2,1}, - {fl_thin_down_box, 1,1,2,2,1}, - {fl_thin_up_frame, 1,1,2,2,1}, - {fl_thin_down_frame, 1,1,2,2,1}, - {fl_engraved_box, 2,2,4,4,1}, - {fl_embossed_box, 2,2,4,4,1}, - {fl_engraved_frame, 2,2,4,4,1}, - {fl_embossed_frame, 2,2,4,4,1}, - {fl_border_box, 1,1,2,2,1}, - {fl_border_box, 1,1,5,5,0}, // _FL_SHADOW_BOX - {fl_border_frame, 1,1,2,2,1}, - {fl_border_frame, 1,1,5,5,0}, // _FL_SHADOW_FRAME - {fl_border_box, 1,1,2,2,0}, // _FL_ROUNDED_BOX - {fl_border_box, 1,1,2,2,0}, // _FL_RSHADOW_BOX - {fl_border_frame, 1,1,2,2,0}, // _FL_ROUNDED_FRAME - {fl_flat_box, 0,0,0,0,0}, // _FL_RFLAT_BOX - {fl_up_box, 3,3,6,6,0}, // _FL_ROUND_UP_BOX - {fl_down_box, 3,3,6,6,0}, // _FL_ROUND_DOWN_BOX - {fl_up_box, 0,0,0,0,0}, // _FL_DIAMOND_UP_BOX - {fl_down_box, 0,0,0,0,0}, // _FL_DIAMOND_DOWN_BOX - {fl_border_box, 1,1,2,2,0}, // _FL_OVAL_BOX - {fl_border_box, 1,1,2,2,0}, // _FL_OVAL_SHADOW_BOX - {fl_border_frame, 1,1,2,2,0}, // _FL_OVAL_FRAME - {fl_flat_box, 0,0,0,0,0}, // _FL_OVAL_FLAT_BOX - {fl_up_box, 4,4,8,8,0}, // _FL_PLASTIC_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_DOWN_BOX - {fl_up_frame, 2,2,4,4,0}, // _FL_PLASTIC_UP_FRAME - {fl_down_frame, 2,2,4,4,0}, // _FL_PLASTIC_DOWN_FRAME - {fl_up_box, 2,2,4,4,0}, // _FL_PLASTIC_THIN_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_THIN_DOWN_BOX - {fl_up_box, 2,2,4,4,0}, // _FL_PLASTIC_ROUND_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_ROUND_DOWN_BOX - {fl_up_box, 2,2,4,4,0}, // _FL_GTK_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_GTK_DOWN_BOX - {fl_up_frame, 2,2,4,4,0}, // _FL_GTK_UP_FRAME - {fl_down_frame, 2,2,4,4,0}, // _FL_GTK_DOWN_FRAME - {fl_up_frame, 1,1,2,2,0}, // _FL_GTK_THIN_UP_FRAME - {fl_down_frame, 1,1,2,2,0}, // _FL_GTK_THIN_DOWN_FRAME - {fl_up_box, 1,1,2,2,0}, // _FL_GTK_THIN_ROUND_UP_BOX - {fl_down_box, 1,1,2,2,0}, // _FL_GTK_THIN_ROUND_DOWN_BOX - {fl_up_box, 2,2,4,4,0}, // _FL_GTK_ROUND_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_GTK_ROUND_DOWN_BOX - {fl_up_box, 2,2,4,4,0}, // _FL_GLEAM_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_GLEAM_DOWN_BOX - {fl_up_frame, 2,2,4,4,0}, // _FL_GLEAM_UP_FRAME - {fl_down_frame, 2,2,4,4,0}, // _FL_GLEAM_DOWN_FRAME - {fl_up_box, 2,2,4,4,0}, // _FL_GLEAM_THIN_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_GLEAM_THIN_DOWN_BOX - {fl_up_box, 2,2,4,4,0}, // _FL_GLEAM_ROUND_UP_BOX - {fl_down_box, 2,2,4,4,0}, // _FL_GLEAM_ROUND_DOWN_BOX - {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+0 - {fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+1 - {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+2 - {fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+3 - {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+4 - {fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+5 - {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+6 - {fl_down_box, 3,3,6,6,0} // FL_FREE_BOX+7 + {fl_no_box, 0,0,0,0,1}, + {fl_flat_box, 0,0,0,0,1}, // FL_FLAT_BOX + {fl_up_box, D1,D1,D2,D2,1}, + {fl_down_box, D1,D1,D2,D2,1}, + {fl_up_frame, D1,D1,D2,D2,1}, + {fl_down_frame, D1,D1,D2,D2,1}, + {fl_thin_up_box, 1,1,2,2,1}, + {fl_thin_down_box, 1,1,2,2,1}, + {fl_thin_up_frame, 1,1,2,2,1}, + {fl_thin_down_frame, 1,1,2,2,1}, + {fl_engraved_box, 2,2,4,4,1}, + {fl_embossed_box, 2,2,4,4,1}, + {fl_engraved_frame, 2,2,4,4,1}, + {fl_embossed_frame, 2,2,4,4,1}, + {fl_border_box, 1,1,2,2,1}, + {fl_border_box, 1,1,5,5,0}, // _FL_SHADOW_BOX + {fl_border_frame, 1,1,2,2,1}, + {fl_border_frame, 1,1,5,5,0}, // _FL_SHADOW_FRAME + {fl_border_box, 1,1,2,2,0}, // _FL_ROUNDED_BOX + {fl_border_box, 1,1,2,2,0}, // _FL_RSHADOW_BOX + {fl_border_frame, 1,1,2,2,0}, // _FL_ROUNDED_FRAME + {fl_flat_box, 0,0,0,0,0}, // _FL_RFLAT_BOX + {fl_up_box, 3,3,6,6,0}, // _FL_ROUND_UP_BOX + {fl_down_box, 3,3,6,6,0}, // _FL_ROUND_DOWN_BOX + {fl_up_box, 0,0,0,0,0}, // _FL_DIAMOND_UP_BOX + {fl_down_box, 0,0,0,0,0}, // _FL_DIAMOND_DOWN_BOX + {fl_border_box, 1,1,2,2,0}, // _FL_OVAL_BOX + {fl_border_box, 1,1,2,2,0}, // _FL_OVAL_SHADOW_BOX + {fl_border_frame, 1,1,2,2,0}, // _FL_OVAL_FRAME + {fl_flat_box, 0,0,0,0,0}, // _FL_OVAL_FLAT_BOX + {fl_up_box, 4,4,8,8,0}, // _FL_PLASTIC_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_DOWN_BOX + {fl_up_frame, 2,2,4,4,0}, // _FL_PLASTIC_UP_FRAME + {fl_down_frame, 2,2,4,4,0}, // _FL_PLASTIC_DOWN_FRAME + {fl_up_box, 2,2,4,4,0}, // _FL_PLASTIC_THIN_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_THIN_DOWN_BOX + {fl_up_box, 2,2,4,4,0}, // _FL_PLASTIC_ROUND_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_ROUND_DOWN_BOX + {fl_up_box, 2,2,4,4,0}, // _FL_GTK_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_GTK_DOWN_BOX + {fl_up_frame, 2,2,4,4,0}, // _FL_GTK_UP_FRAME + {fl_down_frame, 2,2,4,4,0}, // _FL_GTK_DOWN_FRAME + {fl_up_frame, 1,1,2,2,0}, // _FL_GTK_THIN_UP_FRAME + {fl_down_frame, 1,1,2,2,0}, // _FL_GTK_THIN_DOWN_FRAME + {fl_up_box, 1,1,2,2,0}, // _FL_GTK_THIN_ROUND_UP_BOX + {fl_down_box, 1,1,2,2,0}, // _FL_GTK_THIN_ROUND_DOWN_BOX + {fl_up_box, 2,2,4,4,0}, // _FL_GTK_ROUND_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_GTK_ROUND_DOWN_BOX + {fl_up_box, 2,2,4,4,0}, // _FL_GLEAM_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_GLEAM_DOWN_BOX + {fl_up_frame, 2,2,4,4,0}, // _FL_GLEAM_UP_FRAME + {fl_down_frame, 2,2,4,4,0}, // _FL_GLEAM_DOWN_FRAME + {fl_up_box, 2,2,4,4,0}, // _FL_GLEAM_THIN_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_GLEAM_THIN_DOWN_BOX + {fl_up_box, 2,2,4,4,0}, // _FL_GLEAM_ROUND_UP_BOX + {fl_down_box, 2,2,4,4,0}, // _FL_GLEAM_ROUND_DOWN_BOX + {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+0 + {fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+1 + {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+2 + {fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+3 + {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+4 + {fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+5 + {fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+6 + {fl_down_box, 3,3,6,6,0} // FL_FREE_BOX+7 }; /** @@ -414,7 +412,7 @@ Fl_Box_Draw_F *Fl::get_boxtype(Fl_Boxtype t) { } /** Sets the function to call to draw a specific boxtype. */ void Fl::set_boxtype(Fl_Boxtype t, Fl_Box_Draw_F* f, - uchar a, uchar b, uchar c, uchar d) { + uchar a, uchar b, uchar c, uchar d) { fl_box_table[t].f = f; fl_box_table[t].set = 1; fl_box_table[t].dx = a; @@ -464,7 +462,3 @@ void Fl_Widget::draw_box(Fl_Boxtype t, int X, int Y, int W, int H, Fl_Color c) c fl_box_table[t].f(X, Y, W, H, c); draw_it_active = 1; } - -// -// End of "$Id$". -// diff --git a/src/fl_call_main.c b/src/fl_call_main.c index 48bf9a801..84ff50134 100644 --- a/src/fl_call_main.c +++ b/src/fl_call_main.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Copyright 1998-2018 by Bill Spitzak and others. * * fl_call_main() calls main() for you Windows people. Needs to be done in C @@ -10,11 +8,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -128,7 +126,3 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, typedef int dummy; #endif /* _WIN32 && !FL_DLL && !__GNUC__ */ -/* - * End of "$Id$". - */ - diff --git a/src/fl_cmap.h b/src/fl_cmap.h index ff6b9ef20..a793c535b 100644 --- a/src/fl_cmap.h +++ b/src/fl_cmap.h @@ -9,268 +9,268 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// https://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // - 0x00000000, // 0 - 0xff000000, // 1 - 0x00ff0000, // 2 - 0xffff0000, // 3 - 0x0000ff00, // 4 - 0xff00ff00, // 5 - 0x00ffff00, // 6 - 0xffffff00, // 7 - 0x55555500, // 8 - 0xc6717100, // 9 - 0x71c67100, // 10 - 0x8e8e3800, // 11 - 0x7171c600, // 12 - 0x8e388e00, // 13 - 0x388e8e00, // 14 - 0x00008000, // 15 - 0xa8a89800, // 16 - 0xe8e8d800, // 17 - 0x68685800, // 18 - 0x98a8a800, // 19 - 0xd8e8e800, // 20 - 0x58686800, // 21 - 0x9c9ca800, // 22 - 0xdcdce800, // 23 - 0x5c5c6800, // 24 - 0x9ca89c00, // 25 - 0xdce8dc00, // 26 - 0x5c685c00, // 27 - 0x90909000, // 28 - 0xc0c0c000, // 29 - 0x50505000, // 30 - 0xa0a0a000, // 31 - 0x00000000, // 32 - 0x0d0d0d00, // 33 - 0x1a1a1a00, // 34 - 0x26262600, // 35 - 0x31313100, // 36 - 0x3d3d3d00, // 37 - 0x48484800, // 38 - 0x55555500, // 39 - 0x5f5f5f00, // 40 - 0x6a6a6a00, // 41 - 0x75757500, // 42 - 0x80808000, // 43 - 0x8a8a8a00, // 44 - 0x95959500, // 45 - 0xa0a0a000, // 46 - 0xaaaaaa00, // 47 - 0xb5b5b500, // 48 - 0xc0c0c000, // 49 - 0xcbcbcb00, // 50 - 0xd5d5d500, // 51 - 0xe0e0e000, // 52 - 0xeaeaea00, // 53 - 0xf5f5f500, // 54 - 0xffffff00, // 55 - 0x00000000, // 56 - 0x00240000, // 57 - 0x00480000, // 58 - 0x006d0000, // 59 - 0x00910000, // 60 - 0x00b60000, // 61 - 0x00da0000, // 62 - 0x00ff0000, // 63 - 0x3f000000, // 64 - 0x3f240000, // 65 - 0x3f480000, // 66 - 0x3f6d0000, // 67 - 0x3f910000, // 68 - 0x3fb60000, // 69 - 0x3fda0000, // 70 - 0x3fff0000, // 71 - 0x7f000000, // 72 - 0x7f240000, // 73 - 0x7f480000, // 74 - 0x7f6d0000, // 75 - 0x7f910000, // 76 - 0x7fb60000, // 77 - 0x7fda0000, // 78 - 0x7fff0000, // 79 - 0xbf000000, // 80 - 0xbf240000, // 81 - 0xbf480000, // 82 - 0xbf6d0000, // 83 - 0xbf910000, // 84 - 0xbfb60000, // 85 - 0xbfda0000, // 86 - 0xbfff0000, // 87 - 0xff000000, // 88 - 0xff240000, // 89 - 0xff480000, // 90 - 0xff6d0000, // 91 - 0xff910000, // 92 - 0xffb60000, // 93 - 0xffda0000, // 94 - 0xffff0000, // 95 - 0x00003f00, // 96 - 0x00243f00, // 97 - 0x00483f00, // 98 - 0x006d3f00, // 99 - 0x00913f00, // 100 - 0x00b63f00, // 101 - 0x00da3f00, // 102 - 0x00ff3f00, // 103 - 0x3f003f00, // 104 - 0x3f243f00, // 105 - 0x3f483f00, // 106 - 0x3f6d3f00, // 107 - 0x3f913f00, // 108 - 0x3fb63f00, // 109 - 0x3fda3f00, // 110 - 0x3fff3f00, // 111 - 0x7f003f00, // 112 - 0x7f243f00, // 113 - 0x7f483f00, // 114 - 0x7f6d3f00, // 115 - 0x7f913f00, // 116 - 0x7fb63f00, // 117 - 0x7fda3f00, // 118 - 0x7fff3f00, // 119 - 0xbf003f00, // 120 - 0xbf243f00, // 121 - 0xbf483f00, // 122 - 0xbf6d3f00, // 123 - 0xbf913f00, // 124 - 0xbfb63f00, // 125 - 0xbfda3f00, // 126 - 0xbfff3f00, // 127 - 0xff003f00, // 128 - 0xff243f00, // 129 - 0xff483f00, // 130 - 0xff6d3f00, // 131 - 0xff913f00, // 132 - 0xffb63f00, // 133 - 0xffda3f00, // 134 - 0xffff3f00, // 135 - 0x00007f00, // 136 - 0x00247f00, // 137 - 0x00487f00, // 138 - 0x006d7f00, // 139 - 0x00917f00, // 140 - 0x00b67f00, // 141 - 0x00da7f00, // 142 - 0x00ff7f00, // 143 - 0x3f007f00, // 144 - 0x3f247f00, // 145 - 0x3f487f00, // 146 - 0x3f6d7f00, // 147 - 0x3f917f00, // 148 - 0x3fb67f00, // 149 - 0x3fda7f00, // 150 - 0x3fff7f00, // 151 - 0x7f007f00, // 152 - 0x7f247f00, // 153 - 0x7f487f00, // 154 - 0x7f6d7f00, // 155 - 0x7f917f00, // 156 - 0x7fb67f00, // 157 - 0x7fda7f00, // 158 - 0x7fff7f00, // 159 - 0xbf007f00, // 160 - 0xbf247f00, // 161 - 0xbf487f00, // 162 - 0xbf6d7f00, // 163 - 0xbf917f00, // 164 - 0xbfb67f00, // 165 - 0xbfda7f00, // 166 - 0xbfff7f00, // 167 - 0xff007f00, // 168 - 0xff247f00, // 169 - 0xff487f00, // 170 - 0xff6d7f00, // 171 - 0xff917f00, // 172 - 0xffb67f00, // 173 - 0xffda7f00, // 174 - 0xffff7f00, // 175 - 0x0000bf00, // 176 - 0x0024bf00, // 177 - 0x0048bf00, // 178 - 0x006dbf00, // 179 - 0x0091bf00, // 180 - 0x00b6bf00, // 181 - 0x00dabf00, // 182 - 0x00ffbf00, // 183 - 0x3f00bf00, // 184 - 0x3f24bf00, // 185 - 0x3f48bf00, // 186 - 0x3f6dbf00, // 187 - 0x3f91bf00, // 188 - 0x3fb6bf00, // 189 - 0x3fdabf00, // 190 - 0x3fffbf00, // 191 - 0x7f00bf00, // 192 - 0x7f24bf00, // 193 - 0x7f48bf00, // 194 - 0x7f6dbf00, // 195 - 0x7f91bf00, // 196 - 0x7fb6bf00, // 197 - 0x7fdabf00, // 198 - 0x7fffbf00, // 199 - 0xbf00bf00, // 200 - 0xbf24bf00, // 201 - 0xbf48bf00, // 202 - 0xbf6dbf00, // 203 - 0xbf91bf00, // 204 - 0xbfb6bf00, // 205 - 0xbfdabf00, // 206 - 0xbfffbf00, // 207 - 0xff00bf00, // 208 - 0xff24bf00, // 209 - 0xff48bf00, // 210 - 0xff6dbf00, // 211 - 0xff91bf00, // 212 - 0xffb6bf00, // 213 - 0xffdabf00, // 214 - 0xffffbf00, // 215 - 0x0000ff00, // 216 - 0x0024ff00, // 217 - 0x0048ff00, // 218 - 0x006dff00, // 219 - 0x0091ff00, // 220 - 0x00b6ff00, // 221 - 0x00daff00, // 222 - 0x00ffff00, // 223 - 0x3f00ff00, // 224 - 0x3f24ff00, // 225 - 0x3f48ff00, // 226 - 0x3f6dff00, // 227 - 0x3f91ff00, // 228 - 0x3fb6ff00, // 229 - 0x3fdaff00, // 230 - 0x3fffff00, // 231 - 0x7f00ff00, // 232 - 0x7f24ff00, // 233 - 0x7f48ff00, // 234 - 0x7f6dff00, // 235 - 0x7f91ff00, // 236 - 0x7fb6ff00, // 237 - 0x7fdaff00, // 238 - 0x7fffff00, // 239 - 0xbf00ff00, // 240 - 0xbf24ff00, // 241 - 0xbf48ff00, // 242 - 0xbf6dff00, // 243 - 0xbf91ff00, // 244 - 0xbfb6ff00, // 245 - 0xbfdaff00, // 246 - 0xbfffff00, // 247 - 0xff00ff00, // 248 - 0xff24ff00, // 249 - 0xff48ff00, // 250 - 0xff6dff00, // 251 - 0xff91ff00, // 252 - 0xffb6ff00, // 253 - 0xffdaff00, // 254 - 0xffffff00 // 255 + 0x00000000, // 0 + 0xff000000, // 1 + 0x00ff0000, // 2 + 0xffff0000, // 3 + 0x0000ff00, // 4 + 0xff00ff00, // 5 + 0x00ffff00, // 6 + 0xffffff00, // 7 + 0x55555500, // 8 + 0xc6717100, // 9 + 0x71c67100, // 10 + 0x8e8e3800, // 11 + 0x7171c600, // 12 + 0x8e388e00, // 13 + 0x388e8e00, // 14 + 0x00008000, // 15 + 0xa8a89800, // 16 + 0xe8e8d800, // 17 + 0x68685800, // 18 + 0x98a8a800, // 19 + 0xd8e8e800, // 20 + 0x58686800, // 21 + 0x9c9ca800, // 22 + 0xdcdce800, // 23 + 0x5c5c6800, // 24 + 0x9ca89c00, // 25 + 0xdce8dc00, // 26 + 0x5c685c00, // 27 + 0x90909000, // 28 + 0xc0c0c000, // 29 + 0x50505000, // 30 + 0xa0a0a000, // 31 + 0x00000000, // 32 + 0x0d0d0d00, // 33 + 0x1a1a1a00, // 34 + 0x26262600, // 35 + 0x31313100, // 36 + 0x3d3d3d00, // 37 + 0x48484800, // 38 + 0x55555500, // 39 + 0x5f5f5f00, // 40 + 0x6a6a6a00, // 41 + 0x75757500, // 42 + 0x80808000, // 43 + 0x8a8a8a00, // 44 + 0x95959500, // 45 + 0xa0a0a000, // 46 + 0xaaaaaa00, // 47 + 0xb5b5b500, // 48 + 0xc0c0c000, // 49 + 0xcbcbcb00, // 50 + 0xd5d5d500, // 51 + 0xe0e0e000, // 52 + 0xeaeaea00, // 53 + 0xf5f5f500, // 54 + 0xffffff00, // 55 + 0x00000000, // 56 + 0x00240000, // 57 + 0x00480000, // 58 + 0x006d0000, // 59 + 0x00910000, // 60 + 0x00b60000, // 61 + 0x00da0000, // 62 + 0x00ff0000, // 63 + 0x3f000000, // 64 + 0x3f240000, // 65 + 0x3f480000, // 66 + 0x3f6d0000, // 67 + 0x3f910000, // 68 + 0x3fb60000, // 69 + 0x3fda0000, // 70 + 0x3fff0000, // 71 + 0x7f000000, // 72 + 0x7f240000, // 73 + 0x7f480000, // 74 + 0x7f6d0000, // 75 + 0x7f910000, // 76 + 0x7fb60000, // 77 + 0x7fda0000, // 78 + 0x7fff0000, // 79 + 0xbf000000, // 80 + 0xbf240000, // 81 + 0xbf480000, // 82 + 0xbf6d0000, // 83 + 0xbf910000, // 84 + 0xbfb60000, // 85 + 0xbfda0000, // 86 + 0xbfff0000, // 87 + 0xff000000, // 88 + 0xff240000, // 89 + 0xff480000, // 90 + 0xff6d0000, // 91 + 0xff910000, // 92 + 0xffb60000, // 93 + 0xffda0000, // 94 + 0xffff0000, // 95 + 0x00003f00, // 96 + 0x00243f00, // 97 + 0x00483f00, // 98 + 0x006d3f00, // 99 + 0x00913f00, // 100 + 0x00b63f00, // 101 + 0x00da3f00, // 102 + 0x00ff3f00, // 103 + 0x3f003f00, // 104 + 0x3f243f00, // 105 + 0x3f483f00, // 106 + 0x3f6d3f00, // 107 + 0x3f913f00, // 108 + 0x3fb63f00, // 109 + 0x3fda3f00, // 110 + 0x3fff3f00, // 111 + 0x7f003f00, // 112 + 0x7f243f00, // 113 + 0x7f483f00, // 114 + 0x7f6d3f00, // 115 + 0x7f913f00, // 116 + 0x7fb63f00, // 117 + 0x7fda3f00, // 118 + 0x7fff3f00, // 119 + 0xbf003f00, // 120 + 0xbf243f00, // 121 + 0xbf483f00, // 122 + 0xbf6d3f00, // 123 + 0xbf913f00, // 124 + 0xbfb63f00, // 125 + 0xbfda3f00, // 126 + 0xbfff3f00, // 127 + 0xff003f00, // 128 + 0xff243f00, // 129 + 0xff483f00, // 130 + 0xff6d3f00, // 131 + 0xff913f00, // 132 + 0xffb63f00, // 133 + 0xffda3f00, // 134 + 0xffff3f00, // 135 + 0x00007f00, // 136 + 0x00247f00, // 137 + 0x00487f00, // 138 + 0x006d7f00, // 139 + 0x00917f00, // 140 + 0x00b67f00, // 141 + 0x00da7f00, // 142 + 0x00ff7f00, // 143 + 0x3f007f00, // 144 + 0x3f247f00, // 145 + 0x3f487f00, // 146 + 0x3f6d7f00, // 147 + 0x3f917f00, // 148 + 0x3fb67f00, // 149 + 0x3fda7f00, // 150 + 0x3fff7f00, // 151 + 0x7f007f00, // 152 + 0x7f247f00, // 153 + 0x7f487f00, // 154 + 0x7f6d7f00, // 155 + 0x7f917f00, // 156 + 0x7fb67f00, // 157 + 0x7fda7f00, // 158 + 0x7fff7f00, // 159 + 0xbf007f00, // 160 + 0xbf247f00, // 161 + 0xbf487f00, // 162 + 0xbf6d7f00, // 163 + 0xbf917f00, // 164 + 0xbfb67f00, // 165 + 0xbfda7f00, // 166 + 0xbfff7f00, // 167 + 0xff007f00, // 168 + 0xff247f00, // 169 + 0xff487f00, // 170 + 0xff6d7f00, // 171 + 0xff917f00, // 172 + 0xffb67f00, // 173 + 0xffda7f00, // 174 + 0xffff7f00, // 175 + 0x0000bf00, // 176 + 0x0024bf00, // 177 + 0x0048bf00, // 178 + 0x006dbf00, // 179 + 0x0091bf00, // 180 + 0x00b6bf00, // 181 + 0x00dabf00, // 182 + 0x00ffbf00, // 183 + 0x3f00bf00, // 184 + 0x3f24bf00, // 185 + 0x3f48bf00, // 186 + 0x3f6dbf00, // 187 + 0x3f91bf00, // 188 + 0x3fb6bf00, // 189 + 0x3fdabf00, // 190 + 0x3fffbf00, // 191 + 0x7f00bf00, // 192 + 0x7f24bf00, // 193 + 0x7f48bf00, // 194 + 0x7f6dbf00, // 195 + 0x7f91bf00, // 196 + 0x7fb6bf00, // 197 + 0x7fdabf00, // 198 + 0x7fffbf00, // 199 + 0xbf00bf00, // 200 + 0xbf24bf00, // 201 + 0xbf48bf00, // 202 + 0xbf6dbf00, // 203 + 0xbf91bf00, // 204 + 0xbfb6bf00, // 205 + 0xbfdabf00, // 206 + 0xbfffbf00, // 207 + 0xff00bf00, // 208 + 0xff24bf00, // 209 + 0xff48bf00, // 210 + 0xff6dbf00, // 211 + 0xff91bf00, // 212 + 0xffb6bf00, // 213 + 0xffdabf00, // 214 + 0xffffbf00, // 215 + 0x0000ff00, // 216 + 0x0024ff00, // 217 + 0x0048ff00, // 218 + 0x006dff00, // 219 + 0x0091ff00, // 220 + 0x00b6ff00, // 221 + 0x00daff00, // 222 + 0x00ffff00, // 223 + 0x3f00ff00, // 224 + 0x3f24ff00, // 225 + 0x3f48ff00, // 226 + 0x3f6dff00, // 227 + 0x3f91ff00, // 228 + 0x3fb6ff00, // 229 + 0x3fdaff00, // 230 + 0x3fffff00, // 231 + 0x7f00ff00, // 232 + 0x7f24ff00, // 233 + 0x7f48ff00, // 234 + 0x7f6dff00, // 235 + 0x7f91ff00, // 236 + 0x7fb6ff00, // 237 + 0x7fdaff00, // 238 + 0x7fffff00, // 239 + 0xbf00ff00, // 240 + 0xbf24ff00, // 241 + 0xbf48ff00, // 242 + 0xbf6dff00, // 243 + 0xbf91ff00, // 244 + 0xbfb6ff00, // 245 + 0xbfdaff00, // 246 + 0xbfffff00, // 247 + 0xff00ff00, // 248 + 0xff24ff00, // 249 + 0xff48ff00, // 250 + 0xff6dff00, // 251 + 0xff91ff00, // 252 + 0xffb6ff00, // 253 + 0xffdaff00, // 254 + 0xffffff00 // 255 // // End of fl_cmap.h - generated by cmap.cxx // diff --git a/src/fl_color.cxx b/src/fl_color.cxx index e3f6e3c9e..861f8d77f 100644 --- a/src/fl_color.cxx +++ b/src/fl_color.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Color functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -145,8 +143,8 @@ Fl_Color fl_inactive(Fl_Color c) { \return contrasting color */ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) { - unsigned c1, c2; // RGB colors - int l1, l2; // Luminosities + unsigned c1, c2; // RGB colors + int l1, l2; // Luminosities // Get the RGB values for each color... if (fg & 0xffffff00) c1 = (unsigned)fg; @@ -168,7 +166,3 @@ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) { /** \} */ - -// -// End of "$Id$". -// diff --git a/src/fl_cursor.cxx b/src/fl_cursor.cxx index f3bd7e2b0..6109f8c31 100644 --- a/src/fl_cursor.cxx +++ b/src/fl_cursor.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Mouse cursor support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Change the current cursor. @@ -38,7 +36,7 @@ /** Sets the cursor for the current window to the specified shape and colors. - The cursors are defined in the <FL/Enumerations.H> header file. + The cursors are defined in the <FL/Enumerations.H> header file. */ void fl_cursor(Fl_Cursor c) { if (Fl::first_window()) Fl::first_window()->cursor(c); @@ -50,7 +48,7 @@ void fl_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { } -/** +/** Sets the default window cursor. This is the cursor that will be used after the mouse pointer leaves a widget with a custom cursor set. @@ -177,21 +175,16 @@ void Fl_Window::cursor(const Fl_RGB_Image *image, int hotx, int hoty) { /** For back compatibility only. - Same as Fl_Window::cursor(Fl_Cursor) + Same as Fl_Window::cursor(Fl_Cursor) */ void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { cursor(c); }; -/** +/** For back compatibility only. - same as Fl_Window::default_cursor(Fl_Cursor) + same as Fl_Window::default_cursor(Fl_Cursor) */ void Fl_Window::default_cursor(Fl_Cursor c, Fl_Color, Fl_Color) { default_cursor(c); }; - - -// -// End of "$Id$". -// diff --git a/src/fl_curve.cxx b/src/fl_curve.cxx index a7ec61a8a..bfd5125a3 100644 --- a/src/fl_curve.cxx +++ b/src/fl_curve.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Bezier curve functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -37,9 +35,9 @@ /** see fl_curve() */ void Fl_Graphics_Driver::curve(double X0, double Y0, - double X1, double Y1, - double X2, double Y2, - double X3, double Y3) { + double X1, double Y1, + double X2, double Y2, + double X3, double Y3) { double x = fl_transform_x(X0,Y0); double y = fl_transform_y(X0,Y0); @@ -107,7 +105,3 @@ void Fl_Graphics_Driver::curve(double X0, double Y0, \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/fl_diamond_box.cxx b/src/fl_diamond_box.cxx index deafd7bd0..e5f7749ec 100644 --- a/src/fl_diamond_box.cxx +++ b/src/fl_diamond_box.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Diamond box code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Box drawing code for an obscure box type. @@ -67,7 +65,3 @@ Fl_Boxtype fl_define_FL_DIAMOND_BOX() { fl_internal_boxtype(_FL_DIAMOND_UP_BOX,fl_diamond_up_box); return _FL_DIAMOND_UP_BOX; } - -// -// End of "$Id$". -// diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx index b3443fe4c..94fd10cfe 100644 --- a/src/fl_dnd_win32.cxx +++ b/src/fl_dnd_win32.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Drag & Drop code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // This file contains Windows-specific code for FLTK which is always linked @@ -181,8 +179,8 @@ public: char *a, *b; a = b = currDragData; while (*a) { // strip the CRLF pairs - if (*a == '\r' && a[1] == '\n') a++; - else *b++ = *a++; + if (*a == '\r' && a[1] == '\n') a++; + else *b++ = *a++; } *b = 0; Fl::e_text = currDragData; @@ -211,7 +209,7 @@ private: } static char fillCurrentDragData(IDataObject *data) { // shortcut through this whole procedure if there is no fresh data - if (!data) + if (!data) return currDragResult; // shortcut through this whole procedure if this is still the same drag event // (* this is safe, because 'currDragRef' is cleared on Leave and Drop events) @@ -220,7 +218,7 @@ private: // clear currDrag* for a new drag event clearCurrentDragData(); - + currDragRef = data; // fill currDrag* with UTF-8 data, if available FORMATETC fmt = { 0 }; @@ -255,15 +253,15 @@ private: unsigned u; void *stuff = GlobalLock( medium.hGlobal ); currDragData = (char*)malloc(3 * strlen((char*)stuff) + 10); - p = (char*)stuff; + p = (char*)stuff; last = p + strlen(p); q = currDragData; while (p < last) { - u = fl_utf8decode(p, last, &len); - p += len; - len = fl_utf8encode(u, q); - q += len; - } + u = fl_utf8decode(p, last, &len); + p += len; + len = fl_utf8encode(u, q); + q += len; + } *q = 0; currDragSize = (int) (q - currDragData); currDragData = (char*)realloc(currDragData, currDragSize + 1); @@ -408,8 +406,8 @@ public: } HRESULT __stdcall Reset(void) { - n = 0; - return S_OK; + n = 0; + return S_OK; } HRESULT __stdcall Clone(IEnumFORMATETC **ppenum){ @@ -497,8 +495,8 @@ public: // pMem[l * sizeof(WCHAR) + 1 + sizeof(DROPFILES)] = 0; // pMem[l * sizeof(WCHAR) + 2 + sizeof(DROPFILES)] = 0; // pMem[l * sizeof(WCHAR) + 3 + sizeof(DROPFILES)] = 0; - pmedium->tymed = TYMED_HGLOBAL; - pmedium->hGlobal = gh; + pmedium->tymed = TYMED_HGLOBAL; + pmedium->hGlobal = gh; pmedium->pUnkForRelease = NULL; GlobalUnlock( gh ); return S_OK; @@ -514,8 +512,8 @@ public: return DV_E_FORMATETC; } // HRESULT STDMETHODCALLTYPE EnumFormatEtc( DWORD dir, IEnumFORMATETC** ppenumFormatEtc) { -// *ppenumFormatEtc = m_EnumF; -// return S_OK; +// *ppenumFormatEtc = m_EnumF; +// return S_OK; // } // all the following methods are not really needed for a DnD object @@ -557,7 +555,3 @@ int Fl_WinAPI_Screen_Driver::dnd(int unused) if ( ret==DRAGDROP_S_DROP ) return 1; // or DD_S_CANCEL return 0; } - -// -// End of "$Id$". -// diff --git a/src/fl_dnd_x.cxx b/src/fl_dnd_x.cxx index 88d63d6b9..d8911c000 100644 --- a/src/fl_dnd_x.cxx +++ b/src/fl_dnd_x.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Drag & Drop code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -54,9 +52,9 @@ static int dnd_aware(Window& window) { Atom actual; int format; unsigned long count, remaining; unsigned char *data = 0; XGetWindowProperty(fl_display, window, fl_XdndAware, - 0, 4, False, XA_ATOM, - &actual, &format, - &count, &remaining, &data); + 0, 4, False, XA_ATOM, + &actual, &format, + &count, &remaining, &data); int ret = 0; if (actual == XA_ATOM && format==32 && count && data) ret = int(*(Atom*)data); @@ -101,8 +99,8 @@ int Fl_X11_Screen_Driver::dnd(int unused) { XQueryPointer(fl_display, child, &root, &child, &Fl::e_x_root, &Fl::e_y_root, &dest_x, &dest_y, &junk3); if (!child) { - if (!new_window && (new_version = dnd_aware(root))) new_window = root; - break; + if (!new_window && (new_version = dnd_aware(root))) new_window = root; + break; } new_window = child; if ((new_local_window = fl_find(child))) break; @@ -118,42 +116,42 @@ int Fl_X11_Screen_Driver::dnd(int unused) { if (new_window != target_window) { if (local_window) { - local_handle(FL_DND_LEAVE, local_window); + local_handle(FL_DND_LEAVE, local_window); } else if (dndversion) { - fl_sendClientMessage(target_window, fl_XdndLeave, source_window); + fl_sendClientMessage(target_window, fl_XdndLeave, source_window); } dndversion = new_version; target_window = new_window; local_window = new_local_window; if (local_window) { - local_handle(FL_DND_ENTER, local_window); + local_handle(FL_DND_ENTER, local_window); } else if (dndversion) { // Send an X-DND message to the target window. In order to - // support dragging of files/URLs as well as arbitrary text, - // we look at the selection buffer - if the buffer starts - // with a common URI scheme, does not contain spaces, and - // contains at least one CR LF, then we flag the data as - // both a URI list (MIME media type "text/uri-list") and - // plain text. Otherwise, we just say it is plain text. + // support dragging of files/URLs as well as arbitrary text, + // we look at the selection buffer - if the buffer starts + // with a common URI scheme, does not contain spaces, and + // contains at least one CR LF, then we flag the data as + // both a URI list (MIME media type "text/uri-list") and + // plain text. Otherwise, we just say it is plain text. if ((!strncmp(fl_selection_buffer[0], "file:///", 8) || - !strncmp(fl_selection_buffer[0], "ftp://", 6) || - !strncmp(fl_selection_buffer[0], "http://", 7) || - !strncmp(fl_selection_buffer[0], "https://", 8) || - !strncmp(fl_selection_buffer[0], "ipp://", 6) || - !strncmp(fl_selection_buffer[0], "ldap:", 5) || - !strncmp(fl_selection_buffer[0], "mailto:", 7) || - !strncmp(fl_selection_buffer[0], "news:", 5) || - !strncmp(fl_selection_buffer[0], "smb://", 6)) && - !strchr(fl_selection_buffer[0], ' ') && - strstr(fl_selection_buffer[0], "\r\n")) { - // Send file/URI list... - fl_sendClientMessage(target_window, fl_XdndEnter, source_window, - dndversion<<24, fl_XdndURIList, XA_STRING, 0); + !strncmp(fl_selection_buffer[0], "ftp://", 6) || + !strncmp(fl_selection_buffer[0], "http://", 7) || + !strncmp(fl_selection_buffer[0], "https://", 8) || + !strncmp(fl_selection_buffer[0], "ipp://", 6) || + !strncmp(fl_selection_buffer[0], "ldap:", 5) || + !strncmp(fl_selection_buffer[0], "mailto:", 7) || + !strncmp(fl_selection_buffer[0], "news:", 5) || + !strncmp(fl_selection_buffer[0], "smb://", 6)) && + !strchr(fl_selection_buffer[0], ' ') && + strstr(fl_selection_buffer[0], "\r\n")) { + // Send file/URI list... + fl_sendClientMessage(target_window, fl_XdndEnter, source_window, + dndversion<<24, fl_XdndURIList, XA_STRING, 0); } else { - // Send plain text... - fl_sendClientMessage(target_window, fl_XdndEnter, source_window, - dndversion<<24, fl_XaUtf8String, 0, 0); - } + // Send plain text... + fl_sendClientMessage(target_window, fl_XdndEnter, source_window, + dndversion<<24, fl_XaUtf8String, 0, 0); + } } } if (local_window) { @@ -169,7 +167,7 @@ int Fl_X11_Screen_Driver::dnd(int unused) { #endif fl_sendClientMessage(target_window, fl_XdndPosition, source_window, 0, (exroot<<16)|eyroot, fl_event_time, - fl_XdndActionCopy); + fl_XdndActionCopy); } Fl::wait(); } @@ -179,7 +177,7 @@ int Fl_X11_Screen_Driver::dnd(int unused) { if (local_handle(FL_DND_RELEASE, local_window)) Fl::paste(*Fl::belowmouse(), 0); } else if (dndversion) { fl_sendClientMessage(target_window, fl_XdndDrop, source_window, - 0, fl_event_time); + 0, fl_event_time); } else if (target_window) { // fake a drop by clicking the middle mouse button: XButtonEvent msg; @@ -210,8 +208,3 @@ int Fl_X11_Screen_Driver::dnd(int unused) { source_fl_win->cursor(FL_CURSOR_DEFAULT); return 1; } - - -// -// End of "$Id$". -// diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx index 79a1f990a..64d78f849 100644 --- a/src/fl_draw.cxx +++ b/src/fl_draw.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Label drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Implementation of fl_draw(const char*,int,int,int,int,Fl_Align) @@ -27,14 +25,14 @@ #include <FL/Fl.H> #include <FL/fl_draw.H> #include <FL/Fl_Image.H> -#include <FL/platform.H> // fl_open_display() +#include <FL/platform.H> // fl_open_display() #include "flstring.h" #include <ctype.h> #include <math.h> -char fl_draw_shortcut; // set by fl_labeltypes.cxx +char fl_draw_shortcut; // set by fl_labeltypes.cxx static char* underline_at; @@ -42,7 +40,7 @@ static char* underline_at; Otherwise, use buf as buffer but don't go beyond its length of maxbuf. */ static const char* expand_text_(const char* from, char*& buf, int maxbuf, double maxw, int& n, - double &width, int wrap, int draw_symbols) { + double &width, int wrap, int draw_symbols) { char* e = buf+(maxbuf-4); underline_at = 0; double w = 0; @@ -64,14 +62,14 @@ static const char* expand_text_(const char* from, char*& buf, int maxbuf, double if (!c || c == ' ' || c == '\n') { // test for word-wrap: if (word_start < p && wrap) { - double newwidth = w + fl_width(word_end, (int) (o-word_end) ); - if (word_end > buf && int(newwidth) > maxw) { // break before this word - o = word_end; - p = word_start; - break; - } - word_end = o; - w = newwidth; + double newwidth = w + fl_width(word_end, (int) (o-word_end) ); + if (word_end > buf && int(newwidth) > maxw) { // break before this word + o = word_end; + p = word_start; + break; + } + word_end = o; + w = newwidth; } if (!c) break; else if (c == '\n') {p++; break;} @@ -123,7 +121,7 @@ static const char* expand_text_(const char* from, char*& buf, int maxbuf, double */ const char* fl_expand_text(const char* from, char* buf, int maxbuf, double maxw, int& n, - double &width, int wrap, int draw_symbols) { + double &width, int wrap, int draw_symbols) { return expand_text_(from, buf, maxbuf, maxw, n, width, wrap, draw_symbols); } @@ -133,8 +131,8 @@ fl_expand_text(const char* from, char* buf, int maxbuf, double maxw, int& n, function such as fl_draw(const char*, int, int, int) to do the real work */ void fl_draw( - const char* str, // the (multi-line) string - int x, int y, int w, int h, // bounding box + const char* str, // the (multi-line) string + int x, int y, int w, int h, // bounding box Fl_Align align, void (*callthis)(const char*,int,int,int), Fl_Image* img, int draw_symbols) @@ -252,7 +250,7 @@ void fl_draw( int desc = fl_descent(); for (p=str; ; ypos += height) { if (lines>1) e = expand_text_(p, linebuf, 0, w - symtotal - imgtotal, buflen, - width, align&FL_ALIGN_WRAP, draw_symbols); + width, align&FL_ALIGN_WRAP, draw_symbols); else e = ""; if (width > symoffset) symoffset = (int)(width + 0.5); @@ -264,7 +262,7 @@ void fl_draw( callthis(linebuf,buflen,xpos,ypos-desc); if (underline_at && underline_at >= linebuf && underline_at < (linebuf + buflen)) - callthis("_",1,xpos+int(fl_width(linebuf,(int) (underline_at-linebuf))),ypos-desc); + callthis("_",1,xpos+int(fl_width(linebuf,(int) (underline_at-linebuf))),ypos-desc); if (!*e || (*e == '@' && e[1] != '@')) break; p = e; @@ -379,16 +377,16 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) { int W = 0; int symwidth[2], symtotal; - symwidth[0] = 0; // size of symbol at beginning of string (if any) - symwidth[1] = 0; // size of symbol at end of string (if any) + symwidth[0] = 0; // size of symbol at beginning of string (if any) + symwidth[1] = 0; // size of symbol at end of string (if any) if (draw_symbols) { // Symbol at beginning of string? - const char *sym2 = (str[0]=='@' && str[1]=='@') ? str+2 : str; // sym2 check will skip leading @@ + const char *sym2 = (str[0]=='@' && str[1]=='@') ? str+2 : str; // sym2 check will skip leading @@ if (str[0] == '@' && str[1] != '@') { - while (*str && !isspace(*str)) { ++str; } // skip over symbol - if (isspace(*str)) ++str; // skip over trailing space - sym2 = str; // sym2 check will skip leading symbol + while (*str && !isspace(*str)) { ++str; } // skip over symbol + if (isspace(*str)) ++str; // skip over trailing space + sym2 = str; // sym2 check will skip leading symbol symwidth[0] = h; } // Symbol at end of string? @@ -402,7 +400,7 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) { for (p = str, lines=0; p;) { // e = expand(p, linebuf, w - symtotal, buflen, width, w != 0, draw_symbols); e = expand_text_(p, linebuf, 0, w - symtotal, buflen, width, - w != 0, draw_symbols); + w != 0, draw_symbols); if ((int)ceil(width) > W) W = (int)ceil(width); lines++; if (!*e || (*e == '@' && e[1] != '@' && draw_symbols)) break; @@ -460,7 +458,3 @@ int fl_height(int font, int size) { fl_font(tf,ts); // restore return(height); } - -// -// End of "$Id$". -// diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx index 42b7e25f0..fb35f6314 100644 --- a/src/fl_draw_pixmap.cxx +++ b/src/fl_draw_pixmap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pixmap drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // NOTE: I believe many of the following comments (between the dash markers) @@ -48,7 +46,7 @@ static int ncolors, chars_per_pixel; typedef struct { uchar r; uchar g; uchar b; } UsedColor; static UsedColor *used_colors; -static int color_count; // # of non-transparent colors used in pixmap +static int color_count; // # of non-transparent colors used in pixmap /** Get the dimensions of a pixmap. @@ -87,7 +85,7 @@ void Fl_GDI_Graphics_Driver::make_unused_color_(uchar &r, uchar &g, uchar &b) { if ( used_colors[i].r == r && used_colors[i].g == g && used_colors[i].b == b ) - break; + break; if (i >= color_count) { free((void*)used_colors); used_colors = NULL; need_pixmap_bg_color = RGB(r, g, b); @@ -100,8 +98,8 @@ void Fl_GDI_Graphics_Driver::make_unused_color_(uchar &r, uchar &g, uchar &b) { if (g < 255) { g++; } else { - g = 0; - b++; + g = 0; + b++; } } } @@ -113,22 +111,22 @@ int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) { int w, h; const uchar*const* data = (const uchar*const*)(cdata+1); uchar *transparent_c = (uchar *)0; // such that transparent_c[0,1,2] are the RGB of the transparent color - + if (!fl_measure_pixmap(cdata, w, h)) return 0; - + if ((chars_per_pixel < 1) || (chars_per_pixel > 2)) return 0; - + typedef uchar uchar4[4]; uchar4 *colors = new uchar4[1<<(chars_per_pixel*8)]; - + if (Fl_Graphics_Driver::need_pixmap_bg_color) { color_count = 0; used_colors = (UsedColor*)malloc(abs(ncolors) * sizeof(UsedColor)); } - - if (ncolors < 0) { // FLTK (non standard) compressed colormap + + if (ncolors < 0) { // FLTK (non standard) compressed colormap ncolors = -ncolors; const uchar *p = *data++; // if first color is ' ' it is transparent (put it later to make @@ -154,7 +152,7 @@ int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) { *c++ = *p++; *c = 255; } - } else { // normal XPM colormap with names + } else { // normal XPM colormap with names for (int i=0; i<ncolors; i++) { const uchar *p = *data++; // the first 1 or 2 characters are the color index: @@ -202,7 +200,7 @@ int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) { fl_graphics_driver->make_unused_color_(r, g, b); } } - + U32 *q = (U32*)out; for (int Y = 0; Y < h; Y++) { const uchar* p = data[Y]; @@ -262,7 +260,3 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { delete[] buffer; return 1; } - -// -// End of "$Id$". -// diff --git a/src/fl_encoding_latin1.cxx b/src/fl_encoding_latin1.cxx index 0cede695a..a6c7b36a8 100644 --- a/src/fl_encoding_latin1.cxx +++ b/src/fl_encoding_latin1.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Convert Windows-1252 (Latin-1) encoded text to the local encoding. // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -27,14 +25,14 @@ #ifdef FL_CFG_WIN_COCOA #include "drivers/Darwin/Fl_Darwin_System_Driver.H" -// These function assume a western code page. If you need to support +// These function assume a western code page. If you need to support // scripts that are not part of this code page, you might want to // take a look at FLTK2, which uses utf8 for text encoding. // // By keeping these conversion tables in their own module, they will not // be statically linked (by a smart linker) unless actually used. // -// On MS-Windows, nothing need to be converted. We simply return the +// On MS-Windows, nothing need to be converted. We simply return the // original pointer. // // Most X11 implementations seem to default to Latin-1 as a code since it @@ -46,25 +44,25 @@ // This table converts Windows-1252/Latin 1 into MacRoman encoding static uchar latin2roman[128] = { -0xdb, 0xc0, 0xe2, 0xc4, 0xe3, 0xc9, 0xa0, 0xe0, 0xf6, 0xe4, 0xc0, 0xdc, 0xce, 0xc0, 0xc0, 0xc0, -0xc0, 0xd4, 0xd5, 0xd2, 0xd3, 0xa5, 0xd0, 0xd1, 0xf7, 0xaa, 0xc0, 0xdd, 0xcf, 0xc0, 0xc0, 0xd9, -0xca, 0xc1, 0xa2, 0xa3, 0xc0, 0xb4, 0xc0, 0xa4, 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0xc0, 0xa8, 0xf8, -0xa1, 0xb1, 0xc0, 0xc0, 0xab, 0xb5, 0xa6, 0xe1, 0xfc, 0xc0, 0xbc, 0xc8, 0xc0, 0xc0, 0xc0, 0xc0, -0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, -0xc0, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xc0, 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xc0, 0xc0, 0xa7, -0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, +0xdb, 0xc0, 0xe2, 0xc4, 0xe3, 0xc9, 0xa0, 0xe0, 0xf6, 0xe4, 0xc0, 0xdc, 0xce, 0xc0, 0xc0, 0xc0, +0xc0, 0xd4, 0xd5, 0xd2, 0xd3, 0xa5, 0xd0, 0xd1, 0xf7, 0xaa, 0xc0, 0xdd, 0xcf, 0xc0, 0xc0, 0xd9, +0xca, 0xc1, 0xa2, 0xa3, 0xc0, 0xb4, 0xc0, 0xa4, 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0xc0, 0xa8, 0xf8, +0xa1, 0xb1, 0xc0, 0xc0, 0xab, 0xb5, 0xa6, 0xe1, 0xfc, 0xc0, 0xbc, 0xc8, 0xc0, 0xc0, 0xc0, 0xc0, +0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, +0xc0, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xc0, 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xc0, 0xc0, 0xa7, +0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, 0xc0, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xc0, 0xc0, 0xd8 }; // This table converts MacRoman into Windows-1252/Latin 1 static uchar roman2latin[128] = { -0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, -0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, -0x86, 0xb0, 0xa2, 0xa3, 0xa7, 0x95, 0xb6, 0xdf, 0xae, 0xa9, 0x99, 0xb4, 0xa8, 0xbf, 0xc6, 0xd8, -0xbf, 0xb1, 0xbf, 0xbf, 0xa5, 0xb5, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xaa, 0xba, 0xbf, 0xe6, 0xf8, -0xbf, 0xa1, 0xac, 0xbf, 0x83, 0xbf, 0xbf, 0xab, 0xbb, 0x85, 0xa0, 0xc0, 0xc3, 0xd5, 0x8c, 0x9c, -0x96, 0x97, 0x93, 0x94, 0x91, 0x92, 0xf7, 0xbf, 0xff, 0x9f, 0xbf, 0x80, 0x8b, 0x9b, 0xbf, 0xbf, -0x87, 0xb7, 0x82, 0x84, 0x89, 0xc2, 0xca, 0xc1, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4, +0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, +0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, +0x86, 0xb0, 0xa2, 0xa3, 0xa7, 0x95, 0xb6, 0xdf, 0xae, 0xa9, 0x99, 0xb4, 0xa8, 0xbf, 0xc6, 0xd8, +0xbf, 0xb1, 0xbf, 0xbf, 0xa5, 0xb5, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xaa, 0xba, 0xbf, 0xe6, 0xf8, +0xbf, 0xa1, 0xac, 0xbf, 0x83, 0xbf, 0xbf, 0xab, 0xbb, 0x85, 0xa0, 0xc0, 0xc3, 0xd5, 0x8c, 0x9c, +0x96, 0x97, 0x93, 0x94, 0x91, 0x92, 0xf7, 0xbf, 0xff, 0x9f, 0xbf, 0x80, 0x8b, 0x9b, 0xbf, 0xbf, +0x87, 0xb7, 0x82, 0x84, 0x89, 0xc2, 0xca, 0xc1, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4, 0xbf, 0xd2, 0xda, 0xdb, 0xd9, 0xbf, 0x88, 0x98, 0xaf, 0xbf, 0xbf, 0xbf, 0xb8, 0xbf, 0xbf, 0xbf }; @@ -83,7 +81,7 @@ const char *Fl_Darwin_System_Driver::latin1_to_local(const char *t, int n) uchar *dst = (uchar*)buf; for ( ; n>0; n--) { uchar c = *src++; - if (c>127) + if (c>127) *dst = latin2roman[c-128]; else *dst = c; @@ -137,7 +135,7 @@ const char *Fl_System_Driver::latin1_to_local(const char *t, int) /** Default implementation of local-to-latin text conversion. - + The default implementation returns the original text. This method should be reimplemented by drivers for platforms that commonly use latin text encoding. @@ -163,7 +161,3 @@ const char *fl_local_to_latin1(const char *t, int n) { return Fl::system_driver()->local_to_latin1(t, n); } - -// -// End of "$Id$". -// diff --git a/src/fl_encoding_mac_roman.cxx b/src/fl_encoding_mac_roman.cxx index 5317f93d5..234a908d8 100644 --- a/src/fl_encoding_mac_roman.cxx +++ b/src/fl_encoding_mac_roman.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Convert Mac Roman encoded text to the local encoding. // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "config_lib.h" @@ -51,25 +49,25 @@ const char *Fl_Darwin_System_Driver::local_to_mac_roman(const char *t, int) // This table converts Windows-1252/Latin 1 into MacRoman encoding static uchar latin2roman[128] = { -0xdb, 0xc0, 0xe2, 0xc4, 0xe3, 0xc9, 0xa0, 0xe0, 0xf6, 0xe4, 0xc0, 0xdc, 0xce, 0xc0, 0xc0, 0xc0, -0xc0, 0xd4, 0xd5, 0xd2, 0xd3, 0xa5, 0xd0, 0xd1, 0xf7, 0xaa, 0xc0, 0xdd, 0xcf, 0xc0, 0xc0, 0xd9, -0xca, 0xc1, 0xa2, 0xa3, 0xc0, 0xb4, 0xc0, 0xa4, 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0xc0, 0xa8, 0xf8, -0xa1, 0xb1, 0xc0, 0xc0, 0xab, 0xb5, 0xa6, 0xe1, 0xfc, 0xc0, 0xbc, 0xc8, 0xc0, 0xc0, 0xc0, 0xc0, -0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, -0xc0, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xc0, 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xc0, 0xc0, 0xa7, -0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, +0xdb, 0xc0, 0xe2, 0xc4, 0xe3, 0xc9, 0xa0, 0xe0, 0xf6, 0xe4, 0xc0, 0xdc, 0xce, 0xc0, 0xc0, 0xc0, +0xc0, 0xd4, 0xd5, 0xd2, 0xd3, 0xa5, 0xd0, 0xd1, 0xf7, 0xaa, 0xc0, 0xdd, 0xcf, 0xc0, 0xc0, 0xd9, +0xca, 0xc1, 0xa2, 0xa3, 0xc0, 0xb4, 0xc0, 0xa4, 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0xc0, 0xa8, 0xf8, +0xa1, 0xb1, 0xc0, 0xc0, 0xab, 0xb5, 0xa6, 0xe1, 0xfc, 0xc0, 0xbc, 0xc8, 0xc0, 0xc0, 0xc0, 0xc0, +0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, +0xc0, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xc0, 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xc0, 0xc0, 0xa7, +0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, 0xc0, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xc0, 0xc0, 0xd8 }; // This table converts MacRoman into Windows-1252/Latin 1 static uchar roman2latin[128] = { -0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, -0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, -0x86, 0xb0, 0xa2, 0xa3, 0xa7, 0x95, 0xb6, 0xdf, 0xae, 0xa9, 0x99, 0xb4, 0xa8, 0xbf, 0xc6, 0xd8, -0xbf, 0xb1, 0xbf, 0xbf, 0xa5, 0xb5, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xaa, 0xba, 0xbf, 0xe6, 0xf8, -0xbf, 0xa1, 0xac, 0xbf, 0x83, 0xbf, 0xbf, 0xab, 0xbb, 0x85, 0xa0, 0xc0, 0xc3, 0xd5, 0x8c, 0x9c, -0x96, 0x97, 0x93, 0x94, 0x91, 0x92, 0xf7, 0xbf, 0xff, 0x9f, 0xbf, 0x80, 0x8b, 0x9b, 0xbf, 0xbf, -0x87, 0xb7, 0x82, 0x84, 0x89, 0xc2, 0xca, 0xc1, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4, +0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, +0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, +0x86, 0xb0, 0xa2, 0xa3, 0xa7, 0x95, 0xb6, 0xdf, 0xae, 0xa9, 0x99, 0xb4, 0xa8, 0xbf, 0xc6, 0xd8, +0xbf, 0xb1, 0xbf, 0xbf, 0xa5, 0xb5, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xaa, 0xba, 0xbf, 0xe6, 0xf8, +0xbf, 0xa1, 0xac, 0xbf, 0x83, 0xbf, 0xbf, 0xab, 0xbb, 0x85, 0xa0, 0xc0, 0xc3, 0xd5, 0x8c, 0x9c, +0x96, 0x97, 0x93, 0x94, 0x91, 0x92, 0xf7, 0xbf, 0xff, 0x9f, 0xbf, 0x80, 0x8b, 0x9b, 0xbf, 0xbf, +0x87, 0xb7, 0x82, 0x84, 0x89, 0xc2, 0xca, 0xc1, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4, 0xbf, 0xd2, 0xda, 0xdb, 0xd9, 0xbf, 0x88, 0x98, 0xaf, 0xbf, 0xbf, 0xbf, 0xb8, 0xbf, 0xbf, 0xbf }; @@ -94,7 +92,7 @@ const char *Fl_System_Driver::local_to_mac_roman(const char *t, int n) uchar *dst = (uchar*)buf; for ( ; n>0; n--) { uchar c = *src; - if (c>127) + if (c>127) *dst = latin2roman[c-128]; else *dst = c; @@ -136,7 +134,3 @@ const char *fl_local_to_mac_roman(const char *t, int n) { const char *fl_mac_roman_to_local(const char *t, int n) { return Fl::system_driver()->mac_roman_to_local(t, n); } - -// -// End of "$Id$". -// diff --git a/src/fl_engraved_label.cxx b/src/fl_engraved_label.cxx index 666c2af01..137574c1b 100644 --- a/src/fl_engraved_label.cxx +++ b/src/fl_engraved_label.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Engraved label drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Drawing code for XForms style engraved & embossed labels @@ -78,7 +76,3 @@ Fl_Labeltype fl_define_FL_EMBOSSED_LABEL() { Fl::set_labeltype(_FL_EMBOSSED_LABEL, fl_embossed_label, 0); return _FL_EMBOSSED_LABEL; } - -// -// End of "$Id$". -// diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx index ab16c55d7..dc740f9e5 100644 --- a/src/fl_file_dir.cxx +++ b/src/fl_file_dir.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // File chooser widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "flstring.h" @@ -22,9 +20,9 @@ #include <FL/fl_ask.H> -static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; -static void (*current_callback)(const char*) = 0; -static const char *current_label = fl_ok; +static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; +static void (*current_callback)(const char*) = 0; +static const char *current_label = fl_ok; // Do a file chooser callback... @@ -49,10 +47,10 @@ static void popup(Fl_File_Chooser *filechooser) { } -/** \addtogroup group_comdlg +/** \addtogroup group_comdlg @{ */ -/** +/** Set the file chooser callback \note \#include <FL/Fl_File_Chooser.H> \relates Fl_File_Chooser @@ -62,7 +60,7 @@ void fl_file_chooser_callback(void (*cb)(const char*)) { } -/** +/** Set the "OK" button label \note \#include <FL/Fl_File_Chooser.H> \relates Fl_File_Chooser @@ -72,27 +70,27 @@ void fl_file_chooser_ok_label(const char *l) { else current_label = fl_ok; } -/** +/** Shows a file chooser dialog and gets a filename. \note \#include <FL/Fl_File_Chooser.H> - \image html Fl_File_Chooser.jpg + \image html Fl_File_Chooser.jpg \image latex Fl_File_Chooser.jpg "Fl_File_Chooser" width=12cm \param[in] message text in title bar \param[in] pat filename pattern filter \param[in] fname initial/default filename selection \param[in] relative 0 for absolute path name, relative path name otherwise - \return the user selected filename, in absolute or relative format + \return the user selected filename, in absolute or relative format or NULL if user cancels \relates Fl_File_Chooser */ -char * // O - Filename or NULL -fl_file_chooser(const char *message, // I - Message in titlebar - const char *pat, // I - Filename pattern - const char *fname, // I - Initial filename selection - int relative) { // I - 0 for absolute path - static char retname[FL_PATH_MAX]; // Returned filename +char * // O - Filename or NULL +fl_file_chooser(const char *message, // I - Message in titlebar + const char *pat, // I - Filename pattern + const char *fname, // I - Initial filename selection + int relative) { // I - 0 for absolute path + static char retname[FL_PATH_MAX]; // Returned filename if (!fc) { if (!fname || !*fname) fname = "."; @@ -114,29 +112,29 @@ fl_file_chooser(const char *message, // I - Message in titlebar if (!fname) { // null pointer reuses same filename if pattern didn't change if (!same_pattern && fc->value()) { - // if pattern is different, remove name but leave old directory: - strlcpy(retname, fc->value(), sizeof(retname)); + // if pattern is different, remove name but leave old directory: + strlcpy(retname, fc->value(), sizeof(retname)); - char *p = strrchr(retname, '/'); + char *p = strrchr(retname, '/'); if (p) { - // If the filename is "/foo", then the directory will be "/", not - // ""... - if (p == retname) - retname[1] = '\0'; - else - *p = '\0'; - } - // Set the directory... - fc->value(retname); + // If the filename is "/foo", then the directory will be "/", not + // ""... + if (p == retname) + retname[1] = '\0'; + else + *p = '\0'; + } + // Set the directory... + fc->value(retname); } else { // re-use the previously selected name } } else if (!*fname) { // empty filename reuses directory with empty name const char *fcv = fc->value(); - if (fcv) + if (fcv) strlcpy(retname, fc->value(), sizeof(retname)); - else + else *retname = 0; const char *n = fl_filename_name(retname); if (n) *((char*)n) = 0; @@ -165,12 +163,12 @@ fl_file_chooser(const char *message, // I - Message in titlebar \return the directory path string chosen by the user or NULL if user cancels \relates Fl_File_Chooser */ -char * // O - Directory or NULL -fl_dir_chooser(const char *message, // I - Message for titlebar - const char *fname, // I - Initial directory name - int relative) // I - 0 for absolute +char * // O - Directory or NULL +fl_dir_chooser(const char *message, // I - Message for titlebar + const char *fname, // I - Initial directory name + int relative) // I - 0 for absolute { - static char retname[FL_PATH_MAX]; // Returned directory name + static char retname[FL_PATH_MAX]; // Returned directory name if (!fc) { if (!fname || !*fname) fname = "."; @@ -195,8 +193,3 @@ fl_dir_chooser(const char *message, // I - Message for titlebar else return 0; } /** @} */ - - -// -// End of "$Id$". -// diff --git a/src/fl_font.cxx b/src/fl_font.cxx index ef4743c85..24d547e8f 100644 --- a/src/fl_font.cxx +++ b/src/fl_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font selection code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -60,7 +58,3 @@ void fl_reset_spot() { Fl_Graphics_Driver::default_driver().reset_spot(); } - -// -// End of "$Id$". -// diff --git a/src/fl_gleam.cxx b/src/fl_gleam.cxx index 010b50a8a..c75472dc5 100644 --- a/src/fl_gleam.cxx +++ b/src/fl_gleam.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // "Gleam" scheme box drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // These box types provide a sort of Clearlooks Glossy scheme // for FLTK. @@ -179,8 +177,3 @@ Fl_Boxtype fl_define_FL_GLEAM_UP_BOX() { fl_internal_boxtype(_FL_GLEAM_ROUND_DOWN_BOX, down_box); return _FL_GLEAM_UP_BOX; } - - -// -// End of "$Id$". -// diff --git a/src/fl_gtk.cxx b/src/fl_gtk.cxx index 7b4126692..bceae8ebb 100644 --- a/src/fl_gtk.cxx +++ b/src/fl_gtk.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // "GTK" drawing routines for the Fast Light Tool Kit (FLTK). // // These box types provide a GTK+ look, based on Red Hat's Bluecurve @@ -12,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Box drawing code for an obscure box type. @@ -203,7 +201,7 @@ static void draw(int which, int x,int y,int w,int h, int inset) static void gtk_round_up_box(int x, int y, int w, int h, Fl_Color c) { gtk_color(c); - draw(FILL, x, y, w, h, 2); + draw(FILL, x, y, w, h, 2); gtk_color(fl_color_average(FL_BLACK, c, 0.025f)); draw(LOWER_RIGHT, x+1, y, w-2, h, 2); @@ -229,12 +227,12 @@ static void gtk_round_up_box(int x, int y, int w, int h, Fl_Color c) { draw(UPPER_LEFT, x+1, y, w-2, h, 0); gtk_color(fl_color_average(FL_BLACK, c, 0.5f)); - draw(CLOSED, x, y, w, h, 0); + draw(CLOSED, x, y, w, h, 0); } static void gtk_round_down_box(int x, int y, int w, int h, Fl_Color c) { gtk_color(c); - draw(FILL, x, y, w, h, 2); + draw(FILL, x, y, w, h, 2); gtk_color(fl_color_average(FL_BLACK, c, 0.05f)); draw(UPPER_LEFT, x, y, w, h, 2); @@ -244,7 +242,7 @@ static void gtk_round_down_box(int x, int y, int w, int h, Fl_Color c) { draw(UPPER_LEFT, x+1, y, w-2, h, 0); gtk_color(fl_color_average(FL_BLACK, c, 0.5f)); - draw(CLOSED, x, y, w, h, 0); + draw(CLOSED, x, y, w, h, 0); } #else @@ -286,8 +284,3 @@ Fl_Boxtype fl_define_FL_GTK_UP_BOX() { return _FL_GTK_UP_BOX; } - - -// -// End of "$Id$". -// diff --git a/src/fl_images_core.cxx b/src/fl_images_core.cxx index 3df7fcd27..c2d950533 100644 --- a/src/fl_images_core.cxx +++ b/src/fl_images_core.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // FLTK images library core. // // Copyright 1997-2010 by Easy Software Products. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -45,13 +43,13 @@ // the extra image formats that aren't part of the core FLTK library. // -static Fl_Image *fl_check_images(const char *name, uchar *header, int headerlen); +static Fl_Image *fl_check_images(const char *name, uchar *header, int headerlen); /** \brief Register the image formats. - This function is provided in the fltk_images library and + This function is provided in the fltk_images library and registers all of the "extra" image file formats that are not part of the core FLTK library. */ @@ -65,19 +63,19 @@ void fl_register_images() { // 'fl_check_images()' - Check for a supported image format. // -Fl_Image * // O - Image, if found -fl_check_images(const char *name, // I - Filename - uchar *header, // I - Header data from file - int headerlen) { // I - Amount of data +Fl_Image * // O - Image, if found +fl_check_images(const char *name, // I - Filename + uchar *header, // I - Header data from file + int headerlen) { // I - Amount of data if (memcmp(header, "GIF87a", 6) == 0 || - memcmp(header, "GIF89a", 6) == 0) // GIF file + memcmp(header, "GIF89a", 6) == 0) // GIF file return new Fl_GIF_Image(name); - if (memcmp(header, "BM", 2) == 0) // BMP file + if (memcmp(header, "BM", 2) == 0) // BMP file return new Fl_BMP_Image(name); if (header[0] == 'P' && header[1] >= '1' && header[1] <= '7') - // Portable anymap + // Portable anymap return new Fl_PNM_Image(name); #ifdef HAVE_LIBPNG @@ -110,8 +108,3 @@ fl_check_images(const char *name, // I - Filename return 0; } - - -// -// End of "$Id$". -// diff --git a/src/fl_labeltype.cxx b/src/fl_labeltype.cxx index b8c84f46e..8698c277b 100644 --- a/src/fl_labeltype.cxx +++ b/src/fl_labeltype.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Label drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Drawing code for the (one) common label types. @@ -43,7 +41,7 @@ fl_normal_measure(const Fl_Label* o, int& W, int& H) { fl_measure(o->value, W, H); if (o->image) { int iw = o->image->w(), ih = o->image->h(); - if (o->align_ & FL_ALIGN_IMAGE_BACKDROP) { // backdrop: ignore + if (o->align_ & FL_ALIGN_IMAGE_BACKDROP) { // backdrop: ignore // ignore backdrop image for calculation } else if (o->align_ & FL_ALIGN_IMAGE_NEXT_TO_TEXT) { // text and image side by side W += iw; @@ -60,11 +58,11 @@ fl_normal_measure(const Fl_Label* o, int& W, int& H) { static Fl_Label_Draw_F* table[MAX_LABELTYPE] = { fl_normal_label, fl_no_label, - fl_normal_label, // _FL_SHADOW_LABEL, - fl_normal_label, // _FL_ENGRAVED_LABEL, - fl_normal_label, // _FL_EMBOSSED_LABEL, - fl_no_label, // _FL_MULTI_LABEL, - fl_no_label, // _FL_ICON_LABEL, + fl_normal_label, // _FL_SHADOW_LABEL, + fl_normal_label, // _FL_ENGRAVED_LABEL, + fl_normal_label, // _FL_EMBOSSED_LABEL, + fl_no_label, // _FL_MULTI_LABEL, + fl_no_label, // _FL_ICON_LABEL, // FL_FREE_LABELTYPE+n: fl_no_label, fl_no_label, fl_no_label, fl_no_label, fl_no_label, fl_no_label, @@ -74,7 +72,7 @@ static Fl_Label_Draw_F* table[MAX_LABELTYPE] = { static Fl_Label_Measure_F* measure[MAX_LABELTYPE]; /** Sets the functions to call to draw and measure a specific labeltype. */ -void Fl::set_labeltype(Fl_Labeltype t,Fl_Label_Draw_F* f,Fl_Label_Measure_F*m) +void Fl::set_labeltype(Fl_Labeltype t,Fl_Label_Draw_F* f,Fl_Label_Measure_F*m) { table[t] = f; measure[t] = m; } @@ -86,7 +84,7 @@ void Fl_Label::draw(int X, int Y, int W, int H, Fl_Align align) const { if (!value && !image) return; table[type](this, X, Y, W, H, align); } -/** +/** Measures the size of the label. \param[in,out] W, H : this is the requested size for the label text plus image; on return, this will contain the size needed to fit the label @@ -137,7 +135,3 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const { // include these vars here so they can be referenced without including // Fl_Input_ code: #include <FL/Fl_Input_.H> - -// -// End of "$Id$". -// diff --git a/src/fl_open_uri.cxx b/src/fl_open_uri.cxx index d569557b8..5f454c9bd 100644 --- a/src/fl_open_uri.cxx +++ b/src/fl_open_uri.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // fl_open_uri() code for FLTK. // // Test with: @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -107,7 +105,7 @@ int fl_open_uri(const char *uri, char *msg, int msglen) { } /** Decodes a URL-encoded string. - + In a Uniform Resource Identifier (URI), all non-ASCII bytes and several others (e.g., '<', '%', ' ') are URL-encoded using 3 bytes by "%XY" where XY is the hexadecimal value of the byte. This function decodes the URI restoring its original UTF-8 encoded content. Decoding is done in-place. @@ -141,9 +139,9 @@ void fl_decode_uri(char *uri) // Run the specified program, returning 1 on success and 0 on failure int Fl_Posix_System_Driver::run_program(const char *program, char **argv, char *msg, int msglen) { - pid_t pid; // Process ID of first child - int status; // Exit status from first child - sigset_t set, oldset; // Signal masks + pid_t pid; // Process ID of first child + int status; // Exit status from first child + sigset_t set, oldset; // Signal masks // Block SIGCHLD while we run the program... @@ -235,7 +233,3 @@ int main(int argc, char **argv) { } else return 0; } #endif // TEST - -// -// End of "$Id$". -// diff --git a/src/fl_oval_box.cxx b/src/fl_oval_box.cxx index 3868bc403..c094d7a68 100644 --- a/src/fl_oval_box.cxx +++ b/src/fl_oval_box.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Oval box drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -51,7 +49,3 @@ Fl_Boxtype fl_define_FL_OVAL_BOX() { fl_internal_boxtype(_FL_OVAL_BOX,fl_oval_box); return _FL_OVAL_BOX; } - -// -// End of "$Id$". -// diff --git a/src/fl_overlay.cxx b/src/fl_overlay.cxx index 5ba1be467..860b75ae8 100644 --- a/src/fl_overlay.cxx +++ b/src/fl_overlay.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Overlay support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Extremely limited "overlay" support. You can use this to drag out @@ -133,7 +131,3 @@ void fl_overlay_rect(int x, int y, int w, int h) { px = x; py = y; pw = w; ph = h; draw_current_rect(); } - -// -// End of "$Id$". -// diff --git a/src/fl_overlay_visual.cxx b/src/fl_overlay_visual.cxx index a014a1b64..aadd6fdb2 100644 --- a/src/fl_overlay_visual.cxx +++ b/src/fl_overlay_visual.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // X overlay support for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Return an overlay visual, if any. Also allocate a colormap and @@ -52,10 +50,10 @@ XVisualInfo *fl_find_overlay_visual() { Atom actualType; int actualFormat; if (XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen), - overlayVisualsAtom, 0L, 10000L, False, - overlayVisualsAtom, &actualType, &actualFormat, - &sizeData, &bytesLeft, - (unsigned char **) &overlayInfo)) return 0; + overlayVisualsAtom, 0L, 10000L, False, + overlayVisualsAtom, &actualType, &actualFormat, + &sizeData, &bytesLeft, + (unsigned char **) &overlayInfo)) return 0; if (actualType == overlayVisualsAtom && actualFormat == 32) { int n = int(sizeData/4); @@ -69,19 +67,19 @@ XVisualInfo *fl_find_overlay_visual() { int num; XVisualInfo *v1=XGetVisualInfo(fl_display, VisualIDMask, &templt, &num); if (v1->screen == fl_screen && v1->c_class == PseudoColor - && (!v || v1->depth > v->depth && v1->depth <= 8)) { - if (v) XFree((char*)v); - v = v1; - fl_transparent_pixel = overlayInfo[i].value; + && (!v || v1->depth > v->depth && v1->depth <= 8)) { + if (v) XFree((char*)v); + v = v1; + fl_transparent_pixel = overlayInfo[i].value; } else { - XFree((char*)v1); + XFree((char*)v1); } } if (v) { fl_overlay_visual = v; - fl_overlay_colormap = - XCreateColormap(fl_display, RootWindow(fl_display, fl_screen), - v->visual, AllocNone); + fl_overlay_colormap = + XCreateColormap(fl_display, RootWindow(fl_display, fl_screen), + v->visual, AllocNone); } } XFree((char*)overlayInfo); @@ -90,7 +88,3 @@ XVisualInfo *fl_find_overlay_visual() { } #endif - -// -// End of "$Id$". -// diff --git a/src/fl_plastic.cxx b/src/fl_plastic.cxx index 6fdf02c1e..eda2337f5 100644 --- a/src/fl_plastic.cxx +++ b/src/fl_plastic.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // "Plastic" drawing routines for the Fast Light Tool Kit (FLTK). // // These box types provide a cross between Aqua and KDE buttons; kindof @@ -12,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Box drawing code for an obscure box type. @@ -41,9 +39,9 @@ inline Fl_Color shade_color(uchar gc, Fl_Color bc) { #ifdef USE_OLD_PLASTIC_COLOR return fl_color_average((Fl_Color)gc, bc, 0.75f); #else - unsigned grgb = Fl::get_color((Fl_Color)gc), - brgb = Fl::get_color(bc); - int red, green, blue, gray; + unsigned grgb = Fl::get_color((Fl_Color)gc), + brgb = Fl::get_color(bc); + int red, green, blue, gray; gray = ((grgb >> 24) & 255); @@ -146,10 +144,10 @@ static void frame_round(int x, int y, int w, int h, const char *c, Fl_Color bc) static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { const uchar *g = fl_gray_ramp(); - int i, j; - int clen = (int) strlen(c) - 1; - int chalf = clen / 2; - int cstep = 1; + int i, j; + int clen = (int) strlen(c) - 1; + int chalf = clen / 2; + int cstep = 1; if (h < (w * 2)) { // Horizontal shading... @@ -218,9 +216,9 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { static void shade_round(int x, int y, int w, int h, const char *c, Fl_Color bc) { const uchar *g = fl_gray_ramp(); - int i; - int clen = (int) (strlen(c) - 1); - int chalf = clen / 2; + int i; + int clen = (int) (strlen(c) - 1); + int chalf = clen / 2; if (w>h) { int d = h/2; @@ -365,8 +363,3 @@ Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX() { return _FL_PLASTIC_UP_BOX; } - - -// -// End of "$Id$". -// diff --git a/src/fl_read_image.cxx b/src/fl_read_image.cxx index 92f117a8f..90cefe5a7 100644 --- a/src/fl_read_image.cxx +++ b/src/fl_read_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // X11 image reading routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -36,7 +34,7 @@ The \p alpha parameter controls whether an alpha channel is created and the value that is placed in the alpha channel. If 0, no alpha channel is generated. - + \see fl_capture_window_part() */ uchar *fl_read_image(uchar *p, int X, int Y, int w, int h, int alpha) { @@ -107,6 +105,3 @@ Fl_RGB_Image *fl_capture_window_part(Fl_Window *win, int x, int y, int w, int h) } return rgb; } -// -// End of "$Id$". -// diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index cdf857ad7..42be703e0 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -62,8 +60,3 @@ Fl_Region Fl_Graphics_Driver::clip_region() { \} \endcond */ - - -// -// End of "$Id$". -// diff --git a/src/fl_round_box.cxx b/src/fl_round_box.cxx index 4adbfccb7..8cbe79fa6 100644 --- a/src/fl_round_box.cxx +++ b/src/fl_round_box.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Round box drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Box drawing code for an obscure box type. @@ -75,7 +73,7 @@ extern const uchar* fl_gray_ramp(); void fl_round_down_box(int x, int y, int w, int h, Fl_Color bgcolor) { const uchar *g = fl_gray_ramp(); - draw(FILL, x, y, w, h, 2, Fl::box_color(bgcolor)); + draw(FILL, x, y, w, h, 2, Fl::box_color(bgcolor)); draw(UPPER_LEFT, x+1, y, w-2, h, 0, (Fl_Color)g[(int)'N']); draw(UPPER_LEFT, x+1, y, w-2, h, 1, (Fl_Color)g[(int)'H']); draw(UPPER_LEFT, x, y, w, h, 0, (Fl_Color)g[(int)'N']); @@ -84,12 +82,12 @@ void fl_round_down_box(int x, int y, int w, int h, Fl_Color bgcolor) { draw(LOWER_RIGHT, x+1, y, w-2, h, 0, (Fl_Color)g[(int)'U']); draw(LOWER_RIGHT, x, y, w, h, 1, (Fl_Color)g[(int)'U']); draw(LOWER_RIGHT, x+1, y, w-2, h, 1, (Fl_Color)g[(int)'W']); - draw(CLOSED, x, y, w, h, 2, (Fl_Color)g[(int)'A']); + draw(CLOSED, x, y, w, h, 2, (Fl_Color)g[(int)'A']); } void fl_round_up_box(int x, int y, int w, int h, Fl_Color bgcolor) { const uchar *g = fl_gray_ramp(); - draw(FILL, x, y, w, h, 2, Fl::box_color(bgcolor)); + draw(FILL, x, y, w, h, 2, Fl::box_color(bgcolor)); draw(LOWER_RIGHT, x+1, y, w-2, h, 0, (Fl_Color)g[(int)'H']); draw(LOWER_RIGHT, x+1, y, w-2, h, 1, (Fl_Color)g[(int)'N']); draw(LOWER_RIGHT, x, y, w, h, 1, (Fl_Color)g[(int)'H']); @@ -98,7 +96,7 @@ void fl_round_up_box(int x, int y, int w, int h, Fl_Color bgcolor) { draw(UPPER_LEFT, x+1, y, w-2, h, 1, (Fl_Color)g[(int)'S']); draw(UPPER_LEFT, x, y, w, h, 1, (Fl_Color)g[(int)'W']); draw(UPPER_LEFT, x+1, y, w-2, h, 0, (Fl_Color)g[(int)'U']); - draw(CLOSED, x, y, w, h, 0, (Fl_Color)g[(int)'A']); + draw(CLOSED, x, y, w, h, 0, (Fl_Color)g[(int)'A']); } extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*); @@ -107,7 +105,3 @@ Fl_Boxtype fl_define_FL_ROUND_UP_BOX() { fl_internal_boxtype(_FL_ROUND_UP_BOX, fl_round_up_box); return _FL_ROUND_UP_BOX; } - -// -// End of "$Id$". -// diff --git a/src/fl_rounded_box.cxx b/src/fl_rounded_box.cxx index 3a2f28880..4c1eb6aae 100644 --- a/src/fl_rounded_box.cxx +++ b/src/fl_rounded_box.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Rounded box drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -25,9 +23,9 @@ // RS = max. corner radius // BW = box shadow width -#define RN 5 -#define RS 15 -#define BW 3 +#define RN 5 +#define RS 15 +#define BW 3 static double offset[RN] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0}; @@ -41,8 +39,8 @@ static void rbox(int fill, int x, int y, int w, int h) { rs = w*2/5; rsy = h*2/5; if (rs > rsy) rs = rsy; // use smaller radius if (rs > RS) rs = RS; - if (rs == 5) rs = 4; // use only even sizes for small corners (STR #2943) - if (rs == 7) rs = 8; // note: 8 is better than 6 (really) + if (rs == 5) rs = 4; // use only even sizes for small corners (STR #2943) + if (rs == 7) rs = 8; // note: 8 is better than 6 (really) if (fill) fl_begin_polygon(); else fl_begin_loop(); for (i=0; i<RN; i++) @@ -98,7 +96,3 @@ Fl_Boxtype fl_define_FL_RSHADOW_BOX() { fl_internal_boxtype(_FL_RSHADOW_BOX, fl_rshadow_box); return _FL_RSHADOW_BOX; } - -// -// End of "$Id$". -// diff --git a/src/fl_scroll_area.cxx b/src/fl_scroll_area.cxx index 002ce44ad..e9fe9c1df 100644 --- a/src/fl_scroll_area.cxx +++ b/src/fl_scroll_area.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Scrolling routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Drawing function to move the contents of a rectangle. This is passed @@ -81,7 +79,3 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy, if (dx) draw_area(data, clip_x, dest_y, clip_w, src_h); if (dy) draw_area(data, X, clip_y, W, clip_h); } - -// -// End of "$Id$". -// diff --git a/src/fl_set_font.cxx b/src/fl_set_font.cxx index 41a42ad33..6e68d466d 100644 --- a/src/fl_set_font.cxx +++ b/src/fl_set_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Add a font to the internal table. @@ -33,14 +31,14 @@ static int table_size; /** Changes a face. The string pointer is simply stored, the string is not copied, so the string must be in static memory. -*/ +*/ void Fl::set_font(Fl_Font fnum, const char* name) { Fl_Graphics_Driver &d = Fl_Graphics_Driver::default_driver(); unsigned width = d.font_desc_size(); if (!fl_fonts) fl_fonts = d.calc_fl_fonts(); while (fnum >= table_size) { int i = table_size; - if (!i) { // don't realloc the built-in table + if (!i) { // don't realloc the built-in table table_size = 2*FL_FREE_FONT; i = FL_FREE_FONT; Fl_Fontdesc* t = (Fl_Fontdesc*)malloc(table_size*width); @@ -71,7 +69,3 @@ void Fl::set_font(Fl_Font fnum, Fl_Font from) { const char* Fl::get_font(Fl_Font fnum) { return Fl_Graphics_Driver::default_driver().font_name(fnum); } - -// -// End of "$Id$". -// diff --git a/src/fl_shadow_box.cxx b/src/fl_shadow_box.cxx index 3b020f920..1084da3a4 100644 --- a/src/fl_shadow_box.cxx +++ b/src/fl_shadow_box.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Shadow box drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -41,7 +39,3 @@ Fl_Boxtype fl_define_FL_SHADOW_BOX() { fl_internal_boxtype(_FL_SHADOW_BOX, fl_shadow_box); return _FL_SHADOW_BOX; } - -// -// End of "$Id$". -// diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index 526bc2e1d..339ffefb8 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Shortcut support routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Code to test and parse fltk shortcut numbers. @@ -147,8 +145,8 @@ const char* fl_shortcut_label(unsigned int shortcut) { static char *add_modifier_key(char *p, const char *end, const char *name) { size_t ln = strlen(name); - if (p+ln > end) { // string too long - if (p+4 <= end) { // can replace with "..." ? + if (p+ln > end) { // string too long + if (p+4 <= end) { // can replace with "..." ? strcpy(p,"..."); p += 3; } else @@ -157,12 +155,12 @@ static char *add_modifier_key(char *p, const char *end, const char *name) { strcpy(p,name); p += ln; } - if (p[-1] == '\\') // remove (last) '\' character + if (p[-1] == '\\') // remove (last) '\' character p--; - else if (p[-1] == '+') // don't add another '+' character + else if (p[-1] == '+') // don't add another '+' character {/*empty*/} - else // not a '\' or '+' - *p++ = '+'; // add a '+' character + else // not a '\' or '+' + *p++ = '+'; // add a '+' character return p; } @@ -328,7 +326,7 @@ unsigned int Fl_Widget::label_shortcut(const char *t) { \param require_alt if true: match only if Alt key is pressed. \return true, if the entered text matches the '&x' shortcut in \p t - false (0) otherwise. + false (0) otherwise. \note Internal use only. */ @@ -362,7 +360,7 @@ int Fl_Widget::test_shortcut(const char *t, const bool require_alt) { Fl::event_text() is used to get the entered key value. \return true, if the entered text matches the widget's'&x' shortcut, - false (0) otherwise. + false (0) otherwise. \note Internal use only. */ @@ -420,7 +418,3 @@ const char *Fl_System_Driver::shortcut_add_key_name(unsigned key, char *p, char \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/fl_show_colormap.cxx b/src/fl_show_colormap.cxx index a448956c6..d4677181a 100644 --- a/src/fl_show_colormap.cxx +++ b/src/fl_show_colormap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Colormap color selection dialog for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -25,7 +23,7 @@ #define BOXSIZE 14 #define BORDER 4 -/** +/** This widget creates a modal window for selecting a color from the colormap. Pretty much unchanged from Forms. */ @@ -57,7 +55,7 @@ void ColorMenu::drawbox(Fl_Color c) { else fl_draw_box(FL_BORDER_BOX, X, Y, BOXSIZE+1, BOXSIZE+1, c); #else fl_draw_box(c == which ? FL_DOWN_BOX : FL_BORDER_BOX, - X, Y, BOXSIZE+1, BOXSIZE+1, c); + X, Y, BOXSIZE+1, BOXSIZE+1, c); #endif } @@ -133,7 +131,7 @@ Fl_Color ColorMenu::run() { position(Fl::event_x_root()-w()/2, Fl::event_y_root()-y()/2); } else { position(Fl::event_x_root()-(initial%8)*BOXSIZE-BOXSIZE/2-BORDER, - Fl::event_y_root()-(initial/8)*BOXSIZE-BOXSIZE/2-BORDER); + Fl::event_y_root()-(initial/8)*BOXSIZE-BOXSIZE/2-BORDER); } show(); Fl::grab(*this); @@ -147,7 +145,3 @@ Fl_Color fl_show_colormap(Fl_Color oldcol) { ColorMenu m(oldcol); return m.run(); } - -// -// End of "$Id$". -// diff --git a/src/fl_symbols.cxx b/src/fl_symbols.cxx index 4c4903fdf..2f86c2394 100644 --- a/src/fl_symbols.cxx +++ b/src/fl_symbols.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Symbol drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // These are small graphics drawn by the normal label-drawing @@ -79,7 +77,7 @@ int fl_add_symbol(const char *name, void (*drawit)(Fl_Color), int scalable) { fl_init_symbols(); int pos; - if (symbnumb > MAXSYMBOL / 2) return 0; // table is full + if (symbnumb > MAXSYMBOL / 2) return 0; // table is full pos = find(name); symbols[pos].name = name; symbols[pos].drawit = drawit; @@ -100,7 +98,7 @@ int fl_return_arrow(int x,int y,int w,int h); \returns 1 on success, 0 on failure */ // provided for back compatibility: -int fl_draw_symbol(const char *label,int x,int y,int w,int h,Fl_Color col) { +int fl_draw_symbol(const char *label,int x,int y,int w,int h,Fl_Color col) { const char *p = label; if (*p++ != '@') return 0; fl_init_symbols(); @@ -192,7 +190,7 @@ static void rectangle(double x,double y,double x2,double y2,Fl_Color col) { /* The drawing routines */ -static void draw_fltk(Fl_Color col) +static void draw_fltk(Fl_Color col) { fl_color(col); // F fill @@ -226,7 +224,7 @@ static void draw_fltk(Fl_Color col) vv(1.3, 0.15); vv(1.3, 0.5); vv(1.1, 0.5); EC; } -static void draw_search(Fl_Color col) +static void draw_search(Fl_Color col) { fl_color(col); BP; vv(-.4, .13); vv(-1.0, .73); vv(-.73, 1.0); vv(-.13, .4); EP; @@ -301,9 +299,9 @@ static void draw_bararrow(Fl_Color col) BC; vv(-0.5,0.8); vv(-0.1,0.8); vv(-0.1,-0.8); vv(-0.5,-0.8); EC; } -static void draw_doublebar(Fl_Color col) { +static void draw_doublebar(Fl_Color col) { rectangle(-0.6,-0.8,-.1,.8,col); - rectangle(.1,-0.8,.6,.8,col); + rectangle(.1,-0.8,.6,.8,col); } static void draw_arrow01(Fl_Color col) @@ -656,33 +654,33 @@ static void fl_init_symbols(void) { beenhere = 1; symbnumb = 0; - fl_add_symbol("", draw_arrow1, 1); - fl_add_symbol("->", draw_arrow1, 1); - fl_add_symbol(">", draw_arrow2, 1); - fl_add_symbol(">>", draw_arrow3, 1); - fl_add_symbol(">|", draw_arrowbar, 1); - fl_add_symbol(">[]", draw_arrowbox, 1); - fl_add_symbol("|>", draw_bararrow, 1); - fl_add_symbol("<-", draw_arrow01, 1); - fl_add_symbol("<", draw_arrow02, 1); - fl_add_symbol("<<", draw_arrow03, 1); - fl_add_symbol("|<", draw_0arrowbar, 1); - fl_add_symbol("[]<", draw_0arrowbox, 1); - fl_add_symbol("<|", draw_0bararrow, 1); - fl_add_symbol("<->", draw_doublearrow, 1); - fl_add_symbol("-->", draw_arrow, 1); - fl_add_symbol("+", draw_plus, 1); - fl_add_symbol("->|", draw_arrow1bar, 1); - fl_add_symbol("arrow", draw_arrow, 1); - fl_add_symbol("returnarrow", 0, 3); - fl_add_symbol("square", draw_square, 1); - fl_add_symbol("circle", draw_circle, 1); - fl_add_symbol("line", draw_line, 1); - fl_add_symbol("plus", draw_plus, 1); - fl_add_symbol("menu", draw_menu, 1); - fl_add_symbol("UpArrow", draw_uparrow, 1); - fl_add_symbol("DnArrow", draw_downarrow, 1); - fl_add_symbol("||", draw_doublebar, 1); + fl_add_symbol("", draw_arrow1, 1); + fl_add_symbol("->", draw_arrow1, 1); + fl_add_symbol(">", draw_arrow2, 1); + fl_add_symbol(">>", draw_arrow3, 1); + fl_add_symbol(">|", draw_arrowbar, 1); + fl_add_symbol(">[]", draw_arrowbox, 1); + fl_add_symbol("|>", draw_bararrow, 1); + fl_add_symbol("<-", draw_arrow01, 1); + fl_add_symbol("<", draw_arrow02, 1); + fl_add_symbol("<<", draw_arrow03, 1); + fl_add_symbol("|<", draw_0arrowbar, 1); + fl_add_symbol("[]<", draw_0arrowbox, 1); + fl_add_symbol("<|", draw_0bararrow, 1); + fl_add_symbol("<->", draw_doublearrow, 1); + fl_add_symbol("-->", draw_arrow, 1); + fl_add_symbol("+", draw_plus, 1); + fl_add_symbol("->|", draw_arrow1bar, 1); + fl_add_symbol("arrow", draw_arrow, 1); + fl_add_symbol("returnarrow", 0, 3); + fl_add_symbol("square", draw_square, 1); + fl_add_symbol("circle", draw_circle, 1); + fl_add_symbol("line", draw_line, 1); + fl_add_symbol("plus", draw_plus, 1); + fl_add_symbol("menu", draw_menu, 1); + fl_add_symbol("UpArrow", draw_uparrow, 1); + fl_add_symbol("DnArrow", draw_downarrow, 1); + fl_add_symbol("||", draw_doublebar, 1); fl_add_symbol("search", draw_search, 1); fl_add_symbol("FLTK", draw_fltk, 1); @@ -699,7 +697,3 @@ static void fl_init_symbols(void) { // fl_add_symbol("file", draw_file, 1); } - -// -// End of "$Id$". -// diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx index 05ca16dac..b7d273466 100644 --- a/src/fl_utf8.cxx +++ b/src/fl_utf8.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unicode to UTF-8 conversion functions. // // Author: Jean-Marc Lienher ( http://oksid.ch ) @@ -13,9 +11,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -46,7 +44,7 @@ static int Toupper(int ucs) { if (!table) { table = (unsigned short*) malloc( - sizeof(unsigned short) * (NBC)); + sizeof(unsigned short) * (NBC)); for (i = 0; i < NBC; i++) { table[i] = (unsigned short) i; } @@ -124,8 +122,8 @@ int fl_utf8len1(char c) */ int fl_utf_nb_char( - const unsigned char *buf, - int len) + const unsigned char *buf, + int len) { int i = 0; int nbc = 0; @@ -375,9 +373,9 @@ int fl_open(const char* fname, int oflags, ...) { \param[in] fname the UTF-8 encoded filename \param[in] binary if non-zero, the file is to be accessed in binary - (a.k.a. untranslated) mode. + (a.k.a. untranslated) mode. \param[in] oflags,... these arguments are as in the standard open() function. - Setting \p oflags to zero opens the file for reading. + Setting \p oflags to zero opens the file for reading. \return a file descriptor upon successful completion, or -1 in case of error. */ @@ -1359,7 +1357,3 @@ unsigned fl_utf8from_mb(char* dst, unsigned dstlen, const char* src, unsigned sr } /** @} */ - -// -// End of "$Id$". -// diff --git a/src/fl_vertex.cxx b/src/fl_vertex.cxx index e66161c74..5cddfce46 100644 --- a/src/fl_vertex.cxx +++ b/src/fl_vertex.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Portable drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /** @@ -137,7 +135,3 @@ double Fl_Graphics_Driver::transform_dy(double x, double y) { \} \endcond */ - -// -// End of "$Id$". -// diff --git a/src/flstring.c b/src/flstring.c index 455b048b7..6298a6d70 100644 --- a/src/flstring.c +++ b/src/flstring.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * BSD string functions for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include "flstring.h" @@ -23,12 +21,12 @@ * 'fl_strlcat()' - Safely concatenate two strings. */ -size_t /* O - Length of string */ -fl_strlcat(char *dst, /* O - Destination string */ - const char *src, /* I - Source string */ - size_t size) { /* I - Size of destination string buffer */ - size_t srclen; /* Length of source string */ - size_t dstlen; /* Length of destination string */ +size_t /* O - Length of string */ +fl_strlcat(char *dst, /* O - Destination string */ + const char *src, /* I - Source string */ + size_t size) { /* I - Size of destination string buffer */ + size_t srclen; /* Length of source string */ + size_t dstlen; /* Length of destination string */ /* @@ -38,7 +36,7 @@ fl_strlcat(char *dst, /* O - Destination string */ dstlen = strlen(dst); size -= dstlen + 1; - if (!size) return (dstlen); /* No room, return immediately... */ + if (!size) return (dstlen); /* No room, return immediately... */ /* * Figure out how much room is needed... @@ -63,11 +61,11 @@ fl_strlcat(char *dst, /* O - Destination string */ * 'fl_strlcpy()' - Safely copy two strings. */ -size_t /* O - Length of string */ -fl_strlcpy(char *dst, /* O - Destination string */ - const char *src, /* I - Source string */ - size_t size) { /* I - Size of destination string buffer */ - size_t srclen; /* Length of source string */ +size_t /* O - Length of string */ +fl_strlcpy(char *dst, /* O - Destination string */ + const char *src, /* I - Source string */ + size_t size) { /* I - Size of destination string buffer */ + size_t srclen; /* Length of source string */ /* @@ -98,18 +96,14 @@ fl_strlcpy(char *dst, /* O - Destination string */ */ int fl_ascii_strcasecmp(const char *s, const char *t) { if (!s || !t) return (s==t ? 0 : (!s ? -1 : +1)); - + for(;*s && *t; s++,t++) { if (*s == *t) continue; if (*s < *t) { if ( (*s+0x20)!=*t || !C_RANGE(*s,'A','Z') ) return -1; - } else { /* (*s > *t) */ + } else { /* (*s > *t) */ if ( (*s-0x20)!=*t || !C_RANGE(*s,'a','z') ) return +1; } } return (*s==*t) ? 0 : (*t ? -1 : +1); } - -/* - * End of "$Id$". - */ diff --git a/src/flstring.h b/src/flstring.h index 3dc75165e..fa3111226 100644 --- a/src/flstring.h +++ b/src/flstring.h @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Common string header file for the Fast Light Tool Kit (FLTK). * Internal use only (see "important note" below). * @@ -10,11 +8,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -59,8 +57,8 @@ # endif /* _MSC_VER */ # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define strcasecmp(s,t) _stricmp((s), (t)) -# define strncasecmp(s,t,n) _strnicmp((s), (t), (n)) +# define strcasecmp(s,t) _stricmp((s), (t)) +# define strncasecmp(s,t,n) _strnicmp((s), (t), (n)) # endif /* _WIN32 && ... */ # ifdef __cplusplus @@ -103,7 +101,3 @@ FL_EXPORT extern int fl_ascii_strcasecmp(const char *s, const char *t); # endif /* __cplusplus */ #endif /* !flstring_h */ - -/* - * End of "$Id$". - */ diff --git a/src/forms_bitmap.cxx b/src/forms_bitmap.cxx index beb44e82e..4952b7091 100644 --- a/src/forms_bitmap.cxx +++ b/src/forms_bitmap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms compatible bitmap function for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/forms.H> @@ -38,7 +36,3 @@ void Fl_FormsBitmap::draw() { if (b) {fl_color(color()); b->draw(x(), y(), w(), h());} draw_label(); } - -// -// End of "$Id$". -// diff --git a/src/forms_compatibility.cxx b/src/forms_compatibility.cxx index d66fa7ab5..7700e177e 100644 --- a/src/forms_compatibility.cxx +++ b/src/forms_compatibility.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms compatibility functions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Forms library compatibility functions. @@ -198,7 +196,3 @@ char *fl_show_simple_input(const char *str1, const char *defstr) { const char *r = fl_input("%s", defstr, str1); return (char *)(r ? r : defstr); } - -// -// End of "$Id$". -// diff --git a/src/forms_free.cxx b/src/forms_free.cxx index e4db72e50..c30c2730c 100644 --- a/src/forms_free.cxx +++ b/src/forms_free.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms free widget routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Emulation of the Forms "free" widget. @@ -44,9 +42,9 @@ void Fl_Free::step(void *v) { \code int handle_function(Fl_Widget *w, int event, - float event_x, - float event_y, - char key) + float event_x, + float event_y, + char key) \endcode This function is called from the handle() method in response to most events, and is called by the draw() method. @@ -54,16 +52,16 @@ void Fl_Free::step(void *v) { The event argument contains the event type: \code // old event names for compatibility: - #define FL_MOUSE FL_DRAG - #define FL_DRAW 0 - #define FL_STEP 9 - #define FL_FREEMEM 12 - #define FL_FREEZE FL_UNMAP - #define FL_THAW FL_MAP + #define FL_MOUSE FL_DRAG + #define FL_DRAW 0 + #define FL_STEP 9 + #define FL_FREEMEM 12 + #define FL_FREEZE FL_UNMAP + #define FL_THAW FL_MAP \endcode */ Fl_Free::Fl_Free(uchar t,int X, int Y, int W, int H,const char *L, - FL_HANDLEPTR hdl) : + FL_HANDLEPTR hdl) : Fl_Widget(X,Y,W,H,L) { type(t); hfunc = hdl; @@ -99,7 +97,3 @@ int Fl_Free::handle(int e) { if (hfunc(this, e, float(Fl::event_x()), float(Fl::event_y()), key)) do_callback(); return 1; } - -// -// End of "$Id$". -// diff --git a/src/forms_fselect.cxx b/src/forms_fselect.cxx index 6b9f0d713..fd16b4d16 100644 --- a/src/forms_fselect.cxx +++ b/src/forms_fselect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms file selection routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Emulate the Forms file chooser using the fltk file chooser. @@ -26,7 +24,7 @@ static const char *fl_pattern; // assumed passed value is static static char fl_filename[FL_PATH_MAX]; char* fl_show_file_selector(const char *message,const char *dir, - const char *pat,const char *fname) { + const char *pat,const char *fname) { if (dir && dir[0]) strlcpy(fl_directory,dir,sizeof(fl_directory)); if (pat && pat[0]) fl_pattern = pat; if (fname && fname[0]) strlcpy(fl_filename,fname,sizeof(fl_filename)); @@ -47,12 +45,8 @@ char* fl_show_file_selector(const char *message,const char *dir, return (char *)q; } -char* fl_get_directory() {return fl_directory;} - -char* fl_get_pattern() {return (char *)fl_pattern;} +char* fl_get_directory() {return fl_directory;} -char* fl_get_filename() {return fl_filename;} +char* fl_get_pattern() {return (char *)fl_pattern;} -// -// End of "$Id$". -// +char* fl_get_filename() {return fl_filename;} diff --git a/src/forms_pixmap.cxx b/src/forms_pixmap.cxx index 028590a65..25f2a2398 100644 --- a/src/forms_pixmap.cxx +++ b/src/forms_pixmap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms pixmap drawing routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/forms.H> @@ -48,7 +46,3 @@ void Fl_FormsPixmap::draw() { if (b) {fl_color(color()); b->draw(x(), y(), w(), h());} draw_label(); } - -// -// End of "$Id$". -// diff --git a/src/forms_timer.cxx b/src/forms_timer.cxx index 47d1c1b8d..f488eebd5 100644 --- a/src/forms_timer.cxx +++ b/src/forms_timer.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Forms timer object for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Emulate the Forms Timer object @@ -27,7 +25,7 @@ #include "Fl_System_Driver.H" #include <stdio.h> -#define FL_TIMER_BLINKRATE 0.2 +#define FL_TIMER_BLINKRATE 0.2 void fl_gettime(long* sec, long* usec) { time_t tt_sec; @@ -106,12 +104,12 @@ Fl_Timer::~Fl_Timer() { size, and label string. The type parameter can be any of the following symbolic constants: - \li FL_NORMAL_TIMER - The timer just does the callback and - displays the string "Timer" in the widget. - \li FL_VALUE_TIMER - The timer does the callback and displays - the current timer value in the widget. - \li FL_HIDDEN_TIMER - The timer just does the callback and - does not display anything. + \li FL_NORMAL_TIMER - The timer just does the callback and + displays the string "Timer" in the widget. + \li FL_VALUE_TIMER - The timer does the callback and displays + the current timer value in the widget. + \li FL_HIDDEN_TIMER - The timer just does the callback and + does not display anything. */ Fl_Timer::Fl_Timer(uchar t, int X, int Y, int W, int H, const char* l) @@ -148,7 +146,3 @@ void Fl_Timer::suspended(char d) { Fl::remove_timeout(stepcb, this); } } - -// -// End of "$Id$". -// diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx index 3a2949eb5..dc70b9c3e 100644 --- a/src/gl_draw.cxx +++ b/src/gl_draw.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL text drawing support routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,21 +7,21 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Functions from <FL/gl.h> // See also Fl_Gl_Window and gl_start.cxx /* Note about implementing GL text support for a new platform - + 1) if the GL_EXT_texture_rectangle (a.k.a. GL_ARB_texture_rectangle) GL extension is available, no platform-specific code is needed, besides support for fl_draw() and Fl_Image_Surface for the platform. - + 2) if the GL_EXT_texture_rectangle GL extension is not available, a rudimentary support through GLUT is obtained without any platform-specific code. @@ -186,8 +184,8 @@ static void gl_draw_invert(const char* str, int n, int x, int y) { center. Exactly the same output as fl_draw(). */ void gl_draw( - const char* str, // the (multi-line) string - int x, int y, int w, int h, // bounding box + const char* str, // the (multi-line) string + int x, int y, int w, int h, // bounding box Fl_Align align) { fl_draw(str, x, -y-h, w, h, align, gl_draw_invert, NULL, 0); @@ -302,9 +300,9 @@ int gl_texture_fifo::already_known(const char *str, int n) int rank; for ( rank = 0; rank <= last; rank++) { if ((fifo[rank].str_len == n) && - (fifo[rank].fdesc == gl_fontsize) && - (fifo[rank].scale == gl_scale) && - (memcmp(str, fifo[rank].utf8, n) == 0)) { + (fifo[rank].fdesc == gl_fontsize) && + (fifo[rank].scale == gl_scale) && + (memcmp(str, fifo[rank].utf8, n) == 0)) { return rank; } } @@ -348,7 +346,7 @@ void gl_texture_fifo::display_texture(int rank) pos[0] /= gl_start_scale; pos[1] /= gl_start_scale; } - + float R = 2; glScalef (R/winw, R/winh, 1.0f); glTranslatef (-winw/R, -winh/R, 0.0f); @@ -371,13 +369,13 @@ void gl_texture_fifo::display_texture(int rank) glVertex2f (ox + width, oy); glEnd (); glPopAttrib(); - + // reset original matrices glPopMatrix(); // GL_MODELVIEW glMatrixMode (GL_PROJECTION); glPopMatrix(); glMatrixMode (matrixMode); - + //set the raster position to end of string pos[0] += width; GLdouble modelmat[16]; @@ -581,7 +579,7 @@ void Fl_Gl_Window_Driver::draw_string_legacy_glut(const char* str, int n) gl_scale = (gwin ? gwin->pixels_per_unit() : 1); float ratio = fl_width((char*)str_nul, n) * gl_scale/glutStrokeLength(GLUT_STROKE_ROMAN, str_nul); Fl_Surface_Device::pop_current(); - + //setup matrices GLint matrixMode; glGetIntegerv (GL_MATRIX_MODE, &matrixMode); @@ -593,7 +591,7 @@ void Fl_Gl_Window_Driver::draw_string_legacy_glut(const char* str, int n) glLoadIdentity (); float winw = gl_scale * Fl_Window::current()->w(); float winh = gl_scale * Fl_Window::current()->h(); - + GLfloat pos[4]; glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); if (gl_start_scale != 1) { // using gl_start() / gl_finish() @@ -803,7 +801,3 @@ char *Fl_Cocoa_Gl_Window_Driver::alpha_mask_for_string(const char *str, int n, i */ #endif // HAVE_GL || defined(FL_DOXYGEN) - -// -// End of "$Id$". -// diff --git a/src/gl_start.cxx b/src/gl_start.cxx index 3f3589aaf..250bca27e 100644 --- a/src/gl_start.cxx +++ b/src/gl_start.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL context routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // You MUST use gl_visual() to select the default visual before doing @@ -67,7 +65,7 @@ void gl_start() { clip_state_number = fl_graphics_driver->fl_clip_state_number; int x = 0, y = 0, w = 0, h = 0; if (fl_clip_box(0, 0, Fl_Window::current()->w(), Fl_Window::current()->h(), - x, y, w, h)) { + x, y, w, h)) { fl_clip_region(Fl_Graphics_Driver::default_driver().XRectangleRegion(x,y,w,h)); glScissor(x*gl_start_scale, (Fl_Window::current()->h()-(y+h))*gl_start_scale, w*gl_start_scale, h*gl_start_scale); glEnable(GL_SCISSOR_TEST); @@ -135,7 +133,3 @@ int Fl::gl_visual(int mode, int *alist) { */ #endif // HAVE_GL - -// -// End of "$Id$". -// diff --git a/src/glut_compatibility.cxx b/src/glut_compatibility.cxx index 24aafef58..df657a808 100644 --- a/src/glut_compatibility.cxx +++ b/src/glut_compatibility.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // GLUT emulation routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Emulation of Glut using fltk. @@ -139,10 +137,10 @@ int Fl_Glut_Window::handle(int event) { break; } else { if (special) { - int k = Fl::event_key(); - if (k > FL_F && k <= FL_F_Last) k -= FL_F; - special(k,ex,ey); - return 1; + int k = Fl::event_key(); + if (k > FL_F && k <= FL_F_Last) k -= FL_F; + special(k,ex,ey); + return 1; } break; } @@ -392,7 +390,7 @@ int glutGet(GLenum type) { else return 0; //case GLUT_WINDOW_NUM_CHILDREN: -//case GLUT_WINDOW_CURSOR: return +//case GLUT_WINDOW_CURSOR: return case GLUT_SCREEN_WIDTH: return Fl::w(); case GLUT_SCREEN_HEIGHT: return Fl::h(); //case GLUT_SCREEN_WIDTH_MM: @@ -408,9 +406,9 @@ int glutGet(GLenum type) { case GLUT_WINDOW_BUFFER_SIZE: if (glutGet(GLUT_WINDOW_RGBA)) return glutGet(GLUT_WINDOW_RED_SIZE)+ - glutGet(GLUT_WINDOW_GREEN_SIZE)+ - glutGet(GLUT_WINDOW_BLUE_SIZE)+ - glutGet(GLUT_WINDOW_ALPHA_SIZE); + glutGet(GLUT_WINDOW_GREEN_SIZE)+ + glutGet(GLUT_WINDOW_BLUE_SIZE)+ + glutGet(GLUT_WINDOW_ALPHA_SIZE); else return glutGet(GLUT_WINDOW_COLORMAP_SIZE); case GLUT_VERSION: return 20400; @@ -457,7 +455,7 @@ int glutExtensionSupported( const char* extension ) const char *extensions, *start; const int len = strlen( extension ); - + start = extensions = (const char *) glGetString(GL_EXTENSIONS); if (!extensions) return 0; @@ -488,7 +486,3 @@ void glutIdleFunc(void (*f)()) } // glutIdleFunc #endif // HAVE_GL - -// -// End of "$Id$". -// diff --git a/src/glut_font.cxx b/src/glut_font.cxx index 15c6d2c5b..2940863f8 100644 --- a/src/glut_font.cxx +++ b/src/glut_font.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // GLUT font routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // The stroked text code was copied from FreeGLUT 2.4.0 which carries // the following notice: @@ -80,7 +78,7 @@ void glutStrokeCharacter(void* fontID, int character) { if (!schar) return; strip = schar->Strips; - + for (i = 0; i < schar->Number; i++, strip++) { glBegin(GL_LINE_STRIP); @@ -99,7 +97,7 @@ void glutStrokeString(void* fontID, const unsigned char *string) { Fl_Glut_StrokeFont* font = (Fl_Glut_StrokeFont *)fontID; if (!string || ! *string) return; - + /* * Step through the string, drawing each character. * A newline will simply translate the next character's insertion @@ -108,24 +106,24 @@ void glutStrokeString(void* fontID, const unsigned char *string) { while ((c = *string++) != 0) { if (c < font->Quantity) { if (c == '\n') { - glTranslatef(-length, -(float)(font->Height), 0.0); - length = 0.0; + glTranslatef(-length, -(float)(font->Height), 0.0); + length = 0.0; } else { /* Not an EOL, draw the bitmap character */ - const Fl_Glut_StrokeChar *schar = font->Characters[c]; - if (schar) { - const Fl_Glut_StrokeStrip *strip = schar->Strips; - - for (i = 0; i < schar->Number; i++, strip++) { - glBegin(GL_LINE_STRIP); - for (j = 0; j < strip->Number; j++) - glVertex2f(strip->Vertices[j].X, strip->Vertices[j].Y); - glEnd(); - } - - length += schar->Right; - glTranslatef(schar->Right, 0.0, 0.0); - } + const Fl_Glut_StrokeChar *schar = font->Characters[c]; + if (schar) { + const Fl_Glut_StrokeStrip *strip = schar->Strips; + + for (i = 0; i < schar->Number; i++, strip++) { + glBegin(GL_LINE_STRIP); + for (j = 0; j < strip->Number; j++) + glVertex2f(strip->Vertices[j].X, strip->Vertices[j].Y); + glEnd(); + } + + length += schar->Right; + glTranslatef(schar->Right, 0.0, 0.0); + } } } } @@ -159,12 +157,12 @@ int glutStrokeLength(void* fontID, const unsigned char* string) { if (c < font->Quantity) { if (c == '\n') { /* EOL; reset the length of this line */ - if (length < this_line_length) length = this_line_length; - this_line_length = 0.0; + if (length < this_line_length) length = this_line_length; + this_line_length = 0.0; } else { /* Not an EOL, increment the length of this line */ - const Fl_Glut_StrokeChar *schar = font->Characters[c]; - if (schar) this_line_length += schar->Right; + const Fl_Glut_StrokeChar *schar = font->Characters[c]; + if (schar) this_line_length += schar->Right; } } } @@ -183,7 +181,3 @@ GLfloat glutStrokeHeight(void* fontID) { } #endif // HAVE_GL - -// -// End of "$Id$". -// diff --git a/src/numericsort.c b/src/numericsort.c index 46faad8a4..d625066ed 100644 --- a/src/numericsort.c +++ b/src/numericsort.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Numeric sorting routine for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include <ctype.h> @@ -51,11 +49,11 @@ static int numericsort(struct dirent **A, struct dirent **B, int cs) { if (diff) {ret = diff; break;} /* compare first non-zero digit */ } else { if (cs) { - /* compare case-sensitive */ - if ((ret = *a-*b)) break; + /* compare case-sensitive */ + if ((ret = *a-*b)) break; } else { - /* compare case-insensitive */ - if ((ret = tolower(*a & 255)-tolower(*b & 255))) break; + /* compare case-insensitive */ + if ((ret = tolower(*a & 255)-tolower(*b & 255))) break; } if (!*a) break; @@ -69,7 +67,7 @@ static int numericsort(struct dirent **A, struct dirent **B, int cs) { /** Compares directory entries alphanumerically (case-insensitive). - \note This comparison is not (yet) UTF-8 aware. + \note This comparison is not (yet) UTF-8 aware. \todo Make comparison UTF-8 aware. @@ -108,7 +106,7 @@ int fl_casenumericsort(struct dirent **A, struct dirent **B) { \retval 0 A == B \retval +1 A \> B - \note This comparison is not (yet) UTF-8 aware: + \note This comparison is not (yet) UTF-8 aware: - UTF-8 characters are compared according to their binary values. - Locale settings may influence the result in unexpected ways. - The latter is particularly true for fl_casenumericsort(). @@ -122,7 +120,3 @@ int fl_casenumericsort(struct dirent **A, struct dirent **B) { int fl_numericsort(struct dirent **A, struct dirent **B) { return numericsort(A, B, 1); } - -/* - * End of "$Id$". - */ diff --git a/src/print_panel.cxx b/src/print_panel.cxx index b5fc1d5aa..617b9938d 100644 --- a/src/print_panel.cxx +++ b/src/print_panel.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Print panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -25,11 +23,11 @@ // // Todo: // -// - Currently preferences can't be saved, and there are options that -// are not yet used for printing. -// - This file can only be used as an include file in Fl_PS_Printer.cxx -// - The use of static variables should be avoided. -// - Probably much more ... +// - Currently preferences can't be saved, and there are options that +// are not yet used for printing. +// - This file can only be used as an include file in Fl_PS_Printer.cxx +// - The use of static variables should be avoided. +// - Probably much more ... // #include "print_panel.h" @@ -56,7 +54,7 @@ static Fl_Int_Input *print_from=(Fl_Int_Input *)0; static Fl_Int_Input *print_to=(Fl_Int_Input *)0; static Fl_Spinner *print_copies=(Fl_Spinner *)0; -static int print_start = 0; // 1 if print_okay has been clicked +static int print_start = 0; // 1 if print_okay has been clicked static void cb_print_choice(Fl_Choice*, void*) { print_update_status(); @@ -529,7 +527,7 @@ printing_style print_load() { // return whether SystemV or BSD printing style is print_choice->clear(); print_choice->add(Fl_Printer::dialog_print_to_file, 0, 0, 0, FL_MENU_DIVIDER); print_choice->value(0); - + print_start = 0; defname[0] = '\0'; @@ -550,7 +548,7 @@ printing_style print_load() { // return whether SystemV or BSD printing style is } pclose(lpstat); } - + if (print_choice->size() == 2 && (lpstat = fopen("/etc/printcap", "r"))) { // try next with BSD printing system while (fgets(line, sizeof(line),lpstat)) { // get names of all known printers if (*line == '#' || (p = strchr(line, '|')) == NULL) continue; @@ -621,7 +619,3 @@ void print_update_status() { print_prefs.get(name, val, 0); print_output_mode[val]->setonly(); } - -// -// End of "$Id$". -// diff --git a/src/print_panel.h b/src/print_panel.h index 35ead8ad7..3ef0b4b68 100644 --- a/src/print_panel.h +++ b/src/print_panel.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Print panel for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -37,11 +35,7 @@ #include <FL/Fl_Progress.H> enum printing_style {SystemV, BSD}; static Fl_Double_Window* make_print_panel(); -static void print_cb(Fl_Return_Button *, void *); +static void print_cb(Fl_Return_Button *, void *); static printing_style print_load(); static void print_update_status(); #endif - -// -// End of "$Id$". -// diff --git a/src/scandir_posix.c b/src/scandir_posix.c index 34b05e4d9..cf58c4195 100644 --- a/src/scandir_posix.c +++ b/src/scandir_posix.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * This implementation of 'scandir()' is intended to be POSIX.1-2008 compliant. * A POSIX.1-1990 compliant system is required as minimum base. * Note: @@ -12,11 +10,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php * * It is required that 'SIZE_MAX' is at least 'INT_MAX'. * Don't use a C++ compiler to build this module. @@ -211,7 +209,3 @@ fl_scandir(const char *dir, struct dirent ***namelist, typedef int dummy; #endif /* defined(USE_X11) && !defined(HAVE_SCANDIR) */ - -/* - * End of "$Id$". - */ diff --git a/src/scandir_win32.c b/src/scandir_win32.c index cd14a92d7..2663e30dc 100644 --- a/src/scandir_win32.c +++ b/src/scandir_win32.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Windows scandir function for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #ifndef __CYGWIN__ @@ -25,8 +23,8 @@ #include <stdlib.h> int fl_scandir(const char *dirname, struct dirent ***namelist, - int (*select)(struct dirent *), - int (*compar)(struct dirent **, struct dirent **)) { + int (*select)(struct dirent *), + int (*compar)(struct dirent **, struct dirent **)) { int len; char *findIn, *d, is_dir = 0; WIN32_FIND_DATAW findw; @@ -57,14 +55,14 @@ int fl_scandir(const char *dirname, struct dirent ***namelist, { /* Create a block to limit the scope while we find the initial "wide" filename */ /* unsigned short * wbuf = (unsigned short*)malloc(sizeof(short) *(len + 10)); */ /* wbuf[fl_utf2unicode(findIn, strlen(findIn), wbuf)] = 0; */ - unsigned short *wbuf = NULL; - unsigned wlen = fl_utf8toUtf16(findIn, (unsigned) strlen(findIn), NULL, 0); /* Pass NULL to query length */ - wlen++; /* add a little extra for termination etc. */ - wbuf = (unsigned short*)malloc(sizeof(unsigned short)*wlen); - wlen = fl_utf8toUtf16(findIn, (unsigned) strlen(findIn), wbuf, wlen); /* actually convert the filename */ - wbuf[wlen] = 0; /* NULL terminate the resultant string */ - h = FindFirstFileW(wbuf, &findw); /* get a handle to the first filename in the search */ - free(wbuf); /* release the "wide" buffer before the pointer goes out of scope */ + unsigned short *wbuf = NULL; + unsigned wlen = fl_utf8toUtf16(findIn, (unsigned) strlen(findIn), NULL, 0); /* Pass NULL to query length */ + wlen++; /* add a little extra for termination etc. */ + wbuf = (unsigned short*)malloc(sizeof(unsigned short)*wlen); + wlen = fl_utf8toUtf16(findIn, (unsigned) strlen(findIn), wbuf, wlen); /* actually convert the filename */ + wbuf[wlen] = 0; /* NULL terminate the resultant string */ + h = FindFirstFileW(wbuf, &findw); /* get a handle to the first filename in the search */ + free(wbuf); /* release the "wide" buffer before the pointer goes out of scope */ } if (h==INVALID_HANDLE_VALUE) { free(findIn); @@ -76,32 +74,32 @@ int fl_scandir(const char *dirname, struct dirent ***namelist, return nDir; } do { - int l = (int) wcslen(findw.cFileName); - int dstlen = l * 5 + 1; - selectDir=(struct dirent*)malloc(sizeof(struct dirent)+dstlen); + int l = (int) wcslen(findw.cFileName); + int dstlen = l * 5 + 1; + selectDir=(struct dirent*)malloc(sizeof(struct dirent)+dstlen); /* l = fl_unicode2utf(findw.cFileName, l, selectDir->d_name); */ - l = fl_utf8fromwc(selectDir->d_name, dstlen, findw.cFileName, l); + l = fl_utf8fromwc(selectDir->d_name, dstlen, findw.cFileName, l); - selectDir->d_name[l] = 0; - if (findw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - /* Append a trailing slash to directory names... */ - strcat(selectDir->d_name, "/"); - } - if (!select || (*select)(selectDir)) { - if (nDir==NDir) { - struct dirent **tempDir = (struct dirent **)calloc(sizeof(struct dirent*), (size_t)(NDir+33)); - if (NDir) memcpy(tempDir, dir, sizeof(struct dirent*)*NDir); - if (dir) free(dir); - dir = tempDir; - NDir += 32; - } - dir[nDir] = selectDir; - nDir++; - dir[nDir] = 0; - } else { - free(selectDir); - } + selectDir->d_name[l] = 0; + if (findw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + /* Append a trailing slash to directory names... */ + strcat(selectDir->d_name, "/"); + } + if (!select || (*select)(selectDir)) { + if (nDir==NDir) { + struct dirent **tempDir = (struct dirent **)calloc(sizeof(struct dirent*), (size_t)(NDir+33)); + if (NDir) memcpy(tempDir, dir, sizeof(struct dirent*)*NDir); + if (dir) free(dir); + dir = tempDir; + NDir += 32; + } + dir[nDir] = selectDir; + nDir++; + dir[nDir] = 0; + } else { + free(selectDir); + } } while (FindNextFileW(h, &findw)); ret = GetLastError(); if (ret != ERROR_NO_MORE_FILES) { @@ -113,14 +111,10 @@ int fl_scandir(const char *dirname, struct dirent ***namelist, free (findIn); if (compar) qsort(dir, (size_t)nDir, sizeof(*dir), - (int(*)(const void*, const void*))compar); + (int(*)(const void*, const void*))compar); *namelist = dir; return nDir; } #endif - -/* - * End of "$Id$". - */ diff --git a/src/screen_xywh.cxx b/src/screen_xywh.cxx index 468e1064b..2f652c2f4 100644 --- a/src/screen_xywh.cxx +++ b/src/screen_xywh.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Screen/monitor bounding box API for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -188,8 +186,3 @@ void Fl::screen_work_area(int &X, int &Y, int &W, int &H) int nscreen = Fl::screen_driver()->get_mouse(mx, my); Fl::screen_driver()->screen_work_area(X, Y, W, H, nscreen); } - - -// -// End of "$Id$". -// diff --git a/src/utf8_internal.h b/src/utf8_internal.h index 6d5def687..e4cbf1352 100644 --- a/src/utf8_internal.h +++ b/src/utf8_internal.h @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Internal UTF-8 header file for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -35,7 +33,7 @@ extern "C" { unsigned short XUtf8IsNonSpacing( - unsigned int ucs); + unsigned int ucs); unsigned short XUtf8IsRightToLeft( @@ -56,7 +54,3 @@ XUtf8Toupper( # endif #endif /* _SRC__FL_UTF8_H */ - -/* - * End of "$Id$". - */ diff --git a/src/vsnprintf.c b/src/vsnprintf.c index a4e5bc9c0..08aed7fc7 100644 --- a/src/vsnprintf.c +++ b/src/vsnprintf.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * snprintf() and vsnprintf() functions for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include <stdio.h> @@ -31,19 +29,19 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) { #if defined(HAVE_VSNPRINTF) && defined(__linux__) return vsnprintf(buffer, bufsize, format, ap); #else - char *bufptr, /* Pointer to position in buffer */ - *bufend, /* Pointer to end of buffer */ - sign, /* Sign of format width */ - size, /* Size character (h, l, L) */ - type; /* Format type character */ - int width, /* Width of field */ - prec; /* Number of characters of precision */ - char tformat[100], /* Temporary format string for sprintf() */ - *tptr, /* Pointer into temporary format */ - temp[1024]; /* Buffer for formatted numbers */ - char *s; /* Pointer to string */ - int slen; /* Length of string */ - int bytes; /* Total number of bytes needed */ + char *bufptr, /* Pointer to position in buffer */ + *bufend, /* Pointer to end of buffer */ + sign, /* Sign of format width */ + size, /* Size character (h, l, L) */ + type; /* Format type character */ + int width, /* Width of field */ + prec; /* Number of characters of precision */ + char tformat[100], /* Temporary format string for sprintf() */ + *tptr, /* Pointer into temporary format */ + temp[1024]; /* Buffer for formatted numbers */ + char *s; /* Pointer to string */ + int slen; /* Length of string */ + int bytes; /* Total number of bytes needed */ /* @@ -63,7 +61,7 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) { if (bufptr && bufptr < bufend) *bufptr++ = *format; bytes ++; format ++; - continue; + continue; } else if (strchr(" -+#\'", *format)) { *tptr++ = *format; sign = *format++; @@ -71,48 +69,48 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) { if (*format == '*') { /* Get width from argument... */ - format ++; - width = va_arg(ap, int); - snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", width); - tptr += strlen(tptr); + format ++; + width = va_arg(ap, int); + snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", width); + tptr += strlen(tptr); } else { - width = 0; - while (isdigit(*format & 255)) { - if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; - width = width * 10 + *format++ - '0'; - } + width = 0; + while (isdigit(*format & 255)) { + if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; + width = width * 10 + *format++ - '0'; + } } if (*format == '.') { - if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; + if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; format ++; if (*format == '*') { /* Get precision from argument... */ - format ++; - prec = va_arg(ap, int); - snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", prec); - tptr += strlen(tptr); - } else { - prec = 0; - while (isdigit(*format & 255)) { - if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; - prec = prec * 10 + *format++ - '0'; - } - } + format ++; + prec = va_arg(ap, int); + snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", prec); + tptr += strlen(tptr); + } else { + prec = 0; + while (isdigit(*format & 255)) { + if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; + prec = prec * 10 + *format++ - '0'; + } + } } else prec = -1; size = '\0'; if (*format == 'l' && format[1] == 'l') { size = 'L'; - if (tptr < (tformat + sizeof(tformat) - 2)) { - *tptr++ = 'l'; - *tptr++ = 'l'; - } - format += 2; + if (tptr < (tformat + sizeof(tformat) - 2)) { + *tptr++ = 'l'; + *tptr++ = 'l'; + } + format += 2; } else if (*format == 'h' || *format == 'l' || *format == 'L') { - if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; + if (tptr < (tformat + sizeof(tformat) - 1)) *tptr++ = *format; size = *format++; } @@ -123,121 +121,121 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) { *tptr = '\0'; switch (type) { - case 'E' : /* Floating point formats */ - case 'G' : - case 'e' : - case 'f' : - case 'g' : - if ((width + 2) > (int)sizeof(temp)) break; + case 'E' : /* Floating point formats */ + case 'G' : + case 'e' : + case 'f' : + case 'g' : + if ((width + 2) > (int)sizeof(temp)) break; - sprintf(temp, tformat, va_arg(ap, double)); + sprintf(temp, tformat, va_arg(ap, double)); bytes += (int) strlen(temp); if (bufptr) { - if ((bufptr + strlen(temp)) > bufend) { - strncpy(bufptr, temp, (size_t)(bufend - bufptr)); - bufptr = bufend; - } else { - strcpy(bufptr, temp); - bufptr += strlen(temp); - } - } - break; + if ((bufptr + strlen(temp)) > bufend) { + strncpy(bufptr, temp, (size_t)(bufend - bufptr)); + bufptr = bufend; + } else { + strcpy(bufptr, temp); + bufptr += strlen(temp); + } + } + break; case 'B' : /* Integer formats */ - case 'X' : - case 'b' : + case 'X' : + case 'b' : case 'd' : - case 'i' : - case 'o' : - case 'u' : - case 'x' : - if ((width + 2) > (int)sizeof(temp)) break; + case 'i' : + case 'o' : + case 'u' : + case 'x' : + if ((width + 2) > (int)sizeof(temp)) break; #ifdef HAVE_LONG_LONG - if (size == 'L') - sprintf(temp, tformat, va_arg(ap, long long)); - else + if (size == 'L') + sprintf(temp, tformat, va_arg(ap, long long)); + else #endif /* HAVE_LONG_LONG */ - if (size == 'l') - sprintf(temp, tformat, va_arg(ap, long)); - else - sprintf(temp, tformat, va_arg(ap, int)); + if (size == 'l') + sprintf(temp, tformat, va_arg(ap, long)); + else + sprintf(temp, tformat, va_arg(ap, int)); bytes += (int) strlen(temp); - if (bufptr) { - if ((bufptr + strlen(temp)) > bufend) { - strncpy(bufptr, temp, (size_t)(bufend - bufptr)); - bufptr = bufend; - } else { - strcpy(bufptr, temp); - bufptr += strlen(temp); - } - } - break; - - case 'p' : /* Pointer value */ - if ((width + 2) > (int)sizeof(temp)) break; - - sprintf(temp, tformat, va_arg(ap, void *)); + if (bufptr) { + if ((bufptr + strlen(temp)) > bufend) { + strncpy(bufptr, temp, (size_t)(bufend - bufptr)); + bufptr = bufend; + } else { + strcpy(bufptr, temp); + bufptr += strlen(temp); + } + } + break; + + case 'p' : /* Pointer value */ + if ((width + 2) > (int)sizeof(temp)) break; + + sprintf(temp, tformat, va_arg(ap, void *)); bytes += (int) strlen(temp); - if (bufptr) { - if ((bufptr + strlen(temp)) > bufend) { - strncpy(bufptr, temp, (size_t)(bufend - bufptr)); - bufptr = bufend; - } else { - strcpy(bufptr, temp); - bufptr += strlen(temp); - } - } - break; + if (bufptr) { + if ((bufptr + strlen(temp)) > bufend) { + strncpy(bufptr, temp, (size_t)(bufend - bufptr)); + bufptr = bufend; + } else { + strcpy(bufptr, temp); + bufptr += strlen(temp); + } + } + break; case 'c' : /* Character or character array */ - bytes += width; + bytes += width; - if (bufptr) { - if (width <= 1) *bufptr++ = va_arg(ap, int); - else { - if ((bufptr + width) > bufend) width = (int) (bufend - bufptr); + if (bufptr) { + if (width <= 1) *bufptr++ = va_arg(ap, int); + else { + if ((bufptr + width) > bufend) width = (int) (bufend - bufptr); - memcpy(bufptr, va_arg(ap, char *), (size_t)width); - bufptr += width; - } - } - break; + memcpy(bufptr, va_arg(ap, char *), (size_t)width); + bufptr += width; + } + } + break; - case 's' : /* String */ - if ((s = va_arg(ap, char *)) == NULL) s = "(null)"; + case 's' : /* String */ + if ((s = va_arg(ap, char *)) == NULL) s = "(null)"; - slen = (int) strlen(s); - if (slen > width && prec != width) width = slen; + slen = (int) strlen(s); + if (slen > width && prec != width) width = slen; bytes += width; - if (bufptr) { - if ((bufptr + width) > bufend) width = (int) (bufend - bufptr); + if (bufptr) { + if ((bufptr + width) > bufend) width = (int) (bufend - bufptr); if (slen > width) slen = width; - if (sign == '-') { - strncpy(bufptr, s, (size_t)slen); - memset(bufptr + slen, ' ', (size_t)(width - slen)); - } else { - memset(bufptr, ' ', (size_t)(width - slen)); - strncpy(bufptr + width - slen, s, (size_t)slen); - } - - bufptr += width; - } - break; - - case 'n' : /* Output number of chars so far */ - *(va_arg(ap, int *)) = bytes; - break; + if (sign == '-') { + strncpy(bufptr, s, (size_t)slen); + memset(bufptr + slen, ' ', (size_t)(width - slen)); + } else { + memset(bufptr, ' ', (size_t)(width - slen)); + strncpy(bufptr + width - slen, s, (size_t)slen); + } + + bufptr += width; + } + break; + + case 'n' : /* Output number of chars so far */ + *(va_arg(ap, int *)) = bytes; + break; } } else { bytes ++; @@ -269,8 +267,3 @@ int fl_snprintf(char* str, size_t size, const char* fmt, ...) { #ifdef __cplusplus } #endif - -/* - * End of "$Id$". - */ - diff --git a/src/xutf8/COPYING b/src/xutf8/COPYING index eb163a5e5..571d66823 100644 --- a/src/xutf8/COPYING +++ b/src/xutf8/COPYING @@ -5,14 +5,14 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php - lcUniConv directory: + lcUniConv directory: Copyright (c) 1999-2000 Free Software Foundation, Inc. diff --git a/src/xutf8/case.c b/src/xutf8/case.c index 5fce6b570..21ce3c59f 100644 --- a/src/xutf8/case.c +++ b/src/xutf8/case.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2010 by O'ksi'D. * @@ -8,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -95,7 +93,7 @@ XUtf8Tolower(int ucs) { return ucs; } -int +int XUtf8Toupper(int ucs) { int i; static unsigned short *table = NULL; @@ -114,7 +112,3 @@ XUtf8Toupper(int ucs) { if (ucs >= 0x10000 || ucs < 0) return ucs; return table[ucs]; } - -/* -* End of "$Id$". -*/ diff --git a/src/xutf8/fl_wcwidth.c b/src/xutf8/fl_wcwidth.c index f31f472dc..c525a4bda 100644 --- a/src/xutf8/fl_wcwidth.c +++ b/src/xutf8/fl_wcwidth.c @@ -1,6 +1,4 @@ /* - * "$Id$" - * * wrapper(s) around Markus Kuhn's wcwidth() implementation. * * Copyright 2006-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* include Markus Kuhn's wcwidth() implementation. @@ -38,7 +36,3 @@ int fl_wcwidth(unsigned int ucs) { /* warning: we have problems if sizeof(wchar_t) == 2 and ucs > 0xffff */ return mk_wcwidth(ucs); } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/headers/case_tbl.txt b/src/xutf8/headers/case_tbl.txt index 2ed45fc21..e62d22567 100644 --- a/src/xutf8/headers/case_tbl.txt +++ b/src/xutf8/headers/case_tbl.txt @@ -1,8 +1,8 @@ -ucs_table_0041[]; /* end: U+02B6 */ -ucs_table_0386[]; /* end: U+0556 */ -ucs_table_10A0[]; /* end: U+10C5 */ -ucs_table_1E00[]; /* end: U+1FFC */ -ucs_table_2102[]; /* end: U+2133 */ -ucs_table_24B6[]; /* end: U+24CF */ -ucs_table_33CE[]; /* end: U+33CE */ -ucs_table_FF21[]; /* end: U+FF3A */ +ucs_table_0041[]; /* end: U+02B6 */ +ucs_table_0386[]; /* end: U+0556 */ +ucs_table_10A0[]; /* end: U+10C5 */ +ucs_table_1E00[]; /* end: U+1FFC */ +ucs_table_2102[]; /* end: U+2133 */ +ucs_table_24B6[]; /* end: U+24CF */ +ucs_table_33CE[]; /* end: U+33CE */ +ucs_table_FF21[]; /* end: U+FF3A */ diff --git a/src/xutf8/headers/spacing_tbl.txt b/src/xutf8/headers/spacing_tbl.txt index 2e3d90c50..20f9ada04 100644 --- a/src/xutf8/headers/spacing_tbl.txt +++ b/src/xutf8/headers/spacing_tbl.txt @@ -1,10 +1,10 @@ -ucs_table_0300[]; /* end: U+0361 */ -ucs_table_0483[]; /* end: U+0486 */ -ucs_table_0591[]; /* end: U+05C4 */ -ucs_table_064B[]; /* end: U+06ED */ -ucs_table_0901[]; /* end: U+0D4D */ -ucs_table_0E31[]; /* end: U+0FB9 */ -ucs_table_20D0[]; /* end: U+20E1 */ -ucs_table_302A[]; /* end: U+309A */ -ucs_table_FB1E[]; /* end: U+FB1E */ -ucs_table_FE20[]; /* end: U+FE23 */ +ucs_table_0300[]; /* end: U+0361 */ +ucs_table_0483[]; /* end: U+0486 */ +ucs_table_0591[]; /* end: U+05C4 */ +ucs_table_064B[]; /* end: U+06ED */ +ucs_table_0901[]; /* end: U+0D4D */ +ucs_table_0E31[]; /* end: U+0FB9 */ +ucs_table_20D0[]; /* end: U+20E1 */ +ucs_table_302A[]; /* end: U+309A */ +ucs_table_FB1E[]; /* end: U+FB1E */ +ucs_table_FE20[]; /* end: U+FE23 */ diff --git a/src/xutf8/headers/tbl.txt b/src/xutf8/headers/tbl.txt index ddb2c457f..cb01c6941 100644 --- a/src/xutf8/headers/tbl.txt +++ b/src/xutf8/headers/tbl.txt @@ -1,122 +1,122 @@ -unicode_to_iso8859_1_1b_0001[]; /* end: U+00FF */ -unicode_to_iso8859_2_1b_0001[]; /* end: U+017E */ -unicode_to_iso8859_2_1b_02C7[]; /* end: U+02DD */ -unicode_to_iso8859_3_1b_0001[]; /* end: U+017C */ -unicode_to_iso8859_3_1b_02D8[]; /* end: U+02D9 */ -unicode_to_iso8859_4_1b_0001[]; /* end: U+017E */ -unicode_to_iso8859_4_1b_02C7[]; /* end: U+02DB */ -unicode_to_iso8859_5_1b_0001[]; /* end: U+00AD */ -unicode_to_iso8859_5_1b_0401[]; /* end: U+045F */ -unicode_to_iso8859_5_1b_2116[]; /* end: U+2116 */ -unicode_to_iso8859_6_1b_0001[]; /* end: U+00AD */ -unicode_to_iso8859_6_1b_060C[]; /* end: U+0652 */ -unicode_to_iso8859_7_1b_0001[]; /* end: U+00BD */ -unicode_to_iso8859_7_1b_0384[]; /* end: U+03CE */ -unicode_to_iso8859_7_1b_2015[]; /* end: U+2019 */ -unicode_to_iso8859_8_1b_0001[]; /* end: U+00F7 */ -unicode_to_iso8859_8_1b_05D0[]; /* end: U+05EA */ -unicode_to_iso8859_8_1b_200E[]; /* end: U+2017 */ -unicode_to_iso8859_9_1b_0001[]; /* end: U+015F */ -unicode_to_iso8859_10_1b_0001[]; /* end: U+017E */ -unicode_to_iso8859_10_1b_2015[]; /* end: U+2015 */ -unicode_to_iso8859_13_1b_0001[]; /* end: U+017E */ -unicode_to_iso8859_13_1b_2019[]; /* end: U+201E */ -unicode_to_iso8859_14_1b_0001[]; /* end: U+0178 */ -unicode_to_iso8859_14_1b_1E02[]; /* end: U+1EF3 */ -unicode_to_iso8859_15_1b_0001[]; /* end: U+017E */ -unicode_to_iso8859_15_1b_20AC[]; /* end: U+20AC */ -unicode_to_koi8_1_1b_0001[]; /* end: U+00F7 */ -unicode_to_koi8_1_1b_0401[]; /* end: U+0451 */ -unicode_to_koi8_1_1b_2219[]; /* end: U+2265 */ -unicode_to_koi8_1_1b_2320[]; /* end: U+2321 */ -unicode_to_koi8_1_1b_2500[]; /* end: U+25A0 */ -unicode_to_big5_0_2b_00A2[]; /* end: U+00F7 */ -unicode_to_big5_0_2b_02C7[]; /* end: U+02D9 */ -unicode_to_big5_0_2b_0391[]; /* end: U+0451 */ -unicode_to_big5_0_2b_2013[]; /* end: U+203E */ -unicode_to_big5_0_2b_2103[]; /* end: U+2199 */ -unicode_to_big5_0_2b_221A[]; /* end: U+22BF */ -unicode_to_big5_0_2b_2460[]; /* end: U+247D */ -unicode_to_big5_0_2b_2500[]; /* end: U+2642 */ -unicode_to_big5_0_2b_3000[]; /* end: U+3129 */ -unicode_to_big5_0_2b_32A3[]; /* end: U+32A3 */ -unicode_to_big5_0_2b_338E[]; /* end: U+33D5 */ -unicode_to_big5_0_2b_4E00[]; /* end: U+7E9C */ -unicode_to_big5_0_2b_7F36[]; /* end: U+8B9F */ -unicode_to_big5_0_2b_8C37[]; /* end: U+9483 */ -unicode_to_big5_0_2b_9577[]; /* end: U+9FA4 */ -unicode_to_big5_0_2b_FA0C[]; /* end: U+FA0D */ -unicode_to_big5_0_2b_FE30[]; /* end: U+FE6B */ -unicode_to_big5_0_2b_FF01[]; /* end: U+FF64 */ -unicode_to_big5_0_2b_FFFD[]; /* end: U+FFFD */ -unicode_to_ksc5601_1987_0_2b_00A1[]; /* end: U+0167 */ -unicode_to_ksc5601_1987_0_2b_02C7[]; /* end: U+02DD */ -unicode_to_ksc5601_1987_0_2b_0391[]; /* end: U+0451 */ -unicode_to_ksc5601_1987_0_2b_2015[]; /* end: U+2312 */ -unicode_to_ksc5601_1987_0_2b_2460[]; /* end: U+266D */ -unicode_to_ksc5601_1987_0_2b_3000[]; /* end: U+327F */ -unicode_to_ksc5601_1987_0_2b_3380[]; /* end: U+33DD */ -unicode_to_ksc5601_1987_0_2b_4E00[]; /* end: U+7E9C */ -unicode_to_ksc5601_1987_0_2b_7F36[]; /* end: U+8B9A */ -unicode_to_ksc5601_1987_0_2b_8C37[]; /* end: U+947F */ -unicode_to_ksc5601_1987_0_2b_9577[]; /* end: U+9C57 */ -unicode_to_ksc5601_1987_0_2b_9CE5[]; /* end: U+9F9C */ -unicode_to_ksc5601_1987_0_2b_AC00[]; /* end: U+D79D */ -unicode_to_ksc5601_1987_0_2b_F900[]; /* end: U+FA0B */ -unicode_to_ksc5601_1987_0_2b_FF01[]; /* end: U+FF5E */ -unicode_to_ksc5601_1987_0_2b_FFE0[]; /* end: U+FFE6 */ -unicode_to_gb2312_1980_0_2b_00A4[]; /* end: U+01DC */ -unicode_to_gb2312_1980_0_2b_02C7[]; /* end: U+02C9 */ -unicode_to_gb2312_1980_0_2b_0391[]; /* end: U+0451 */ -unicode_to_gb2312_1980_0_2b_2015[]; /* end: U+203B */ -unicode_to_gb2312_1980_0_2b_2103[]; /* end: U+2312 */ -unicode_to_gb2312_1980_0_2b_2460[]; /* end: U+2642 */ -unicode_to_gb2312_1980_0_2b_3000[]; /* end: U+3129 */ -unicode_to_gb2312_1980_0_2b_3220[]; /* end: U+3229 */ -unicode_to_gb2312_1980_0_2b_4E00[]; /* end: U+7DAE */ -unicode_to_gb2312_1980_0_2b_7E3B[]; /* end: U+8C98 */ -unicode_to_gb2312_1980_0_2b_8D1D[]; /* end: U+8ECE */ -unicode_to_gb2312_1980_0_2b_8F66[]; /* end: U+91DC */ -unicode_to_gb2312_1980_0_2b_9274[]; /* end: U+99A8 */ -unicode_to_gb2312_1980_0_2b_9A6C[]; /* end: U+9B54 */ -unicode_to_gb2312_1980_0_2b_9C7C[]; /* end: U+9CE2 */ -unicode_to_gb2312_1980_0_2b_9E1F[]; /* end: U+9FA0 */ -unicode_to_gb2312_1980_0_2b_FF01[]; /* end: U+FF5E */ -unicode_to_gb2312_1980_0_2b_FFE0[]; /* end: U+FFE5 */ -unicode_to_jisx0201_1976_0_1b_0020[]; /* end: U+00A5 */ -unicode_to_jisx0201_1976_0_1b_203E[]; /* end: U+203E */ -unicode_to_jisx0201_1976_0_1b_FF61[]; /* end: U+FF9F */ -unicode_to_jisx0208_1983_0_2b_005C[]; /* end: U+00F7 */ -unicode_to_jisx0208_1983_0_2b_0391[]; /* end: U+0451 */ -unicode_to_jisx0208_1983_0_2b_2010[]; /* end: U+203B */ -unicode_to_jisx0208_1983_0_2b_2103[]; /* end: U+2312 */ -unicode_to_jisx0208_1983_0_2b_2500[]; /* end: U+266F */ -unicode_to_jisx0208_1983_0_2b_3000[]; /* end: U+30FE */ -unicode_to_jisx0208_1983_0_2b_4E00[]; /* end: U+7E9C */ -unicode_to_jisx0208_1983_0_2b_7F36[]; /* end: U+8B9A */ -unicode_to_jisx0208_1983_0_2b_8C37[]; /* end: U+9481 */ -unicode_to_jisx0208_1983_0_2b_9577[]; /* end: U+9FA0 */ -unicode_to_jisx0208_1983_0_2b_FF01[]; /* end: U+FF5D */ -unicode_to_jisx0208_1983_0_2b_FFE3[]; /* end: U+FFE5 */ -unicode_to_jisx0212_1990_0_2b_007E[]; /* end: U+01F5 */ -unicode_to_jisx0212_1990_0_2b_02C7[]; /* end: U+02DD */ -unicode_to_jisx0212_1990_0_2b_0384[]; /* end: U+045F */ -unicode_to_jisx0212_1990_0_2b_2116[]; /* end: U+2122 */ -unicode_to_jisx0212_1990_0_2b_4E02[]; /* end: U+7E9E */ -unicode_to_jisx0212_1990_0_2b_7F3B[]; /* end: U+8B9F */ -unicode_to_jisx0212_1990_0_2b_8C38[]; /* end: U+9484 */ -unicode_to_jisx0212_1990_0_2b_9578[]; /* end: U+9FA5 */ -unicode_to_symbol_1b_0020[]; /* end: U+00F7 */ -unicode_to_symbol_1b_0192[]; /* end: U+0192 */ -unicode_to_symbol_1b_0391[]; /* end: U+03D6 */ -unicode_to_symbol_1b_2022[]; /* end: U+232A */ -unicode_to_symbol_1b_25CA[]; /* end: U+25CA */ -unicode_to_symbol_1b_2660[]; /* end: U+2666 */ -unicode_to_symbol_1b_F6D9[]; /* end: U+F6DB */ -unicode_to_symbol_1b_F8E5[]; /* end: U+F8FE */ -unicode_to_dingbats_1b_0020[]; /* end: U+00A0 */ -unicode_to_dingbats_1b_2192[]; /* end: U+2195 */ -unicode_to_dingbats_1b_2460[]; /* end: U+2469 */ -unicode_to_dingbats_1b_25A0[]; /* end: U+2666 */ -unicode_to_dingbats_1b_2701[]; /* end: U+27BE */ -unicode_to_dingbats_1b_F8D7[]; /* end: U+F8E4 */ +unicode_to_iso8859_1_1b_0001[]; /* end: U+00FF */ +unicode_to_iso8859_2_1b_0001[]; /* end: U+017E */ +unicode_to_iso8859_2_1b_02C7[]; /* end: U+02DD */ +unicode_to_iso8859_3_1b_0001[]; /* end: U+017C */ +unicode_to_iso8859_3_1b_02D8[]; /* end: U+02D9 */ +unicode_to_iso8859_4_1b_0001[]; /* end: U+017E */ +unicode_to_iso8859_4_1b_02C7[]; /* end: U+02DB */ +unicode_to_iso8859_5_1b_0001[]; /* end: U+00AD */ +unicode_to_iso8859_5_1b_0401[]; /* end: U+045F */ +unicode_to_iso8859_5_1b_2116[]; /* end: U+2116 */ +unicode_to_iso8859_6_1b_0001[]; /* end: U+00AD */ +unicode_to_iso8859_6_1b_060C[]; /* end: U+0652 */ +unicode_to_iso8859_7_1b_0001[]; /* end: U+00BD */ +unicode_to_iso8859_7_1b_0384[]; /* end: U+03CE */ +unicode_to_iso8859_7_1b_2015[]; /* end: U+2019 */ +unicode_to_iso8859_8_1b_0001[]; /* end: U+00F7 */ +unicode_to_iso8859_8_1b_05D0[]; /* end: U+05EA */ +unicode_to_iso8859_8_1b_200E[]; /* end: U+2017 */ +unicode_to_iso8859_9_1b_0001[]; /* end: U+015F */ +unicode_to_iso8859_10_1b_0001[]; /* end: U+017E */ +unicode_to_iso8859_10_1b_2015[]; /* end: U+2015 */ +unicode_to_iso8859_13_1b_0001[]; /* end: U+017E */ +unicode_to_iso8859_13_1b_2019[]; /* end: U+201E */ +unicode_to_iso8859_14_1b_0001[]; /* end: U+0178 */ +unicode_to_iso8859_14_1b_1E02[]; /* end: U+1EF3 */ +unicode_to_iso8859_15_1b_0001[]; /* end: U+017E */ +unicode_to_iso8859_15_1b_20AC[]; /* end: U+20AC */ +unicode_to_koi8_1_1b_0001[]; /* end: U+00F7 */ +unicode_to_koi8_1_1b_0401[]; /* end: U+0451 */ +unicode_to_koi8_1_1b_2219[]; /* end: U+2265 */ +unicode_to_koi8_1_1b_2320[]; /* end: U+2321 */ +unicode_to_koi8_1_1b_2500[]; /* end: U+25A0 */ +unicode_to_big5_0_2b_00A2[]; /* end: U+00F7 */ +unicode_to_big5_0_2b_02C7[]; /* end: U+02D9 */ +unicode_to_big5_0_2b_0391[]; /* end: U+0451 */ +unicode_to_big5_0_2b_2013[]; /* end: U+203E */ +unicode_to_big5_0_2b_2103[]; /* end: U+2199 */ +unicode_to_big5_0_2b_221A[]; /* end: U+22BF */ +unicode_to_big5_0_2b_2460[]; /* end: U+247D */ +unicode_to_big5_0_2b_2500[]; /* end: U+2642 */ +unicode_to_big5_0_2b_3000[]; /* end: U+3129 */ +unicode_to_big5_0_2b_32A3[]; /* end: U+32A3 */ +unicode_to_big5_0_2b_338E[]; /* end: U+33D5 */ +unicode_to_big5_0_2b_4E00[]; /* end: U+7E9C */ +unicode_to_big5_0_2b_7F36[]; /* end: U+8B9F */ +unicode_to_big5_0_2b_8C37[]; /* end: U+9483 */ +unicode_to_big5_0_2b_9577[]; /* end: U+9FA4 */ +unicode_to_big5_0_2b_FA0C[]; /* end: U+FA0D */ +unicode_to_big5_0_2b_FE30[]; /* end: U+FE6B */ +unicode_to_big5_0_2b_FF01[]; /* end: U+FF64 */ +unicode_to_big5_0_2b_FFFD[]; /* end: U+FFFD */ +unicode_to_ksc5601_1987_0_2b_00A1[]; /* end: U+0167 */ +unicode_to_ksc5601_1987_0_2b_02C7[]; /* end: U+02DD */ +unicode_to_ksc5601_1987_0_2b_0391[]; /* end: U+0451 */ +unicode_to_ksc5601_1987_0_2b_2015[]; /* end: U+2312 */ +unicode_to_ksc5601_1987_0_2b_2460[]; /* end: U+266D */ +unicode_to_ksc5601_1987_0_2b_3000[]; /* end: U+327F */ +unicode_to_ksc5601_1987_0_2b_3380[]; /* end: U+33DD */ +unicode_to_ksc5601_1987_0_2b_4E00[]; /* end: U+7E9C */ +unicode_to_ksc5601_1987_0_2b_7F36[]; /* end: U+8B9A */ +unicode_to_ksc5601_1987_0_2b_8C37[]; /* end: U+947F */ +unicode_to_ksc5601_1987_0_2b_9577[]; /* end: U+9C57 */ +unicode_to_ksc5601_1987_0_2b_9CE5[]; /* end: U+9F9C */ +unicode_to_ksc5601_1987_0_2b_AC00[]; /* end: U+D79D */ +unicode_to_ksc5601_1987_0_2b_F900[]; /* end: U+FA0B */ +unicode_to_ksc5601_1987_0_2b_FF01[]; /* end: U+FF5E */ +unicode_to_ksc5601_1987_0_2b_FFE0[]; /* end: U+FFE6 */ +unicode_to_gb2312_1980_0_2b_00A4[]; /* end: U+01DC */ +unicode_to_gb2312_1980_0_2b_02C7[]; /* end: U+02C9 */ +unicode_to_gb2312_1980_0_2b_0391[]; /* end: U+0451 */ +unicode_to_gb2312_1980_0_2b_2015[]; /* end: U+203B */ +unicode_to_gb2312_1980_0_2b_2103[]; /* end: U+2312 */ +unicode_to_gb2312_1980_0_2b_2460[]; /* end: U+2642 */ +unicode_to_gb2312_1980_0_2b_3000[]; /* end: U+3129 */ +unicode_to_gb2312_1980_0_2b_3220[]; /* end: U+3229 */ +unicode_to_gb2312_1980_0_2b_4E00[]; /* end: U+7DAE */ +unicode_to_gb2312_1980_0_2b_7E3B[]; /* end: U+8C98 */ +unicode_to_gb2312_1980_0_2b_8D1D[]; /* end: U+8ECE */ +unicode_to_gb2312_1980_0_2b_8F66[]; /* end: U+91DC */ +unicode_to_gb2312_1980_0_2b_9274[]; /* end: U+99A8 */ +unicode_to_gb2312_1980_0_2b_9A6C[]; /* end: U+9B54 */ +unicode_to_gb2312_1980_0_2b_9C7C[]; /* end: U+9CE2 */ +unicode_to_gb2312_1980_0_2b_9E1F[]; /* end: U+9FA0 */ +unicode_to_gb2312_1980_0_2b_FF01[]; /* end: U+FF5E */ +unicode_to_gb2312_1980_0_2b_FFE0[]; /* end: U+FFE5 */ +unicode_to_jisx0201_1976_0_1b_0020[]; /* end: U+00A5 */ +unicode_to_jisx0201_1976_0_1b_203E[]; /* end: U+203E */ +unicode_to_jisx0201_1976_0_1b_FF61[]; /* end: U+FF9F */ +unicode_to_jisx0208_1983_0_2b_005C[]; /* end: U+00F7 */ +unicode_to_jisx0208_1983_0_2b_0391[]; /* end: U+0451 */ +unicode_to_jisx0208_1983_0_2b_2010[]; /* end: U+203B */ +unicode_to_jisx0208_1983_0_2b_2103[]; /* end: U+2312 */ +unicode_to_jisx0208_1983_0_2b_2500[]; /* end: U+266F */ +unicode_to_jisx0208_1983_0_2b_3000[]; /* end: U+30FE */ +unicode_to_jisx0208_1983_0_2b_4E00[]; /* end: U+7E9C */ +unicode_to_jisx0208_1983_0_2b_7F36[]; /* end: U+8B9A */ +unicode_to_jisx0208_1983_0_2b_8C37[]; /* end: U+9481 */ +unicode_to_jisx0208_1983_0_2b_9577[]; /* end: U+9FA0 */ +unicode_to_jisx0208_1983_0_2b_FF01[]; /* end: U+FF5D */ +unicode_to_jisx0208_1983_0_2b_FFE3[]; /* end: U+FFE5 */ +unicode_to_jisx0212_1990_0_2b_007E[]; /* end: U+01F5 */ +unicode_to_jisx0212_1990_0_2b_02C7[]; /* end: U+02DD */ +unicode_to_jisx0212_1990_0_2b_0384[]; /* end: U+045F */ +unicode_to_jisx0212_1990_0_2b_2116[]; /* end: U+2122 */ +unicode_to_jisx0212_1990_0_2b_4E02[]; /* end: U+7E9E */ +unicode_to_jisx0212_1990_0_2b_7F3B[]; /* end: U+8B9F */ +unicode_to_jisx0212_1990_0_2b_8C38[]; /* end: U+9484 */ +unicode_to_jisx0212_1990_0_2b_9578[]; /* end: U+9FA5 */ +unicode_to_symbol_1b_0020[]; /* end: U+00F7 */ +unicode_to_symbol_1b_0192[]; /* end: U+0192 */ +unicode_to_symbol_1b_0391[]; /* end: U+03D6 */ +unicode_to_symbol_1b_2022[]; /* end: U+232A */ +unicode_to_symbol_1b_25CA[]; /* end: U+25CA */ +unicode_to_symbol_1b_2660[]; /* end: U+2666 */ +unicode_to_symbol_1b_F6D9[]; /* end: U+F6DB */ +unicode_to_symbol_1b_F8E5[]; /* end: U+F8FE */ +unicode_to_dingbats_1b_0020[]; /* end: U+00A0 */ +unicode_to_dingbats_1b_2192[]; /* end: U+2195 */ +unicode_to_dingbats_1b_2460[]; /* end: U+2469 */ +unicode_to_dingbats_1b_25A0[]; /* end: U+2666 */ +unicode_to_dingbats_1b_2701[]; /* end: U+27BE */ +unicode_to_dingbats_1b_F8D7[]; /* end: U+F8E4 */ diff --git a/src/xutf8/imKStoUCS.c b/src/xutf8/imKStoUCS.c index aa67020f0..af82f4593 100644 --- a/src/xutf8/imKStoUCS.c +++ b/src/xutf8/imKStoUCS.c @@ -63,7 +63,7 @@ static unsigned short const keysym_to_unicode_590_5fe[] = { 0x06f0, 0x06f1, 0x06f2, 0x06f3, 0x06f4, 0x06f5, 0x06f6, 0x06f7, /* 0x0590-0x0597 */ 0x06f8, 0x06f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0598-0x059f */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x066a, 0x0670, 0x0679, /* 0x05a0-0x05a7 */ - + 0x067e, 0x0686, 0x0688, 0x0691, 0x060c, 0x0000, 0x06d4, 0x0000, /* 0x05ac-0x05af */ 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, /* 0x05b0-0x05b7 */ 0x0668, 0x0669, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f, /* 0x05b8-0x05bf */ @@ -203,7 +203,7 @@ static unsigned short keysym_to_unicode_12a1_12fe[] = { 0x0175, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1e6b, /* 0x12f0-0x12f7 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0177 /* 0x12f0-0x12ff */ }; - + static unsigned short const keysym_to_unicode_13bc_13be[] = { 0x0152, 0x0153, 0x0178 /* 0x13b8-0x13bf */ }; @@ -274,51 +274,47 @@ KeySymToUcs4(KeySym keysym) return (keysym & 0x00ffffff); if (keysym > 0 && keysym < 0x100) - return keysym; + return keysym; else if (keysym > 0x1a0 && keysym < 0x200) - return keysym_to_unicode_1a1_1ff[keysym - 0x1a1]; + return keysym_to_unicode_1a1_1ff[keysym - 0x1a1]; else if (keysym > 0x2a0 && keysym < 0x2ff) - return keysym_to_unicode_2a1_2fe[keysym - 0x2a1]; + return keysym_to_unicode_2a1_2fe[keysym - 0x2a1]; else if (keysym > 0x3a1 && keysym < 0x3ff) - return keysym_to_unicode_3a2_3fe[keysym - 0x3a2]; + return keysym_to_unicode_3a2_3fe[keysym - 0x3a2]; else if (keysym > 0x4a0 && keysym < 0x4e0) - return keysym_to_unicode_4a1_4df[keysym - 0x4a1]; + return keysym_to_unicode_4a1_4df[keysym - 0x4a1]; else if (keysym > 0x589 && keysym < 0x5ff) - return keysym_to_unicode_590_5fe[keysym - 0x590]; + return keysym_to_unicode_590_5fe[keysym - 0x590]; else if (keysym > 0x67f && keysym < 0x700) - return keysym_to_unicode_680_6ff[keysym - 0x680]; + return keysym_to_unicode_680_6ff[keysym - 0x680]; else if (keysym > 0x7a0 && keysym < 0x7fa) - return keysym_to_unicode_7a1_7f9[keysym - 0x7a1]; + return keysym_to_unicode_7a1_7f9[keysym - 0x7a1]; else if (keysym > 0x8a3 && keysym < 0x8ff) - return keysym_to_unicode_8a4_8fe[keysym - 0x8a4]; + return keysym_to_unicode_8a4_8fe[keysym - 0x8a4]; else if (keysym > 0x9de && keysym < 0x9f9) - return keysym_to_unicode_9df_9f8[keysym - 0x9df]; + return keysym_to_unicode_9df_9f8[keysym - 0x9df]; else if (keysym > 0xaa0 && keysym < 0xaff) - return keysym_to_unicode_aa1_afe[keysym - 0xaa1]; + return keysym_to_unicode_aa1_afe[keysym - 0xaa1]; else if (keysym > 0xcde && keysym < 0xcfb) - return keysym_to_unicode_cdf_cfa[keysym - 0xcdf]; + return keysym_to_unicode_cdf_cfa[keysym - 0xcdf]; else if (keysym > 0xda0 && keysym < 0xdfa) - return keysym_to_unicode_da1_df9[keysym - 0xda1]; + return keysym_to_unicode_da1_df9[keysym - 0xda1]; else if (keysym > 0xe9f && keysym < 0xf00) - return keysym_to_unicode_ea0_eff[keysym - 0xea0]; + return keysym_to_unicode_ea0_eff[keysym - 0xea0]; else if (keysym > 0x12a0 && keysym < 0x12ff) - return keysym_to_unicode_12a1_12fe[keysym - 0x12a1]; + return keysym_to_unicode_12a1_12fe[keysym - 0x12a1]; else if (keysym > 0x13bb && keysym < 0x13bf) - return keysym_to_unicode_13bc_13be[keysym - 0x13bc]; + return keysym_to_unicode_13bc_13be[keysym - 0x13bc]; else if (keysym > 0x14a0 && keysym < 0x1500) return keysym_to_unicode_14a1_14ff[keysym - 0x14a1]; else if (keysym > 0x15cf && keysym < 0x15f7) - return keysym_to_unicode_15d0_15f6[keysym - 0x15d0]; + return keysym_to_unicode_15d0_15f6[keysym - 0x15d0]; else if (keysym > 0x169f && keysym < 0x16f7) - return keysym_to_unicode_16a0_16f6[keysym - 0x16a0]; + return keysym_to_unicode_16a0_16f6[keysym - 0x16a0]; else if (keysym > 0x1e9e && keysym < 0x1f00) - return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f]; + return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f]; else if (keysym > 0x209f && keysym < 0x20ad) - return keysym_to_unicode_20a0_20ac[keysym - 0x20a0]; - else - return 0; + return keysym_to_unicode_20a0_20ac[keysym - 0x20a0]; + else + return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/is_right2left.c b/src/xutf8/is_right2left.c index 9f8e44fe4..aca6dee5e 100644 --- a/src/xutf8/is_right2left.c +++ b/src/xutf8/is_right2left.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2010 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -71,7 +70,3 @@ XUtf8IsRightToLeft(unsigned int ucs) { return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/is_spacing.c b/src/xutf8/is_spacing.c index c17dc2b60..53bab4f95 100644 --- a/src/xutf8/is_spacing.c +++ b/src/xutf8/is_spacing.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2010 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -78,7 +77,3 @@ XUtf8IsNonSpacing(unsigned int ucs) { return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/keysym2Ucs.c b/src/xutf8/keysym2Ucs.c index 7e451f890..92bd7b32f 100644 --- a/src/xutf8/keysym2Ucs.c +++ b/src/xutf8/keysym2Ucs.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include "../Xutf8.h" @@ -20,7 +19,3 @@ long XKeysymToUcs(KeySym keysym) { return (long) KeySymToUcs4(keysym); } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/lcUniConv/cp936ext.h b/src/xutf8/lcUniConv/cp936ext.h index 6c4763833..4fff93bae 100644 --- a/src/xutf8/lcUniConv/cp936ext.h +++ b/src/xutf8/lcUniConv/cp936ext.h @@ -1,6 +1,4 @@ /* - * "$Id$" - * * Character encoding support for the Fast Light Tool Kit (FLTK). * * Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #if defined(_WIN32) || defined(__APPLE__) /* PORTME: is this really needed? It's huge! */ @@ -6248,7 +6246,3 @@ cp936ext_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) #endif /* CP936 */ #endif /* _WIN32 || __APPLE__ */ /* PORTME: Unicode stuff */ - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/lcUniConv/gbk_tab_to_h.c b/src/xutf8/lcUniConv/gbk_tab_to_h.c index 0df963756..893db9d7b 100644 --- a/src/xutf8/lcUniConv/gbk_tab_to_h.c +++ b/src/xutf8/lcUniConv/gbk_tab_to_h.c @@ -1,6 +1,6 @@ /* $XFree86: xc/lib/X11/lcUniConv/cjk_tab_to_h.c,v 1.2 2000/12/04 18:49:31 dawes Exp $ */ -/* 2009-02-17 <sparkaround@gmail.com>: Create gbk_tab_to_h.c from +/* 2009-02-17 <sparkaround@gmail.com>: Create gbk_tab_to_h.c from * cjk_tab_to_h.c to generate GBK(cp936ext) table correctly. * * diff --git a/src/xutf8/lcUniConv/iso8859_9e.h b/src/xutf8/lcUniConv/iso8859_9e.h index a5a0b609c..47fda5268 100644 --- a/src/xutf8/lcUniConv/iso8859_9e.h +++ b/src/xutf8/lcUniConv/iso8859_9e.h @@ -74,7 +74,7 @@ static const unsigned char iso8859_9e_page01_d[24] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xba, /* 0xe0-0xe7 */ }; - + static int iso8859_9e_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) { diff --git a/src/xutf8/mk_wcwidth.c b/src/xutf8/mk_wcwidth.c index 086665a31..ab16ff4fa 100644 --- a/src/xutf8/mk_wcwidth.c +++ b/src/xutf8/mk_wcwidth.c @@ -204,12 +204,12 @@ int mk_wcwidth(unsigned int ucs) /* binary search in table of non-spacing characters */ if (bisearch(ucs, combining, - sizeof(combining) / sizeof(struct interval) - 1)) + sizeof(combining) / sizeof(struct interval) - 1)) return 0; /* if we arrive here, ucs is not a combining or C0/C1 control character */ - return 1 + + return 1 + (ucs >= 0x1100 && (ucs <= 0x115f || /* Hangul Jamo init. consonants */ ucs == 0x2329 || ucs == 0x232a || @@ -323,7 +323,7 @@ int mk_wcwidth_cjk(unsigned int ucs) /* binary search in table of non-spacing characters */ if (bisearch(ucs, ambiguous, - sizeof(ambiguous) / sizeof(struct interval) - 1)) + sizeof(ambiguous) / sizeof(struct interval) - 1)) return 2; return mk_wcwidth(ucs); diff --git a/src/xutf8/test.c b/src/xutf8/test.c index 6140afbc6..fe0dd6cb5 100644 --- a/src/xutf8/test.c +++ b/src/xutf8/test.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -26,13 +25,13 @@ XMODIFIERS="@im=kinput2"; export XMODIFIERS LANG=ja_JP; export LANG ./test - to open a conversion window press "Shift space" - type some keys. - press space. - select glyph with arrows keys. - press return. - press return. - press "Shift space" to close the window + to open a conversion window press "Shift space" + type some keys. + press space. + select glyph with arrows keys. + press return. + press return. + press "Shift space" to close the window LANG=ar_AE; export LANG LANG=he_IL; export LANG @@ -58,10 +57,10 @@ export LANG=C; export XMODIFIERS="@im=interxim" #include <X11/Intrinsic.h> #include <X11/Xmd.h> -char *jp_txt = "� UTF-8 e\xCC\x82=\xC3\xAA" - " \357\274\270\357\274\254\357\274\246\357\274" - "\244\345\220\215\343\201\247\346\214\207 \345\256\232" - "\343\201\231\343\202\213"; +char *jp_txt = "é UTF-8 e\xCC\x82=\xC3\xAA" + " \357\274\270\357\274\254\357\274\246\357\274" + "\244\345\220\215\343\201\247\346\214\207 \345\256\232" + "\343\201\231\343\202\213"; char *rtl_txt = "->e\xCC\x82=\xC3\xAA"; @@ -104,7 +103,7 @@ int main(int argc, char**argv) { if (!XSetLocaleModifiers("")) puts("X locale modifiers not supported, using default"); - + dpy = XOpenDisplay(0); if (!dpy) { puts("cannot open display.\n"); exit(-1); } scr = DefaultScreen(dpy); @@ -112,10 +111,10 @@ int main(int argc, char**argv) { set_attr.event_mask = KeyPressMask|FocusChangeMask; set_attr.background_pixel = WhitePixel(dpy, DefaultScreen(dpy)); set_attr.border_pixel = BlackPixel(dpy, DefaultScreen(dpy)); - w = XCreateWindow(dpy, root, 10,10,200,100,0, - DefaultDepth(dpy, DefaultScreen(dpy)), - InputOutput, DefaultVisual(dpy, DefaultScreen(dpy)), - CWEventMask | CWBackPixel | CWBorderPixel, &set_attr); + w = XCreateWindow(dpy, root, 10,10,200,100,0, + DefaultDepth(dpy, DefaultScreen(dpy)), + InputOutput, DefaultVisual(dpy, DefaultScreen(dpy)), + CWEventMask | CWBackPixel | CWBorderPixel, &set_attr); if (!w) { puts("cannot creat window.\n"); exit(-1); @@ -127,12 +126,12 @@ int main(int argc, char**argv) { wm_hints.flags = InputHint; XmbSetWMProperties(dpy, w, "test", "test", NULL, 0, - NULL, &wm_hints, &class_hints); + NULL, &wm_hints, &class_hints); XMapWindow(dpy, w); xim_im = XOpenIM(dpy, NULL, "test", "Test"); - if (!xim_im) { - puts("cannot Open Input Manager: Try default.\n"); + if (!xim_im) { + puts("cannot Open Input Manager: Try default.\n"); XSetLocaleModifiers("@im="); xim_im = XOpenIM(dpy, NULL, "test", "Test"); if (!xim_im) { @@ -151,11 +150,11 @@ int main(int argc, char**argv) { } xim_ic = XCreateIC(xim_im, - XNInputStyle, - (XIMPreeditNothing | XIMStatusNothing), - XNClientWindow, w, - XNFocusWindow, w, - NULL); + XNInputStyle, + (XIMPreeditNothing | XIMStatusNothing), + XNClientWindow, w, + XNFocusWindow, w, + NULL); if (!xim_ic) { puts("cannot create Input Context.\n"); exit(-1); @@ -164,26 +163,26 @@ int main(int argc, char**argv) { XSetICFocus(xim_ic); /*************************************************************** - * I don't recommend to use a font base name list similar - * to the following one in a real application ;-) - * You should use an iso8859-1 font, plus a single font for + * I don't recommend to use a font base name list similar + * to the following one in a real application ;-) + * You should use an iso8859-1 font, plus a single font for * your language. ***************************************************************/ - fontset = XCreateUtf8FontStruct(dpy, - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8858-3," /* not valid */ - "-*-*-medium-r-*-*-*-*-*-*-*-*-iso8859-1," - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-6," - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-8," - "-*-*-*-*-*-*-*-*-*-*-*-*-ksc5601.1987-0," - "-*-symbol-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific," - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-2," - "-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1," - "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0208.1983-0," - "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0212.1990-0," - "-*-*-*-*-*-*-*-*-*-*-*-*-big5-0," - "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0201.1976-0," - "-*-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1[0x300 0x400_0x500]," - "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"); + fontset = XCreateUtf8FontStruct(dpy, + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8858-3," /* not valid */ + "-*-*-medium-r-*-*-*-*-*-*-*-*-iso8859-1," + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-6," + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-8," + "-*-*-*-*-*-*-*-*-*-*-*-*-ksc5601.1987-0," + "-*-symbol-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific," + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-2," + "-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1," + "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0208.1983-0," + "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0212.1990-0," + "-*-*-*-*-*-*-*-*-*-*-*-*-big5-0," + "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0201.1976-0," + "-*-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1[0x300 0x400_0x500]," + "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"); /* THIS PART IS NOT REQUIERED */ nb_font = fontset->nb_font; @@ -191,10 +190,10 @@ int main(int argc, char**argv) { while (nb_font > 0) { nb_font--; if (fontset->fonts[nb_font]) { - printf("encoding=\"\" fid=%d \n %s\n", + printf("encoding=\"\" fid=%d \n %s\n", /* fontset->encodings[nb_font], */ - fontset->fonts[nb_font]->fid, - fontset->font_name_list[nb_font]); + fontset->fonts[nb_font]->fid, + fontset->font_name_list[nb_font]); } } /* END OF NOT REQUIERED PART*/ @@ -227,17 +226,17 @@ int main(int argc, char**argv) { XSetLocaleModifiers("@im="); xim_im = XOpenIM(dpy, NULL, "test", "Test"); if (xim_im) { - xim_ic = XCreateIC(xim_im, - XNInputStyle, (XIMPreeditNothing | XIMStatusNothing), - XNClientWindow, w, - XNFocusWindow, w, - NULL); + xim_ic = XCreateIC(xim_im, + XNInputStyle, (XIMPreeditNothing | XIMStatusNothing), + XNClientWindow, w, + XNFocusWindow, w, + NULL); } else { - xim_ic = NULL; + xim_ic = NULL; } if (!xim_ic) { - puts("Crash recovery failed. exiting.\n"); - exit(-1); + puts("Crash recovery failed. exiting.\n"); + exit(-1); } } if (xevent.type != DestroyNotify) { @@ -247,20 +246,20 @@ int main(int argc, char**argv) { if (xevent.type == FocusIn && xim_ic) XSetICFocus(xim_ic); if (xevent.type == KeyPress && !filtered) { - len = XUtf8LookupString(xim_ic, &xevent.xkey, - buf, 127, &keysym, &status); + len = XUtf8LookupString(xim_ic, &xevent.xkey, + buf, 127, &keysym, &status); if (len == 1 && buf[0] == '\b') { - x -= XUtf8TextWidth(fontset, buf, len); - XUtf8DrawImageString(dpy, w, fontset, gc, - x, y, buf, len); + x -= XUtf8TextWidth(fontset, buf, len); + XUtf8DrawImageString(dpy, w, fontset, gc, + x, y, buf, len); } else if (len == 1 && buf[0] == '\r') { - y += fontset->ascent + fontset->descent; - x = 0; - XCloseIM(xim_im); + y += fontset->ascent + fontset->descent; + x = 0; + XCloseIM(xim_im); } else { - XUtf8DrawImageString(dpy, w, fontset, gc, x, y, buf, len); - x += XUtf8TextWidth(fontset, buf, len); + XUtf8DrawImageString(dpy, w, fontset, gc, x, y, buf, len); + x += XUtf8TextWidth(fontset, buf, len); } XUtf8DrawString(dpy, w, fontset, gc, 0, 20, jp_txt, strlen(jp_txt)); @@ -277,7 +276,3 @@ int main(int argc, char**argv) { XFreeUtf8FontStruct(dpy, fontset); return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/test2.c b/src/xutf8/test2.c index 635578058..6dc55a862 100644 --- a/src/xutf8/test2.c +++ b/src/xutf8/test2.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -26,13 +25,13 @@ XMODIFIERS="@im=kinput2"; export XMODIFIERS LANG=ja_JP; export LANG ./test - to open a conversion window press "Shift space" - type some keys. - press space. - select glyph with arrows keys. - press return. - press return. - press "Shift space" to close the window + to open a conversion window press "Shift space" + type some keys. + press space. + select glyph with arrows keys. + press return. + press return. + press "Shift space" to close the window LANG=ar_AE; export LANG LANG=he_IL; export LANG @@ -60,10 +59,10 @@ export LD_PRELOAD="/usr/src/x11/xc/exports/lib/libX11.so /usr/src/x11/xc/exports #include <X11/Intrinsic.h> #include <X11/Xmd.h> -char *jp_txt = "� UTF-8 e\xCC\x82=\xC3\xAA" - " \357\274\270\357\274\254\357\274\246\357\274" - "\244\345\220\215\343\201\247\346\214\207 \345\256\232" - "\343\201\231\343\202\213"; +char *jp_txt = "é UTF-8 e\xCC\x82=\xC3\xAA" + " \357\274\270\357\274\254\357\274\246\357\274" + "\244\345\220\215\343\201\247\346\214\207 \345\256\232" + "\343\201\231\343\202\213"; char *rtl_txt = "->e\xCC\x82=\xC3\xAA"; @@ -102,23 +101,23 @@ int main(int argc, char**argv) { char **missing_charset_list_return; int missing_charset_count_return; char *def_string_return; - + if (!setlocale(LC_ALL, "")) puts("locale not supported by C library, locale unchanged"); if (!XSetLocaleModifiers("")) puts("X locale modifiers not supported, using default"); - + dpy = XOpenDisplay(0); scr = DefaultScreen(dpy); root = RootWindow(dpy, scr); set_attr.event_mask = KeyPressMask|FocusChangeMask; set_attr.background_pixel = WhitePixel(dpy, DefaultScreen(dpy)); set_attr.border_pixel = BlackPixel(dpy, DefaultScreen(dpy)); - w = XCreateWindow(dpy, root, 10,10,200,100,0, - DefaultDepth(dpy, DefaultScreen(dpy)), - InputOutput, DefaultVisual(dpy, DefaultScreen(dpy)), - CWEventMask | CWBackPixel | CWBorderPixel, &set_attr); + w = XCreateWindow(dpy, root, 10,10,200,100,0, + DefaultDepth(dpy, DefaultScreen(dpy)), + InputOutput, DefaultVisual(dpy, DefaultScreen(dpy)), + CWEventMask | CWBackPixel | CWBorderPixel, &set_attr); class_hints.res_name = "test"; class_hints.res_class = "Test"; @@ -126,7 +125,7 @@ int main(int argc, char**argv) { wm_hints.flags = InputHint; XmbSetWMProperties(dpy, w, "test", "test", NULL, 0, - NULL, &wm_hints, &class_hints); + NULL, &wm_hints, &class_hints); XMapWindow(dpy, w); xim_im = XOpenIM(dpy, NULL, "test", "Test"); @@ -142,33 +141,33 @@ int main(int argc, char**argv) { XFree(xim_styles); xim_ic = XCreateIC(xim_im, - XNInputStyle, (XIMPreeditNothing | XIMStatusNothing), - XNClientWindow, w, - XNFocusWindow, w, - NULL); + XNInputStyle, (XIMPreeditNothing | XIMStatusNothing), + XNClientWindow, w, + XNFocusWindow, w, + NULL); XSetICFocus(xim_ic); /*************************************************************** - * I don't recommend to use a font base name list similar + * I don't recommend to use a font base name list similar * to the following one in a real application ;-) ***************************************************************/ - fontset = XCreateFontSet(dpy, - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8858-3," /* not valid */ - "-*-*-medium-r-*-*-*-*-*-*-*-*-iso8859-1," - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-6," - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-8," - "-*-symbol-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific," - "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-2," - "-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1," - "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0208.1983-0," - "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0212.1990-0," - "-*-*-*-*-*-*-*-*-*-*-*-*-big5-0," - "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0201.1976-0," - "-*-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1[0x300 0x400_0x500]," - "-*-*-*-*-*-*-*-*-*-*-*-*-*-*", - &missing_charset_list_return, - &missing_charset_count_return, - &def_string_return); + fontset = XCreateFontSet(dpy, + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8858-3," /* not valid */ + "-*-*-medium-r-*-*-*-*-*-*-*-*-iso8859-1," + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-6," + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-8," + "-*-symbol-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific," + "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-2," + "-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1," + "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0208.1983-0," + "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0212.1990-0," + "-*-*-*-*-*-*-*-*-*-*-*-*-big5-0," + "-*-*-*-*-*-*-*-*-*-*-*-*-jisx0201.1976-0," + "-*-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1[0x300 0x400_0x500]," + "-*-*-*-*-*-*-*-*-*-*-*-*-*-*", + &missing_charset_list_return, + &missing_charset_count_return, + &def_string_return); mask = (GCForeground | GCBackground); xgcv.foreground = BlackPixel(dpy, DefaultScreen(dpy)); xgcv.background = WhitePixel(dpy, DefaultScreen(dpy)); @@ -192,7 +191,7 @@ int main(int argc, char**argv) { if (xevent.type == FocusIn) XSetICFocus(xim_ic); if (xevent.type == KeyPress && !filtered) { - len = Xutf8LookupString(xim_ic, &xevent.xkey, buf, 127, &keysym, &status); + len = Xutf8LookupString(xim_ic, &xevent.xkey, buf, 127, &keysym, &status); Xutf8DrawImageString(dpy, w, fontset, gc, x, y, buf, len); Xutf8DrawString(dpy, w, fontset, gc, 0, 20, jp_txt, strlen(jp_txt)); Xutf8DrawString(dpy, w, fontset, gc, 50, 90, rtl_txt, strlen(rtl_txt)); @@ -208,7 +207,3 @@ int main(int argc, char**argv) { XFreeFontSet(dpy, fontset); return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/ucs2fontmap.c b/src/xutf8/ucs2fontmap.c index 2cbfd3983..50f85e551 100644 --- a/src/xutf8/ucs2fontmap.c +++ b/src/xutf8/ucs2fontmap.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include <stdlib.h> @@ -53,17 +52,17 @@ typedef struct { #include "lcUniConv/cp1251.h" #include "headers/symbol_.h" #include "headers/dingbats_.h" - + /*************** conv_gen.c ************/ /*const*/ static int ucs2fontmap(char *s, unsigned int ucs, int enc) { switch(enc) { - case 0: /* iso10646-1 */ + case 0: /* iso10646-1 */ s[0] = (char) ((ucs & 0xFF00) >> 8); s[1] = (char) (ucs & 0xFF); return 0; - case 1: /* iso8859-1 */ + case 1: /* iso8859-1 */ if (ucs <= 0x00FF) { if (ucs >= 0x0001) { s[0] = 0; @@ -72,15 +71,15 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) { } } break; - case 2: /* iso8859-2 */ + case 2: /* iso8859-2 */ if (ucs <= 0x00a0) { s[0] = 0; s[1] = (char) ucs; return 2; } else if (ucs < 0x0180) { if (ucs >= 0x00a0) { - s[0] = 0; - s[1] = (char) iso8859_2_page00[ucs-0x00a0]; + s[0] = 0; + s[1] = (char) iso8859_2_page00[ucs-0x00a0]; if (s[1]) return 2; } } else if (ucs < 0x02e0) { @@ -88,105 +87,105 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) { s[0] = 0; s[1] = (char) iso8859_2_page02[ucs-0x02c0]; if (s[1]) return 2; - } + } } break; - case 3: /* iso8859-3 */ + case 3: /* iso8859-3 */ if (iso8859_3_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 3; - } + } break; - case 4: /* iso8859-4 */ + case 4: /* iso8859-4 */ if (iso8859_4_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 4; - } + } break; - case 5: /* iso8859-5 */ + case 5: /* iso8859-5 */ if (iso8859_5_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 5; - } + } break; - case 6: /* iso8859-6 */ + case 6: /* iso8859-6 */ if (iso8859_6_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 6; - } + } break; - case 7: /* iso8859-7 */ + case 7: /* iso8859-7 */ if (iso8859_7_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 7; - } + } break; - case 8: /* iso8859-8 */ + case 8: /* iso8859-8 */ if (iso8859_8_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 8; - } + } break; - case 9: /* iso8859-9 */ + case 9: /* iso8859-9 */ if (iso8859_9_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 9; - } + } break; - case 10: /* iso8859-10 */ + case 10: /* iso8859-10 */ if (iso8859_10_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 10; - } + } break; - case 25: /* iso8859-11 */ + case 25: /* iso8859-11 */ if (iso8859_11_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 25; - } + } break; - case 11: /* iso8859-13 */ + case 11: /* iso8859-13 */ if (iso8859_13_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 11; - } + } break; - case 12: /* iso8859-14 */ + case 12: /* iso8859-14 */ if (iso8859_14_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 12; - } + } break; - case 13: /* iso8859-15 */ + case 13: /* iso8859-15 */ if (iso8859_15_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 13; - } + } break; - case 14: /* koi8-r */ + case 14: /* koi8-r */ if (koi8_r_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 14; - } + } break; - case 15: /* big5 */ + case 15: /* big5 */ if (big5_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 15; - } + } break; - case 16: /* ksc5601.1987-0 */ + case 16: /* ksc5601.1987-0 */ if (ksc5601_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 16; - } + } break; - case 17: /* gb2312.1980-0 */ + case 17: /* gb2312.1980-0 */ if (gb2312_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 17; - } + } break; - case 18: /* jisx0201.1976-0 */ + case 18: /* jisx0201.1976-0 */ if (jisx0201_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 18; - } + } break; - case 19: /* jisx0208.1983-0 */ + case 19: /* jisx0208.1983-0 */ if (jisx0208_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 19; - } + } break; - case 20: /* jisx0212.1990-0 */ + case 20: /* jisx0212.1990-0 */ if (jisx0212_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 20; - } + } break; - case 21: /* symbol */ + case 21: /* symbol */ if (ucs <= 0x00F7) { if (ucs >= 0x0020) { s[0] = 0; @@ -237,7 +236,7 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) { } } break; - case 22: /* dingbats */ + case 22: /* dingbats */ if (ucs <= 0x00A0) { if (ucs >= 0x0020) { s[0] = 0; @@ -276,15 +275,15 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) { } } break; - case 23: /* koi8-u */ + case 23: /* koi8-u */ if (koi8_u_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 23; - } + } break; - case 24: /* microsoft-cp1251 */ + case 24: /* microsoft-cp1251 */ if (cp1251_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { return 24; - } + } break; case 26: /* gbk/cp936ext */ if (cp936ext_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) { @@ -330,27 +329,27 @@ static int encoding_number(const char *enc) { } else if (!strcmp(enc, "koi8-r")) { return 14; } else if (!strcmp(enc, "big5-0") || !strcmp(enc, "big5.eten-0") || - !strcmp(enc, "big5p-0")) + !strcmp(enc, "big5p-0")) { return 15; } else if (!strcmp(enc, "ksc5601.1987-0")) { return 16; - } else if (!strcmp(enc, "gb2312.1980-0") || !strcmp(enc, "gb2312.80-0") || - !strcmp(enc, "gb2312.80&gb8565.88") || !strcmp(enc, "gb2312.80-0")) + } else if (!strcmp(enc, "gb2312.1980-0") || !strcmp(enc, "gb2312.80-0") || + !strcmp(enc, "gb2312.80&gb8565.88") || !strcmp(enc, "gb2312.80-0")) { return 17; } else if (!strcmp(enc, "jisx0201.1976-0")) { return 18; } else if (!strcmp(enc, "jisx0208.1983-0") || !strcmp(enc, "jisx0208.1990-0") - || !strcmp(enc, "jisx0208.1978-0")) + || !strcmp(enc, "jisx0208.1978-0")) { return 19; } else if (!strcmp(enc, "jisx0212.1990-0")) { return 20; } else if (!strcmp(enc, "symbol")) { return 21; - } else if (!strcmp(enc, "dingbats") || !strcmp(enc, "zapfdingbats") || - !strcmp(enc, "zapf dingbats") || !strcmp(enc, "itc zapf dingbats")) + } else if (!strcmp(enc, "dingbats") || !strcmp(enc, "zapfdingbats") || + !strcmp(enc, "zapf dingbats") || !strcmp(enc, "itc zapf dingbats")) { return 22; } else if (!strcmp(enc, "koi8-u")) { @@ -364,7 +363,3 @@ static int encoding_number(const char *enc) { }; return -1; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/ucs2fontmap.c.mini b/src/xutf8/ucs2fontmap.c.mini index bd94f3f92..89ed7a8b0 100644 --- a/src/xutf8/ucs2fontmap.c.mini +++ b/src/xutf8/ucs2fontmap.c.mini @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ int ucs2fontmap(char *s, unsigned long ucs, int enc) @@ -31,7 +30,3 @@ const char *encoding_name(int num) { return "iso10646-1"; }; - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utf8Input.c b/src/xutf8/utf8Input.c index 231553b5d..e270adfb5 100644 --- a/src/xutf8/utf8Input.c +++ b/src/xutf8/utf8Input.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include <config.h> @@ -75,18 +74,18 @@ XConvertEucTwToUtf8(char* buffer_return, int len) { cd = iconv_open("EUC-TW", "UTF-8"); iconv(cd, &b, &len, &buffer_return, &cdl); iconv_close(cd); - l -= cdl; + l -= cdl; #else while (i < len) { unsigned int ucs; - unsigned char c; + unsigned char c; c = (unsigned char) buf[i]; if (c < 0x80) { - ucs = c; + ucs = c; i++; } else if (c >= 0xa1 && c < 0xff && len - i > 1 ) { -#if 0 +#if 0 unsigned char b[2]; b[0] = (unsigned char) c - 0x80; b[1] = (unsigned char) buf[i + 1] - 0x80; @@ -102,13 +101,13 @@ XConvertEucTwToUtf8(char* buffer_return, int len) { b[1] = (unsigned char) buf[i + 3] - 0x80; #endif if (c1 >= 0xa1 && c1 <= 0xb0) { - if (c2 >= 0xa1 && c2 < 0xff && c3 >= 0xa1 && c3 < 0xff) { - ucs = ' '; i += 4; - } else { - ucs = '?'; i++; - } + if (c2 >= 0xa1 && c2 < 0xff && c3 >= 0xa1 && c3 < 0xff) { + ucs = ' '; i += 4; + } else { + ucs = '?'; i++; + } } else { - ucs = '?'; i++; + ucs = '?'; i++; } } else { ucs = '?'; @@ -136,19 +135,19 @@ XConvertEucKrToUtf8(char* buffer_return, int len) { unsigned char c, c1; c = (unsigned char) buf[i]; if (c < 0x80) { - ucs = c; + ucs = c; i++; } else if (c >= 0xA1 && c < 0xFF && len - i > 1) { c1 = (unsigned char) buf[i + 1]; if (c1 >= 0xa1 && c1 < 0xff) { - unsigned char b[2]; - b[0] = c - 0x80; - b[1] = c1 - 0x80; - if (ksc5601_mbtowc(NULL, &ucs, b, 2) < 1) { - ucs = '?'; - } + unsigned char b[2]; + b[0] = c - 0x80; + b[1] = c1 - 0x80; + if (ksc5601_mbtowc(NULL, &ucs, b, 2) < 1) { + ucs = '?'; + } } else { - ucs = '?'; + ucs = '?'; } i += 2; } else { @@ -201,26 +200,26 @@ XConvertCp936extToUtf8(char* buffer_return, int len) memcpy(buf, buffer_return, (unsigned)len); if (len == 1) { - l += XConvertUcsToUtf8((unsigned int)buf[i], buffer_return + l); + l += XConvertUcsToUtf8((unsigned int)buf[i], buffer_return + l); } while (i + 1 < len) { - unsigned int ucs; - unsigned char b[2]; - b[0] = (unsigned char) buf[i]; - b[1] = (unsigned char) buf[i + 1]; - if (cp936ext_mbtowc(NULL, &ucs, b, 2) == 2) { - i += 2; - } else { - if ( b[0] < 0x80) { - ucs = b[0]; - }else{ - ucs = '?'; - } - i++; - } - l += XConvertUcsToUtf8(ucs, buffer_return + l); + unsigned int ucs; + unsigned char b[2]; + b[0] = (unsigned char) buf[i]; + b[1] = (unsigned char) buf[i + 1]; + if (cp936ext_mbtowc(NULL, &ucs, b, 2) == 2) { + i += 2; + } else { + if ( b[0] < 0x80) { + ucs = b[0]; + }else{ + ucs = '?'; + } + i++; + } + l += XConvertUcsToUtf8(ucs, buffer_return + l); } - if(i + 1 == len) { + if(i + 1 == len) { l += XConvertUcsToUtf8((unsigned int)buf[i], buffer_return + l); } free(buf); @@ -276,19 +275,19 @@ XConvertEucCnToUtf8(char* buffer_return, int len) { unsigned char c, c1; c = (unsigned char) buf[i]; if (c < 0x80) { - ucs = c; + ucs = c; i++; } else if (c >= 0xA1 && c < 0xFF && len - i > 1) { c1 = (unsigned char) buf[i + 1]; - if (c1 >= 0xa1 && c1 < 0xff) { - unsigned char b[2]; - b[0] = (unsigned char) c; - b[1] = (unsigned char) c1; - if (gb2312_mbtowc(NULL, &ucs, b, 2) < 1) { - ucs = '?'; - } + if (c1 >= 0xa1 && c1 < 0xff) { + unsigned char b[2]; + b[0] = (unsigned char) c; + b[1] = (unsigned char) c1; + if (gb2312_mbtowc(NULL, &ucs, b, 2) < 1) { + ucs = '?'; + } } else { - ucs = '?'; + ucs = '?'; } i += 2; } else { @@ -315,53 +314,53 @@ XConvertEucJpToUtf8(char* buffer_return, int len) { unsigned char c, c1; c = (unsigned char) buf[i]; if (c < 0x80) { - ucs = c; + ucs = c; i++; } else if (c >= 0xA1 && c < 0xFF && len - i > 1) { - c1 = (unsigned char) buf[i + 1]; + c1 = (unsigned char) buf[i + 1]; if (c < 0xF5 && c1 >= 0xa1) { - unsigned char b[2]; - b[0] = c - 0x80; - b[1] = c1 - 0x80; - if (jisx0208_mbtowc(NULL, &ucs, b, 2) < 1) { - ucs = '?'; - } + unsigned char b[2]; + b[0] = c - 0x80; + b[1] = c1 - 0x80; + if (jisx0208_mbtowc(NULL, &ucs, b, 2) < 1) { + ucs = '?'; + } } else if (c1 >= 0xA1 && c1 < 0xFF) { - ucs = 0xE000 + 94 * (c - 0xF5) + (c1 - 0xA1); + ucs = 0xE000 + 94 * (c - 0xF5) + (c1 - 0xA1); } else { - ucs = '?'; + ucs = '?'; } i += 2; } else if (c == 0x8E && len - i > 1) { - c1 = (unsigned char) buf[i + 1]; + c1 = (unsigned char) buf[i + 1]; if (c1 >= 0xa1 && c1 <= 0xe0) { - if (jisx0201_mbtowc(NULL, &ucs, &c1, 1) != 1) { - ucs = '?'; - } + if (jisx0201_mbtowc(NULL, &ucs, &c1, 1) != 1) { + ucs = '?'; + } } else { - ucs = '?'; + ucs = '?'; } i += 2; } else if (c == 0x8F && len - i > 2) { - c = (unsigned char) buf[i + 1]; - c1 = (unsigned char) buf[i + 2]; + c = (unsigned char) buf[i + 1]; + c1 = (unsigned char) buf[i + 2]; if (c >= 0xa1 && c < 0xff) { - if (c < 0xf5 && c1 >= 0xa1 && c1 < 0xff) { - unsigned char b[2]; - b[0] = c - 0x80; - b[1] = c1 - 0x80; - if (jisx0212_mbtowc(NULL, &ucs, b, 2) < 1) { - ucs = '?'; - } - } else { - ucs = '?'; - } + if (c < 0xf5 && c1 >= 0xa1 && c1 < 0xff) { + unsigned char b[2]; + b[0] = c - 0x80; + b[1] = c1 - 0x80; + if (jisx0212_mbtowc(NULL, &ucs, b, 2) < 1) { + ucs = '?'; + } + } else { + ucs = '?'; + } } else { - if (c1 >= 0xa1 && c1 < 0xff) { - ucs = 0xe3ac + 94 * (c - 0xF5) + (c1 - 0xA1); - } else { - ucs = '?'; - } + if (c1 >= 0xa1 && c1 < 0xff) { + ucs = 0xe3ac + 94 * (c - 0xF5) + (c1 - 0xA1); + } else { + ucs = '?'; + } } i += 3; } else { @@ -375,10 +374,10 @@ XConvertEucJpToUtf8(char* buffer_return, int len) { } static int -XConvertEucToUtf8(const char* locale, - char* buffer_return, - int len, - int bytes_buffer) { +XConvertEucToUtf8(const char* locale, + char* buffer_return, + int len, + int bytes_buffer) { /* if (!locale) { */ /* if (!locale || strstr(locale, "UTF") || strstr(locale, "utf")) { */ @@ -386,7 +385,7 @@ XConvertEucToUtf8(const char* locale, return len; } - if (strstr(locale, "ja")) { + if (strstr(locale, "ja")) { return XConvertEucJpToUtf8(buffer_return, len); } else if (strstr(locale, "Big5") || strstr(locale, "big5")) { /* BIG5 */ return XConvertBig5ToUtf8(buffer_return, len); @@ -395,7 +394,7 @@ XConvertEucToUtf8(const char* locale, } else if (strstr(locale, "zh") || strstr(locale, "chinese-")) { if (strstr(locale, "TW") || strstr(locale, "chinese-t")) { if (strstr(locale, "EUC") || strstr(locale, "euc") || strstr(locale, "chinese-t")) { - return XConvertEucTwToUtf8(buffer_return, len); + return XConvertEucTwToUtf8(buffer_return, len); } return XConvertBig5ToUtf8(buffer_return, len); } @@ -403,7 +402,7 @@ XConvertEucToUtf8(const char* locale, return XConvertEucCnToUtf8(buffer_return, len); } return XConvertGb2312ToUtf8(buffer_return, len); - } else if (strstr(locale, "ko")) { + } else if (strstr(locale, "ko")) { return XConvertEucKrToUtf8(buffer_return, len); } return len; @@ -411,16 +410,16 @@ XConvertEucToUtf8(const char* locale, int XUtf8LookupString(XIC ic, - XKeyPressedEvent* event, - char* buffer_return, - int bytes_buffer, - KeySym* keysym, - Status* status_return) { + XKeyPressedEvent* event, + char* buffer_return, + int bytes_buffer, + KeySym* keysym, + Status* status_return) { long ucs = -1; int len; len = XmbLookupString(ic, event, buffer_return, bytes_buffer / 5, - keysym, status_return); + keysym, status_return); if (*status_return == XBufferOverflow) { return len * 5; } @@ -431,7 +430,7 @@ XUtf8LookupString(XIC ic, ucs = (long)*keysym; } } else if (((*keysym >= 0x100 && *keysym <= 0xf000) || - (*keysym & 0xff000000U) == 0x01000000)) + (*keysym & 0xff000000U) == 0x01000000)) { ucs = XKeysymToUcs(*keysym); } else { @@ -445,14 +444,10 @@ XUtf8LookupString(XIC ic, if (!ic) return 0; im = XIMOfIC(ic); if (!im) return 0; - len = XConvertEucToUtf8(XLocaleOfIM(im), buffer_return, len, bytes_buffer); + len = XConvertEucToUtf8(XLocaleOfIM(im), buffer_return, len, bytes_buffer); } return len; } #endif /* X11 has UTF-8 */ #endif /* X11 only */ - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utf8Utils.c b/src/xutf8/utf8Utils.c index ad2bc83ff..846846c93 100644 --- a/src/xutf8/utf8Utils.c +++ b/src/xutf8/utf8Utils.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -24,84 +23,84 @@ /*** NOTE : all functions are LIMITED to 24 bits Unicode values !!! ***/ -/* - * Converts the first char of the UTF-8 string to an Unicode value - * Returns the byte length of the converted UTF-8 char - * Returns -1 if the UTF-8 string is not valid +/* + * Converts the first char of the UTF-8 string to an Unicode value + * Returns the byte length of the converted UTF-8 char + * Returns -1 if the UTF-8 string is not valid */ int XConvertUtf8ToUcs(const unsigned char *buf, - int len, - unsigned int *ucs) { + int len, + unsigned int *ucs) { if (buf[0] & 0x80) { if (buf[0] & 0x40) { if (buf[0] & 0x20) { - if (buf[0] & 0x10) { - if (buf[0] & 0x08) { - if (buf[0] & 0x04) { - if (buf[0] & 0x02) { - /* bad UTF-8 string */ - } else { - /* 0x04000000 - 0x7FFFFFFF */ - } - } else if (len > 4 - && (buf[1] & 0xC0) == 0x80 - && (buf[2] & 0xC0) == 0x80 - && (buf[3] & 0xC0) == 0x80 - && (buf[4] & 0xC0) == 0x80) { - /* 0x00200000 - 0x03FFFFFF */ - *ucs = ((buf[0] & ~0xF8) << 24) + - ((buf[1] & ~0x80) << 18) + - ((buf[2] & ~0x80) << 12) + - ((buf[3] & ~0x80) << 6) + - (buf[4] & ~0x80); - if (*ucs > 0x001FFFFF && *ucs < 0x01000000) return 5; - } - } else if (len > 3 - && (buf[1] & 0xC0) == 0x80 - && (buf[2] & 0xC0) == 0x80 - && (buf[3] & 0xC0) == 0x80) { - /* 0x00010000 - 0x001FFFFF */ - *ucs = ((buf[0] & ~0xF0) << 18) + - ((buf[1] & ~0x80) << 12) + - ((buf[2] & ~0x80) << 6) + - (buf[3] & ~0x80); - if (*ucs > 0x0000FFFF) return 4; - } - } else if (len > 2 - && (buf[1] & 0xC0) == 0x80 - && (buf[2] & 0xC0) == 0x80) { - /* 0x00000800 - 0x0000FFFF */ - *ucs = ((buf[0] & ~0xE0) << 12) + - ((buf[1] & ~0x80) << 6) + - (buf[2] & ~0x80); - if (*ucs > 0x000007FF) return 3; - } + if (buf[0] & 0x10) { + if (buf[0] & 0x08) { + if (buf[0] & 0x04) { + if (buf[0] & 0x02) { + /* bad UTF-8 string */ + } else { + /* 0x04000000 - 0x7FFFFFFF */ + } + } else if (len > 4 + && (buf[1] & 0xC0) == 0x80 + && (buf[2] & 0xC0) == 0x80 + && (buf[3] & 0xC0) == 0x80 + && (buf[4] & 0xC0) == 0x80) { + /* 0x00200000 - 0x03FFFFFF */ + *ucs = ((buf[0] & ~0xF8) << 24) + + ((buf[1] & ~0x80) << 18) + + ((buf[2] & ~0x80) << 12) + + ((buf[3] & ~0x80) << 6) + + (buf[4] & ~0x80); + if (*ucs > 0x001FFFFF && *ucs < 0x01000000) return 5; + } + } else if (len > 3 + && (buf[1] & 0xC0) == 0x80 + && (buf[2] & 0xC0) == 0x80 + && (buf[3] & 0xC0) == 0x80) { + /* 0x00010000 - 0x001FFFFF */ + *ucs = ((buf[0] & ~0xF0) << 18) + + ((buf[1] & ~0x80) << 12) + + ((buf[2] & ~0x80) << 6) + + (buf[3] & ~0x80); + if (*ucs > 0x0000FFFF) return 4; + } + } else if (len > 2 + && (buf[1] & 0xC0) == 0x80 + && (buf[2] & 0xC0) == 0x80) { + /* 0x00000800 - 0x0000FFFF */ + *ucs = ((buf[0] & ~0xE0) << 12) + + ((buf[1] & ~0x80) << 6) + + (buf[2] & ~0x80); + if (*ucs > 0x000007FF) return 3; + } } else if (len > 1 && (buf[1] & 0xC0) == 0x80) { - /* 0x00000080 - 0x000007FF */ - *ucs = ((buf[0] & ~0xC0) << 6) + - (buf[1] & ~0x80); - if (*ucs > 0x0000007F) return 2; + /* 0x00000080 - 0x000007FF */ + *ucs = ((buf[0] & ~0xC0) << 6) + + (buf[1] & ~0x80); + if (*ucs > 0x0000007F) return 2; } } } else if (len > 0) { /* 0x00000000 - 0x0000007F */ *ucs = buf[0]; return 1; - } + } *ucs = (unsigned int) '?'; /* bad UTF-8 string */ return -1; } -/* - * Converts an Unicode value to an UTF-8 string - * NOTE : the buffer (buf) must be at least 5 bytes long !!! +/* + * Converts an Unicode value to an UTF-8 string + * NOTE : the buffer (buf) must be at least 5 bytes long !!! */ -int -XConvertUcsToUtf8(unsigned int ucs, - char *buf) { +int +XConvertUcsToUtf8(unsigned int ucs, + char *buf) { if (ucs < 0x000080) { buf[0] = ucs; @@ -110,7 +109,7 @@ XConvertUcsToUtf8(unsigned int ucs, buf[0] = 0xC0 | (ucs >> 6); buf[1] = 0x80 | (ucs & 0x3F); return 2; - } else if (ucs < 0x010000) { + } else if (ucs < 0x010000) { buf[0] = 0xE0 | (ucs >> 12); buf[1] = 0x80 | ((ucs >> 6) & 0x3F); buf[2] = 0x80 | (ucs & 0x3F); @@ -133,23 +132,23 @@ XConvertUcsToUtf8(unsigned int ucs, return -1; } -/* - * returns the byte length of the first UTF-8 char - * (returns -1 if not valid) +/* + * returns the byte length of the first UTF-8 char + * (returns -1 if not valid) */ int XUtf8CharByteLen(const unsigned char *buf, - int len) { + int len) { unsigned int ucs; return XConvertUtf8ToUcs(buf, len, &ucs); } /* - * returns the quantity of Unicode chars in the UTF-8 string + * returns the quantity of Unicode chars in the UTF-8 string */ -int -XCountUtf8Char(const unsigned char *buf, - int len) { +int +XCountUtf8Char(const unsigned char *buf, + int len) { int i = 0; int nbc = 0; @@ -162,66 +161,62 @@ XCountUtf8Char(const unsigned char *buf, return nbc; } -/* +/* * Same as XConvertUtf8ToUcs but no sanity check is done. */ int XFastConvertUtf8ToUcs(const unsigned char *buf, - int len, - unsigned int *ucs) { + int len, + unsigned int *ucs) { if (buf[0] & 0x80) { if (buf[0] & 0x40) { if (buf[0] & 0x20) { - if (buf[0] & 0x10) { - if (buf[0] & 0x08) { - if (buf[0] & 0x04) { - if (buf[0] & 0x02) { - /* bad UTF-8 string */ - } else { - /* 0x04000000 - 0x7FFFFFFF */ - } - } else if (len > 4) { - /* 0x00200000 - 0x03FFFFFF */ - *ucs = ((buf[0] & ~0xF8) << 24) + - ((buf[1] & ~0x80) << 18) + - ((buf[2] & ~0x80) << 12) + - ((buf[3] & ~0x80) << 6) + - (buf[4] & ~0x80); - return 5; - } - } else if (len > 3) { - /* 0x00010000 - 0x001FFFFF */ - *ucs = ((buf[0] & ~0xF0) << 18) + - ((buf[1] & ~0x80) << 12) + - ((buf[2] & ~0x80) << 6) + - (buf[3] & ~0x80); - return 4; - } - } else if (len > 2) { - /* 0x00000800 - 0x0000FFFF */ - *ucs = ((buf[0] & ~0xE0) << 12) + - ((buf[1] & ~0x80) << 6) + - (buf[2] & ~0x80); - return 3; - } + if (buf[0] & 0x10) { + if (buf[0] & 0x08) { + if (buf[0] & 0x04) { + if (buf[0] & 0x02) { + /* bad UTF-8 string */ + } else { + /* 0x04000000 - 0x7FFFFFFF */ + } + } else if (len > 4) { + /* 0x00200000 - 0x03FFFFFF */ + *ucs = ((buf[0] & ~0xF8) << 24) + + ((buf[1] & ~0x80) << 18) + + ((buf[2] & ~0x80) << 12) + + ((buf[3] & ~0x80) << 6) + + (buf[4] & ~0x80); + return 5; + } + } else if (len > 3) { + /* 0x00010000 - 0x001FFFFF */ + *ucs = ((buf[0] & ~0xF0) << 18) + + ((buf[1] & ~0x80) << 12) + + ((buf[2] & ~0x80) << 6) + + (buf[3] & ~0x80); + return 4; + } + } else if (len > 2) { + /* 0x00000800 - 0x0000FFFF */ + *ucs = ((buf[0] & ~0xE0) << 12) + + ((buf[1] & ~0x80) << 6) + + (buf[2] & ~0x80); + return 3; + } } else if (len > 1) { - /* 0x00000080 - 0x000007FF */ - *ucs = ((buf[0] & ~0xC0) << 6) + - (buf[1] & ~0x80); - return 2; + /* 0x00000080 - 0x000007FF */ + *ucs = ((buf[0] & ~0xC0) << 6) + + (buf[1] & ~0x80); + return 2; } } } else if (len > 0) { /* 0x00000000 - 0x0000007F */ *ucs = buf[0]; return 1; - } + } *ucs = (unsigned int) '?'; /* bad UTF-8 string */ return -1; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utf8Wrap.c b/src/xutf8/utf8Wrap.c index 612c822f3..e26aef15f 100644 --- a/src/xutf8/utf8Wrap.c +++ b/src/xutf8/utf8Wrap.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -58,8 +57,8 @@ Fl_XChar2b; /*********************************************************************/ static int get_font_list( - const char *base_font_name_list, - char ***flist) { + const char *base_font_name_list, + char ***flist) { const char *ptr; const char *p; int nb; @@ -101,7 +100,7 @@ get_font_list( /*********************************************************************/ /** get the font name used as encoding for "fontspecific" encoding **/ -/** (mainly used for adobe-symbol and adobe-zapfdingbats) **/ +/** (mainly used for adobe-symbol and adobe-zapfdingbats) **/ /*********************************************************************/ static int font_spec_enc(char *font) { @@ -126,12 +125,12 @@ font_spec_enc(char *font) { /*********************************************************************/ -/** get the sub range of a iso10646-1 font **/ +/** get the sub range of a iso10646-1 font **/ /*********************************************************************/ static void -get_range(const char *enc, - int *min, - int *max) { +get_range(const char *enc, + int *min, + int *max) { const char *ptr = enc; const char *ptr1; @@ -156,12 +155,12 @@ get_range(const char *enc, } /*********************************************************************/ -/** get the internal encoding number of each fonts **/ +/** get the internal encoding number of each fonts **/ /*********************************************************************/ static int * -get_encodings(char **font_name_list, - int *ranges, - int nb_font) { +get_encodings(char **font_name_list, + int *ranges, + int nb_font) { int *font_encoding_list; int i; @@ -183,16 +182,16 @@ get_encodings(char **font_name_list, } while (ptr && *ptr) { if (*ptr == '-') { - ec++; - if (ec == 13) { - font_encoding_list[i] = encoding_number(ptr + 1); - if (font_encoding_list[i] == 0) { - get_range(ptr + 1, - ranges + i * 2, - ranges + i * 2 + 1); - } - break; - } + ec++; + if (ec == 13) { + font_encoding_list[i] = encoding_number(ptr + 1); + if (font_encoding_list[i] == 0) { + get_range(ptr + 1, + ranges + i * 2, + ranges + i * 2 + 1); + } + break; + } } ptr++; } @@ -203,11 +202,11 @@ get_encodings(char **font_name_list, } /*********************************************************************/ -/** find the first font which matches the name and load it. **/ +/** find the first font which matches the name and load it. **/ /*********************************************************************/ static XFontStruct * find_best_font(Display *dpy, - char **name) { + char **name) { char **list; int cnt; @@ -225,11 +224,11 @@ find_best_font(Display *dpy, } /*********************************************************************/ -/** load all fonts **/ +/** load all fonts **/ /*********************************************************************/ static void -load_fonts(Display *dpy, - XUtf8FontStruct *font_set) { +load_fonts(Display *dpy, + XUtf8FontStruct *font_set) { int i = 0; @@ -251,10 +250,10 @@ load_fonts(Display *dpy, if (fnt) { font_set->fid = fnt->fid; if (fnt->ascent > font_set->ascent) { - font_set->ascent = fnt->ascent; + font_set->ascent = fnt->ascent; } if (fnt->descent > font_set->descent) { - font_set->descent = fnt->descent; + font_set->descent = fnt->descent; } } else { free(font_set->font_name_list[i]); @@ -272,18 +271,18 @@ load_fonts(Display *dpy, if (font_set->font_name_list[i]) { int j; for (j = 0; j < i; j++) { - if (font_set->font_name_list[j] && - font_set->encodings[j] == - font_set->encodings[i] && - font_set->ranges[2*j] == - font_set->ranges[2*i] && - font_set->ranges[(2*j)+1] && - font_set->ranges[(2*i)+1]) { - XFreeFont(dpy, font_set->fonts[i]); - free(font_set->font_name_list[i]); - font_set->font_name_list[i] = NULL; - font_set->fonts[i] = 0; - } + if (font_set->font_name_list[j] && + font_set->encodings[j] == + font_set->encodings[i] && + font_set->ranges[2*j] == + font_set->ranges[2*i] && + font_set->ranges[(2*j)+1] && + font_set->ranges[(2*i)+1]) { + XFreeFont(dpy, font_set->fonts[i]); + free(font_set->font_name_list[i]); + font_set->font_name_list[i] = NULL; + font_set->fonts[i] = 0; + } } } } @@ -291,11 +290,11 @@ load_fonts(Display *dpy, /*********************************************************************/ /** Creates an array of XFontStruct acording to the comma separated **/ -/** list of fonts. XLoad all fonts. **/ +/** list of fonts. XLoad all fonts. **/ /*********************************************************************/ XUtf8FontStruct * XCreateUtf8FontStruct(Display *dpy, - const char *base_font_name_list) { + const char *base_font_name_list) { XUtf8FontStruct *font_set; @@ -306,7 +305,7 @@ XCreateUtf8FontStruct(Display *dpy, } font_set->nb_font = get_font_list(base_font_name_list, - &font_set->font_name_list); + &font_set->font_name_list); if (font_set->nb_font < 1) { free(font_set); @@ -320,29 +319,29 @@ XCreateUtf8FontStruct(Display *dpy, /*****************************************************************************/ -/** draw a Right To Left UTF-8 string using multiple fonts as needed. **/ +/** draw a Right To Left UTF-8 string using multiple fonts as needed. **/ /*****************************************************************************/ void -XUtf8DrawRtlString(Display *display, - Drawable d, - XUtf8FontStruct *font_set, - GC gc, - int x, - int y, - const char *string, - int num_bytes) { - - int *encodings; /* encodings array */ - XFontStruct **fonts; /* fonts array */ - Fl_XChar2b buf[128]; /* drawing buffer */ - Fl_XChar2b *ptr; /* pointer to the drawing buffer */ - int fnum; /* index of the current font in the fonts array*/ - int i; /* current byte in the XChar2b buffer */ - int first; /* first valid font index */ - int last_fnum; /* font index of the previous char */ - int nb_font; /* quantity of fonts in the font array */ - char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ - int *ranges; /* sub range of iso10646 */ +XUtf8DrawRtlString(Display *display, + Drawable d, + XUtf8FontStruct *font_set, + GC gc, + int x, + int y, + const char *string, + int num_bytes) { + + int *encodings; /* encodings array */ + XFontStruct **fonts; /* fonts array */ + Fl_XChar2b buf[128]; /* drawing buffer */ + Fl_XChar2b *ptr; /* pointer to the drawing buffer */ + int fnum; /* index of the current font in the fonts array*/ + int i; /* current byte in the XChar2b buffer */ + int first; /* first valid font index */ + int last_fnum; /* font index of the previous char */ + int nb_font; /* quantity of fonts in the font array */ + char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ + int *ranges; /* sub range of iso10646 */ nb_font = font_set->nb_font; @@ -368,7 +367,7 @@ XUtf8DrawRtlString(Display *display, last_fnum = fnum; while (num_bytes > 0) { - int ulen; /* byte length of the UTF-8 char */ + int ulen; /* byte length of the UTF-8 char */ unsigned int ucs; /* Unicode value of the UTF-8 char */ unsigned int no_spc; /* Spacing char equivalent of a non-spacing char */ @@ -395,10 +394,10 @@ XUtf8DrawRtlString(Display *display, fnum = first; while (fnum < nb_font) { if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) { - if (encodings[fnum] != 0 || - ((int)ucs >= ranges[fnum * 2] && (int)ucs <= ranges[fnum * 2 + 1])) { - break; - } + if (encodings[fnum] != 0 || + ((int)ucs >= ranges[fnum * 2] && (int)ucs <= ranges[fnum * 2 + 1])) { + break; + } } fnum++; } @@ -419,7 +418,7 @@ XUtf8DrawRtlString(Display *display, (*ptr).byte1 = glyph[0]; (*ptr).byte2 = glyph[1]; if (no_spc) { - x += XTextWidth16(fonts[fnum], ptr, 1); + x += XTextWidth16(fonts[fnum], ptr, 1); } } else { ptr--; @@ -441,28 +440,28 @@ XUtf8DrawRtlString(Display *display, /*****************************************************************************/ -/** draw an UTF-8 string using multiple fonts as needed. **/ +/** draw an UTF-8 string using multiple fonts as needed. **/ /*****************************************************************************/ void -XUtf8DrawString(Display *display, - Drawable d, +XUtf8DrawString(Display *display, + Drawable d, XUtf8FontStruct *font_set, - GC gc, - int x, - int y, - const char *string, - int num_bytes) { - - int *encodings; /* encodings array */ - XFontStruct **fonts; /* fonts array */ - Fl_XChar2b buf[128]; /* drawing buffer */ - int fnum; /* index of the current font in the fonts array*/ - int i; /* current byte in the XChar2b buffer */ - int first; /* first valid font index */ - int last_fnum; /* font index of the previous char */ - int nb_font; /* quantity of fonts in the font array */ - char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ - int *ranges; /* sub range of iso10646 */ + GC gc, + int x, + int y, + const char *string, + int num_bytes) { + + int *encodings; /* encodings array */ + XFontStruct **fonts; /* fonts array */ + Fl_XChar2b buf[128]; /* drawing buffer */ + int fnum; /* index of the current font in the fonts array*/ + int i; /* current byte in the XChar2b buffer */ + int first; /* first valid font index */ + int last_fnum; /* font index of the previous char */ + int nb_font; /* quantity of fonts in the font array */ + char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ + int *ranges; /* sub range of iso10646 */ nb_font = font_set->nb_font; @@ -486,7 +485,7 @@ XUtf8DrawString(Display *display, last_fnum = fnum; while (num_bytes > 0) { - int ulen; /* byte length of the UTF-8 char */ + int ulen; /* byte length of the UTF-8 char */ unsigned int ucs; /* Unicode value of the UTF-8 char */ unsigned int no_spc; /* Spacing char equivalent of a non-spacing char */ @@ -512,11 +511,11 @@ XUtf8DrawString(Display *display, fnum = first; while (fnum < nb_font) { if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) { - if (encodings[fnum] != 0 || - ((int)ucs >= ranges[fnum * 2] && - (int)ucs <= ranges[fnum * 2 + 1])) { - break; - } + if (encodings[fnum] != 0 || + ((int)ucs >= ranges[fnum * 2] && + (int)ucs <= ranges[fnum * 2 + 1])) { + break; + } } fnum++; } @@ -536,7 +535,7 @@ XUtf8DrawString(Display *display, (*buf).byte1 = glyph[0]; (*buf).byte2 = glyph[1]; if (no_spc) { - x -= XTextWidth16(fonts[fnum], buf, 1); + x -= XTextWidth16(fonts[fnum], buf, 1); } } else { (*(buf + i)).byte1 = glyph[0]; @@ -560,26 +559,26 @@ XUtf8DrawString(Display *display, /*****************************************************************************/ void XUtf8_measure_extents( - Display *display, - Drawable d, + Display *display, + Drawable d, XUtf8FontStruct *font_set, - GC gc, - int *xx, /* x-offset from origin */ - int *yy, /* y-offset from origin */ - int *ww, /* overall inked width */ - int *hh, /* maximum inked height */ - const char *string, /* text to measure */ - int num_bytes) { - int *encodings; /* encodings array */ - XFontStruct **fonts; /* fonts array */ - Fl_XChar2b buf[128]; /* drawing buffer */ - int fnum; /* index of the current font in the fonts array*/ - int i; /* current byte in the XChar2b buffer */ - int first; /* first valid font index */ - int last_fnum; /* font index of the previous char */ - int nb_font; /* quantity of fonts in the font array */ - char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ - int *ranges; /* sub range of iso10646 */ + GC gc, + int *xx, /* x-offset from origin */ + int *yy, /* y-offset from origin */ + int *ww, /* overall inked width */ + int *hh, /* maximum inked height */ + const char *string, /* text to measure */ + int num_bytes) { + int *encodings; /* encodings array */ + XFontStruct **fonts; /* fonts array */ + Fl_XChar2b buf[128]; /* drawing buffer */ + int fnum; /* index of the current font in the fonts array*/ + int i; /* current byte in the XChar2b buffer */ + int first; /* first valid font index */ + int last_fnum; /* font index of the previous char */ + int nb_font; /* quantity of fonts in the font array */ + char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ + int *ranges; /* sub range of iso10646 */ int wd = 0; /* accumulates the width of the text */ int ht = 0; /* used to find max height in text */ @@ -615,7 +614,7 @@ XUtf8_measure_extents( last_fnum = fnum; while (num_bytes > 0) { - int ulen; /* byte length of the UTF-8 char */ + int ulen; /* byte length of the UTF-8 char */ unsigned int ucs; /* Unicode value of the UTF-8 char */ unsigned int no_spc; /* Spacing char equivalent of a non-spacing char */ @@ -645,11 +644,11 @@ XUtf8_measure_extents( fnum = first; while (fnum < nb_font) { if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) { - if (encodings[fnum] != 0 || - ((int)ucs >= ranges[fnum * 2] && - (int)ucs <= ranges[fnum * 2 + 1])) { - break; - } + if (encodings[fnum] != 0 || + ((int)ucs >= ranges[fnum * 2] && + (int)ucs <= ranges[fnum * 2 + 1])) { + break; + } } fnum++; } @@ -673,7 +672,7 @@ XUtf8_measure_extents( (*buf).byte1 = glyph[0]; (*buf).byte2 = glyph[1]; if (no_spc) { - wd -= XTextWidth16(fonts[fnum], buf, 1); + wd -= XTextWidth16(fonts[fnum], buf, 1); } } else { (*(buf + i)).byte1 = glyph[0]; @@ -701,24 +700,24 @@ XUtf8_measure_extents( /*****************************************************************************/ -/** returns the pixel width of a UTF-8 string **/ +/** returns the pixel width of a UTF-8 string **/ /*****************************************************************************/ int -XUtf8TextWidth(XUtf8FontStruct *font_set, - const char *string, - int num_bytes) { - - int x; - int *encodings; /* encodings array */ - XFontStruct **fonts; /* fonts array */ - Fl_XChar2b buf[128]; /* drawing buffer */ - int fnum; /* index of the current font in the fonts array*/ - int i; /* current byte in the XChar2b buffer */ - int first; /* first valid font index */ - int last_fnum; /* font index of the previous char */ - int nb_font; /* quantity of fonts in the font array */ - char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ - int *ranges; /* sub range of iso10646 */ +XUtf8TextWidth(XUtf8FontStruct *font_set, + const char *string, + int num_bytes) { + + int x; + int *encodings; /* encodings array */ + XFontStruct **fonts; /* fonts array */ + Fl_XChar2b buf[128]; /* drawing buffer */ + int fnum; /* index of the current font in the fonts array*/ + int i; /* current byte in the XChar2b buffer */ + int first; /* first valid font index */ + int last_fnum; /* font index of the previous char */ + int nb_font; /* quantity of fonts in the font array */ + char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ + int *ranges; /* sub range of iso10646 */ nb_font = font_set->nb_font; x = 0; @@ -744,7 +743,7 @@ XUtf8TextWidth(XUtf8FontStruct *font_set, last_fnum = fnum; while (num_bytes > 0) { - int ulen; /* byte length of the UTF-8 char */ + int ulen; /* byte length of the UTF-8 char */ unsigned int ucs; /* Unicode value of the UTF-8 char */ unsigned int no_spc; /* Spacing char equivalent of a non-spacing char */ @@ -770,11 +769,11 @@ XUtf8TextWidth(XUtf8FontStruct *font_set, fnum = first; while (fnum < nb_font) { if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) { - if (encodings[fnum] != 0 || - ((int)ucs >= ranges[fnum * 2] && - (int)ucs <= ranges[fnum * 2 + 1])) { - break; - } + if (encodings[fnum] != 0 || + ((int)ucs >= ranges[fnum * 2] && + (int)ucs <= ranges[fnum * 2 + 1])) { + break; + } } fnum++; } @@ -792,8 +791,8 @@ XUtf8TextWidth(XUtf8FontStruct *font_set, (*buf).byte1 = glyph[0]; (*buf).byte2 = glyph[1]; if (no_spc) { - /* go back to draw the non-spacing char over the previous char */ - x -= XTextWidth16(fonts[fnum], buf, 1); + /* go back to draw the non-spacing char over the previous char */ + x -= XTextWidth16(fonts[fnum], buf, 1); } } else { (*(buf + i)).byte1 = glyph[0]; @@ -815,16 +814,16 @@ XUtf8TextWidth(XUtf8FontStruct *font_set, /*****************************************************************************/ int fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set, - unsigned int ucs, - XFontStruct **fnt, - unsigned short *id) { + unsigned int ucs, + XFontStruct **fnt, + unsigned short *id) { int *encodings; /* encodings array */ XFontStruct **fonts; /* fonts array */ int fnum; /* index of the current font in the fonts array*/ int first; /* first valid font index */ int nb_font; /* quantity of fonts in the font array */ - char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ + char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ int *ranges; /* sub range of iso10646 */ nb_font = font_set->nb_font; @@ -855,8 +854,8 @@ fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set, if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) { if (encodings[fnum] != 0 || ((int)ucs >= ranges[fnum * 2] && - (int)ucs <= ranges[fnum * 2 + 1])) { - break; + (int)ucs <= ranges[fnum * 2 + 1])) { + break; } } fnum++; @@ -875,21 +874,21 @@ fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set, } /*****************************************************************************/ -/** returns the pixel width of a UCS char **/ +/** returns the pixel width of a UCS char **/ /*****************************************************************************/ int XUtf8UcsWidth(XUtf8FontStruct *font_set, - unsigned int ucs) { - - int x; - int *encodings; /* encodings array */ - XFontStruct **fonts; /* fonts array */ - Fl_XChar2b buf[8]; /* drawing buffer */ - int fnum; /* index of the current font in the fonts array*/ - int first; /* first valid font index */ - int nb_font; /* quantity of fonts in the font array */ - char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ - int *ranges; /* sub range of iso10646 */ + unsigned int ucs) { + + int x; + int *encodings; /* encodings array */ + XFontStruct **fonts; /* fonts array */ + Fl_XChar2b buf[8]; /* drawing buffer */ + int fnum; /* index of the current font in the fonts array*/ + int first; /* first valid font index */ + int nb_font; /* quantity of fonts in the font array */ + char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */ + int *ranges; /* sub range of iso10646 */ unsigned int no_spc; nb_font = font_set->nb_font; @@ -923,10 +922,10 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set, fnum = first; while (fnum < nb_font) { if (fonts[fnum] && - ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) { + ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) { if (encodings[fnum] != 0 || ((int)ucs >= ranges[fnum * 2] && - (int)ucs <= ranges[fnum * 2 + 1])) { - break; + (int)ucs <= ranges[fnum * 2 + 1])) { + break; } } fnum++; @@ -948,17 +947,17 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set, } /*****************************************************************************/ -/** draw an UTF-8 string and clear the background. **/ +/** draw an UTF-8 string and clear the background. **/ /*****************************************************************************/ void XUtf8DrawImageString(Display *display, - Drawable d, - XUtf8FontStruct *font_set, - GC gc, - int x, - int y, - const char *string, - int num_bytes) { + Drawable d, + XUtf8FontStruct *font_set, + GC gc, + int x, + int y, + const char *string, + int num_bytes) { /* FIXME: must be improved ! */ int w; @@ -971,7 +970,7 @@ XUtf8DrawImageString(Display *display, w = XUtf8TextWidth(font_set, string, num_bytes); XGetGCValues(display, gc, - GCFunction|GCForeground|GCBackground|GCFillStyle, &xgcv); + GCFunction|GCForeground|GCBackground|GCFillStyle, &xgcv); function = xgcv.function; fill_style = xgcv.fill_style; @@ -984,10 +983,10 @@ XUtf8DrawImageString(Display *display, xgcv.fill_style = FillSolid; XChangeGC(display, gc, - GCFunction|GCForeground|GCBackground|GCFillStyle, &xgcv); + GCFunction|GCForeground|GCBackground|GCFillStyle, &xgcv); XFillRectangle(display, d, gc, x, y - font_set->ascent, - (unsigned)w, (unsigned)(font_set->ascent + font_set->descent)); + (unsigned)w, (unsigned)(font_set->ascent + font_set->descent)); xgcv.function = function; xgcv.foreground = foreground; @@ -995,7 +994,7 @@ XUtf8DrawImageString(Display *display, xgcv.fill_style = fill_style; XChangeGC(display, gc, - GCFunction|GCForeground|GCBackground|GCFillStyle, &xgcv); + GCFunction|GCForeground|GCBackground|GCFillStyle, &xgcv); XUtf8DrawString(display, d, font_set, gc, x, y, string, num_bytes); } @@ -1004,15 +1003,15 @@ XUtf8DrawImageString(Display *display, /** free the XFontSet and others things created by XCreateUtf8FontSet **/ /*****************************************************************************/ void -XFreeUtf8FontStruct(Display *dpy, - XUtf8FontStruct *font_set) { +XFreeUtf8FontStruct(Display *dpy, + XUtf8FontStruct *font_set) { int i; i = 0; while (i < font_set->nb_font) { if (font_set->fonts[i]) { - XFreeFont(dpy, font_set->fonts[i]); - free(font_set->font_name_list[i]); + XFreeFont(dpy, font_set->fonts[i]); + free(font_set->font_name_list[i]); } i++; } @@ -1022,7 +1021,3 @@ XFreeUtf8FontStruct(Display *dpy, free(font_set->encodings); free(font_set); } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utils/Makefile b/src/xutf8/utils/Makefile index 3bed422c7..8c6f1de74 100644 --- a/src/xutf8/utils/Makefile +++ b/src/xutf8/utils/Makefile @@ -1,7 +1,7 @@ euc_tw: euc_tw.c gcc euc_tw.c -o euc_tw -all: convert_map create_table conv_gen +all: convert_map create_table conv_gen ./tbl_gen.sh ./non_spacing.sh ./case.sh @@ -18,5 +18,5 @@ create_table: create_table.c clean: rm -f *.o convert_map create_table conv_gen euc_tw - + diff --git a/src/xutf8/utils/case.sh b/src/xutf8/utils/case.sh index 4ccb51bb1..dbc20c90f 100755 --- a/src/xutf8/utils/case.sh +++ b/src/xutf8/utils/case.sh @@ -9,7 +9,7 @@ IFS=" #echo "# # List of case chars # -# +# # Format: Three tab-separated columns # Column #1 is the non-spacing Unicode (in hex as 0xXXXX) # Column #2 is the spacing Unicode (in hex as 0xXXXX) @@ -23,7 +23,7 @@ for line in ${nopsc} do ucs=`echo ${line} | cut -d\; -f1` name=`echo ${line} | cut -d\; -f2 | cut -d\; -f1| sed s/CAPITAL/SMALL/` - small=`grep ";${name};" ../UnicodeData-2.txt` + small=`grep ";${name};" ../UnicodeData-2.txt` if test "X${small}" != X ;then tbl=`echo ${small} | cut -d\; -f1` # echo "0x${ucs} 0x${tbl} # ${name}" >> space.txt @@ -51,11 +51,11 @@ cat >../case.c << ENDOFTEXT * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include "headers/case.h" @@ -63,7 +63,7 @@ cat >../case.c << ENDOFTEXT ENDOFTEXT echo " -int +int XUtf8Tolower( int ucs) { @@ -72,7 +72,7 @@ XUtf8Tolower( tables=`cat ../headers/case_tbl.txt` -for line in ${tables} +for line in ${tables} do tbl=`echo ${line} | cut -d']' -f1` bot=`echo ${line} | cut -d'_' -f3 | cut -d'[' -f1` diff --git a/src/xutf8/utils/conv_gen.c b/src/xutf8/utils/conv_gen.c index 833790269..8766971e1 100644 --- a/src/xutf8/utils/conv_gen.c +++ b/src/xutf8/utils/conv_gen.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,14 +6,14 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ -/* +/* * generate the "if(){} else if ..." structure of ucs2fontmap() */ #include <wchar.h> @@ -37,9 +36,9 @@ int main(int argc, char **argv) { puts(" /*************** conv_gen.c ************/"); buffer[len] = '\0'; ptr = buffer; - + printf("const int ucs2fontmap" - "(char *s, unsigned int ucs, int enc)\n"); + "(char *s, unsigned int ucs, int enc)\n"); printf("{\n"); printf(" switch(enc) {\n"); printf(" case 0:\n"); @@ -49,7 +48,7 @@ int main(int argc, char **argv) { while (len > 0) { unsigned char *p = ptr; unsigned char *f, *t; - + while (*p != ']') { i++; p++; @@ -88,7 +87,7 @@ int main(int argc, char **argv) { while (*ptr != '\n') { ptr++; len--; - } + } ptr++; len--; } @@ -112,21 +111,21 @@ int main(int argc, char **argv) { ptr--; while (ptr != encode[i]) { if (*ptr == '_') { - *ptr = '-'; - ptr--; - break; + *ptr = '-'; + ptr--; + break; } ptr--; } while (ptr != encode[i]) { if (*ptr == '_') { - *ptr = '.'; + *ptr = '.'; } ptr--; } printf(" } else if (!strcmp(enc, \"%s\")", encode[i] +11); - if (!strcmp(encode[i] + 11, "big5-0")) { + if (!strcmp(encode[i] + 11, "big5-0")) { printf(" || !strcmp(enc, \"big5.eten-0\")"); } else if (!strcmp(encode[i] + 11, "dingbats")) { printf(" || !strcmp(enc, \"zapfdingbats\")"); @@ -140,11 +139,11 @@ int main(int argc, char **argv) { printf(" return %d;\n", i); i++; } - printf(" };\n"); - printf(" return -1;\n"); - printf("};\n\n"); + printf(" };\n"); + printf(" return -1;\n"); + printf("};\n\n"); - printf("/*\n"); + printf("/*\n"); printf("const char *encoding_name(int num)\n{\n"); printf(" switch (num) {\n"); i = 1; @@ -156,10 +155,6 @@ int main(int argc, char **argv) { printf(" };\n"); printf(" return \"iso10646-1\";\n"); printf("};\n\n"); - printf("*/\n"); + printf("*/\n"); return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utils/convert_map.c b/src/xutf8/utils/convert_map.c index c672d5423..df7a091b2 100644 --- a/src/xutf8/utils/convert_map.c +++ b/src/xutf8/utils/convert_map.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ /* @@ -34,9 +33,9 @@ int JIS0208(unsigned char * ptr) { while(*ptr != '\0') { ptr++; i++; } i++; ptr++; *(ptr+6) = '\0'; ucs = (unsigned int)strtoul(ptr, NULL, 16); - if (ucs) - printf("/* U+%04X */ 0x%02X, 0x%02X,\n", ucs, - (fmap & 0xFF00) >> 8, fmap & 0xFF); + if (ucs) + printf("/* U+%04X */ 0x%02X, 0x%02X,\n", ucs, + (fmap & 0xFF00) >> 8, fmap & 0xFF); while(*ptr != '\0') { ptr++; i++; } i++; ptr++; while(*ptr != '\n') { ptr++; i++; } @@ -104,8 +103,8 @@ int JIS0212(unsigned char * ptr) { abort(); } if (ucs) - printf("/* U+%04X */ 0x%02X, 0x%02X,\n", ucs, - (fmap & 0xFF00) >> 8, fmap & 0xFF); + printf("/* U+%04X */ 0x%02X, 0x%02X,\n", ucs, + (fmap & 0xFF00) >> 8, fmap & 0xFF); while(*ptr != '\0') { ptr++; i++; } i++; ptr++; while(*ptr != '\n') { ptr++; i++; } @@ -153,7 +152,7 @@ int main(int argc, char **argv) { } else if (!strcmp("koi8-1", argv[1])) { nb = JIS0201(ptr); } else if (!strcmp("dingbats", argv[1]) || - !strcmp("symbol", argv[1])) + !strcmp("symbol", argv[1])) { nb = ADOBE(ptr); } else { @@ -164,7 +163,3 @@ int main(int argc, char **argv) { } return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utils/create_table.c b/src/xutf8/utils/create_table.c index bf75631a5..4c2cda399 100644 --- a/src/xutf8/utils/create_table.c +++ b/src/xutf8/utils/create_table.c @@ -1,5 +1,4 @@ -/* "$Id$" - * +/* * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. * @@ -7,11 +6,11 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include <wchar.h> @@ -57,30 +56,30 @@ int main(int argc, char **argv) { } if (i != ucs - 1 || !i) { if ((ucs - i) > MAX_DELTA || !i) { - if (i) { - printf("};\n"); - fprintf(stderr, "\t/* end: U+%04X */\n", i); - } - if (strcmp(argv[1], "spacing")) { - printf("\nstatic const char unicode_to_%s_%db_%04X[] = {\n", - argv[1], nbb, ucs); - fprintf(stderr, "unicode_to_%s_%db_%04X[]; ", - argv[1], nbb, ucs); - } else { - printf("\nstatic const unsigned short" - " ucs_table_%04X[]" - " = {\n", ucs); - fprintf(stderr, "ucs_table_%04X[]; ", ucs); - } + if (i) { + printf("};\n"); + fprintf(stderr, "\t/* end: U+%04X */\n", i); + } + if (strcmp(argv[1], "spacing")) { + printf("\nstatic const char unicode_to_%s_%db_%04X[] = {\n", + argv[1], nbb, ucs); + fprintf(stderr, "unicode_to_%s_%db_%04X[]; ", + argv[1], nbb, ucs); + } else { + printf("\nstatic const unsigned short" + " ucs_table_%04X[]" + " = {\n", ucs); + fprintf(stderr, "ucs_table_%04X[]; ", ucs); + } } else { - while (i < ucs - 1) { - i++; - if (nbb == 1) { - printf("0x00,\n"); - } else { - printf("0x00, 0x00,\n"); - } - }; + while (i < ucs - 1) { + i++; + if (nbb == 1) { + printf("0x00,\n"); + } else { + printf("0x00, 0x00,\n"); + } + }; } } i = ucs; @@ -97,7 +96,3 @@ int main(int argc, char **argv) { fprintf(stderr, "\t/* end: U+%04X */\n", i); return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utils/euc_tw.c b/src/xutf8/utils/euc_tw.c index 3d6a1e1e9..258524dc9 100644 --- a/src/xutf8/utils/euc_tw.c +++ b/src/xutf8/utils/euc_tw.c @@ -6,14 +6,14 @@ * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ -/* +/* * generate the "if(){} else if ..." structure of ucs2fontmap() */ @@ -52,7 +52,3 @@ int main(int argc, char **argv) { iconv_close(cd); return 0; } - -/* - * End of "$Id$". - */ diff --git a/src/xutf8/utils/non_spacing.sh b/src/xutf8/utils/non_spacing.sh index 5fef9c6d8..993095b07 100755 --- a/src/xutf8/utils/non_spacing.sh +++ b/src/xutf8/utils/non_spacing.sh @@ -9,7 +9,7 @@ IFS=" #echo "# # List of non-spacing chars # -# +# # Format: Three tab-separated columns # Column #1 is the non-spacing Unicode (in hex as 0xXXXX) # Column #2 is the spacing Unicode (in hex as 0xXXXX) @@ -23,7 +23,7 @@ for line in ${nopsc} do ucs=`echo ${line} | cut -d\; -f1` name=`echo ${line} | cut -d\; -f2` - space=`grep " 0020 ${ucs};" ../UnicodeData-2.txt` + space=`grep " 0020 ${ucs};" ../UnicodeData-2.txt` if test "X${space}" != X ;then tbl=`echo ${space} | cut -d\; -f1` # echo "0x${ucs} 0x${tbl} # ${name}" >> space.txt @@ -51,11 +51,11 @@ cat >../is_spacing.c << ENDOFTEXT * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ #include "headers/spacing.h" @@ -63,7 +63,7 @@ cat >../is_spacing.c << ENDOFTEXT ENDOFTEXT echo " -unsigned short +unsigned short XUtf8IsNonSpacing( unsigned int ucs) { @@ -71,7 +71,7 @@ XUtf8IsNonSpacing( tables=`cat ../headers/spacing_tbl.txt` -for line in ${tables} +for line in ${tables} do tbl=`echo ${line} | cut -d']' -f1` bot=`echo ${line} | cut -d'_' -f3 | cut -d'[' -f1` diff --git a/src/xutf8/utils/tbl_gen.sh b/src/xutf8/utils/tbl_gen.sh index f764d3af0..aa9942610 100755 --- a/src/xutf8/utils/tbl_gen.sh +++ b/src/xutf8/utils/tbl_gen.sh @@ -9,11 +9,11 @@ # * 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 +# * https://www.fltk.org/COPYING.php # * -# * Please report all bugs and problems on the following page: +# * Please see the following page on how to report bugs and issues: # * -# * http://www.fltk.org/str.php +# * https://www.fltk.org/bugs.php # */ # @@ -32,7 +32,7 @@ for enc in ${encode} do echo ${enc} - case ${enc} in + case ${enc} in ksc5601.1987-0) # cat ../MAPPINGS/EASTASIA/KSC/KSC5601.TXT | \ cat ../MAPPINGS/EASTASIA/KSC/KSX1001.TXT | \ @@ -125,7 +125,7 @@ do esac nm=`echo ${enc} |tr '.' '_' | tr '-' '_'` cat ${enc}.txt | sort | uniq | \ - ./create_table "${nm}" >> ../headers/${nm}_.h 2>> ../headers/tbl.txt + ./create_table "${nm}" >> ../headers/${nm}_.h 2>> ../headers/tbl.txt rm -f ${enc}.txt enc=" " done @@ -139,11 +139,11 @@ cat > ../ucs2fontmap.c << ENDOFTEXT * 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 + * https://www.fltk.org/COPYING.php * - * Please report all bugs and problems on the following page: + * Please see the following page on how to report bugs and issues: * - * http://www.fltk.org/str.php + * https://www.fltk.org/bugs.php */ ENDOFTEXT diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6e996a5a3..f47f33b93 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,4 @@ # -# "$Id$" -# # CMakeLists.txt used to build test and demo apps by the CMake build system # # Copyright 2004-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # ####################################################################### diff --git a/test/CubeMain.cxx b/test/CubeMain.cxx index bcf3f8756..c2c0c6cfa 100644 --- a/test/CubeMain.cxx +++ b/test/CubeMain.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // CubeView class . // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -24,17 +22,12 @@ int main(int argc, char **argv) { CubeViewUI *cvui=new CubeViewUI; - + //Initial global objects. - + Fl::visual(FL_DOUBLE|FL_INDEX); cvui->show(argc, argv); - + return Fl::run(); } - - -// -// End of "$Id$". -// diff --git a/test/CubeView.cxx b/test/CubeView.cxx index 39afa80c1..fda542aa0 100644 --- a/test/CubeView.cxx +++ b/test/CubeView.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // CubeView class implementation for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "CubeView.h" @@ -34,10 +32,10 @@ CubeView::CubeView(int x,int y,int w,int h,const char *l) size=10.0; xshift=0.0; yshift=0.0; - + /* The cube definition. These are the vertices of a unit cube * centered on the origin.*/ - + boxv0[0] = -0.5; boxv0[1] = -0.5; boxv0[2] = -0.5; boxv1[0] = 0.5; boxv1[1] = -0.5; boxv1[2] = -0.5; boxv2[0] = 0.5; boxv2[1] = 0.5; boxv2[2] = -0.5; @@ -155,11 +153,7 @@ void CubeView::draw() { glScalef(float(size),float(size),float(size)); drawCube(); - + glPopMatrix(); } #endif /* HAVE_GL */ - -// -// End of "$Id$". -// diff --git a/test/CubeView.h b/test/CubeView.h index 95d17ae48..5770538ac 100644 --- a/test/CubeView.h +++ b/test/CubeView.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // CubeView class definitions for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef CUBEVIEW_H @@ -47,7 +45,7 @@ public: * initialize button in CubeViewUI. */ void v_angle(double angle){vAng=angle;} - + // Return the rotation about the vertical (y ) axis. double v_angle() const {return vAng;} @@ -83,7 +81,7 @@ public: * entities displayed in the cube view. * */ - void draw(); + void draw(); #endif /* HAVE_GL */ private: @@ -97,7 +95,7 @@ private: #else void drawCube() { } #endif /* HAVE_GL */ - + double vAng,hAng; double xshift,yshift; @@ -109,7 +107,3 @@ private: }; #endif - -// -// End of "$Id$". -// diff --git a/test/Makefile b/test/Makefile index 66a25825c..d65895d64 100644 --- a/test/Makefile +++ b/test/Makefile @@ -9,9 +9,9 @@ # # https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# https://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # include ../makeinclude @@ -578,7 +578,3 @@ cairo_test$(EXEEXT): cairo_test.o echo Linking $@... $(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(CAIROFLAGS) $(LDFLAGS) -o $@ cairo_test.o $(LINKFLTK) $(LINKFLTKCAIRO) $(GLDLIBS) $(OSX_ONLY) ../fltk-config --post $@ - -# -# End of "$Id$". -# diff --git a/test/README.txt b/test/README.txt index f979f1458..d57c46a16 100644 --- a/test/README.txt +++ b/test/README.txt @@ -11,23 +11,23 @@ may recognize this as a rewrite of an XForms program). Some of the more interesting programs: -fractals: A GLUT program with FL controls added to it +fractals: A GLUT program with FL controls added to it -glpuzzle: A GLUT program with no modifications +glpuzzle: A GLUT program with no modifications -fullscreen: Demo of how to make your window toggle to fill screen +fullscreen: Demo of how to make your window toggle to fill screen -list_visuals: necessary to debug X visual stuff +list_visuals: necessary to debug X visual stuff -mandelbrot: A true application, using panels built in Fluid +mandelbrot: A true application, using panels built in Fluid -menubar: Demo of how FL's menus work +menubar: Demo of how FL's menus work -shiny: Demo of drawing FL's controls using OpenGL +shiny: Demo of drawing FL's controls using OpenGL -forms: An XForms program to demonstrate emulation +forms: An XForms program to demonstrate emulation -colbrowser: Another XForms program that is actually useful +colbrowser: Another XForms program that is actually useful ----------------------------------------------------- diff --git a/test/adjuster.cxx b/test/adjuster.cxx index 61abcdc0f..ba50c6112 100644 --- a/test/adjuster.cxx +++ b/test/adjuster.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Adjuster test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> @@ -51,7 +49,3 @@ int main(int argc, char ** argv) { window.show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/animated.cxx b/test/animated.cxx index 442aa4495..1d7680c92 100644 --- a/test/animated.cxx +++ b/test/animated.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Alpha rendering benchmark program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -149,7 +147,3 @@ int main(int argc, char **argv) { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/arc.cxx b/test/arc.cxx index c6352ca48..3931c53fe 100644 --- a/test/arc.cxx +++ b/test/arc.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Arc drawing test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -82,8 +80,3 @@ int main(int argc, char** argv) { window.show(argc,argv); return Fl::run(); } - - -// -// End of "$Id$". -// diff --git a/test/ask.cxx b/test/ask.cxx index 72d88ed2a..a3caea0ab 100644 --- a/test/ask.cxx +++ b/test/ask.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Standard dialog test program for the Fast Light Tool Kit (FLTK). // // This also demonstrates how to trap attempts by the user to @@ -12,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -54,7 +52,7 @@ void window_callback(Fl_Widget *win, void*) { fl_message_hotspot(0); fl_message_title("note: no hotspot set for this dialog"); int rep = fl_choice("Are you sure you want to quit?", - "Cancel", "Quit", "Dunno"); + "Cancel", "Quit", "Dunno"); fl_message_hotspot(hotspot); if (rep==1) exit(0); @@ -101,11 +99,11 @@ void timer_cb(void *) { // pop up a message: stop = fl_choice("Timeout. Click the 'Close' button.\n" - "Note: this message was blocked in FLTK 1.3\n" - "if another message window is open.\n" - "This *should* be fixed in FLTK 1.4.0!\n" - "This message should pop up every 5 seconds.", - "Close", "Stop these funny popups", NULL); + "Note: this message was blocked in FLTK 1.3\n" + "if another message window is open.\n" + "This *should* be fixed in FLTK 1.4.0!\n" + "This message should pop up every 5 seconds.", + "Close", "Stop these funny popups", NULL); } int main(int argc, char **argv) { @@ -135,7 +133,3 @@ int main(int argc, char **argv) { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/bitmap.cxx b/test/bitmap.cxx index 71aff20c9..a798b4795 100644 --- a/test/bitmap.cxx +++ b/test/bitmap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Bitmap label test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -132,7 +130,3 @@ int main(int argc, char **argv) { w->show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/blocks.cxx b/test/blocks.cxx index 6135313ba..7faa4c903 100644 --- a/test/blocks.cxx +++ b/test/blocks.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // "Block Attack!" scrolling blocks game using the Fast Light Tool Kit (FLTK). // // Copyright 2006-2018 by Michael Sweet. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -50,10 +48,10 @@ # include <mmsystem.h> #endif // _WIN32 -#define BLOCK_COLS 20 -#define BLOCK_ROWS 10 -#define BLOCK_SIZE 32 -#define BLOCK_BLAST 100 +#define BLOCK_COLS 20 +#define BLOCK_ROWS 10 +#define BLOCK_SIZE 32 +#define BLOCK_BLAST 100 // These factors are used to fine-tune the game when these events // occur by multiplying the timer interval with the given factor: @@ -62,12 +60,12 @@ // (b) click on a "normal block", destroy this one and adjacent blocks // (c) click on a "bomb", destroy all blocks of the same color -#define LEVEL_FACTOR 0.90 // was: 0.95 -#define NORMAL_FACTOR 0.999 -#define BOMB_FACTOR 0.995 +#define LEVEL_FACTOR 0.90 // was: 0.95 +#define NORMAL_FACTOR 0.999 +#define BOMB_FACTOR 0.995 // Set this to 1 to debug the timer callback (should be 0) -#define DEBUG_TIMER 0 +#define DEBUG_TIMER 0 #include "pixmaps/blast.xpm" Fl_Pixmap blast_pixmap(blast_xpm); @@ -163,18 +161,18 @@ class BlockSound { int remaining; static OSStatus audio_cb(AudioDeviceID device, - const AudioTimeStamp *current_time, - const AudioBufferList *data_in, - const AudioTimeStamp *time_in, - AudioBufferList *data_out, - const AudioTimeStamp *time_out, - void *client_data); + const AudioTimeStamp *current_time, + const AudioBufferList *data_in, + const AudioTimeStamp *time_in, + AudioBufferList *data_out, + const AudioTimeStamp *time_out, + void *client_data); #elif defined(_WIN32) - HWAVEOUT device; - HGLOBAL header_handle; - LPWAVEHDR header_ptr; - HGLOBAL data_handle; - LPSTR data_ptr; + HWAVEOUT device; + HGLOBAL header_handle; + LPWAVEHDR header_ptr; + HGLOBAL data_handle; + LPSTR data_ptr; #else # ifdef HAVE_ALSA_ASOUNDLIB_H @@ -191,7 +189,7 @@ class BlockSound { BlockSound(); ~BlockSound(); - void play_explosion(float duration); + void play_explosion(float duration); }; // Sound class globals... @@ -209,19 +207,19 @@ BlockSound::BlockSound() { UInt32 size = sizeof(device); if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, - &size, (void *)&device) != noErr) return; + &size, (void *)&device) != noErr) return; size = sizeof(format); if (AudioDeviceGetProperty(device, 0, false, kAudioDevicePropertyStreamFormat, - &size, &format) != noErr) return; + &size, &format) != noErr) return; // Set up a format we like... - format.mSampleRate = 44100.0; // 44.1kHz - format.mChannelsPerFrame = 2; // stereo + format.mSampleRate = 44100.0; // 44.1kHz + format.mChannelsPerFrame = 2; // stereo if (AudioDeviceSetProperty(device, NULL, 0, false, kAudioDevicePropertyStreamFormat, - sizeof(format), &format) != noErr) return; + sizeof(format), &format) != noErr) return; // Check we got linear pcm - what to do if we did not ??? if (format.mFormatID != kAudioFormatLinearPCM) return; @@ -238,7 +236,7 @@ BlockSound::BlockSound() { sample_size = (int)format.mSampleRate; #elif defined(_WIN32) - WAVEFORMATEX format; + WAVEFORMATEX format; memset(&format, 0, sizeof(format)); format.cbSize = sizeof(format); @@ -363,12 +361,12 @@ BlockSound::~BlockSound() { #ifdef __APPLE__ // Callback function for writing audio data... OSStatus BlockSound::audio_cb(AudioDeviceID device, - const AudioTimeStamp *current_time, - const AudioBufferList *data_in, - const AudioTimeStamp *time_in, - AudioBufferList *data_out, - const AudioTimeStamp *time_out, - void *client_data) { + const AudioTimeStamp *current_time, + const AudioBufferList *data_in, + const AudioTimeStamp *time_in, + AudioBufferList *data_out, + const AudioTimeStamp *time_out, + void *client_data) { BlockSound *ss = (BlockSound *)client_data; int count; float *buffer; @@ -440,45 +438,45 @@ class BlockWindow : public Fl_Double_Window { public: struct Block { - int color; - bool bomb; - int y; + int color; + bool bomb; + int y; }; struct Column { - int num_blocks; - Block blocks[BLOCK_ROWS]; - int x; + int num_blocks; + Block blocks[BLOCK_ROWS]; + int x; }; private: - Fl_Button *help_button_, - *play_button_; - - int num_columns_; - Column columns_[BLOCK_COLS]; - int count_; - bool help_; - int high_score_; - float interval_; - int level_; - int num_colors_; - int opened_columns_; - bool paused_; - static Fl_Preferences prefs_; - int score_; - BlockSound *sound_; - char title_[255]; - int title_y_; - - void _BlockWindow(); - int bomb(int color); - int click(int col, int row); - static void help_cb(Fl_Widget *wi, BlockWindow *bw); - void init(); - static void play_cb(Fl_Widget *wi, BlockWindow *bw); - static void timeout_cb(BlockWindow *bw); + Fl_Button *help_button_, + *play_button_; + + int num_columns_; + Column columns_[BLOCK_COLS]; + int count_; + bool help_; + int high_score_; + float interval_; + int level_; + int num_colors_; + int opened_columns_; + bool paused_; + static Fl_Preferences prefs_; + int score_; + BlockSound *sound_; + char title_[255]; + int title_y_; + + void _BlockWindow(); + int bomb(int color); + int click(int col, int row); + static void help_cb(Fl_Widget *wi, BlockWindow *bw); + void init(); + static void play_cb(Fl_Widget *wi, BlockWindow *bw); + static void timeout_cb(BlockWindow *bw); public: @@ -486,24 +484,24 @@ class BlockWindow : public Fl_Double_Window { BlockWindow(int W, int H, const char *L = 0); ~BlockWindow(); - void draw(); - int handle(int event); - void new_game(); - int score() { return (score_); } + void draw(); + int handle(int event); + void new_game(); + int score() { return (score_); } void up_level(); }; -Fl_Preferences BlockWindow::prefs_(Fl_Preferences::USER, "fltk.org", "blocks"); +Fl_Preferences BlockWindow::prefs_(Fl_Preferences::USER, "fltk.org", "blocks"); int main(int argc, char *argv[]) { Fl::scheme("plastic"); Fl::visible_focus(0); - BlockWindow *bw = new BlockWindow(BLOCK_COLS * BLOCK_SIZE, + BlockWindow *bw = new BlockWindow(BLOCK_COLS * BLOCK_SIZE, BLOCK_ROWS * BLOCK_SIZE + 20, - "Block Attack!"); + "Block Attack!"); bw->show(argc, argv); @@ -554,10 +552,10 @@ void BlockWindow::_BlockWindow() { // Bomb all blocks of a given color and return the number of affected blocks int BlockWindow::bomb(int color) { - int j, k; - int count; - Block *b; - Column *c; + int j, k; + int count; + Block *b; + Column *c; if (color >= BLOCK_BLAST) return (0); @@ -566,7 +564,7 @@ int BlockWindow::bomb(int color) { for (k = c->num_blocks, b = c->blocks; k > 0; k --, b ++) if (b->color == color) { b->color = -color; - count ++; + count ++; } return (count); @@ -576,9 +574,9 @@ int BlockWindow::bomb(int color) { // Tag all blocks connected to the clicked block and return the number // of affected blocks int BlockWindow::click(int col, int row) { - Block *b; - Column *c; - int count, color; + Block *b; + Column *c; + int count, color; c = columns_ + col; @@ -619,9 +617,9 @@ int BlockWindow::click(int col, int row) { // Draw the block window... void BlockWindow::draw() { - int j, k, xx, yy; - Block *b; - Column *c; + int j, k, xx, yy; + Block *b; + Column *c; // Draw the blocks... @@ -635,14 +633,14 @@ void BlockWindow::draw() { yy = h() - BLOCK_SIZE - b->y; if (b->color >= BLOCK_BLAST) { - b->color ++; + b->color ++; blast_pixmap.draw(xx, yy); } else if (b->color < 0) { if (b->bomb) bomb_pixmaps[-b->color - 1]->draw(xx, yy); - else normal_pixmaps[-b->color - 1]->draw(xx, yy); + else normal_pixmaps[-b->color - 1]->draw(xx, yy); } else { if (b->bomb) bomb_pixmaps[b->color - 1]->draw(xx, yy); - else normal_pixmaps[b->color - 1]->draw(xx, yy); + else normal_pixmaps[b->color - 1]->draw(xx, yy); } } @@ -675,27 +673,27 @@ void BlockWindow::draw() { } else { if (interval_ < 0.0) { #ifdef DEBUG - // Show sample waveform... - short *sample_ptr; + // Show sample waveform... + short *sample_ptr; - for (i = 0; i < 2; i++) { - fl_color(FL_RED + i); - fl_begin_line(); - for (j = 0, sample_ptr = sound_->sample_data + i; + for (i = 0; i < 2; i++) { + fl_color(FL_RED + i); + fl_begin_line(); + for (j = 0, sample_ptr = sound_->sample_data + i; j < sound_->sample_size; - j ++, sample_ptr += 2) - fl_vertex(j * w() / sound_->sample_size, - *sample_ptr * h() / 4 / 65534 + h() / 2); - fl_end_line(); - } + j ++, sample_ptr += 2) + fl_vertex(j * w() / sound_->sample_size, + *sample_ptr * h() / 4 / 65534 + h() / 2); + fl_end_line(); + } #endif // DEBUG - if (num_columns_ && (time(NULL) & 7) < 4) - s = "Game Over"; - else - s = "Block Attack!\nby Michael R Sweet"; + if (num_columns_ && (time(NULL) & 7) < 4) + s = "Game Over"; + else + s = "Block Attack!\nby Michael R Sweet"; } else - s = "Paused"; + s = "Paused"; fl_font(FL_HELVETICA_BOLD, 32); fl_color(FL_BLACK); @@ -734,9 +732,9 @@ void BlockWindow::draw() { // Handle mouse clicks, etc. int BlockWindow::handle(int event) { - int j, k, mx, my, count; - Block *b; - Column *c; + int j, k, mx, my, count; + Block *b; + Column *c; if (Fl_Double_Window::handle(event)) return (1); @@ -748,19 +746,19 @@ int BlockWindow::handle(int event) { // '+': raise level if (Fl::event_text() && - !Fl::event_state(FL_CTRL | FL_ALT | FL_META) && - !strcmp(Fl::event_text(), "+")) { - up_level(); - return (1); + !Fl::event_state(FL_CTRL | FL_ALT | FL_META) && + !strcmp(Fl::event_text(), "+")) { + up_level(); + return (1); } // ALT + SHIFT + 'H': clear highscore if (Fl::event_text() && - (Fl::event_state() & (FL_ALT | FL_SHIFT)) == (FL_ALT | FL_SHIFT) && - !strcmp(Fl::event_text(), "H")) { - high_score_ = score_; - prefs_.set("high_score", high_score_); - return (1); + (Fl::event_state() & (FL_ALT | FL_SHIFT)) == (FL_ALT | FL_SHIFT) && + !strcmp(Fl::event_text(), "H")) { + high_score_ = score_; + prefs_.set("high_score", high_score_); + return (1); } break; @@ -771,41 +769,41 @@ int BlockWindow::handle(int event) { b = 0; for (j = 0, c = columns_; !count && j < num_columns_; j ++, c ++) - for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++) - if (mx >= c->x && mx < (c->x + BLOCK_SIZE) && - my >= b->y && my < (b->y + BLOCK_SIZE)) { - if (b->bomb) count = bomb(b->color); - else count = click(j, k); - break; - } + for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++) + if (mx >= c->x && mx < (c->x + BLOCK_SIZE) && + my >= b->y && my < (b->y + BLOCK_SIZE)) { + if (b->bomb) count = bomb(b->color); + else count = click(j, k); + break; + } if (count < 2) { - for (j = 0, c = columns_; j < num_columns_; j ++, c ++) - for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++) - if (b->color < 0) b->color = -b->color; + for (j = 0, c = columns_; j < num_columns_; j ++, c ++) + for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++) + if (b->color < 0) b->color = -b->color; } else { - count --; + count --; - if (b->bomb) { - sound_->play_explosion(0.19 + 0.005 * count); + if (b->bomb) { + sound_->play_explosion(0.19 + 0.005 * count); - interval_ *= BOMB_FACTOR; - score_ += count; - } else { - sound_->play_explosion(0.09 + 0.005 * count); + interval_ *= BOMB_FACTOR; + score_ += count; + } else { + sound_->play_explosion(0.09 + 0.005 * count); - interval_ *= NORMAL_FACTOR; - score_ += count * count; - } + interval_ *= NORMAL_FACTOR; + score_ += count * count; + } - if (score_ > high_score_) { - high_score_ = score_; - prefs_.set("high_score", high_score_); - } + if (score_ > high_score_) { + high_score_ = score_; + prefs_.set("high_score", high_score_); + } - for (j = 0, c = columns_; j < num_columns_; j ++, c ++) - for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++) - if (b->color < 0) b->color = BLOCK_BLAST; + for (j = 0, c = columns_; j < num_columns_; j ++, c ++) + for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++) + if (b->color < 0) b->color = BLOCK_BLAST; } return (1); @@ -880,10 +878,10 @@ void BlockWindow::up_level() { // Animate the game... void BlockWindow::timeout_cb(BlockWindow *bw) { - int i, j; - Block *b; - Column *c; - int lastx, lasty; + int i, j; + Block *b; + Column *c; + int lastx, lasty; #if DEBUG_TIMER static double lasttime; @@ -911,9 +909,9 @@ void BlockWindow::timeout_cb(BlockWindow *bw) { if (bw->interval_ > 0) { // game is active if (bw->level_ != level) { if (ntime > 0) { - printf("*** average delta time = %9.6f, n =%4d, level %d, interval %f\n", - delta_sum / ntime, ntime, level, interval); - fflush(stdout); + printf("*** average delta time = %9.6f, n =%4d, level %d, interval %f\n", + delta_sum / ntime, ntime, level, interval); + fflush(stdout); } delta_sum = 0; // reset average ntime = 0; @@ -925,7 +923,7 @@ void BlockWindow::timeout_cb(BlockWindow *bw) { delta += 60; printf("%9.6f (%+f - %f = %9.6f), level: %d\n", - curtime, delta, interval, delta - interval, level); + curtime, delta, interval, delta - interval, level); fflush(stdout); interval = bw->interval_; @@ -946,26 +944,26 @@ void BlockWindow::timeout_cb(BlockWindow *bw) { if (b->color > (BLOCK_BLAST + 1)) { bw->redraw(); - c->num_blocks --; + c->num_blocks --; - if (j < c->num_blocks) { - memmove(b, b + 1, (c->num_blocks - j) * sizeof(Block)); - } + if (j < c->num_blocks) { + memmove(b, b + 1, (c->num_blocks - j) * sizeof(Block)); + } - j --; - b --; + j --; + b --; - if (!c->num_blocks) { - bw->num_columns_ --; + if (!c->num_blocks) { + bw->num_columns_ --; - if (i < bw->num_columns_) { - memmove(c, c + 1, (bw->num_columns_ - i) * sizeof(Column)); + if (i < bw->num_columns_) { + memmove(c, c + 1, (bw->num_columns_ - i) * sizeof(Column)); } - i --; - c --; - j = c->num_blocks; - } + i --; + c --; + j = c->num_blocks; + } } // Let the rest of the blocks fall and/or move... @@ -1007,31 +1005,31 @@ void BlockWindow::timeout_cb(BlockWindow *bw) { bw->count_ = BLOCK_SIZE; if (bw->num_columns_ == BLOCK_COLS) { - bw->interval_ = -1.0; - bw->sound_->play_explosion(0.8); - bw->play_button_->label("@>"); + bw->interval_ = -1.0; + bw->sound_->play_explosion(0.8); + bw->play_button_->label("@>"); } else { - bw->opened_columns_ ++; + bw->opened_columns_ ++; - if (bw->opened_columns_ > (2 * BLOCK_COLS)) { + if (bw->opened_columns_ > (2 * BLOCK_COLS)) { bw->up_level(); - } + } - c = bw->columns_; + c = bw->columns_; - if (bw->num_columns_) { + if (bw->num_columns_) { memmove(c + 1, c, bw->num_columns_ * sizeof(Column)); - } + } - bw->num_columns_ ++; - c->x = 0; - c->num_blocks = BLOCK_ROWS; + bw->num_columns_ ++; + c->x = 0; + c->num_blocks = BLOCK_ROWS; - for (j = 0, b = c->blocks; j < BLOCK_ROWS; j ++, b ++) { + for (j = 0, b = c->blocks; j < BLOCK_ROWS; j ++, b ++) { b->bomb = bw->num_colors_ > 3 && (rand() & 127) < bw->num_colors_; b->color = 1 + (rand() % bw->num_colors_); - b->y = j * (BLOCK_SIZE + 8) + 24; - } + b->y = j * (BLOCK_SIZE + 8) + 24; + } } } } else { @@ -1066,8 +1064,3 @@ void BlockWindow::timeout_cb(BlockWindow *bw) { Fl::repeat_timeout(0.1, (Fl_Timeout_Handler)timeout_cb, (void *)bw); } } - - -// -// End of "$Id$". -// diff --git a/test/boxtype.cxx b/test/boxtype.cxx index d344db7a5..8bcd1b0ed 100644 --- a/test/boxtype.cxx +++ b/test/boxtype.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Boxtype test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> @@ -57,19 +55,19 @@ class BoxGroup : public Fl_Group { void draw() { draw_box(); if (outline + box_bg) { // outline or box_bg or both - Fl_Widget*const* a = array(); - for (int i=children(); i--;) { - Fl_Widget& o = **a++; - if (outline) { - fl_color(FL_RED); - fl_rect(o.x()-1,o.y()-1,o.w()+2,o.h()+2); - } - if (box_bg) { - fl_color(FL_WHITE); - fl_rectf(o.x(),o.y(),o.w(),o.h()); - } - fl_color(FL_BLACK); - } + Fl_Widget*const* a = array(); + for (int i=children(); i--;) { + Fl_Widget& o = **a++; + if (outline) { + fl_color(FL_RED); + fl_rect(o.x()-1,o.y()-1,o.w()+2,o.h()+2); + } + if (box_bg) { + fl_color(FL_WHITE); + fl_rectf(o.x(),o.y(),o.w(),o.h()); + } + fl_color(FL_BLACK); + } } // outline or box_bg or both Fl_Group::draw_children(); } // draw() @@ -178,7 +176,3 @@ int main(int argc, char ** argv) { window->show(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/browser.cxx b/test/browser.cxx index 749a7ed83..23d84e7d8 100644 --- a/test/browser.cxx +++ b/test/browser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Browser test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* @@ -53,11 +51,11 @@ That was a blank line above this. #s## start line with '#' #s#.# alternative start line with '#' - You should try different browser types: - Fl_Browser - Fl_Select_Browser - Fl_Hold_Browser - Fl_Multi_Browser + You should try different browser types: + Fl_Browser + Fl_Select_Browser + Fl_Hold_Browser + Fl_Multi_Browser */ #include <FL/Fl.H> @@ -74,15 +72,15 @@ That was a blank line above this. #include <stdlib.h> Fl_Select_Browser *browser; -Fl_Button *top, - *bottom, - *middle, - *visible, - *swap, - *sort; +Fl_Button *top, + *bottom, + *middle, + *visible, + *swap, + *sort; Fl_Choice *btype; Fl_Choice *wtype; -Fl_Int_Input *field; +Fl_Int_Input *field; Fl_Simple_Terminal *tty = 0; typedef struct { @@ -106,7 +104,7 @@ WhenItem when_items[] = { void b_cb(Fl_Widget* o, void*) { tty->printf("callback, selection = \033[31m%d\033[0m, event_clicks = \033[32m%d\033[0m\n", - ((Fl_Browser*)o)->value(), Fl::event_clicks()); + ((Fl_Browser*)o)->value(), Fl::event_clicks()); } void show_cb(Fl_Widget *o, void *) { @@ -130,15 +128,15 @@ void show_cb(Fl_Widget *o, void *) { void swap_cb(Fl_Widget *, void *) { int a = -1, b = -1; - for ( int t=0; t<browser->size(); t++ ) { // find two selected items + for ( int t=0; t<browser->size(); t++ ) { // find two selected items if ( browser->selected(t) ) { if ( a < 0 ) - { a = t; } - else - { b = t; break; } + { a = t; } + else + { b = t; break; } } } - browser->swap(a, b); // swap them + browser->swap(a, b); // swap them } void sort_cb(Fl_Widget *, void *) { @@ -147,7 +145,7 @@ void sort_cb(Fl_Widget *, void *) { void btype_cb(Fl_Widget *, void *) { for ( int t=1; t<=browser->size(); t++ ) browser->select(t,0); - browser->select(1,0); // leave focus box on first line + browser->select(1,0); // leave focus box on first line if ( strcmp(btype->text(),"Normal")==0) browser->type(FL_NORMAL_BROWSER); else if ( strcmp(btype->text(),"Select")==0) browser->type(FL_SELECT_BROWSER); else if ( strcmp(btype->text(),"Hold" )==0) browser->type(FL_HOLD_BROWSER); @@ -157,7 +155,7 @@ void btype_cb(Fl_Widget *, void *) { void wtype_cb(Fl_Widget *, void *) { if ( wtype->value() < 0 ) return; - browser->when( when_items[wtype->value()].wvalue ); // when value based on array + browser->when( when_items[wtype->value()].wvalue ); // when value based on array } int main(int argc, char **argv) { @@ -176,10 +174,10 @@ int main(int argc, char **argv) { if (!browser->load(fname)) { int done = 0; #ifdef _MSC_VER - // if 'browser' was started from the VisualC environment in Win32, - // the current directory is set to the environment itself, + // if 'browser' was started from the VisualC environment in Win32, + // the current directory is set to the environment itself, // so we need to correct the browser file path - if ( i == argc ) + if ( i == argc ) { fname = "../test/browser.cxx"; done = browser->load(fname); @@ -253,7 +251,3 @@ int main(int argc, char **argv) { return Fl::run(); } -// -// End of "$Id$". -// - diff --git a/test/button.cxx b/test/button.cxx index f9ade8754..4787dc177 100644 --- a/test/button.cxx +++ b/test/button.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Button/callback test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> @@ -55,7 +53,3 @@ int main(int argc, char ** argv) { #endif return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/buttons.cxx b/test/buttons.cxx index a2a6cb6bd..107c4a42c 100644 --- a/test/buttons.cxx +++ b/test/buttons.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Another button test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> @@ -41,7 +39,3 @@ int main(int argc, char ** argv) { window->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/cairo_test.cxx b/test/cairo_test.cxx index 30cde3498..d2808e8d8 100644 --- a/test/cairo_test.cxx +++ b/test/cairo_test.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Cairo drawing test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -51,8 +49,8 @@ static void centered_text(cairo_t *cr, double x0, double y0, double w0, double h // draw a button object with rounded corners and a label static void round_button(cairo_t *cr, double x0, double y0, - double rect_width, double rect_height, double radius, - double r, double g, double b) { + double rect_width, double rect_height, double radius, + double r, double g, double b) { double x1, y1; x1 = x0 + rect_width; y1 = y0 + rect_height; @@ -158,7 +156,3 @@ int main(int argc, char **argv) { return 0; } #endif - -// -// End of "$Id$". -// diff --git a/test/checkers.cxx b/test/checkers.cxx index dcc67c6a9..95e670cf0 100644 --- a/test/checkers.cxx +++ b/test/checkers.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Checkers game for the Fast Light Tool Kit (FLTK). // // Hours of fun: the FLTK checkers game! @@ -12,14 +10,14 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // -const char* copyright = +const char* copyright = "Checkers game\n" "Copyright (C) 1997-2010 Bill Spitzak spitzak@d2.com\n" "Original Pascal code:\n" @@ -58,58 +56,58 @@ const char* copyright = #include <time.h> #ifdef VT100 -#include <ctype.h> // toupper +#include <ctype.h> // toupper #endif //////////////////////////////////////////////////////////////// // The algorithim: -int maxevaluate=2500; // max number of moves to examine on a turn -int maxnodes = 2500; // maximum number of nodes in search tree -int maxply = 20; // maximum depth to look ahead -char forcejumps = 1; // is forced jumps rule in effect? +int maxevaluate=2500; // max number of moves to examine on a turn +int maxnodes = 2500; // maximum number of nodes in search tree +int maxply = 20; // maximum depth to look ahead +char forcejumps = 1; // is forced jumps rule in effect? // scoring parameters: (all divided by 5 from original code) // some signs seem to be backwards, marked them with (-) in comment -const int spiece = 800; // value of a piece -const int sking = 1200; // value of a king -const int sadvan = 160; // value of mypieces/theirpieces-1 -// const int smobil = ? // moves *enemy* can make w/o being jumped -const int sallpin = 80; // mobil == 0 -const int sdeny = 10; // moves enemy can make that will be jumped -const int spin = 32; // enemy pieces that have no move except jumped -const int sthreat = -10; // enemy pieces we can jump if not moved (-) -const int sgrad = 1; // score of piece positions -const int sback = 10; // back row occupied so enemy can't make king -const int smoc2 = 200; // more mobility, more center -const int smoc3 = -8; // less mobility, less center -const int smoc4 = -80; // more mobility, less center -const int smode2 = -14; // less mobility, less denied -const int smode3 = -40; // more mobility, more denied (-) -const int sdemmo = -20; // more denied, more moves (-) -const int scent = 10; // pieces in center -const int skcent = 100; // kings in center - -const int depthpenalty=4; // guess -const int noise=2; // values less or eq to this apart are eq - -// const int sattackking = 4; // not used +const int spiece = 800; // value of a piece +const int sking = 1200; // value of a king +const int sadvan = 160; // value of mypieces/theirpieces-1 +// const int smobil = ? // moves *enemy* can make w/o being jumped +const int sallpin = 80; // mobil == 0 +const int sdeny = 10; // moves enemy can make that will be jumped +const int spin = 32; // enemy pieces that have no move except jumped +const int sthreat = -10; // enemy pieces we can jump if not moved (-) +const int sgrad = 1; // score of piece positions +const int sback = 10; // back row occupied so enemy can't make king +const int smoc2 = 200; // more mobility, more center +const int smoc3 = -8; // less mobility, less center +const int smoc4 = -80; // more mobility, less center +const int smode2 = -14; // less mobility, less denied +const int smode3 = -40; // more mobility, more denied (-) +const int sdemmo = -20; // more denied, more moves (-) +const int scent = 10; // pieces in center +const int skcent = 100; // kings in center + +const int depthpenalty=4; // guess +const int noise=2; // values less or eq to this apart are eq + +// const int sattackking = 4; // not used // const int sattackpiece = 3; struct node { node *father; - node *son; // best son - node *brother; // next brother - short int value; // value of this board position to player making move + node *son; // best son + node *brother; // next brother + short int value; // value of this board position to player making move unsigned char from,to; // the move to reach this board - long int jump; // bit map of locations jumped + long int jump; // bit map of locations jumped unsigned char mobil; unsigned char deny; unsigned char pin; unsigned char threat; short int gradient; - unsigned who:1; // 0 = black's move, 1 = white's move - unsigned king:1; // 1 = move causes piece to be kinged + unsigned who:1; // 0 = black's move, 1 = white's move + unsigned king:1; // 1 = move causes piece to be kinged unsigned back:1; unsigned moc2:1; unsigned moc3:1; @@ -119,20 +117,20 @@ struct node { unsigned demmo:1; }; -int nodes; // count of nodes +int nodes; // count of nodes -/* Board positions: Border positions: +/* Board positions: Border positions: - WHITE 00 01 02 03 04 - 05 06 07 08 04 XX XX XX XX - 09 10 11 12 XX XX XX XX 13 - 14 15 16 17 13 XX XX XX XX - 18 19 20 21 XX XX XX XX 22 - 23 24 25 26 22 XX XX XX XX - 27 28 29 30 XX XX XX XX 31 - 32 33 34 36 31 XX XX XX XX - 36 37 38 39 XX XX XX XX 40 - BLACK 40 41 42 43 44 + WHITE 00 01 02 03 04 + 05 06 07 08 04 XX XX XX XX + 09 10 11 12 XX XX XX XX 13 + 14 15 16 17 13 XX XX XX XX + 18 19 20 21 XX XX XX XX 22 + 23 24 25 26 22 XX XX XX XX + 27 28 29 30 XX XX XX XX 31 + 32 33 34 36 31 XX XX XX XX + 36 37 38 39 XX XX XX XX 40 + BLACK 40 41 42 43 44 */ @@ -150,7 +148,7 @@ typedef char piece; const piece flip[9] = { EMPTY, WHITE, BLACK, 0, 0, WHITEKING, BLACKKING, 0, BLUE}; -const int offset[9][4] = { // legal move directions +const int offset[9][4] = { // legal move directions {0,0,0,0}, {-5,-4,0,0}, {4,5,0,0}, @@ -162,15 +160,15 @@ const int offset[9][4] = { // legal move directions {0,0,0,0} }; -piece b[45]; // current board position being considered +piece b[45]; // current board position being considered -int evaluated; // number of moves evaluated this turn +int evaluated; // number of moves evaluated this turn char centralsquares[45]; char is_protected[45]; -piece flipboard[45]; // swapped if enemy is black -piece *tb; // pointer to real or swapped board +piece flipboard[45]; // swapped if enemy is black +piece *tb; // pointer to real or swapped board #define FRIEND BLACK #define FRIENDKING BLACKKING #define ENEMY WHITE @@ -205,11 +203,11 @@ void analyzemove(int direction,int src) { if (!tb[target+direction]) is_protected[target] = 1; piece a = tb[src]; tb[src] = EMPTY; if (check(target,4) || check(target,5) || - check(target,-4) || check(target,-5) || - (tb[src+4]&ENEMY && check(src+4,4)) || - (tb[src+5]&ENEMY && check(src+5,5)) || - (tb[src-4]&ENEMY && check(src-4,-4)) || - (tb[src-5]&ENEMY && check(src-5,-5))) + check(target,-4) || check(target,-5) || + (tb[src+4]&ENEMY && check(src+4,4)) || + (tb[src+5]&ENEMY && check(src+5,5)) || + (tb[src-4]&ENEMY && check(src-4,-4)) || + (tb[src-5]&ENEMY && check(src-5,-5))) deniedmoves++; else undeniedmoves++; tb[src] = a; @@ -218,7 +216,7 @@ void analyzemove(int direction,int src) { void evaluateboard(node *n,int print) { - if (!n->who) tb = b; // move was black's + if (!n->who) tb = b; // move was black's else { for (int i=0; i<45; i++) flipboard[44-i] = flip[(int)b[i]]; tb = flipboard; @@ -250,7 +248,7 @@ void evaluateboard(node *n,int print) { case ENEMY: deniedmoves = 0; undeniedmoves = 0; - J1: enemypieces++; + J1: enemypieces++; enemycent += centralsquares[i]; if (i<36) { analyzemove(4,i); @@ -297,22 +295,22 @@ void evaluateboard(node *n,int print) { n->demmo = n->deny>f->deny && f->deny+f->mobil>n->deny+n->mobil; total = - spiece * (friendpieces - enemypieces) + - (sking-spiece) * (friendkings - enemykings) + - // mobil? - sdeny * (n->deny - f->deny) + - spin * (n->pin - f->pin) + - sthreat * (n->threat - f->threat) + - sgrad * (n->gradient - f->gradient) + - sback * (n->back - f->back) + - smoc2 * (n->moc2 - f->moc2) + - smoc3 * (n->moc3 - f->moc3) + - smoc4 * (n->moc4 - f->moc4) + - smode2 * (n->mode2 - f->mode2) + - smode3 * (n->mode3 - f->mode3) + - sdemmo * (n->demmo - f->demmo) + - scent * (friendcent - enemycent) + - (skcent-scent) * (friendkcent - enemykcent); + spiece * (friendpieces - enemypieces) + + (sking-spiece) * (friendkings - enemykings) + + // mobil? + sdeny * (n->deny - f->deny) + + spin * (n->pin - f->pin) + + sthreat * (n->threat - f->threat) + + sgrad * (n->gradient - f->gradient) + + sback * (n->back - f->back) + + smoc2 * (n->moc2 - f->moc2) + + smoc3 * (n->moc3 - f->moc3) + + smoc4 * (n->moc4 - f->moc4) + + smode2 * (n->mode2 - f->mode2) + + smode3 * (n->mode3 - f->mode3) + + sdemmo * (n->demmo - f->demmo) + + scent * (friendcent - enemycent) + + (skcent-scent) * (friendkcent - enemykcent); if (!n->mobil) total += sallpin; if (!enemypieces) total = 30000; @@ -323,9 +321,9 @@ void evaluateboard(node *n,int print) { if (print) { printf("\tParent\tNew\tScore\n"); printf("pieces\t%d\t%d\t%d\n",enemypieces,friendpieces, - spiece*(friendpieces-enemypieces)); + spiece*(friendpieces-enemypieces)); printf("kings\t%d\t%d\t%d\n",enemykings,friendkings, - (sking-spiece)*(friendkings-enemykings)); + (sking-spiece)*(friendkings-enemykings)); printf("mobil\t%d\t%d\n",f->mobil,n->mobil); printf("deny\t%d\t%d\t%d\n",f->deny,n->deny,sdeny*(n->deny-f->deny)); printf("pin\t%d\t%d\t%d\n",f->pin,n->pin,spin*(n->pin-f->pin)); @@ -346,7 +344,7 @@ void evaluateboard(node *n,int print) { n->value = total; evaluated++; } -} // end of evaluateboard +} // end of evaluateboard // --------------------- Tree management ----------------- @@ -389,7 +387,7 @@ void killnode(node *x) { freelist = x; } -int seed; // current random number +int seed; // current random number void insert(node *n) { int val = n->value; @@ -417,25 +415,25 @@ void movepiece(node* f, int i, node* jnode) { int j = i+direction; if (b[j] == EMPTY) { if (!jnode && (!forcejumps || !f->son || !f->son->jump)) { - node* n = newnode(); - n->father = f; - n->who = !f->who; - n->from = i; - n->to = j; - piece oldpiece = b[i]; b[i] = EMPTY; - if (!(oldpiece&KING) && n->who ? (j>=36) : (j<=8)) { - n->king = 1; - b[j] = oldpiece|KING; - } - else b[j] = oldpiece; - evaluateboard(n,0); - insert(n); - b[i] = oldpiece; b[j] = EMPTY; + node* n = newnode(); + n->father = f; + n->who = !f->who; + n->from = i; + n->to = j; + piece oldpiece = b[i]; b[i] = EMPTY; + if (!(oldpiece&KING) && n->who ? (j>=36) : (j<=8)) { + n->king = 1; + b[j] = oldpiece|KING; + } + else b[j] = oldpiece; + evaluateboard(n,0); + insert(n); + b[i] = oldpiece; b[j] = EMPTY; } } else if (((b[j]^b[i])&(WHITE|BLACK))==(WHITE|BLACK) && !b[j+direction]) { if (forcejumps && f->son && !f->son->jump) { - killnode(f->son); - f->son = 0; + killnode(f->son); + f->son = 0; } int jumploc = j; j += direction; @@ -447,14 +445,14 @@ void movepiece(node* f, int i, node* jnode) { n->jump = (1<<(jumploc-10)); piece oldpiece = b[i]; b[i] = EMPTY; if (!(oldpiece&KING) && n->who ? (j>=36) : (j<=8)) { - n->king = 1; - b[j] = oldpiece|KING; + n->king = 1; + b[j] = oldpiece|KING; } else b[j] = oldpiece; if (jnode) { - n->from = jnode->from; - n->jump |= jnode->jump; - n->king |= jnode->king; + n->from = jnode->from; + n->jump |= jnode->jump; + n->king |= jnode->king; } piece jumpedpiece = b[jumploc]; b[jumploc] = EMPTY; @@ -470,7 +468,7 @@ void movepiece(node* f, int i, node* jnode) { } void expandnode(node *f) { - if (f->son || f->value > 28000) return; // already done + if (f->son || f->value > 28000) return; // already done piece turn = f->who ? BLACK : WHITE; for (int i=5; i<40; i++) if (b[i]&turn) movepiece(f,i,0); if (f->son) { @@ -532,9 +530,9 @@ int descend(node *f) { char debug; -node *calcmove(node *root) { // return best move after root +node *calcmove(node *root) { // return best move after root expandnode(root); - if (!root->son) return(0); // no move due to loss + if (!root->son) return(0); // no move due to loss if (debug) printf("calcmove() initial nodes = %d\n",nodes); evaluated = 0; if (root->son->brother) { @@ -555,10 +553,10 @@ node *calcmove(node *root) { // return best move after root node *root,*undoroot; -piece jumpboards[24][45]; // saved boards for undoing jumps +piece jumpboards[24][45]; // saved boards for undoing jumps int nextjump; -char user; // 0 = black, 1 = white +char user; // 0 = black, 1 = white char playing; char autoplay; @@ -610,7 +608,7 @@ node* undomove() { root = n->father; killnode(n); root->son = 0; - root->value = 0; // prevent it from thinking game is over + root->value = 0; // prevent it from thinking game is over playing = 1; if (root == undoroot) user = 0; return n; @@ -624,13 +622,13 @@ void dumpnode(node *n, int help) { int x = n->from; int y = n->to; if (help) printf("%c%c %c%c\t- ", - usermoves(x,1),usermoves(x,2), - usermoves(y,1),usermoves(y,2)); + usermoves(x,1),usermoves(x,2), + usermoves(y,1),usermoves(y,2)); printf("%s %ss from %c%c to %c%c", - n->who ? "White" : "Black", - n->jump ? "jump" : "move", - usermoves(x,1),usermoves(x,2), - usermoves(y,1),usermoves(y,2)); + n->who ? "White" : "Black", + n->jump ? "jump" : "move", + usermoves(x,1),usermoves(x,2), + usermoves(y,1),usermoves(y,2)); if (n->jump) { for (int i=0; i<32; i++) if (n->jump & (1<<i)) printf(", %c%c",usermoves(10+i,1),usermoves(10+i,2)); @@ -647,8 +645,8 @@ int abortflag; void positioncursor(int i) { printf("\033[%d;%dH", - usermoves(i,2)-'0'+1, - 2*(usermoves(i,1)-'A')+1); + usermoves(i,2)-'0'+1, + 2*(usermoves(i,1)-'A')+1); } void outpiecename(piece n) { @@ -798,20 +796,20 @@ node *getusermove(void) { break; default: puts( - "A(utoplay)\n" - "C(opyright)\n" - "D(ebug on/off)\n" - "F(orce jumps rule on/off)\n" - "L(ist legal moves)\n" - "M(ake a move for me)\n" - "N(ew game)\n" - "P(redict next few moves)\n" - "Q(uit)\n" - "R(edraw screen)\n" - "S(witch sides)\n" - "U(ndo)\n" - "+ - smarter\n" - "- - stupider"); + "A(utoplay)\n" + "C(opyright)\n" + "D(ebug on/off)\n" + "F(orce jumps rule on/off)\n" + "L(ist legal moves)\n" + "M(ake a move for me)\n" + "N(ew game)\n" + "P(redict next few moves)\n" + "Q(uit)\n" + "R(edraw screen)\n" + "S(witch sides)\n" + "U(ndo)\n" + "+ - smarter\n" + "- - stupider"); expandnode(root); for (t = root->son; t; t = t->brother) dumpnode(t,1); } @@ -825,17 +823,17 @@ int VT100main() { if (playing) { expandnode(root); if (!root->son) { - printf("%s has no move. Game over.",root->who ? "Black" : "White"); - playing = autoplay = 0; + printf("%s has no move. Game over.",root->who ? "Black" : "White"); + playing = autoplay = 0; } } node* move; if (playing && (autoplay || root->who == user)) { move = calcmove(root); if (move->value <= -30000) { - printf("%s resigns.", move->who ? "White" : "Black"); - move = 0; - playing = autoplay = 0; + printf("%s resigns.", move->who ? "White" : "Black"); + move = 0; + playing = autoplay = 0; } } else { move = getusermove(); @@ -879,7 +877,7 @@ void make_pieces() { png[i]->scale(png[i]->data_w()/2, png[i]->data_h()/2); } -#define ISIZE 62 // old: 56 +#define ISIZE 62 // old: 56 void draw_piece(int which, int x, int y) { if (!fl_not_clipped(x,y,ISIZE,ISIZE)) return; @@ -912,10 +910,10 @@ public: #define BMOFFSET 5 static int erase_this; // real location of dragging piece, don't draw it -static int dragging; // piece being dragged -static int dragx; // where it is +static int dragging; // piece being dragged +static int dragx; // where it is static int dragy; -static int showlegal; // show legal moves +static int showlegal; // show legal moves int squarex(int i) {return (usermoves(i,1)-'A')*BOXSIZE+BMOFFSET;} int squarey(int i) {return (usermoves(i,2)-'1')*BOXSIZE+BMOFFSET;} @@ -928,7 +926,7 @@ void Board::draw() { fl_color((Fl_Color)10 /*107*/); int x; for (x=0; x<8; x++) for (int y=0; y<8; y++) { if (!((x^y)&1)) fl_rectf(BORDER+x*BOXSIZE, BORDER+y*BOXSIZE, - BOXSIZE-BORDER, BOXSIZE-BORDER); + BOXSIZE-BORDER, BOXSIZE-BORDER); } // -- draw outlines around the fileds fl_color(FL_DARK3); @@ -1085,14 +1083,14 @@ int Board::handle(int e) { if (playing) { expandnode(root); for (t = root->son; t; t = t->brother) { - int x = squarex(t->from); - int y = squarey(t->from); - if (Fl::event_inside(x,y,BOXSIZE,BOXSIZE)) { - deltax = Fl::event_x()-x; - deltay = Fl::event_y()-y; - drag_piece(t->from,x,y); - return 1; - } + int x = squarex(t->from); + int y = squarey(t->from); + if (Fl::event_inside(x,y,BOXSIZE,BOXSIZE)) { + deltax = Fl::event_x()-x; + deltay = Fl::event_y()-y; + drag_piece(t->from,x,y); + return 1; + } } } return 0; @@ -1134,7 +1132,7 @@ int FLTKmain(int argc, char** argv) { b.callback(quit_cb); b.show(argc,argv); return Fl::run(); -} +} void autoplay_cb(Fl_Widget*bp, void*) { if (autoplay) {autoplay = 0; return;} @@ -1326,7 +1324,3 @@ int main(int argc, char **argv) { return VT100main(); #endif } - -// -// End of "$Id$". -// diff --git a/test/checkers_pieces.fl b/test/checkers_pieces.fl index 2d8aef590..11e90f505 100644 --- a/test/checkers_pieces.fl +++ b/test/checkers_pieces.fl @@ -3,8 +3,6 @@ version 1.0400 header_name {.h} code_name {.cxx} comment {// -// "$Id$" -// // Checkers images for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -15,9 +13,9 @@ comment {// // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // } {in_source in_header } @@ -33,9 +31,3 @@ data pixmaps_black_checker_king_png {selected public local filename {pixmaps/bla data pixmaps_white_checker_king_png {public local filename {pixmaps/white_checker_king.png} } - -comment { -// -// End of "$Id$". -//} {in_source in_header -} diff --git a/test/clock.cxx b/test/clock.cxx index b6c1832fb..957054f1f 100644 --- a/test/clock.cxx +++ b/test/clock.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Clock test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -57,7 +55,3 @@ int main(int argc, char **argv) { window2.show(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/colbrowser.cxx b/test/colbrowser.cxx index ccec8d60c..bcd1506d7 100644 --- a/test/colbrowser.cxx +++ b/test/colbrowser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // X Color Browser demo program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2019 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // @@ -37,7 +35,7 @@ #define MAX_RGB 3000 #define FL_FREE_COL4 ((Fl_Color)(FL_FREE_COLOR+3)) -#define FL_INDIANRED ((Fl_Color)(164)) +#define FL_INDIANRED ((Fl_Color)(164)) static Fl_Double_Window *cl; @@ -59,9 +57,9 @@ static RGBdb rgbdb[MAX_RGB]; int main(int argc, char *argv[]) { Fl::args(argc, argv); - + create_form_cl(); - + #ifdef __APPLE__ // Bundled apps do not set the current directory strcpy(dbname, argv[0]); @@ -71,19 +69,19 @@ int main(int argc, char *argv[]) #else strcpy(dbname, "rgb.txt"); #endif - + if (load_browser(dbname)) dbobj->label(dbname); else dbobj->label("None"); dbobj->redraw(); - + cl->size_range(cl->w(),cl->h(),2*cl->w(),2*cl->h()); - + cl->label("RGB Browser"); cl->free_position(); cl->show(argc,argv); - + return Fl::run(); } @@ -102,7 +100,7 @@ static void set_entry(int i) static void br_cb(Fl_Widget *ob, long) { int r = ((Fl_Browser *)ob)->value(); - + if (r <= 0) return; set_entry(r - 1); @@ -113,21 +111,21 @@ static int read_entry(FILE * fp, int *r, int *g, int *b, char *name) { int n; char buf[512], *p; - + if (!fgets(buf, sizeof(buf) - 1, fp)) return 0; - + if(buf[0] == '!') { if (fgets(buf,sizeof(buf)-1,fp)==0) { /* ignore */ } } - + if(sscanf(buf, " %d %d %d %n", r, g, b, &n) < 3) return 0; - + p = buf + n; - + /* squeeze out all spaces */ while (*p) { @@ -136,7 +134,7 @@ static int read_entry(FILE * fp, int *r, int *g, int *b, char *name) p++; } *name = 0; - + return (feof(fp) || ferror(fp)) ? 0 : 1; } @@ -152,15 +150,15 @@ static int load_browser(char *fname) fl_alert("%s\n%s\n%s","Load", fname, "Can't open"); return 0; } - + /* read the items */ - + for (; db < dbs && read_entry(fp, &r, &g, &b, name);) { db->r = r; db->g = g; db->b = b; - + /* unique the entries on the fly */ if (lr != r || lg != g || lb != b) { @@ -173,19 +171,19 @@ static int load_browser(char *fname) } } fclose(fp); - + if (db < dbs) - db->r = 1000; /* sentinel */ + db->r = 1000; /* sentinel */ else { db--; db->r = 1000; } - + colbr->topline(1); colbr->select(1,1); set_entry(0); - + return 1; } @@ -195,14 +193,14 @@ static int search_entry(int r, int g, int b) RGBdb *db = rgbdb; int i, j, diffr, diffg, diffb; unsigned int diff, mindiff; - + mindiff = (unsigned int)~0; for (i = j = 0; db->r < 256; db++, i++) { diffr = r - db->r; diffg = g - db->g; diffb = b - db->b; - + #ifdef FL_LINEAR diff = unsigned(3.0 * (FL_abs(r - db->r)) + (5.9 * FL_abs(g - db->g)) + @@ -212,14 +210,14 @@ static int search_entry(int r, int g, int b) 5.9 * (diffg *diffg) + 1.1 * (diffb *diffb)); #endif - + if (mindiff > diff) { mindiff = diff; j = i; } } - + return j; } @@ -228,11 +226,11 @@ static void search_rgb(Fl_Widget *, long) { int r, g, b, i; int top = colbr->topline(); - + r = int(rs->value()); g = int(gs->value()); b = int(bs->value()); - + // fl_freeze_form(cl); Fl::set_color(FL_FREE_COL4, r, g, b); rescol->redraw(); @@ -250,10 +248,10 @@ static void db_cb(Fl_Widget * ob, long) { const char *p = fl_input("Enter New Database Name", dbname); char buf[512]; - + if (!p || strcmp(p, dbname) == 0) return; - + strcpy(buf, p); if (load_browser(buf)) strcpy(dbname, buf); @@ -272,33 +270,33 @@ static void create_form_cl(void) { if (cl) return; - + cl = new Fl_Double_Window(400,385); cl->box(FL_UP_BOX); cl->color(FL_INDIANRED, FL_GRAY); - + Fl_Box *title = new Fl_Box(40, 10, 300, 30, "Color Browser"); title->box(FL_NO_BOX); title->labelcolor(FL_RED); title->labelsize(32); title->labelfont(FL_HELVETICA_BOLD); title->labeltype(FL_SHADOW_LABEL); - + dbobj = new Fl_Button(40, 50, 300, 25, ""); dbobj->type(FL_NORMAL_BUTTON); dbobj->box(FL_BORDER_BOX); dbobj->color(FL_INDIANRED,FL_INDIANRED); dbobj->callback(db_cb, 0); - + colbr = new Fl_Hold_Browser(10, 90, 280, 240, ""); - colbr->textfont(FL_COURIER); + colbr->textfont(FL_COURIER); colbr->callback(br_cb, 0); colbr->box(FL_DOWN_BOX); - + rescol = new Fl_Box(300, 90, 90, 35, ""); rescol->color(FL_FREE_COL4, FL_FREE_COL4); rescol->box(FL_BORDER_BOX); - + rs = new Fl_Value_Slider(300, 130, 30, 200, ""); rs->type(FL_VERT_FILL_SLIDER); rs->color(FL_INDIANRED, FL_RED); @@ -306,7 +304,7 @@ static void create_form_cl(void) rs->precision(0); rs->callback(search_rgb, 0); rs->when(FL_WHEN_RELEASE); - + gs = new Fl_Value_Slider(330, 130, 30, 200, ""); gs->type(FL_VERT_FILL_SLIDER); gs->color(FL_INDIANRED, FL_GREEN); @@ -314,7 +312,7 @@ static void create_form_cl(void) gs->precision(0); gs->callback(search_rgb, 1); gs->when(FL_WHEN_RELEASE); - + bs = new Fl_Value_Slider(360, 130, 30, 200, ""); bs->type(FL_VERT_FILL_SLIDER); bs->color(FL_INDIANRED, FL_BLUE); @@ -322,15 +320,11 @@ static void create_form_cl(void) bs->precision(0); bs->callback(search_rgb, 2); bs->when(FL_WHEN_RELEASE); - + Fl_Button *done = new Fl_Button(160, 345, 80, 30, "Done"); done->type(FL_NORMAL_BUTTON); done->callback(done_cb, 0); - + cl->end(); cl->resizable(cl); } - -// -// End of "$Id$". -// diff --git a/test/color_chooser.cxx b/test/color_chooser.cxx index 0c998034d..ffa89b1e5 100644 --- a/test/color_chooser.cxx +++ b/test/color_chooser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Color chooser test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -45,8 +43,8 @@ void make_image() { for (int x = 0; x < width; x++) { double X = double(x)/(width-1); *p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left - *p++ = uchar(255*((1-X)*Y)); // green in lower-left - *p++ = uchar(255*(X*Y)); // blue in lower-right + *p++ = uchar(255*((1-X)*Y)); // green in lower-left + *p++ = uchar(255*(X*Y)); // blue in lower-right } } } @@ -145,7 +143,3 @@ int main(int argc, char ** argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/connect.cxx b/test/connect.cxx index 4fbabfc65..d8b84b9e7 100644 --- a/test/connect.cxx +++ b/test/connect.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // PPP example program for the Fast Light Tool Kit (FLTK). // // Program to make a button to turn a ppp connection on/off. @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> @@ -30,7 +28,7 @@ #include <FL/Fl_Window.H> #include <FL/Fl_Toggle_Button.H> -int running; // actually the pid +int running; // actually the pid Fl_Toggle_Button *Button; void sigchld(int) { @@ -62,7 +60,3 @@ int main(int argc, char ** argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/cube.cxx b/test/cube.cxx index 63b6fdb8d..7add96490 100644 --- a/test/cube.cxx +++ b/test/cube.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL test program for the Fast Light Tool Kit (FLTK). // // Modified to have 2 cubes to test multiple OpenGL contexts @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -165,7 +163,7 @@ void makeform(const char *name) { cube2 = new cube_box(513,23,344,344, 0); Fl_Box *b = new Fl_Box(FL_NO_BOX,cube->x(),size->y(), - cube->w(),size->h(),0); + cube->w(),size->h(),0); form->resizable(b); b->hide(); form->end(); @@ -194,7 +192,7 @@ int main(int argc, char **argv) { makeform(argv[0]); // added to demo printing form->begin(); - static Fl_Menu_Item items[] = { + static Fl_Menu_Item items[] = { { "Print", 0, 0, 0, FL_SUBMENU }, { "Print window", 0, print_cb, 0, 0 }, { 0 }, @@ -231,9 +229,9 @@ int main(int argc, char **argv) { #endif for (;;) { if (form->visible() && speed->value()) - {if (!Fl::check()) break;} // returns immediately + {if (!Fl::check()) break;} // returns immediately else - {if (!Fl::wait()) break;} // waits until something happens + {if (!Fl::wait()) break;} // waits until something happens cube->wire = wire->value(); cube2->wire = !wire->value(); cube->size = cube2->size = size->value(); @@ -244,7 +242,3 @@ int main(int argc, char **argv) { } return 0; } - -// -// End of "$Id$". -// diff --git a/test/cursor.cxx b/test/cursor.cxx index 0b27d71e3..4f80f4180 100644 --- a/test/cursor.cxx +++ b/test/cursor.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Cursor test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -116,7 +114,3 @@ int main(int argc, char **argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/curve.cxx b/test/curve.cxx index 6ee1450fc..3b92be159 100644 --- a/test/curve.cxx +++ b/test/curve.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Curve test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -100,7 +98,3 @@ int main(int argc, char** argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/demo.cxx b/test/demo.cxx index b68a66756..e7f9445e1 100644 --- a/test/demo.cxx +++ b/test/demo.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Main demo program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -11,9 +9,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -111,7 +109,7 @@ typedef struct { char icommand[9][64]; } MENU; -#define MAXMENU 32 +#define MAXMENU 32 MENU menus[MAXMENU]; int mennumb = 0; @@ -144,27 +142,27 @@ void addto_menu(const char* men, const char* item, const char* comm) { /* Button to Item conversion and back. */ -int b2n[][9] = { - { -1, -1, -1, -1, 0, -1, -1, -1, -1}, - { -1, -1, -1, 0, -1, 1, -1, -1, -1}, - { 0, -1, -1, -1, 1, -1, -1, -1, 2}, - { 0, -1, 1, -1, -1, -1, 2, -1, 3}, - { 0, -1, 1, -1, 2, -1, 3, -1, 4}, - { 0, -1, 1, 2, -1, 3, 4, -1, 5}, - { 0, -1, 1, 2, 3, 4, 5, -1, 6}, - { 0, 1, 2, 3, -1, 4, 5, 6, 7}, - { 0, 1, 2, 3, 4, 5, 6, 7, 8} +int b2n[][9] = { + { -1, -1, -1, -1, 0, -1, -1, -1, -1}, + { -1, -1, -1, 0, -1, 1, -1, -1, -1}, + { 0, -1, -1, -1, 1, -1, -1, -1, 2}, + { 0, -1, 1, -1, -1, -1, 2, -1, 3}, + { 0, -1, 1, -1, 2, -1, 3, -1, 4}, + { 0, -1, 1, 2, -1, 3, 4, -1, 5}, + { 0, -1, 1, 2, 3, 4, 5, -1, 6}, + { 0, 1, 2, 3, -1, 4, 5, 6, 7}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8} }; -int n2b[][9] = { - { 4, -1, -1, -1, -1, -1, -1, -1, -1}, - { 3, 5, -1, -1, -1, -1, -1, -1, -1}, - { 0, 4, 8, -1, -1, -1, -1, -1, -1}, - { 0, 2, 6, 8, -1, -1, -1, -1, -1}, - { 0, 2, 4, 6, 8, -1, -1, -1, -1}, - { 0, 2, 3, 5, 6, 8, -1, -1, -1}, - { 0, 2, 3, 4, 5, 6, 8, -1, -1}, - { 0, 1, 2, 3, 5, 6, 7, 8, -1}, - { 0, 1, 2, 3, 4, 5, 6, 7, 8} +int n2b[][9] = { + { 4, -1, -1, -1, -1, -1, -1, -1, -1}, + { 3, 5, -1, -1, -1, -1, -1, -1, -1}, + { 0, 4, 8, -1, -1, -1, -1, -1, -1}, + { 0, 2, 6, 8, -1, -1, -1, -1, -1}, + { 0, 2, 4, 6, 8, -1, -1, -1, -1}, + { 0, 2, 3, 5, 6, 8, -1, -1, -1}, + { 0, 2, 3, 4, 5, 6, 8, -1, -1}, + { 0, 1, 2, 3, 5, 6, 7, 8, -1}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8} }; /* Transform a button number to an item number when there are @@ -222,26 +220,26 @@ void dobut(Fl_Widget *, long arg) { #ifdef _WIN32 - STARTUPINFO suInfo; // Process startup information - PROCESS_INFORMATION prInfo; // Process information + STARTUPINFO suInfo; // Process startup information + PROCESS_INFORMATION prInfo; // Process information # if DEBUG_EXE_WITH_D - const char *exe = "d.exe"; // exe name with trailing 'd' + const char *exe = "d.exe"; // exe name with trailing 'd' # else - const char *exe = ".exe"; // exe name w/o trailing 'd' + const char *exe = ".exe"; // exe name w/o trailing 'd' # endif memset(&suInfo, 0, sizeof(suInfo)); suInfo.cb = sizeof(suInfo); - + int icommand_length = strlen(menus[men].icommand[bn]); - + char* copy_of_icommand = new char[icommand_length+1]; strcpy(copy_of_icommand,menus[men].icommand[bn]); - + // On Windows the .exe suffix needs to be appended to the command // whilst leaving any additional parameters unchanged - this - // is required to handle the correct conversion of cases such as : + // is required to handle the correct conversion of cases such as : // `../fluid/fluid valuators.fl' to '../fluid/fluid.exe valuators.fl'. // skip leading spaces. @@ -261,16 +259,16 @@ void dobut(Fl_Widget *, long arg) { *start_parameters = 0; // move start_paremeters to skip over the intermediate space. ++start_parameters; - + sprintf(command, "%s%s %s", start_command, exe, start_parameters); } - + CreateProcess(NULL, command, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &suInfo, &prInfo); - + delete[] command; delete[] copy_of_icommand; - + #elif defined __APPLE__ /* Starting with version 1.4.0, FLTK uses CMake as the only supported build @@ -364,7 +362,7 @@ void dobut(Fl_Widget *, long arg) { #else // Non Windows systems. int icommand_length = strlen(menus[men].icommand[bn]); - char* command = new char[icommand_length+5]; // 5 for extra './' and ' &\0' + char* command = new char[icommand_length+5]; // 5 for extra './' and ' &\0' sprintf(command, "./%s &", menus[men].icommand[bn]); if (system(command)==-1) { /* ignore */ } @@ -417,7 +415,7 @@ int load_the_menu(char* fname) { while (line[i] != ':' && line[i] != '\n') mname[j++] = line[i++]; mname[j] = '\0'; if (line[i] == ':') i++; - j = 0; + j = 0; while (line[i] != ':' && line[i] != '\n') { if (line[i] == '\\') { i++; @@ -453,15 +451,15 @@ int main(int argc, char **argv) { if (!Fl::args(argc,argv,i) || i < argc-1) Fl::fatal("Usage: %s <switches> <menufile>\n%s",argv[0],Fl::help); if (i < argc) fname = argv[i]; - + create_the_forms(); - + if (!load_the_menu(fname)) Fl::fatal("Can't open %s",fname); if (buf != fname) strcpy(buf,fname); const char *c = fl_filename_name(buf); if (c > buf) { - buf[c-buf] = 0; + buf[c-buf] = 0; if (fl_chdir(buf) == -1) { /* ignore */ } } push_menu("@main"); @@ -469,7 +467,3 @@ int main(int argc, char **argv) { Fl::run(); return 0; } - -// -// End of "$Id$". -// diff --git a/test/device.cxx b/test/device.cxx index e242f6ae6..e922a77cd 100644 --- a/test/device.cxx +++ b/test/device.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Device test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Roman Kantor and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <math.h> @@ -118,7 +116,7 @@ protected: fl_color(FL_YELLOW); fl_rectf(x()+7,y()+7,w()-14,h()-14); fl_color(FL_BLUE); - + fl_rect(x()+8,y()+8,w()-16,h()-16); fl_push_clip(x()+25,y()+25,w()-50, h()-50); fl_color(FL_BLACK); @@ -127,7 +125,7 @@ protected: fl_line(x()+27,y()+h()-27,x()+w()-27,y()+27); //fl_rect(x()+30,y()+30,w()-60,h()-60); fl_pop_clip(); - + } public: MyWidget(int x, int y):Fl_Box(x,y,100,100, "Clipping and rect(f):\nYellow rect.framed\nby B-Y-G-R rect. 1 p.\nthick. Your printer may \nrender very thin lines\nsurrounding \"X\""){ @@ -146,13 +144,13 @@ protected: for(d=y()+5;d<48+y();d+=2){ fl_xyline(x()+5,d,x()+48); } - + fl_push_clip(x()+52,y()+5,45,43); for(d=y()+5;d<150+y();d+=3){ fl_line(x()+52,d,x()+92,d-40); } fl_pop_clip(); - + fl_line_style(FL_DASH); fl_xyline(x()+5,y()+55,x()+48); fl_line_style(FL_DOT); @@ -163,39 +161,39 @@ protected: fl_xyline(x()+5,y()+64,x()+48); fl_line_style(0,0,(char*)"\7\3\7\2"); fl_xyline(x()+5,y()+67,x()+48); - + fl_line_style(0); - + fl_line(x()+5,y()+72,x()+25,y()+95); fl_line(x()+8,y()+72,x()+28,y()+95,x()+31,y()+72); - + fl_color(FL_YELLOW); fl_polygon(x()+11, y()+72,x()+27,y()+91,x()+29,y()+72); fl_color(FL_RED); fl_loop(x()+11, y()+72,x()+27,y()+91,x()+29,y()+72); - + fl_color(FL_BLUE); //// fl_line_style(FL_SOLID, 6); fl_loop(x()+31, y()+12,x()+47,y()+31,x()+49,y()+12); fl_line_style(0); - + fl_color(200,0,200); fl_polygon(x()+35,y()+72,x()+33,y()+95,x()+48,y()+95,x()+43,y()+72); fl_color(FL_GREEN); fl_loop(x()+35,y()+72,x()+33,y()+95,x()+48,y()+95,x()+43,y()+72); - - fl_color(FL_BLUE); + + fl_color(FL_BLUE); fl_yxline(x()+65,y()+63,y()+66); - fl_color(FL_GREEN); + fl_color(FL_GREEN); fl_yxline(x()+66,y()+66,y()+63); - + fl_color(FL_BLUE); fl_rect(x()+80,y()+55,5,5); fl_color(FL_YELLOW); fl_rectf(x()+81,y()+56,3,3); fl_color(FL_BLACK); fl_point(x()+82,y()+57); - + fl_color(FL_BLUE); fl_rect(x()+56, y()+79, 24, 17); fl_color(FL_CYAN); @@ -204,9 +202,9 @@ protected: fl_arc(x()+57, y()+80, 22 ,15 ,40, 270); fl_color(FL_YELLOW); fl_pie(x()+58, y()+81, 20 ,13 ,40, 270); - + fl_line_style(0); - + fl_color(FL_BLACK); fl_point(x()+58,y()+58); fl_color(FL_RED); @@ -217,7 +215,7 @@ protected: fl_xyline(x()+61,y()+58,x()+62); fl_color(FL_RED); fl_xyline(x()+62,y()+59,x()+61); - + fl_color(FL_GREEN); fl_yxline(x()+57,y()+58,y()+59,x()+58); fl_color(FL_BLUE); @@ -226,15 +224,15 @@ protected: fl_xyline(x()+58,y()+61,x()+56,y()+63); fl_color(FL_GREEN); fl_yxline(x()+57,y()+63,y()+62,x()+58); - + fl_color(FL_BLUE); fl_line(x()+58,y()+63, x()+60, y()+65); fl_color(FL_BLACK); fl_line(x()+61,y()+65, x()+59, y()+63); - + fl_color(FL_BLACK); }; - + public: MyWidget2(int x, int y):Fl_Box(x,y,100,100, "Integer primitives"){ labelsize(10); @@ -257,7 +255,7 @@ protected: fl_end_line(); } fl_pop_clip(); - + fl_push_clip(x()+52,y()+5,45,43); for(d=y()+5;d<150+y();d+=2.3052){ fl_begin_line(); @@ -266,7 +264,7 @@ protected: fl_end_line(); } fl_pop_clip(); - + }; public: MyWidget3(int x, int y):Fl_Box(x,y,100,100, "Sub-pixel drawing of\nlines 1.63 points apart\nOn the screen you\ncan see aliasing, the\nprinter should render\nthem properly"){ @@ -284,7 +282,7 @@ protected: fl_push_matrix(); fl_translate(x(),y()); fl_scale(.75,.75); - + fl_line_style(FL_SOLID , 5); fl_begin_line(); fl_vertex(10, 160); @@ -301,8 +299,8 @@ protected: fl_vertex(50, 190); fl_end_line(); fl_line_style(0); - - fl_color(FL_GREEN); + + fl_color(FL_GREEN); fl_line_style(FL_SOLID | FL_CAP_ROUND |FL_JOIN_ROUND , 5); fl_begin_line(); fl_vertex(10, 140); @@ -310,7 +308,7 @@ protected: fl_vertex(60, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_BLUE); fl_line_style(FL_SOLID | FL_CAP_SQUARE |FL_JOIN_BEVEL , 5); fl_begin_line(); @@ -319,7 +317,7 @@ protected: fl_vertex(70, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_BLACK); fl_line_style(FL_DASH , 5); fl_begin_line(); @@ -328,7 +326,7 @@ protected: fl_vertex(80, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_RED); fl_line_style(FL_DASH |FL_CAP_FLAT , 5); fl_begin_line(); @@ -337,7 +335,7 @@ protected: fl_vertex(90, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_GREEN); fl_line_style(FL_DASH |FL_CAP_ROUND , 5); fl_begin_line(); @@ -346,8 +344,8 @@ protected: fl_vertex(100, 190); fl_end_line(); fl_line_style(0); - - + + fl_color(FL_BLUE); fl_line_style(FL_DASH |FL_CAP_SQUARE , 5); fl_begin_line(); @@ -356,7 +354,7 @@ protected: fl_vertex(110, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_BLACK); fl_line_style(FL_DOT, 5); fl_begin_line(); @@ -365,7 +363,7 @@ protected: fl_vertex(120, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_RED); fl_line_style(FL_DOT | FL_CAP_FLAT, 5); fl_begin_line(); @@ -374,7 +372,7 @@ protected: fl_vertex(130, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_GREEN); fl_line_style(FL_DOT | FL_CAP_ROUND, 5); fl_begin_line(); @@ -383,7 +381,7 @@ protected: fl_vertex(140, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_BLUE); fl_line_style(FL_DOT | FL_CAP_SQUARE, 5); fl_begin_line(); @@ -392,7 +390,7 @@ protected: fl_vertex(150, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_BLACK); fl_line_style(FL_DASHDOT |FL_CAP_ROUND |FL_JOIN_ROUND , 5); fl_begin_line(); @@ -401,7 +399,7 @@ protected: fl_vertex(160, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_RED); fl_line_style(FL_DASHDOTDOT |FL_CAP_SQUARE |FL_JOIN_BEVEL , 5); fl_begin_line(); @@ -410,8 +408,8 @@ protected: fl_vertex(170, 190); fl_end_line(); fl_line_style(0); - - + + fl_color(FL_GREEN); fl_line_style(FL_DASHDOTDOT |FL_CAP_ROUND |FL_JOIN_ROUND , 5); fl_begin_line(); @@ -420,18 +418,18 @@ protected: fl_vertex(180, 190); fl_end_line(); fl_line_style(0); - + fl_color(FL_BLUE); fl_line_style(0, 5, (char*)"\12\3\4\2\2\1"); fl_begin_line(); fl_vertex(10, 10); fl_vertex(190, 10); fl_vertex(190, 190); - + fl_end_line(); fl_line_style(0); - fl_pop_matrix(); - + fl_pop_matrix(); + fl_color(FL_BLACK); }; public: @@ -447,7 +445,7 @@ protected: void draw(){ Fl_Box::draw(); fl_push_matrix(); - + fl_translate(x(),y()); fl_push_matrix(); fl_mult_matrix(1,3,0,1,0,-20); @@ -457,39 +455,39 @@ protected: fl_vertex(100,-80); fl_vertex(100,-190); fl_end_polygon(); - + fl_color(FL_RED); fl_line_style(FL_DASHDOT, 7); fl_begin_loop(); - + fl_vertex(10,10); fl_vertex(100,-80); fl_vertex(100,-190); fl_end_loop(); fl_line_style(0); - + fl_color(FL_BLUE); fl_line_style(FL_SOLID, 3); fl_begin_loop(); fl_circle(60,-50,30); fl_end_loop(); fl_line_style(0); - + fl_pop_matrix(); fl_scale(1.8,1); - + fl_color(FL_YELLOW); fl_begin_polygon(); fl_arc(30,90,20,-45,200); fl_end_polygon(); - + fl_color(FL_BLACK); fl_line_style(FL_DASH, 3); fl_begin_line(); fl_arc(30,90,20,-45,200); fl_end_line(); fl_line_style(0); - + fl_translate(15,0); fl_scale(1.5,3); fl_begin_complex_polygon(); @@ -507,7 +505,7 @@ protected: fl_vertex(40,10); fl_vertex(35,20); fl_end_complex_polygon(); - + fl_pop_matrix(); }; public: @@ -530,12 +528,12 @@ void make_image() { for (int x = 0; x < width; x++) { double X = double(x)/(width-1); *p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left - *p++ = uchar(255*((1-X)*Y)); // green in lower-left - *p++ = uchar(255*(X*Y)); // blue in lower-right + *p++ = uchar(255*((1-X)*Y)); // green in lower-left + *p++ = uchar(255*(X*Y)); // blue in lower-right X -= 0.5; Y -= 0.5; int alpha = (int)(350 * sqrt(X * X + Y * Y)); - if (alpha < 255) *p++ = uchar(alpha); // alpha transparency + if (alpha < 255) *p++ = uchar(alpha); // alpha transparency else *p++ = 255; Y += 0.5; } @@ -559,7 +557,7 @@ void copy(Fl_Widget *, void *data) { W = target->as_window()->decorated_w(); H = target->as_window()->decorated_h(); decorated = 1; - } + } else { W = target->w(); H = target->h(); @@ -586,8 +584,8 @@ void copy(Fl_Widget *, void *data) { } return; } - - + + if (strcmp(operation, "Fl_Copy_Surface") == 0) { Fl_Copy_Surface *copy_surf; if (target->as_window() && !target->parent()) { @@ -604,7 +602,7 @@ void copy(Fl_Widget *, void *data) { delete copy_surf; Fl_Surface_Device::pop_current(); } - + if (strcmp(operation, "Fl_Printer") == 0 || strcmp(operation, "Fl_PostScript_File_Device") == 0) { Fl_Paged_Device *p; int err; @@ -626,7 +624,7 @@ void copy(Fl_Widget *, void *data) { } else if (err > 1 && err_message) {fl_alert("%s", err_message); delete[] err_message;} delete p; } - + if (strcmp(operation, "Fl_EPS_File_Surface") == 0) { Fl_Native_File_Chooser fnfc; fnfc.title("Save a .eps file"); @@ -694,7 +692,7 @@ protected: fl_line(x()+w()-15,y()+10,x()+15,y()+h()-23); fl_line_style(0); draw_label(); - + }; public: My_Button(int x, int y, int w, int h, const char * label = 0):Fl_Button(x,y,w,h,label){} @@ -712,32 +710,32 @@ void operation_cb(Fl_Widget* wid, void *data) } int main(int argc, char ** argv) { - - Fl::scheme("plastic"); - + + Fl::scheme("plastic"); + Fl_Window * w2 = new Fl_Window(500,568,"Graphics test"); - + Fl_Group *c2 =new Fl_Group(3, 56, 494, 514 ); - + new MyWidget(10,140+16); new MyWidget2(110,80+16); new MyWidget3(220,140+16); new MyWidget4(330,70+16); new MyWidget5(140,270+16); - + make_image(); Fl_RGB_Image *rgb = new Fl_RGB_Image(image, width, height, 4); My_Button b_rgb(10,245+16,100,100,"RGB with alpha"); b_rgb.image(rgb); - + My_Button b_pixmap(10,345+16,100,100,"Pixmap"); Fl_Pixmap *pixmap = new Fl_Pixmap(porsche_xpm); b_pixmap.image(pixmap); - + My_Button b_bitmap(10,445+16,100,100,"Bitmap"); b_bitmap.labelcolor(FL_GREEN); b_bitmap.image(new Fl_Bitmap(sorceress_bits,sorceress_width,sorceress_height)); - + new Fl_Clock(360,230+16,120,120); Fl_Return_Button * ret = new Fl_Return_Button (360, 360, 120,30, "Return"); ret->deactivate(); @@ -753,10 +751,10 @@ int main(int argc, char ** argv) { but5.labelfont(FL_BOLD|FL_ITALIC); but5.labeltype(FL_SHADOW_LABEL); but5.box(FL_ROUND_UP_BOX); - + Fl_Button but6(360, 460+16, 120, 30, "Plastic"); but6.box(FL_PLASTIC_UP_BOX); - + Fl_Group *group; { Fl_Group* o = new Fl_Group(360, 495+16, 120, 40); group=o; o->box(FL_UP_BOX); @@ -767,7 +765,6 @@ int main(int argc, char ** argv) { } { Fl_Check_Button* o = new Fl_Check_Button(410, 500+16, 60, 30, "check"); o->value(1); - } o->end(); } @@ -777,16 +774,16 @@ int main(int argc, char ** argv) { Fl_Box tx(120,492+16,230,50,"Background is not printed because\nencapsulating group, which we are\n printing, has not set the box type"); tx.box(FL_SHADOW_BOX); tx.labelsize(12); - + tx.hide(); - + c2->end(); - + Fl_Radio_Round_Button *rb; Fl_Window *w3 = new Fl_Window(2,5,w2->w()-10,73); w3->box(FL_DOWN_BOX); Fl_Group *g1 = new Fl_Group(w3->x(),w3->y(),w3->w(),w3->h()); - rb = new Fl_Radio_Round_Button(5,5,150,12, "Fl_Image_Surface"); + rb = new Fl_Radio_Round_Button(5,5,150,12, "Fl_Image_Surface"); rb->set(); rb->callback(operation_cb, NULL); operation = rb->label(); rb->labelsize(12); rb = new Fl_Radio_Round_Button(5,18,150,12, "Fl_Copy_Surface"); rb->callback(operation_cb, NULL); rb->labelsize(12); rb = new Fl_Radio_Round_Button(5,31,150,12, "Fl_Printer"); rb->callback(operation_cb, NULL); rb->labelsize(12); @@ -794,9 +791,9 @@ int main(int argc, char ** argv) { rb = new Fl_Radio_Round_Button(5,57,150,12, "Fl_EPS_File_Surface"); rb->callback(operation_cb, NULL); rb->labelsize(12); rb = new Fl_Radio_Round_Button(170,57,150,12, "Fl_SVG_File_Surface"); rb->callback(operation_cb, NULL); rb->labelsize(12); g1->end(); - + Fl_Group *g2 = new Fl_Group(w3->x(),w3->y(),w3->w(),w3->h()); - rb = new Fl_Radio_Round_Button(170,5,150,12, "Decorated Window"); + rb = new Fl_Radio_Round_Button(170,5,150,12, "Decorated Window"); rb->set(); rb->callback(target_cb, w2); target = w2; rb = new Fl_Radio_Round_Button(170,22,150,12, "Sub-window"); rb->callback(target_cb, w3); rb = new Fl_Radio_Round_Button(170,39,150,12, "Group"); rb->callback(target_cb, group); @@ -804,22 +801,18 @@ int main(int argc, char ** argv) { Fl_Button *b4 = new Fl_Button(330, (w3->h() - 25)/2, 150, 25, "GO"); b4->callback((Fl_Callback*)copy,NULL); w3->end(); - + w2->end(); Fl_RGB_Image *rgba_icon = new Fl_RGB_Image(pixmap); Fl_Window::default_icon(rgba_icon); - //w2->icon(rgba_icon); + // w2->icon(rgba_icon); delete rgba_icon; w2->show(argc, argv); - + Fl::run(); delete pixmap; delete b_bitmap.image(); delete rgb; - + return 0; } - -// -// End of "$Id$" -// diff --git a/test/doublebuffer.cxx b/test/doublebuffer.cxx index d36910eca..805a6e4b6 100644 --- a/test/doublebuffer.cxx +++ b/test/doublebuffer.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Double-buffering test program for the Fast Light Tool Kit (FLTK). // // This demo shows how double buffering helps, by drawing the @@ -19,11 +17,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -113,7 +111,3 @@ int main(int argc, char **argv) { w2.show(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/editor.cxx b/test/editor.cxx index 176a8d79b..3170362b3 100644 --- a/test/editor.cxx +++ b/test/editor.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // A simple text editor program for the Fast Light Tool Kit (FLTK). // // This program is described in Chapter 4 of the FLTK Programmer's Guide. @@ -13,9 +11,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -50,7 +48,7 @@ Fl_Text_Buffer *textbuf = 0; // width of line number display, if enabled const int line_num_width = 75; -// #define DEV_TEST // uncomment this line ... +// #define DEV_TEST // uncomment this line ... // ... to enable additional test features for developers, // particularly to test Fl_Text_Display and/or Fl_Text_Editor. @@ -58,89 +56,89 @@ const int line_num_width = 75; #define TS 14 // default editor textsize Fl_Text_Buffer *stylebuf = 0; Fl_Text_Display::Style_Table_Entry - styletable[] = { // Style table - { FL_BLACK, FL_COURIER, TS }, // A - Plain - { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // B - Line comments - { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // C - Block comments - { FL_BLUE, FL_COURIER, TS }, // D - Strings - { FL_DARK_RED, FL_COURIER, TS }, // E - Directives - { FL_DARK_RED, FL_COURIER_BOLD, TS }, // F - Types - { FL_BLUE, FL_COURIER_BOLD, TS }, // G - Keywords - }; -const char *code_keywords[] = { // List of known C/C++ keywords... - "and", - "and_eq", - "asm", - "bitand", - "bitor", - "break", - "case", - "catch", - "compl", - "continue", - "default", - "delete", - "do", - "else", - "false", - "for", - "goto", - "if", - "new", - "not", - "not_eq", - "operator", - "or", - "or_eq", - "return", - "switch", - "template", - "this", - "throw", - "true", - "try", - "while", - "xor", - "xor_eq" - }; -const char *code_types[] = { // List of known C/C++ types... - "auto", - "bool", - "char", - "class", - "const", - "const_cast", - "double", - "dynamic_cast", - "enum", - "explicit", - "extern", - "float", - "friend", - "inline", - "int", - "long", - "mutable", - "namespace", - "private", - "protected", - "public", - "register", - "short", - "signed", - "sizeof", - "static", - "static_cast", - "struct", - "template", - "typedef", - "typename", - "union", - "unsigned", - "virtual", - "void", - "volatile" - }; + styletable[] = { // Style table + { FL_BLACK, FL_COURIER, TS }, // A - Plain + { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // B - Line comments + { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // C - Block comments + { FL_BLUE, FL_COURIER, TS }, // D - Strings + { FL_DARK_RED, FL_COURIER, TS }, // E - Directives + { FL_DARK_RED, FL_COURIER_BOLD, TS }, // F - Types + { FL_BLUE, FL_COURIER_BOLD, TS }, // G - Keywords + }; +const char *code_keywords[] = { // List of known C/C++ keywords... + "and", + "and_eq", + "asm", + "bitand", + "bitor", + "break", + "case", + "catch", + "compl", + "continue", + "default", + "delete", + "do", + "else", + "false", + "for", + "goto", + "if", + "new", + "not", + "not_eq", + "operator", + "or", + "or_eq", + "return", + "switch", + "template", + "this", + "throw", + "true", + "try", + "while", + "xor", + "xor_eq" + }; +const char *code_types[] = { // List of known C/C++ types... + "auto", + "bool", + "char", + "class", + "const", + "const_cast", + "double", + "dynamic_cast", + "enum", + "explicit", + "extern", + "float", + "friend", + "inline", + "int", + "long", + "mutable", + "namespace", + "private", + "protected", + "public", + "register", + "short", + "signed", + "sizeof", + "static", + "static_cast", + "struct", + "template", + "typedef", + "typename", + "union", + "unsigned", + "virtual", + "void", + "volatile" + }; // @@ -162,11 +160,11 @@ extern "C" { void style_parse(const char *text, char *style, - int length) { - char current; - int col; - int last; - char buf[255], + int length) { + char current; + int col; + int last; + char buf[255], *bufptr; const char *temp; @@ -189,64 +187,64 @@ style_parse(const char *text, current = 'E'; } else if (strncmp(text, "//", 2) == 0) { current = 'B'; - for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; + for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; if (length == 0) break; } else if (strncmp(text, "/*", 2) == 0) { current = 'C'; } else if (strncmp(text, "\\\"", 2) == 0) { // Quoted quote... - *style++ = current; - *style++ = current; - text ++; - length --; - col += 2; - continue; + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; } else if (*text == '\"') { current = 'D'; } else if (!last && (islower((*text)&255) || *text == '_')) { // Might be a keyword... - for (temp = text, bufptr = buf; - (islower((*temp)&255) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); - *bufptr++ = *temp++) { - // nothing + for (temp = text, bufptr = buf; + (islower((*temp)&255) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); + *bufptr++ = *temp++) { + // nothing } if (!islower((*temp)&255) && *temp != '_') { - *bufptr = '\0'; + *bufptr = '\0'; bufptr = buf; - if (bsearch(&bufptr, code_types, - sizeof(code_types) / sizeof(code_types[0]), - sizeof(code_types[0]), compare_keywords)) { - while (text < temp) { - *style++ = 'F'; - text ++; - length --; - col ++; - } - - text --; - length ++; - last = 1; - continue; - } else if (bsearch(&bufptr, code_keywords, - sizeof(code_keywords) / sizeof(code_keywords[0]), - sizeof(code_keywords[0]), compare_keywords)) { - while (text < temp) { - *style++ = 'G'; - text ++; - length --; - col ++; - } - - text --; - length ++; - last = 1; - continue; - } - } + if (bsearch(&bufptr, code_types, + sizeof(code_types) / sizeof(code_types[0]), + sizeof(code_types[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'F'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } else if (bsearch(&bufptr, code_keywords, + sizeof(code_keywords) / sizeof(code_keywords[0]), + sizeof(code_keywords[0]), compare_keywords)) { + while (text < temp) { + *style++ = 'G'; + text ++; + length --; + col ++; + } + + text --; + length ++; + last = 1; + continue; + } + } } } else if (current == 'C' && strncmp(text, "*/", 2) == 0) { // Close a C comment... @@ -261,18 +259,18 @@ style_parse(const char *text, // Continuing in string... if (strncmp(text, "\\\"", 2) == 0) { // Quoted end quote... - *style++ = current; - *style++ = current; - text ++; - length --; - col += 2; - continue; + *style++ = current; + *style++ = current; + text ++; + length --; + col += 2; + continue; } else if (*text == '\"') { // End quote... - *style++ = current; - col ++; - current = 'A'; - continue; + *style++ = current; + col ++; + current = 'A'; + continue; } } @@ -328,17 +326,17 @@ style_unfinished_cb(int, void*) { // void -style_update(int pos, // I - Position of update - int nInserted, // I - Number of inserted chars - int nDeleted, // I - Number of deleted chars - int /*nRestyled*/, // I - Number of restyled chars - const char * /*deletedText*/,// I - Text that was deleted - void *cbArg) { // I - Callback data - int start, // Start of text - end; // End of text - char last, // Last style on line - *style, // Style data - *text; // Text data +style_update(int pos, // I - Position of update + int nInserted, // I - Number of inserted chars + int nDeleted, // I - Number of deleted chars + int /*nRestyled*/, // I - Number of restyled chars + const char * /*deletedText*/,// I - Text that was deleted + void *cbArg) { // I - Callback data + int start, // Start of text + end; // End of text + char last, // Last style on line + *style, // Style data + *text; // Text data // If this is just a selection change, just unselect the style buffer... @@ -435,17 +433,17 @@ class EditorWindow : public Fl_Double_Window { #ifdef DEV_TEST - Fl_Button *plus; // increase width - Fl_Button *minus; // decrease width - Fl_Button *vscroll; // toggle vert. scrollbar left/right - Fl_Button *hscroll; // toggle hor. scrollbar top/bottom - Fl_Button *lnum; // toggle line number display - Fl_Button *wrap; // toggle wrap mode + Fl_Button *plus; // increase width + Fl_Button *minus; // decrease width + Fl_Button *vscroll; // toggle vert. scrollbar left/right + Fl_Button *hscroll; // toggle hor. scrollbar top/bottom + Fl_Button *lnum; // toggle line number display + Fl_Button *wrap; // toggle wrap mode #endif // DEV_TEST - int wrap_mode; - int line_numbers; + int wrap_mode; + int line_numbers; Fl_Text_Editor *editor; char search[256]; @@ -485,8 +483,8 @@ void resize_cb(Fl_Widget *b, void *v) { Fl_Window *w = b->window(); int dw = (int)(long)v; - const int fac = 16; // factor - const int num = 1; // loop count + const int fac = 16; // factor + const int num = 1; // loop count dw *= fac; @@ -502,22 +500,22 @@ void scroll_cb(Fl_Widget *b, void *v) { int align = ed->scrollbar_align(); switch(n) { - case 1: // vscroll + case 1: // vscroll if (align & FL_ALIGN_LEFT) { - align &= ~FL_ALIGN_LEFT; - align |= FL_ALIGN_RIGHT; + align &= ~FL_ALIGN_LEFT; + align |= FL_ALIGN_RIGHT; } else { - align &= ~FL_ALIGN_RIGHT; - align |= FL_ALIGN_LEFT; + align &= ~FL_ALIGN_RIGHT; + align |= FL_ALIGN_LEFT; } break; - case 2: // hscroll + case 2: // hscroll if (align & FL_ALIGN_TOP) { - align &= ~FL_ALIGN_TOP; - align |= FL_ALIGN_BOTTOM; + align &= ~FL_ALIGN_TOP; + align |= FL_ALIGN_BOTTOM; } else { - align &= ~FL_ALIGN_BOTTOM; - align |= FL_ALIGN_TOP; + align &= ~FL_ALIGN_BOTTOM; + align |= FL_ALIGN_TOP; } break; default: @@ -544,10 +542,10 @@ void lnum_cb(Fl_Widget *w, void* v) { Fl_Text_Editor *ed = (Fl_Text_Editor*)ew->editor; ew->line_numbers = 1 - ew->line_numbers; if (ew->line_numbers) { - ed->linenumber_width(line_num_width); // enable + ed->linenumber_width(line_num_width); // enable ed->linenumber_size(ed->textsize()); } else { - ed->linenumber_width(0); // disable + ed->linenumber_width(0); // disable } ew->redraw(); } @@ -615,10 +613,10 @@ void linenumbers_cb(Fl_Widget *w, void* v) { Fl_Menu_Bar* m = (Fl_Menu_Bar*)w; const Fl_Menu_Item* i = m->mvalue(); if ( i->value() ) { - e->editor->linenumber_width(line_num_width); // enable + e->editor->linenumber_width(line_num_width); // enable e->editor->linenumber_size(e->editor->textsize()); } else { - e->editor->linenumber_width(0); // disable + e->editor->linenumber_width(0); // disable } e->line_numbers = (i->value()?1:0); e->redraw(); @@ -905,7 +903,7 @@ Fl_Window* new_view() { w->editor->buffer(textbuf); w->editor->highlight_data(stylebuf, styletable, sizeof(styletable) / sizeof(styletable[0]), - 'A', style_unfinished_cb, 0); + 'A', style_unfinished_cb, 0); #ifdef DEV_TEST @@ -969,7 +967,3 @@ int main(int argc, char **argv) { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx index 3c72cdd70..83b75bab9 100644 --- a/test/file_chooser.cxx +++ b/test/file_chooser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // File chooser test program. // // Copyright 1999-2010 by Michael Sweet. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -50,11 +48,11 @@ // Globals... // -Fl_Input *filter; -Fl_File_Browser *files; -Fl_File_Chooser *fc; -Fl_Shared_Image *image = 0; -Fl_Simple_Terminal *tty = 0; +Fl_Input *filter; +Fl_File_Browser *files; +Fl_File_Chooser *fc; +Fl_Shared_Image *image = 0; +Fl_Simple_Terminal *tty = 0; // for choosing extra groups Fl_Choice *ch_extra; @@ -68,29 +66,29 @@ Fl_Check_Button *version = (Fl_Check_Button*)0; // Functions... // -void close_callback(void); -void create_callback(void); -void dir_callback(void); -void fc_callback(Fl_File_Chooser *, void *); -void multi_callback(void); -Fl_Image *pdf_check(const char *, uchar *, int); -Fl_Image *ps_check(const char *, uchar *, int); -void show_callback(void); +void close_callback(void); +void create_callback(void); +void dir_callback(void); +void fc_callback(Fl_File_Chooser *, void *); +void multi_callback(void); +Fl_Image *pdf_check(const char *, uchar *, int); +Fl_Image *ps_check(const char *, uchar *, int); +void show_callback(void); -void extra_callback(Fl_Choice*,void*); +void extra_callback(Fl_Choice*,void*); // // 'main()' - Create a file chooser and wait for a selection to be made. // -int // O - Exit status -main(int argc, // I - Number of command-line arguments - char *argv[]) // I - Command-line arguments +int // O - Exit status +main(int argc, // I - Number of command-line arguments + char *argv[]) // I - Command-line arguments { - Fl_Double_Window *window;// Main window - Fl_Button *button;// Buttons + Fl_Double_Window *window;// Main window + Fl_Button *button;// Buttons Fl_Group *grp; // Groups - Fl_File_Icon *icon; // New file icon + Fl_File_Icon *icon; // New file icon // Make the file chooser... @@ -125,8 +123,8 @@ main(int argc, // I - Number of command-line arguments else filter->value("PDF Files (*.pdf)\t" "PostScript Files (*.ps)\t" - "Image Files (*.{bmp,gif,jpg,png})\t" - "C/C++ Source Files (*.{c,C,cc,cpp,cxx})"); + "Image Files (*.{bmp,gif,jpg,png})\t" + "C/C++ Source Files (*.{c,C,cc,cpp,cxx})"); button = new Fl_Button(365, 10, 25, 25); button->tooltip("Click to open file browser.."); @@ -250,10 +248,10 @@ dir_callback(void) // void -fc_callback(Fl_File_Chooser *fc, // I - File chooser - void *data) // I - Data +fc_callback(Fl_File_Chooser *fc, // I - File chooser + void *data) // I - Data { - const char *filename; // Current filename + const char *filename; // Current filename tty->printf("fc_callback(fc = %p, data = %p)\n", fc, data); @@ -279,14 +277,14 @@ multi_callback(void) // 'pdf_check()' - Check for and load the first page of a PDF file. // -Fl_Image * // O - Page image or NULL -pdf_check(const char *name, // I - Name of file - uchar *header, // I - Header data - int) // I - Length of header data (unused) +Fl_Image * // O - Page image or NULL +pdf_check(const char *name, // I - Name of file + uchar *header, // I - Header data + int) // I - Length of header data (unused) { - const char *home; // Home directory - char preview[FL_PATH_MAX], // Preview filename - command[3 * FL_PATH_MAX]; // Command + const char *home; // Home directory + char preview[FL_PATH_MAX], // Preview filename + command[3 * FL_PATH_MAX]; // Command if (memcmp(header, "%PDF", 4) != 0) @@ -297,8 +295,8 @@ pdf_check(const char *name, // I - Name of file sprintf(command, "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH " - "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' " - "-dFirstPage=1 -dLastPage=1 \'%s\' 2>/dev/null", preview, name); + "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' " + "-dFirstPage=1 -dLastPage=1 \'%s\' 2>/dev/null", preview, name); if (system(command)) return 0; @@ -310,19 +308,19 @@ pdf_check(const char *name, // I - Name of file // 'ps_check()' - Check for and load the first page of a PostScript file. // -Fl_Image * // O - Page image or NULL -ps_check(const char *name, // I - Name of file - uchar *header, // I - Header data - int) // I - Length of header data (unused) +Fl_Image * // O - Page image or NULL +ps_check(const char *name, // I - Name of file + uchar *header, // I - Header data + int) // I - Length of header data (unused) { - const char *home; // Home directory - char preview[FL_PATH_MAX], // Preview filename - outname[FL_PATH_MAX], // Preview PS file - command[3 * FL_PATH_MAX]; // Command - FILE *in, // Input file - *out; // Output file - int page; // Current page - char line[256]; // Line from file + const char *home; // Home directory + char preview[FL_PATH_MAX], // Preview filename + outname[FL_PATH_MAX], // Preview PS file + command[3 * FL_PATH_MAX]; // Command + FILE *in, // Input file + *out; // Output file + int page; // Current page + char line[256]; // Line from file if (memcmp(header, "%!", 2) != 0) @@ -341,12 +339,12 @@ ps_check(const char *name, // I - Name of file page = 0; while (fgets(line, sizeof(line), in) != NULL) { - if (strncmp(line, "%%Page:", 7) == 0) { + if (strncmp(line, "%%Page:", 7) == 0) { page ++; - if (page > 1) break; - } + if (page > 1) break; + } - fputs(line, out); + fputs(line, out); } fclose(in); @@ -360,8 +358,8 @@ ps_check(const char *name, // I - Name of file sprintf(command, "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH " - "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' \'%s\' 2>/dev/null", - preview, outname); + "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' \'%s\' 2>/dev/null", + preview, outname); if (system(command)) return 0; @@ -376,9 +374,9 @@ ps_check(const char *name, // I - Name of file void show_callback(void) { - int i; // Looping var - int count; // Number of files selected - char relative[FL_PATH_MAX]; // Relative filename + int i; // Looping var + int count; // Number of files selected + char relative[FL_PATH_MAX]; // Relative filename if (filter->value()[0]) @@ -399,7 +397,7 @@ show_callback(void) { if (!fc->value(i)) break; fl_filename_relative(relative, sizeof(relative), fc->value(i)); - tty->printf("%d/%d) %sPicked: '%s'\n Relative: '%s'%s\n", i, count, + tty->printf("%d/%d) %sPicked: '%s'\n Relative: '%s'%s\n", i, count, TERMINAL_GREEN, fc->value(i), relative, TERMINAL_NORMAL); files->add(relative, Fl_File_Icon::find(fc->value(i), Fl_File_Icon::PLAIN)); } @@ -407,8 +405,3 @@ show_callback(void) files->redraw(); } } - - -// -// End of "$Id$". -// diff --git a/test/fonts.cxx b/test/fonts.cxx index ac19abce9..dbc8a7a7e 100644 --- a/test/fonts.cxx +++ b/test/fonts.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Font demo program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -356,7 +354,7 @@ int main(int argc, char **argv) { char *p = buffer; if (t & FL_BOLD) {*p++ = '@'; *p++ = 'b';} if (t & FL_ITALIC) {*p++ = '@'; *p++ = 'i';} - *p++ = '@'; *p++ = '.'; // Suppress subsequent formatting - some MS fonts have '@' in their name + *p++ = '@'; *p++ = '.'; // Suppress subsequent formatting - some MS fonts have '@' in their name strcpy(p,name); name = buffer; } @@ -377,7 +375,3 @@ int main(int argc, char **argv) { form->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/forms.cxx b/test/forms.cxx index d4f9ee0e2..1fff9ca4f 100644 --- a/test/forms.cxx +++ b/test/forms.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Another forms demo for the Fast Light Tool Kit (FLTK). // // This is an XForms program with some changes for FLTK. @@ -14,11 +12,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/forms.H> // changed for fltk @@ -187,7 +185,3 @@ main (int argc, char *argv[]) return 0; } - -// -// End of "$Id$". -// diff --git a/test/fractals.cxx b/test/fractals.cxx index 435ede1b6..da6dec60e 100644 --- a/test/fractals.cxx +++ b/test/fractals.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fractal drawing demo for the Fast Light Tool Kit (FLTK). // // This is a GLUT demo program, with modifications to @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -34,10 +32,10 @@ int main(int, char**) { * * Usage: fractals * - * Homework 6, Part 2: fractal mountains and fractal trees + * Homework 6, Part 2: fractal mountains and fractal trees * (Pretty Late) * - * Draws fractal mountains and trees -- and an island of mountains in water + * Draws fractal mountains and trees -- and an island of mountains in water * (I tried having trees on the island but it didn't work too well.) * * Two viewer modes: polar and flying (both restrained to y>0 for up vector). @@ -75,7 +73,7 @@ int main(int, char**) { # define srand48(x) (srand((x))) #endif -typedef enum { NOTALLOWED, MOUNTAIN, TREE, ISLAND, BIGMTN, STEM, LEAF, +typedef enum { NOTALLOWED, MOUNTAIN, TREE, ISLAND, BIGMTN, STEM, LEAF, MOUNTAIN_MAT, WATER_MAT, LEAF_MAT, TREE_MAT, STEMANDLEAVES, AXES } DisplayLists; @@ -83,9 +81,9 @@ typedef enum { NOTALLOWED, MOUNTAIN, TREE, ISLAND, BIGMTN, STEM, LEAF, int Rebuild = 1, /* Rebuild display list in next display? */ fractal = TREE, /* What fractal are we building */ - Level = 4; /* levels of recursion for fractals */ + Level = 4; /* levels of recursion for fractals */ -int DrawAxes = 0; +int DrawAxes = 0; /***************************************************************/ /************************* VECTOR JUNK *************************/ @@ -97,7 +95,7 @@ void printvert(float v[3]) fprintf(stderr, "(%f, %f, %f)\n", v[0], v[1], v[2]); } -#if 0 // removed for FL, it is in fracviewer.c +#if 0 // removed for FL, it is in fracviewer.c /* normalizes v */ void normalize(GLfloat v[3]) { @@ -140,7 +138,7 @@ float xzlength(float v1[3], float v2[3]) float xzslope(float v1[3], float v2[3]) { return ((v1[0] != v2[0]) ? ((v1[2] - v2[2]) / (v1[0] - v2[0])) - : FLT_MAX); + : FLT_MAX); } @@ -149,14 +147,14 @@ float xzslope(float v1[3], float v2[3]) /***************************************************************/ GLfloat DispFactor[MAXLEVEL]; /* Array of what to multiply random number - by for a given level to get midpoint - displacement */ + by for a given level to get midpoint + displacement */ GLfloat DispBias[MAXLEVEL]; /* Array of what to add to random number - before multiplying it by DispFactor */ + before multiplying it by DispFactor */ #define NUMRANDS 191 float RandTable[NUMRANDS]; /* hash table of random numbers so we can - raise the same midpoints by the same amount */ + raise the same midpoints by the same amount */ /* The following are for permitting an edge of a moutain to be */ /* pegged so it won't be displaced up or down. This makes it */ @@ -164,7 +162,7 @@ float RandTable[NUMRANDS]; /* hash table of random numbers so we can GLfloat Verts[3][3], /* Vertices of outside edges of mountain */ Slopes[3]; /* Slopes between these outside edges */ -int Pegged[3]; /* Is this edge pegged or not */ +int Pegged[3]; /* Is this edge pegged or not */ /* * Comes up with a new table of random numbers [0,1) @@ -180,14 +178,14 @@ void InitRandTable(unsigned int seed) /* calculate midpoint and displace it if required */ void Midpoint(GLfloat mid[3], GLfloat v1[3], GLfloat v2[3], - int edge, int level) + int edge, int level) { unsigned hash; mid[0] = (v1[0] + v2[0]) / 2; mid[1] = (v1[1] + v2[1]) / 2; mid[2] = (v1[2] + v2[2]) / 2; - if (!Pegged[edge] || (fabs(xzslope(Verts[edge], mid) + if (!Pegged[edge] || (fabs(xzslope(Verts[edge], mid) - Slopes[edge]) > 0.00001)) { srand48((int)((v1[0]+v2[0])*23344)); hash = unsigned(drand48() * 7334334); @@ -198,9 +196,9 @@ void Midpoint(GLfloat mid[3], GLfloat v1[3], GLfloat v2[3], } /* - * Recursive moutain drawing routine -- from lecture with addition of + * Recursive moutain drawing routine -- from lecture with addition of * allowing an edge to be pegged. This function requires the above - * globals to be set, as well as the Level global for fractal level + * globals to be set, as well as the Level global for fractal level */ static float cutoff = -1; @@ -239,9 +237,9 @@ void FractalMountain(GLfloat v1[3], GLfloat v2[3], GLfloat v3[3], GLfloat fraction[8] = { 0.3, 0.3, 0.4, 0.2, 0.3, 0.2, 0.4, 0.4 }; GLfloat bias[8] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 }; int i; - float avglen = (xzlength(v1, v2) + + float avglen = (xzlength(v1, v2) + xzlength(v2, v3) + - xzlength(v3, v1) / 3); + xzlength(v3, v1) / 3); for (i = 0; i < 3; i++) { Verts[0][i] = v1[i]; /* set mountain vertex globals */ @@ -254,15 +252,15 @@ void FractalMountain(GLfloat v1[3], GLfloat v2[3], GLfloat v3[3], Slopes[1] = xzslope(Verts[1], Verts[2]); Slopes[2] = xzslope(Verts[2], Verts[0]); - lengths[0] = avglen; - for (i = 1; i < Level; i++) { + lengths[0] = avglen; + for (i = 1; i < Level; i++) { lengths[i] = lengths[i-1]/2; /* compute edge length for each level */ } - for (i = 0; i < Level; i++) { /* DispFactor and DispBias arrays */ + for (i = 0; i < Level; i++) { /* DispFactor and DispBias arrays */ DispFactor[i] = (lengths[i] * ((i <= 7) ? fraction[i] : fraction[7])); DispBias[i] = ((i <= 7) ? bias[i] : bias[7]); - } + } glBegin(GL_TRIANGLES); FMR(v1, v2, v3, 0); /* issues no GL but vertex calls */ @@ -301,7 +299,7 @@ long TreeSeed; /* for srand48 - remember so we can build "same tree" at a different level */ /* - * recursive tree drawing thing, fleshed out from class notes pseudocode + * recursive tree drawing thing, fleshed out from class notes pseudocode */ void FractalTree(int level, long level_seed) { @@ -318,7 +316,7 @@ void FractalTree(int level, long level_seed) glScalef(0.7, 0.7, 0.7); srand48(level_seed+1); - glPushMatrix(); + glPushMatrix(); glRotatef(110 + drand48()*40, 0, 1, 0); glRotatef(30 + drand48()*20, 0, 0, 1); FractalTree(level + 1, level_seed+4); @@ -412,7 +410,7 @@ void CreateTree(void) FractalTree(0, TreeSeed); glPopAttrib(); glPopMatrix(); - glEndList(); + glEndList(); } /* @@ -477,7 +475,7 @@ void CreateIsland(void) glPopMatrix(); glPopAttrib(); - glEndList(); + glEndList(); } @@ -565,7 +563,7 @@ void myGLInit(void) glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); glLightfv(GL_LIGHT0, GL_POSITION, light_position); - + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); glEnable(GL_LIGHTING); @@ -590,7 +588,7 @@ void myGLInit(void) CreateTreeLists(); glFlush(); -} +} /***************************************************************/ /************************ GLUT STUFF ***************************/ @@ -792,7 +790,7 @@ int main(int argc, char** argv) g->end(); b = new Fl_Button(400,50,100,30,"New Fractal"); b->callback(handlemenu,(void*)MENU_RAND); - + b = new Fl_Button( 10,10,100,30,"Mountain"); b->callback(choosefract,(void*)MOUNTAIN); b = new Fl_Button(110,10,100,30,"Tree"); b->callback(choosefract,(void*)TREE); b = new Fl_Button(210,10,100,30,"Island"); b->callback(choosefract,(void*)ISLAND); @@ -817,7 +815,7 @@ int main(int argc, char** argv) NewFractals(); agvMakeAxesList(AXES); - myGLInit(); + myGLInit(); MenuInit(); glutMainLoop(); // you could use Fl::run() instead @@ -825,7 +823,3 @@ int main(int argc, char** argv) return 0; } #endif - -// -// End of "$Id$". -// diff --git a/test/fracviewer.cxx b/test/fracviewer.cxx index e1467619b..2e8d9cdcb 100644 --- a/test/fracviewer.cxx +++ b/test/fracviewer.cxx @@ -50,18 +50,18 @@ #define INIT_EY -2.0 #define INIT_EZ -2.0 #define INIT_MOVE 0.01 -#define MINMOVE 0.001 +#define MINMOVE 0.001 /* Start in this mode */ -#define INIT_MODE POLAR +#define INIT_MODE POLAR /* Controls: */ /* map 0-9 to an EyeMove value when number key is hit in FLYING mode */ -#define SPEEDFUNCTION(x) ((x)*(x)*0.001) +#define SPEEDFUNCTION(x) ((x)*(x)*0.001) /* Multiply EyeMove by (1+-MOVEFRACTION) when +/- hit in FLYING mode */ -#define MOVEFRACTION 0.25 +#define MOVEFRACTION 0.25 /* What to multiply number of pixels mouse moved by to get rotation amount */ #define EL_SENS 0.5 @@ -92,7 +92,7 @@ int MoveMode = INIT_MODE; /* FLYING or POLAR mode? */ GLfloat Ex = INIT_EX, /* flying parameters */ Ey = INIT_EY, Ez = INIT_EZ, - EyeMove = INIT_MOVE, + EyeMove = INIT_MOVE, EyeDist = INIT_DIST, /* polar params */ AzSpin = INIT_AZ_SPIN, @@ -106,15 +106,15 @@ int agvMoving; /* Currently moving? */ int downx, downy, /* for tracking mouse position */ lastx, lasty, downb = -1; /* and button status */ - + GLfloat downDist, downEl, downAz, /* for saving state of things */ downEx, downEy, downEz, /* when button is pressed */ - downEyeMove; + downEyeMove; GLfloat dAz, dEl, lastAz, lastEl; /* to calculate spinning w/ polar motion */ int AdjustingAzEl = 0; -int AllowIdle, RedisplayWindow; +int AllowIdle, RedisplayWindow; /* If AllowIdle is 1 it means AGV will install its own idle which * will update the viewpoint as needed and send glutPostRedisplay() to the * window RedisplayWindow which was set in agvInit(). AllowIdle of 0 @@ -200,7 +200,7 @@ void FlyLookFrom(GLfloat x, GLfloat y, GLfloat z, GLfloat az, GLfloat el) * Call viewing transformation based on movement mode */ void agvViewTransform(void) -{ +{ switch (MoveMode) { case FLYING: FlyLookFrom(Ex, Ey, Ez, EyeAz, EyeEl); @@ -212,7 +212,7 @@ void agvViewTransform(void) } /* - * keep them vertical; I think this makes a lot of things easier, + * keep them vertical; I think this makes a lot of things easier, * but maybe it wouldn't be too hard to adapt things to let you go * upside down */ @@ -285,7 +285,7 @@ void MoveOn(int v) /* * set new redisplay window. If <= 0 it means we are not to install - * an idle function and will rely on whoever does install one to + * an idle function and will rely on whoever does install one to * put statement like "if (agvMoving) agvMove();" at end of it */ void agvSetAllowIdle(int allowidle) @@ -368,16 +368,16 @@ void agvHandleButton(int button, int state, int x, int y) lastAz = downAz = EyeAz; AzSpin = ElSpin = dAz = dEl = 0; AdjustingAzEl = 1; - MoveOn(1); + MoveOn(1); break; case GLUT_MIDDLE_BUTTON: downDist = EyeDist; - downEx = Ex; - downEy = Ey; - downEz = Ez; - downEyeMove = EyeMove; - EyeMove = 0; + downEx = Ex; + downEy = Ey; + downEz = Ez; + downEyeMove = EyeMove; + EyeMove = 0; } } else if (state == GLUT_UP && button == downb) { @@ -387,19 +387,19 @@ void agvHandleButton(int button, int state, int x, int y) switch (button) { case GLUT_LEFT_BUTTON: if (MoveMode != FLYING) { - AzSpin = -dAz; - if (AzSpin < MIN_AZSPIN && AzSpin > -MIN_AZSPIN) - AzSpin = 0; - ElSpin = -dEl; - if (ElSpin < MIN_ELSPIN && ElSpin > -MIN_ELSPIN) - ElSpin = 0; - } + AzSpin = -dAz; + if (AzSpin < MIN_AZSPIN && AzSpin > -MIN_AZSPIN) + AzSpin = 0; + ElSpin = -dEl; + if (ElSpin < MIN_ELSPIN && ElSpin > -MIN_ELSPIN) + ElSpin = 0; + } AdjustingAzEl = 0; MoveOn(1); - break; + break; case GLUT_MIDDLE_BUTTON: - EyeMove = downEyeMove; + EyeMove = downEyeMove; } } } @@ -460,14 +460,14 @@ void agvHandleKeys(unsigned char key, int, int) { SetMove(SPEEDFUNCTION((key-'0'))); else switch(key) { - case '+': + case '+': if (EyeMove == 0) SetMove(MINMOVE); else - SetMove(EyeMove *= (1 + MOVEFRACTION)); + SetMove(EyeMove *= (1 + MOVEFRACTION)); break; case '-': - SetMove(EyeMove *= (1 - MOVEFRACTION)); + SetMove(EyeMove *= (1 - MOVEFRACTION)); break; } } @@ -522,11 +522,11 @@ void agvMakeAxesList(int displaylistnum) for (j = 0; j < 21; j++) { // glutSolidCube(0.1); glTranslatef(i==0, i==1, i==2); - } + } glPopMatrix(); } glPopAttrib(); - glEndList(); + glEndList(); } diff --git a/test/fracviewer.h b/test/fracviewer.h index b51e65e8c..72dc5dc11 100644 --- a/test/fracviewer.h +++ b/test/fracviewer.h @@ -26,7 +26,7 @@ /* - * Call agvInit() with glut's current window set to the window in + * Call agvInit() with glut's current window set to the window in * which you want to run the viewer. Right after creating it is fine. It * will remember that window for possible later use (see below) and * registers mouse, motion, and keyboard handlers for that window (see below). @@ -40,14 +40,14 @@ * agvMove(); * * at the end of your idle function, to let AGV update the viewpoint if it - * is moving. + * is moving. * * If allowidle is 1 it means AGV will install its own idle which * will update the viewpoint as needed and send glutPostRedisplay() to the * window which was current when agvInit() was called. * * agvSetIdleAllow changes this value so you can let AGV install its idle - * when your idle isn't installed. + * when your idle isn't installed. * */ void agvInit(int allowidle); @@ -61,14 +61,14 @@ typedef enum { FLYING, POLAR } MovementType; void agvSwitchMoveMode(int move); /* - * agvViewTransform basically does the appropriate gluLookAt() for the + * agvViewTransform basically does the appropriate gluLookAt() for the * current position. So call it in your display on the projection matrix */ void agvViewTransform(void); /* * agvMoving will be set by AGV according to whether it needs you to call - * agvMove() at the end of your idle function. You only need these if + * agvMove() at the end of your idle function. You only need these if * you aren't allowing AGV to do its own idle. * (Don't change the value of agvMoving) */ @@ -80,7 +80,7 @@ void agvMove(void); * Keyboard input only matters in flying mode, and then only to set speed. * Mouse input only uses left two buttons in both modes. * These are all registered with agvInit(), but you could register - * something else which called these, or reregister these as needed + * something else which called these, or reregister these as needed */ void agvHandleButton(int button, int state, int x, int y); void agvHandleMotion(int x, int y); diff --git a/test/fromdos.c b/test/fromdos.c index 54dff5a9f..13450214c 100644 --- a/test/fromdos.c +++ b/test/fromdos.c @@ -17,8 +17,8 @@ int main(int argc, char** argv) { for (;;) { c = getchar(); while (c == '\r') { - c = getchar(); - if (c != '\n') putchar(c); + c = getchar(); + if (c != '\n') putchar(c); } if (c < 0) break; putchar(c); @@ -45,8 +45,8 @@ int main(int argc, char** argv) { for (;;) { c = getc(in); while (c == '\r') { - c = getc(in); - if (c == '\n') mod=1; else putc(c,out); + c = getc(in); + if (c == '\n') mod=1; else putc(c,out); } if (c < 0) break; putc(c,out); diff --git a/test/fullscreen.cxx b/test/fullscreen.cxx index 668ea460f..54be3701b 100644 --- a/test/fullscreen.cxx +++ b/test/fullscreen.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -130,7 +128,7 @@ class fullscreen_window : public Fl_Single_Window { Fl_Toggle_Light_Button *b4; }; -fullscreen_window::fullscreen_window(int W, int H, const char *t) : Fl_Single_Window(W, H, t) { +fullscreen_window::fullscreen_window(int W, int H, const char *t) : Fl_Single_Window(W, H, t) { } @@ -234,15 +232,15 @@ void update_screeninfo(Fl_Widget *b, void *p) { sprintf(line, "Mouse screen work area: %dx%d@%d,%d", w, h, x, y); browser->add(line); for (int n = 0; n < Fl::screen_count(); n++) { - int x, y, w, h; + int x, y, w, h; float dpih, dpiv; - Fl::screen_xywh(x, y, w, h, n); + Fl::screen_xywh(x, y, w, h, n); Fl::screen_dpi(dpih, dpiv, n); sprintf(line, "Screen %d: %dx%d@%d,%d DPI:%.1fx%.1f scale:%.2f", n, w, h, x, y, dpih, dpiv, Fl::screen_scale(n)); - browser->add(line); - Fl::screen_work_area(x, y, w, h, n); - sprintf(line, "Work area %d: %dx%d@%d,%d", n, w, h, x, y); - browser->add(line); + browser->add(line); + Fl::screen_work_area(x, y, w, h, n); + sprintf(line, "Work area %d: %dx%d@%d,%d", n, w, h, x, y); + browser->add(line); } } @@ -278,13 +276,13 @@ int main(int argc, char **argv) { #endif Fl_Window *w; - if (twowindow) { // make it's own window + if (twowindow) { // make it's own window sw.resizable(&sw); w = &sw; - window.set_modal(); // makes controls stay on top when fullscreen pushed + window.set_modal(); // makes controls stay on top when fullscreen pushed argc--; sw.show(); - } else { // otherwise make a subwindow + } else { // otherwise make a subwindow window.add(sw); window.resizable(&sw); w = &window; @@ -329,7 +327,7 @@ int main(int argc, char **argv) { Fl_Browser *browser = new Fl_Browser(50,y,window.w()-60,100); update_screeninfo(0, browser); y+=100; - + Fl_Button update(50,y,window.w()-60,30,"Update"); update.callback(update_screeninfo, browser); y+=30; @@ -338,10 +336,6 @@ int main(int argc, char **argv) { window.end(); window.show(argc,argv); - + return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/gl_overlay.cxx b/test/gl_overlay.cxx index ab52cc251..a635fd52f 100644 --- a/test/gl_overlay.cxx +++ b/test/gl_overlay.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL overlay test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -26,7 +24,7 @@ #if !HAVE_GL #include <FL/Fl_Box.H> class shape_window : public Fl_Box { -public: +public: int sides; shape_window(int x,int y,int w,int h,const char *l=0) :Fl_Box(FL_DOWN_BOX,x,y,w,h,l){ @@ -143,7 +141,3 @@ int main(int argc, char **argv) { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/glpuzzle.cxx b/test/glpuzzle.cxx index 8a97e8f4b..5f265f55e 100644 --- a/test/glpuzzle.cxx +++ b/test/glpuzzle.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // OpenGL puzzle demo for the Fast Light Tool Kit (FLTK). // // This is a GLUT demo program to demonstrate fltk's GLUT emulation. @@ -14,9 +12,9 @@ // // https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// https://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Convenience options 'n' and ' ' and command line switch '-n' added for FLTK @@ -39,9 +37,9 @@ int main(int, char**) { #include <sys/types.h> #include <time.h> #include <math.h> -#include <FL/glut.H> // changed for fltk +#include <FL/glut.H> // changed for fltk #include <FL/glu.h> // added for fltk -#include "trackball.c" // changed from trackball.h for fltk +#include "trackball.c" // changed from trackball.h for fltk #define WIDTH 4 #define HEIGHT 5 @@ -879,7 +877,7 @@ invertMatrix(const GLfloat src[16], GLfloat inverse[16]) makeIdentity(inverse); for (i = 0; i < 4; i++) { - /* + /* ** Look for largest element in column */ swap = i; for (j = i + 1; j < 4; j++) { @@ -889,7 +887,7 @@ invertMatrix(const GLfloat src[16], GLfloat inverse[16]) } if (swap != i) { - /* + /* ** Swap rows. */ for (k = 0; k < 4; k++) { t = temp[i][k]; @@ -902,7 +900,7 @@ invertMatrix(const GLfloat src[16], GLfloat inverse[16]) } } if (temp[i][i] == 0) { - /* + /* ** No non-zero pivot. The matrix is singular, which shouldn't ** happen. This means the user gave us a bad matrix. */ @@ -928,9 +926,9 @@ invertMatrix(const GLfloat src[16], GLfloat inverse[16]) /* ** This is a screwball function. What it does is the following: - ** Given screen x and y coordinates, compute the corresponding object space + ** Given screen x and y coordinates, compute the corresponding object space ** x and y coordinates given that the object space z is 0.9 + OFFSETZ. - ** Since the tops of (most) pieces are at z = 0.9 + OFFSETZ, we use that + ** Since the tops of (most) pieces are at z = 0.9 + OFFSETZ, we use that ** number. */ int @@ -969,10 +967,10 @@ computeCoords(int piece, int mousex, int mousey, finalMatrix[3 * 4 + 3]; d = finalMatrix[2 * 4 + 3]; - /* - ** Ok, now we need to solve for z: ** (a + b z) / (c + d + /* + ** Ok, now we need to solve for z: ** (a + b z) / (c + d - z) = height. ** ("height" is the height in object space we + z) = height. ** ("height" is the height in object space we want to solve z for) ** ** ==> a + b z = height c + height d z ** bz - height d z = height c - a ** z = @@ -984,12 +982,12 @@ computeCoords(int piece, int mousex, int mousey, z = top / bot; - /* + /* ** Ok, no problem. ** Now we solve for x and y. We know that w = c + d z, so we compute it. */ w = c + d * z; - /* + /* ** Now for x and y: */ *selx = (in[0] * finalMatrix[0 * 4 + 0] + in[1] * finalMatrix[1 * 4 + 0] + @@ -1096,7 +1094,7 @@ moveSelection(float selx, float sely) } else { if (deltay > 0 && thePuzzle[selecty][selectx] == 10 && selectx == 1 && selecty == 3) { - /* Allow visual movement of solution piece outside of the + /* Allow visual movement of solution piece outside of the box */ move_x = selectx; @@ -1497,7 +1495,3 @@ main(int argc, char **argv) } #endif // added for fltk's distribution - -// -// End of "$Id$". -// diff --git a/test/hello.cxx b/test/hello.cxx index ac1565996..b301832b7 100644 --- a/test/hello.cxx +++ b/test/hello.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Hello, World! program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -32,7 +30,3 @@ int main(int argc, char **argv) { return Fl::run(); } -// -// End of "$Id$". -// - diff --git a/test/help_dialog.cxx b/test/help_dialog.cxx index 5fc2dc2c4..2ee19c41a 100644 --- a/test/help_dialog.cxx +++ b/test/help_dialog.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Help_Dialog test program. // // Copyright 1999-2010 by Easy Software Products. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -26,16 +24,16 @@ // #include <FL/Fl_Help_Dialog.H> -#include <FL/filename.H> /* FL_PATH_MAX */ -#include <string.h> /* strcpy(), etc */ +#include <FL/filename.H> /* FL_PATH_MAX */ +#include <string.h> /* strcpy(), etc */ // // 'main()' - Display the help GUI... // -int // O - Exit status -main(int argc, // I - Number of command-line arguments - char *argv[]) // I - Command-line arguments +int // O - Exit status +main(int argc, // I - Number of command-line arguments + char *argv[]) // I - Command-line arguments { Fl_Help_Dialog *help = new Fl_Help_Dialog; char htmlname[FL_PATH_MAX]; @@ -58,7 +56,7 @@ main(int argc, // I - Number of command-line arguments } #endif - help->load(htmlname); // TODO: add error check (when load() returns int instead of void) + help->load(htmlname); // TODO: add error check (when load() returns int instead of void) help->show(1, argv); @@ -68,7 +66,3 @@ main(int argc, // I - Number of command-line arguments return 0; } - -// -// End of "$Id$". -// diff --git a/test/help_dialog.html b/test/help_dialog.html index 01809f234..c5faa0eb4 100644 --- a/test/help_dialog.html +++ b/test/help_dialog.html @@ -265,20 +265,20 @@ This text should be between two horizontal lines. 6 Space 7 Space __ 8 Space | - 4 Space + 1 Tab |-- should all be - 1 Tab __| same indent level - 1 Tab + 1 Space - 1 Tab + 2 Space - 1 Tab + 3 Space - 1 Tab + 4 Space - 1 Tab + 5 Space - 1 Tab + 6 Space - 1 Tab + 7 Space __ - 1 Tab + 8 Space | - 4 Space + 1 Tab + 8 Space |-- should all be - 2 Tab __| same indent level - 2 Tab + 1 Space - 2 Tab + 2 Space - 2 Tab + 3 Space - .. + 4 Space + 1 Tab |-- should all be + 1 Tab __| same indent level + 1 Tab + 1 Space + 1 Tab + 2 Space + 1 Tab + 3 Space + 1 Tab + 4 Space + 1 Tab + 5 Space + 1 Tab + 6 Space + 1 Tab + 7 Space __ + 1 Tab + 8 Space | + 4 Space + 1 Tab + 8 Space |-- should all be + 2 Tab __| same indent level + 2 Tab + 1 Space + 2 Tab + 2 Space + 2 Tab + 3 Space + .. </PRE> diff --git a/test/icon.cxx b/test/icon.cxx index 75c43ab39..c36e9a066 100644 --- a/test/icon.cxx +++ b/test/icon.cxx @@ -7,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> diff --git a/test/iconize.cxx b/test/iconize.cxx index a282fcc97..f058ef05c 100644 --- a/test/iconize.cxx +++ b/test/iconize.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Iconize test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -68,7 +66,3 @@ int main(int argc, char **argv) { control.callback(window_cb); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/image.cxx b/test/image.cxx index f0d12743c..d90421ae3 100644 --- a/test/image.cxx +++ b/test/image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Image test program for the Fast Light Tool Kit (FLTK). // // Notice that Fl_Image is for a static, multiple-reuse image, such @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -40,12 +38,12 @@ void make_image() { for (int x = 0; x < width; x++) { double X = double(x)/(width-1); *p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left - *p++ = uchar(255*((1-X)*Y)); // green in lower-left - *p++ = uchar(255*(X*Y)); // blue in lower-right + *p++ = uchar(255*((1-X)*Y)); // green in lower-left + *p++ = uchar(255*(X*Y)); // blue in lower-right X -= 0.5; Y -= 0.5; int alpha = (int)(255 * sqrt(X * X + Y * Y)); - if (alpha < 255) *p++ = uchar(alpha); // alpha transparency + if (alpha < 255) *p++ = uchar(alpha); // alpha transparency else *p++ = 255; Y += 0.5; } @@ -105,7 +103,7 @@ int main(int argc, char **argv) { exit(1); } fl_colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen), - fl_visual->visual, AllocNone); + fl_visual->visual, AllocNone); fl_xpixel(FL_BLACK); // make sure black is allocated in overlay visuals } else { Fl::visual(FL_RGB); @@ -146,7 +144,3 @@ int main(int argc, char **argv) { window.show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/input.cxx b/test/input.cxx index 3b8db7380..2b6e15c06 100644 --- a/test/input.cxx +++ b/test/input.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Input field test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -88,7 +86,7 @@ void arrownav_cb(Fl_Widget *w, void *v) { } int main(int argc, char **argv) { - // the following two lines set the correct color scheme, so that + // the following two lines set the correct color scheme, so that // calling fl_contrast below will return good results Fl::args(argc, argv); Fl::get_system_colors(); @@ -164,7 +162,3 @@ int main(int argc, char **argv) { window->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/input_choice.cxx b/test/input_choice.cxx index 4e4d16109..b9598d52c 100644 --- a/test/input_choice.cxx +++ b/test/input_choice.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Test program for Fl_Input_Choice // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -63,8 +61,3 @@ int main(int argc, char **argv) { win.show(argc, argv); return Fl::run(); } - - -// -// End of "$Id$". -// diff --git a/test/keyboard.cxx b/test/keyboard.cxx index 27107de3e..e28a302c7 100644 --- a/test/keyboard.cxx +++ b/test/keyboard.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -99,23 +97,23 @@ int main(int argc, char** argv) { window->show(argc,argv); while (Fl::wait()) { const char *str; - + // update all the buttons with the current key and shift state: for (int c = 0; c < window->children(); c++) { Fl_Widget* b = window->child(c); if (b->callback() == (Fl_Callback*)key_cb) { - int i = b->argument(); - if (!i) i = b->label()[0]; + int i = b->argument(); + if (!i) i = b->label()[0]; Fl_Button *btn = ((Fl_Button*)b); int state = Fl::event_key(i); if (btn->value()!=state) - btn->value(state); + btn->value(state); } else if (b->callback() == (Fl_Callback*)shift_cb) { - int i = b->argument(); + int i = b->argument(); Fl_Button *btn = ((Fl_Button*)b); int state = Fl::event_state(i); if (btn->value()!=state) - btn->value(state); + btn->value(state); } } @@ -136,7 +134,7 @@ int main(int argc, char** argv) { } else { sprintf(buffer, "0x%04x", k); for (int i = 0; i < int(sizeof(table)/sizeof(*table)); i++) - if (table[i].n == k) {keyname = table[i].text; break;} + if (table[i].n == k) {keyname = table[i].text; break;} } if (strcmp(key_output->value(), keyname)) key_output->value(keyname); @@ -147,7 +145,3 @@ int main(int argc, char** argv) { } return 0; } - -// -// End of "$Id$". -// diff --git a/test/keyboard.h b/test/keyboard.h index 3f5f6fed4..8105e56df 100644 --- a/test/keyboard.h +++ b/test/keyboard.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Keyboard/event test header for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #ifndef keyboard_h @@ -25,13 +23,8 @@ class MyWindow : public Fl_Window { int handle(int); public: - MyWindow(int w, int h, const char *t=0L) + MyWindow(int w, int h, const char *t=0L) : Fl_Window( w, h, t ) { } }; #endif // !keyboard_h - - -// -// End of "$Id$". -// diff --git a/test/label.cxx b/test/label.cxx index 6336cf5e3..7ae739bc4 100644 --- a/test/label.cxx +++ b/test/label.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Label test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -197,7 +195,3 @@ int main(int argc, char **argv) { window->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/line_style.cxx b/test/line_style.cxx index 32fdbf77a..083ed5b50 100644 --- a/test/line_style.cxx +++ b/test/line_style.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Line style demo for the Fast Light Tool Kit (FLTK). // // Copyright 2000-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -39,8 +37,8 @@ public: void test_box::draw() { Fl_Double_Window::draw(); fl_color((uchar)(sliders[0]->value()), - (uchar)(sliders[1]->value()), - (uchar)(sliders[2]->value())); + (uchar)(sliders[1]->value()), + (uchar)(sliders[2]->value())); // dashes char dashes[5]; dashes[0] = char(sliders[5]->value()); @@ -52,7 +50,7 @@ void test_box::draw() { choice[0]->mvalue()->argument() + choice[1]->mvalue()->argument() + choice[2]->mvalue()->argument(), - long(sliders[3]->value()), // width + long(sliders[3]->value()), // width dashes); // draw the defined fl_rect and fl_vertex first and then @@ -75,27 +73,27 @@ void test_box::draw() { } Fl_Menu_Item style_menu[] = { - {"FL_SOLID", 0, 0, (void*)FL_SOLID}, - {"FL_DASH", 0, 0, (void*)FL_DASH}, - {"FL_DOT", 0, 0, (void*)FL_DOT}, + {"FL_SOLID", 0, 0, (void*)FL_SOLID}, + {"FL_DASH", 0, 0, (void*)FL_DASH}, + {"FL_DOT", 0, 0, (void*)FL_DOT}, {"FL_DASHDOT",0, 0, (void*)FL_DASHDOT}, {"FL_DASHDOTDOT", 0, 0, (void*)FL_DASHDOTDOT}, {0} }; Fl_Menu_Item cap_menu[] = { - {"default", 0, 0, 0}, - {"FL_CAP_FLAT", 0, 0, (void*)FL_CAP_FLAT}, - {"FL_CAP_ROUND", 0, 0, (void*)FL_CAP_ROUND}, - {"FL_CAP_SQUARE", 0, 0, (void*)FL_CAP_SQUARE}, + {"default", 0, 0, 0}, + {"FL_CAP_FLAT", 0, 0, (void*)FL_CAP_FLAT}, + {"FL_CAP_ROUND", 0, 0, (void*)FL_CAP_ROUND}, + {"FL_CAP_SQUARE", 0, 0, (void*)FL_CAP_SQUARE}, {0} }; Fl_Menu_Item join_menu[] = { - {"default", 0, 0, 0}, - {"FL_JOIN_MITER", 0, 0, (void*)FL_JOIN_MITER}, - {"FL_JOIN_ROUND", 0, 0, (void*)FL_JOIN_ROUND}, - {"FL_JOIN_BEVEL", 0, 0, (void*)FL_JOIN_BEVEL}, + {"default", 0, 0, 0}, + {"FL_JOIN_MITER", 0, 0, (void*)FL_JOIN_MITER}, + {"FL_JOIN_ROUND", 0, 0, (void*)FL_JOIN_ROUND}, + {"FL_JOIN_BEVEL", 0, 0, (void*)FL_JOIN_BEVEL}, {0} }; @@ -162,7 +160,3 @@ int main(int argc, char **argv) { form->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/list_visuals.cxx b/test/list_visuals.cxx index ebda7ef8e..a21e80ede 100644 --- a/test/list_visuals.cxx +++ b/test/list_visuals.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Visual list utility for the Fast Light Tool Kit (FLTK). // // List all the visuals on the screen, and dumps anything interesting @@ -17,11 +15,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #if defined(_WIN32) || defined(__APPLE__) @@ -101,8 +99,8 @@ static void print_mask(XVisualInfo* p) { else new_what = '?'; if (new_what != what) { if (what && (what != '?' || print_anything)) { - q += sprintf(q,"%d%c", n, what); - print_anything = 1; + q += sprintf(q,"%d%c", n, what); + print_anything = 1; } what = new_what; n = 1; @@ -132,10 +130,10 @@ void list_visuals() { Atom actualType; int actualFormat; if (!XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen), - overlayVisualsAtom, 0L, 10000L, False, - overlayVisualsAtom, &actualType, &actualFormat, - &sizeData, &bytesLeft, - (unsigned char **) &overlayInfo)) + overlayVisualsAtom, 0L, 10000L, False, + overlayVisualsAtom, &actualType, &actualFormat, + &sizeData, &bytesLeft, + (unsigned char **) &overlayInfo)) numoverlayinfo = int(sizeData/4); } @@ -145,7 +143,7 @@ void list_visuals() { int nmbuf = 0, nsbuf = 0; if (XmbufQueryExtension(fl_display,&event_base, &error_base)) { XmbufGetScreenInfo(fl_display,RootWindow(fl_display,fl_screen), - &nmbuf, &mbuf, &nsbuf, &sbuf); + &nmbuf, &mbuf, &nsbuf, &sbuf); } #endif @@ -176,7 +174,7 @@ void list_visuals() { int j = pfv ? pfv->bits_per_pixel : 0; printf(" %2ld: %s %2d/%d", p->visualid, ClassNames[p->c_class], - p->depth, j); + p->depth, j); if (j < 10) putchar(' '); print_mask(p); @@ -184,11 +182,11 @@ void list_visuals() { for (j=0; j<numoverlayinfo; j++) { OverlayInfo *o = &overlayInfo[j]; if (o->overlay_visual == long(p->visualid)) { - printf(" overlay("); - if (o->transparent_type==1) printf("transparent pixel %ld, ",o->value); - else if (o->transparent_type==2) printf("transparent mask %ld, ",o->value); - else printf("opaque, "); - printf("layer %ld)", o->layer); + printf(" overlay("); + if (o->transparent_type==1) printf("transparent pixel %ld, ",o->value); + else if (o->transparent_type==2) printf("transparent mask %ld, ",o->value); + else printf("opaque, "); + printf("layer %ld)", o->layer); } } @@ -196,12 +194,12 @@ void list_visuals() { for (j=0; j<nmbuf; j++) { XmbufBufferInfo *m = &mbuf[j]; if (m->visualid == p->visualid) - printf(" multibuffer(%d)", m->max_buffers); + printf(" multibuffer(%d)", m->max_buffers); } for (j=0; j<nsbuf; j++) { XmbufBufferInfo *m = &sbuf[j]; if (m->visualid == p->visualid) - printf(" stereo multibuffer(%d)", m->max_buffers); + printf(" stereo multibuffer(%d)", m->max_buffers); } #endif @@ -229,7 +227,3 @@ int main(int argc, char **argv) { return 0; } #endif - -// -// End of "$Id$". -// diff --git a/test/mandelbrot.cxx b/test/mandelbrot.cxx index 50f048f54..d6cbe338a 100644 --- a/test/mandelbrot.cxx +++ b/test/mandelbrot.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Mandelbrot set demo for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "mandelbrot_ui.h" @@ -105,16 +103,16 @@ int Drawing_Area::idle() { double wx = xx; double wy = yi; if (julia) xx = jX; for (int i=0; ; i++) { - if (i >= iterations) {*p = 0; break;} - double t = wx*wx - wy*wy + xx; - wy = 2*wx*wy + yy; - wx = t; - if (wx*wx + wy*wy > 4) { - wx = t = 1-double(i)/(1<<10); - if (t <= 0) t = 0; else for (i=brightness; i--;) t*=wx; - *p = 255-int(254*t); - break; - } + if (i >= iterations) {*p = 0; break;} + double t = wx*wx - wy*wy + xx; + wy = 2*wx*wy + yy; + wx = t; + if (wx*wx + wy*wy > 4) { + wx = t = 1-double(i)/(1<<10); + if (t <= 0) t = 0; else for (i=brightness; i--;) t*=wx; + *p = 255-int(254*t); + break; + } } p++; } @@ -157,34 +155,34 @@ int Drawing_Area::handle(int event) { if (button == 1) { erase_box(); if (dragged && sw > 3 && sh > 3) { - X = X + (sx+sw/2-x()-W/2)*scale/W; - Y = Y + (-sy-sh/2+y()+H/2)*scale/W; - scale = sw*scale/W; + X = X + (sx+sw/2-x()-W/2)*scale/W; + Y = Y + (-sy-sh/2+y()+H/2)*scale/W; + scale = sw*scale/W; } else if (!dragged) { - scale = 2*scale; - if (julia) { - if (scale >= 4) { - scale = 4; - X = Y = 0; - } - } else { - if (scale >= 2.5) { - scale = 2.5; - X = -.75; - Y = 0; - } - } + scale = 2*scale; + if (julia) { + if (scale >= 4) { + scale = 4; + X = Y = 0; + } + } else { + if (scale >= 2.5) { + scale = 2.5; + X = -.75; + Y = 0; + } + } } else return 1; ((Drawing_Window*)(user_data()))->update_label(); new_display(); } else if (!julia) { if (!jbrot.d) { - jbrot.make_window(); - jbrot.d->julia = 1; - jbrot.d->X = 0; - jbrot.d->Y = 0; - jbrot.d->scale = 4; - jbrot.update_label(); + jbrot.make_window(); + jbrot.d->julia = 1; + jbrot.d->X = 0; + jbrot.d->Y = 0; + jbrot.d->scale = 4; + jbrot.update_label(); } jbrot.d->jX = X + (ix-x()-W/2)*scale/W; jbrot.d->jY = Y + (H/2-iy+y())*scale/W; @@ -212,7 +210,3 @@ void Drawing_Area::resize(int XX,int YY,int WW,int HH) { } Fl_Box::resize(XX,YY,WW,HH); } - -// -// End of "$Id$". -// diff --git a/test/mandelbrot.h b/test/mandelbrot.h index 741f0ffab..d6bae813f 100644 --- a/test/mandelbrot.h +++ b/test/mandelbrot.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Mandelbrot set header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -59,7 +57,3 @@ public: } int idle(); }; - -// -// End of "$Id$". -// diff --git a/test/menubar.cxx b/test/menubar.cxx index 2dca71707..856aa72a1 100644 --- a/test/menubar.cxx +++ b/test/menubar.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Menubar test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2020 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -39,7 +37,7 @@ Fl_Simple_Terminal *G_tty = 0; void window_cb(Fl_Widget* w, void*) { - puts("window callback called"); // end of program, so stdout instead of G_tty + puts("window callback called"); // end of program, so stdout instead of G_tty ((Fl_Double_Window *)w)->hide(); } @@ -61,9 +59,9 @@ Fl_Menu_Item hugemenu[100]; Fl_Menu_Item menutable[] = { {"foo",0,0,0,FL_MENU_INACTIVE}, {"&File",0,0,0,FL_SUBMENU}, - {"&Open", FL_ALT+'o', 0, 0, FL_MENU_INACTIVE}, - {"&Close", 0, 0}, - {"&Quit", FL_ALT+'q', quit_cb, 0, FL_MENU_DIVIDER}, + {"&Open", FL_ALT+'o', 0, 0, FL_MENU_INACTIVE}, + {"&Close", 0, 0}, + {"&Quit", FL_ALT+'q', quit_cb, 0, FL_MENU_DIVIDER}, {"shortcut",'a'}, {"shortcut",FL_SHIFT+'a'}, {"shortcut",FL_CTRL+'a'}, @@ -82,65 +80,65 @@ Fl_Menu_Item menutable[] = { {"shortcut",FL_ALT+FL_SHIFT+FL_F+1}, {"shortcut",FL_ALT+FL_CTRL+FL_F+1}, {"shortcut",FL_ALT+FL_SHIFT+FL_CTRL+FL_F+1, 0,0, FL_MENU_DIVIDER}, - {"&Submenus", FL_ALT+'S', 0, (void*)"Submenu1", FL_SUBMENU}, + {"&Submenus", FL_ALT+'S', 0, (void*)"Submenu1", FL_SUBMENU}, {"A very long menu item"}, - {"&submenu",FL_CTRL+'S', 0, (void*)"submenu2", FL_SUBMENU}, - {"item 1"}, - {"item 2"}, - {"item 3"}, - {"item 4"}, - {0}, + {"&submenu",FL_CTRL+'S', 0, (void*)"submenu2", FL_SUBMENU}, + {"item 1"}, + {"item 2"}, + {"item 3"}, + {"item 4"}, + {0}, {"after submenu"}, {0}, {0}, {"&Edit",FL_F+2,0,0,FL_SUBMENU}, - {"Undo", FL_ALT+'z', 0}, - {"Redo", FL_ALT+'r', 0, 0, FL_MENU_DIVIDER}, - {"Cut", FL_ALT+'x', 0}, - {"Copy", FL_ALT+'c', 0}, - {"Paste", FL_ALT+'v', 0}, - {"Inactive",FL_ALT+'d', 0, 0, FL_MENU_INACTIVE}, - {"Clear", 0, 0, 0, FL_MENU_DIVIDER}, - {"Invisible",FL_ALT+'e', 0, 0, FL_MENU_INVISIBLE}, - {"Preferences",0, 0}, - {"Size", 0, 0}, + {"Undo", FL_ALT+'z', 0}, + {"Redo", FL_ALT+'r', 0, 0, FL_MENU_DIVIDER}, + {"Cut", FL_ALT+'x', 0}, + {"Copy", FL_ALT+'c', 0}, + {"Paste", FL_ALT+'v', 0}, + {"Inactive", FL_ALT+'d', 0, 0, FL_MENU_INACTIVE}, + {"Clear", 0, 0, 0, FL_MENU_DIVIDER}, + {"Invisible", FL_ALT+'e', 0, 0, FL_MENU_INVISIBLE}, + {"Preferences", 0, 0}, + {"Size", 0, 0}, {0}, {"&Checkbox",FL_F+3,0,0,FL_SUBMENU}, - {"&Alpha", FL_F+2, 0, (void *)1, FL_MENU_TOGGLE}, - {"&Beta", 0, 0, (void *)2, FL_MENU_TOGGLE}, - {"&Gamma", 0, 0, (void *)3, FL_MENU_TOGGLE}, - {"&Delta", 0, 0, (void *)4, FL_MENU_TOGGLE|FL_MENU_VALUE}, - {"&Epsilon",0, 0, (void *)5, FL_MENU_TOGGLE}, - {"&Pi", 0, 0, (void *)6, FL_MENU_TOGGLE}, - {"&Mu", 0, 0, (void *)7, FL_MENU_TOGGLE|FL_MENU_DIVIDER}, - {"Red", 0, 0, (void *)1, FL_MENU_TOGGLE, 0, 0, 0, 1}, - {"Black", 0, 0, (void *)1, FL_MENU_TOGGLE|FL_MENU_DIVIDER}, - {"00", 0, 0, (void *)1, FL_MENU_TOGGLE}, - {"000", 0, 0, (void *)1, FL_MENU_TOGGLE}, + {"&Alpha", FL_F+2, 0, (void *)1, FL_MENU_TOGGLE}, + {"&Beta", 0, 0, (void *)2, FL_MENU_TOGGLE}, + {"&Gamma", 0, 0, (void *)3, FL_MENU_TOGGLE}, + {"&Delta", 0, 0, (void *)4, FL_MENU_TOGGLE|FL_MENU_VALUE}, + {"&Epsilon",0, 0, (void *)5, FL_MENU_TOGGLE}, + {"&Pi", 0, 0, (void *)6, FL_MENU_TOGGLE}, + {"&Mu", 0, 0, (void *)7, FL_MENU_TOGGLE|FL_MENU_DIVIDER}, + {"Red", 0, 0, (void *)1, FL_MENU_TOGGLE, 0, 0, 0, 1}, + {"Black", 0, 0, (void *)1, FL_MENU_TOGGLE|FL_MENU_DIVIDER}, + {"00", 0, 0, (void *)1, FL_MENU_TOGGLE}, + {"000", 0, 0, (void *)1, FL_MENU_TOGGLE}, {0}, {"&Radio",0,0,0,FL_SUBMENU}, - {"&Alpha", 0, 0, (void *)1, FL_MENU_RADIO}, - {"&Beta", 0, 0, (void *)2, FL_MENU_RADIO}, - {"&Gamma", 0, 0, (void *)3, FL_MENU_RADIO}, - {"&Delta", 0, 0, (void *)4, FL_MENU_RADIO|FL_MENU_VALUE}, - {"&Epsilon",0, 0, (void *)5, FL_MENU_RADIO}, - {"&Pi", 0, 0, (void *)6, FL_MENU_RADIO}, - {"&Mu", 0, 0, (void *)7, FL_MENU_RADIO|FL_MENU_DIVIDER}, - {"Red", 0, 0, (void *)1, FL_MENU_RADIO}, - {"Black", 0, 0, (void *)1, FL_MENU_RADIO|FL_MENU_DIVIDER}, - {"00", 0, 0, (void *)1, FL_MENU_RADIO}, - {"000", 0, 0, (void *)1, FL_MENU_RADIO}, + {"&Alpha", 0, 0, (void *)1, FL_MENU_RADIO}, + {"&Beta", 0, 0, (void *)2, FL_MENU_RADIO}, + {"&Gamma", 0, 0, (void *)3, FL_MENU_RADIO}, + {"&Delta", 0, 0, (void *)4, FL_MENU_RADIO|FL_MENU_VALUE}, + {"&Epsilon",0, 0, (void *)5, FL_MENU_RADIO}, + {"&Pi", 0, 0, (void *)6, FL_MENU_RADIO}, + {"&Mu", 0, 0, (void *)7, FL_MENU_RADIO|FL_MENU_DIVIDER}, + {"Red", 0, 0, (void *)1, FL_MENU_RADIO}, + {"Black", 0, 0, (void *)1, FL_MENU_RADIO|FL_MENU_DIVIDER}, + {"00", 0, 0, (void *)1, FL_MENU_RADIO}, + {"000", 0, 0, (void *)1, FL_MENU_RADIO}, {0}, {"&Font",0,0,0,FL_SUBMENU /*, 0, FL_BOLD, 20*/}, - {"Normal", 0, 0, 0, 0, 0, 0, 14}, - {"Bold", 0, 0, 0, 0, 0, FL_BOLD, 14}, - {"Italic", 0, 0, 0, 0, 0, FL_ITALIC, 14}, + {"Normal", 0, 0, 0, 0, 0, 0, 14}, + {"Bold", 0, 0, 0, 0, 0, FL_BOLD, 14}, + {"Italic", 0, 0, 0, 0, 0, FL_ITALIC, 14}, {"BoldItalic",0,0,0, 0, 0, FL_BOLD+FL_ITALIC, 14}, - {"Small", 0, 0, 0, 0, 0, FL_BOLD+FL_ITALIC, 10}, - {"Emboss", 0, 0, 0, 0, (uchar)FL_EMBOSSED_LABEL}, - {"Engrave", 0, 0, 0, 0, (uchar)FL_ENGRAVED_LABEL}, - {"Shadow", 0, 0, 0, 0, (uchar)FL_SHADOW_LABEL}, - {"@->", 0, 0, 0, 0, (uchar)FL_SYMBOL_LABEL}, + {"Small", 0, 0, 0, 0, 0, FL_BOLD+FL_ITALIC, 10}, + {"Emboss", 0, 0, 0, 0, (uchar)FL_EMBOSSED_LABEL}, + {"Engrave", 0, 0, 0, 0, (uchar)FL_ENGRAVED_LABEL}, + {"Shadow", 0, 0, 0, 0, (uchar)FL_SHADOW_LABEL}, + {"@->", 0, 0, 0, 0, (uchar)FL_SYMBOL_LABEL}, {0}, {"&International",0,0,0,FL_SUBMENU}, {"Sharp Ess",0x0000df}, @@ -156,11 +154,11 @@ Fl_Menu_Item menutable[] = { {0}, {"E&mpty",0,0,0,FL_SUBMENU}, {0}, - {"&Inactive", 0, 0, 0, FL_MENU_INACTIVE|FL_SUBMENU}, + {"&Inactive", 0, 0, 0, FL_MENU_INACTIVE|FL_SUBMENU}, {"A very long menu item"}, {"A very long menu item"}, {0}, - {"Invisible",0, 0, 0, FL_MENU_INVISIBLE|FL_SUBMENU}, + {"Invisible",0, 0, 0, FL_MENU_INVISIBLE|FL_SUBMENU}, {"A very long menu item"}, {"A very long menu item"}, {0}, @@ -170,32 +168,32 @@ Fl_Menu_Item menutable[] = { }; Fl_Menu_Item pulldown[] = { - {"Red", FL_ALT+'r'}, - {"Green", FL_ALT+'g'}, - {"Blue", FL_ALT+'b'}, - {"Strange", FL_ALT+'s', 0, 0, FL_MENU_INACTIVE}, - {"&Charm", FL_ALT+'c'}, - {"Truth", FL_ALT+'t'}, - {"Beauty", FL_ALT+'b'}, + {"Red", FL_ALT+'r'}, + {"Green", FL_ALT+'g'}, + {"Blue", FL_ALT+'b'}, + {"Strange", FL_ALT+'s', 0, 0, FL_MENU_INACTIVE}, + {"&Charm", FL_ALT+'c'}, + {"Truth", FL_ALT+'t'}, + {"Beauty", FL_ALT+'b'}, {0} }; #ifdef __APPLE__ Fl_Menu_Item menu_location[] = { - {"Fl_Menu_Bar", 0, 0, 0, FL_MENU_VALUE}, - {"Fl_Sys_Menu_Bar", }, + {"Fl_Menu_Bar", 0, 0, 0, FL_MENU_VALUE}, + {"Fl_Sys_Menu_Bar", }, {0} }; Fl_Sys_Menu_Bar* smenubar; -void menu_location_cb(Fl_Widget* w, void* data) +void menu_location_cb(Fl_Widget* w, void* data) { Fl_Menu_Bar *menubar = (Fl_Menu_Bar*)data; if (((Fl_Choice*)w)->value() == 1) { // switch to system menu bar menubar->hide(); const Fl_Menu_Item *menu = menubar->menu(); - smenubar = new Fl_Sys_Menu_Bar(0,0,0,30); + smenubar = new Fl_Sys_Menu_Bar(0,0,0,30); smenubar->menu(menu); smenubar->callback(test_cb); } @@ -211,7 +209,7 @@ void menu_location_cb(Fl_Widget* w, void* data) void menu_linespacing_cb(Fl_Widget* w, void*) { Fl_Value_Slider *fvs = (Fl_Value_Slider*)w; int val = (int)fvs->value(); - Fl::menu_linespacing(val); // takes effect when someone opens a new menu.. + Fl::menu_linespacing(val); // takes effect when someone opens a new menu.. } #define WIDTH 700 @@ -255,7 +253,7 @@ int main(int argc, char **argv) { window.resizable(&mb); window.size_range(300,400,0,400); #ifdef __APPLE__ - Fl_Choice ch2(500,100,150,25,"Use:"); + Fl_Choice ch2(500,100,150,25,"Use:"); ch2.menu(menu_location); ch2.callback(menu_location_cb, &menubar); ch2.value(1); @@ -276,13 +274,13 @@ int main(int argc, char **argv) { menu_linespacing_slider.callback(menu_linespacing_cb); window.end(); - + Fl_Sys_Menu_Bar::about(about_cb, NULL); #ifdef __APPLE__ Fl_Menu_Item custom[] = { - {"Preferences…", 0, test_cb, NULL, FL_MENU_DIVIDER}, - {"Radio1", 0, test_cb, NULL, FL_MENU_RADIO|FL_MENU_VALUE}, - {"Radio2", 0, test_cb, NULL, FL_MENU_RADIO}, + {"Preferences…", 0, test_cb, NULL, FL_MENU_DIVIDER}, + {"Radio1", 0, test_cb, NULL, FL_MENU_RADIO | FL_MENU_VALUE}, + {"Radio2", 0, test_cb, NULL, FL_MENU_RADIO}, {0} }; Fl_Mac_App_Menu::custom_application_menu_items(custom); @@ -291,7 +289,3 @@ int main(int argc, char **argv) { window.show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/message.cxx b/test/message.cxx index fe18a3095..1b0f8ecec 100644 --- a/test/message.cxx +++ b/test/message.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Message test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -27,10 +25,10 @@ int main(int argc, char **argv) { Fl::get_system_colors(); fl_message("Spelling check sucessful, %d errors found with %g%% confidence", - 1002, 100*(15/77.0)); + 1002, 100*(15/77.0)); fl_alert("Quantum fluctuations in the space-time continuum detected,\n" - "you have %g seconds to comply.\n\n" + "you have %g seconds to comply.\n\n" "\"In physics, spacetime is any mathematical model that combines\n" "space and time into a single construct called the space-time\n" "continuum. Spacetime is usually interpreted with space being\n" @@ -46,7 +44,7 @@ int main(int argc, char **argv) { const char *r; r = fl_input("Please enter a string for '%s':", "this is the default value", - "testing"); + "testing"); printf("fl_input returned \"%s\"\n", r ? r : "NULL"); r = fl_password("Enter %s's password:", 0, "somebody"); @@ -54,7 +52,3 @@ int main(int argc, char **argv) { return 0; } - -// -// End of "$Id$". -// diff --git a/test/minimum.cxx b/test/minimum.cxx index 6b7ba12b2..7c8985cc9 100644 --- a/test/minimum.cxx +++ b/test/minimum.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Minimal update test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // @@ -67,7 +65,3 @@ int main(int argc, char **argv) { window->show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/native-filechooser.cxx b/test/native-filechooser.cxx index 6730ab65e..dd0c4812d 100644 --- a/test/native-filechooser.cxx +++ b/test/native-filechooser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Simple test of the Fl_Native_File_Chooser. // // Copyright 1998-2016 by Bill Spitzak and others. @@ -10,16 +8,16 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> -#include <string.h> /* strstr() */ +#include <string.h> /* strstr() */ #include <FL/Fl.H> -#include <FL/fl_ask.H> /* fl_beep() */ +#include <FL/fl_ask.H> /* fl_beep() */ #include <FL/Fl_Window.H> #include <FL/Fl_Button.H> #include <FL/Fl_Input.H> @@ -45,15 +43,15 @@ void PickFile_CB(Fl_Widget*, void*) { native.preset_file(G_filename->value()); // Show native chooser switch ( native.show() ) { - case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR - case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL - default: // PICKED FILE + case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR + case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL + default: // PICKED FILE if ( native.filename() ) { G_filename->value(native.filename()); - G_tty->printf("filename='%s'\n", native.filename()); + G_tty->printf("filename='%s'\n", native.filename()); } else { - G_filename->value("NULL"); - G_tty->printf("filename='(null)'\n"); + G_filename->value("NULL"); + G_tty->printf("filename='(null)'\n"); } break; } @@ -67,15 +65,15 @@ void PickDir_CB(Fl_Widget*, void*) { native.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY); // Show native chooser switch ( native.show() ) { - case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR - case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL - default: // PICKED DIR + case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR + case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL + default: // PICKED DIR if ( native.filename() ) { G_filename->value(native.filename()); - G_tty->printf("dirname='%s'\n", native.filename()); + G_tty->printf("dirname='%s'\n", native.filename()); } else { - G_filename->value("NULL"); - G_tty->printf("dirname='(null)'\n"); + G_filename->value("NULL"); + G_tty->printf("dirname='(null)'\n"); } break; } @@ -98,7 +96,7 @@ int main(int argc, char **argv) { if (argc>argn && strncmp(argv[1], "-psn_", 5)==0) argn++; #endif - + Fl_Window *win = new Fl_Window(640, 400+TERMINAL_HEIGHT, "Native File Chooser Test"); win->size_range(win->w(), win->h(), 0, 0); win->begin(); @@ -115,7 +113,7 @@ int main(int argc, char **argv) { G_filter->value("Text\t*.txt\n" "C Files\t*.{cxx,h,c,cpp}\n" "Tars\t*.{tar,tar.gz}\n" - "Apps\t*.app"); + "Apps\t*.app"); G_filter->tooltip("Filter to be used for browser.\n" "An empty string may be used.\n"); @@ -127,19 +125,19 @@ int main(int argc, char **argv) { view->textfont(FL_HELVETICA); view->textsize(10); view->value("The Filter can be one or more filter patterns, one per line.\n" - "Patterns can be:<ul>\n" - " <li>A single wildcard (e.g. <tt>\"*.txt\"</tt>)</li>\n" - " <li>Multiple wildcards (e.g. <tt>\"*.{cxx,h,H}\"</tt>)</li>\n" - " <li>A descriptive name followed by a " TAB " and a wildcard (e.g. <tt>\"Text Files" TAB "*.txt\"</tt>)</li>\n" - "</ul>\n" + "Patterns can be:<ul>\n" + " <li>A single wildcard (e.g. <tt>\"*.txt\"</tt>)</li>\n" + " <li>Multiple wildcards (e.g. <tt>\"*.{cxx,h,H}\"</tt>)</li>\n" + " <li>A descriptive name followed by a " TAB " and a wildcard (e.g. <tt>\"Text Files" TAB "*.txt\"</tt>)</li>\n" + "</ul>\n" "In the above \"Filter\" field, you can use <b><font color=#55f face=Courier>Ctrl-I</font></b> to enter " TAB " characters as needed.<br>\n" - "Example:<pre>\n" - "\n" - " Text<font color=#55f><Ctrl-I></font>*.txt\n" - " C Files<font color=#55f><Ctrl-I></font>*.{cxx,h,c,cpp}\n" - " Tars<font color=#55f><Ctrl-I></font>*.{tar,tar.gz}\n" - " Apps<font color=#55f><Ctrl-I></font>*.app\n" - "</pre>\n"); + "Example:<pre>\n" + "\n" + " Text<font color=#55f><Ctrl-I></font>*.txt\n" + " C Files<font color=#55f><Ctrl-I></font>*.{cxx,h,c,cpp}\n" + " Tars<font color=#55f><Ctrl-I></font>*.{tar,tar.gz}\n" + " Apps<font color=#55f><Ctrl-I></font>*.app\n" + "</pre>\n"); Fl_Button *but = new Fl_Button(win->w()-x-10, win->h()-TERMINAL_HEIGHT-25-10, 80, 25, "Pick File"); but->callback(PickFile_CB); @@ -153,7 +151,3 @@ int main(int argc, char **argv) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/test/navigation.cxx b/test/navigation.cxx index f6a7f3b91..00a85a653 100644 --- a/test/navigation.cxx +++ b/test/navigation.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Navigation test program for the Fast Light Tool Kit (FLTK). // // Silly test of navigation keys. This is not a recommended method of @@ -12,11 +10,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -40,7 +38,7 @@ int main(int argc, char **argv) { // Include a toggle button to control arrow focus Fl_Light_Button arrowfocus_butt(10,HEIGHT+10,130,20," Arrow Focus"); arrowfocus_butt.callback(ToggleArrowFocus_CB); - arrowfocus_butt.value(Fl::option(Fl::OPTION_ARROW_FOCUS) ? 1 : 0); // use default + arrowfocus_butt.value(Fl::option(Fl::OPTION_ARROW_FOCUS) ? 1 : 0); // use default arrowfocus_butt.tooltip("Control horizontal arrow key focus navigation behavior.\n" "e.g. Fl::OPTION_ARROW_FOCUS"); window.end(); // don't auto-add children @@ -58,7 +56,7 @@ int main(int argc, char **argv) { int n; for (n=0; n < window.children(); n++) { Fl_Widget *o = window.child(n); if (x<o->x()+o->w() && x+w>o->x() && - y<o->y()+o->h() && y+h>o->y()) break; + y<o->y()+o->h() && y+h>o->y()) break; if ( !j && ( y<o->y() || (y==o->y() && x<o->x()) ) ) j = o; } // skip if intersection: @@ -68,7 +66,3 @@ int main(int argc, char **argv) { window.show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/offscreen.cxx b/test/offscreen.cxx index 23cd368a6..b22218fc1 100644 --- a/test/offscreen.cxx +++ b/test/offscreen.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Offscreen drawing test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* Standard headers */ @@ -69,7 +67,7 @@ private: // Width and height of the offscreen surface int offsc_w, offsc_h; int iters; // Must be set on first pass! - float scale; // current screen scaling factor value + float scale; // current screen scaling factor value }; /*****************************************************************************/ @@ -119,7 +117,7 @@ void oscr_box::draw() int oscr_box::handle(int ev) { int ret = Fl_Box::handle(ev); - + // handle dragging of visible page area - if a valid context exists if (has_oscr()) { @@ -145,32 +143,32 @@ int oscr_box::handle(int ev) case FL_DRAG: if (drag_state == 1) // dragging page { - int x2 = Fl::event_x_root(); - int y2 = Fl::event_y_root(); - xoff = x1 - x2; - yoff = y1 - y2; - x1 = x2; - y1 = y2; - page_x += xoff; - page_y += yoff; - // check the page bounds - if (page_x < -w()) - { - page_x = -w(); - } - else if (page_x > offsc_w) - { - page_x = offsc_w; - } - if (page_y < -h()) - { - page_y = -h(); - } - else if (page_y > offsc_h) - { - page_y = offsc_h; - } - redraw(); + int x2 = Fl::event_x_root(); + int y2 = Fl::event_y_root(); + xoff = x1 - x2; + yoff = y1 - y2; + x1 = x2; + y1 = y2; + page_x += xoff; + page_y += yoff; + // check the page bounds + if (page_x < -w()) + { + page_x = -w(); + } + else if (page_x > offsc_w) + { + page_x = offsc_w; + } + if (page_y < -h()) + { + page_y = -h(); + } + else if (page_y > offsc_h) + { + page_y = offsc_h; + } + redraw(); } ret = 1; break; @@ -264,7 +262,3 @@ int main(int argc, char **argv) return Fl::run(); } // main - -// -// End of "$Id$". -// diff --git a/test/output.cxx b/test/output.cxx index 794b37abe..8bcc4b944 100644 --- a/test/output.cxx +++ b/test/output.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Output test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -90,7 +88,3 @@ int main(int argc, char **argv) { window->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/overlay.cxx b/test/overlay.cxx index 7e9e018c5..f510d5c9f 100644 --- a/test/overlay.cxx +++ b/test/overlay.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Overlay window test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> @@ -71,7 +69,3 @@ int main(int argc, char **argv) { ovl->redraw_overlay(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/pack.cxx b/test/pack.cxx index 79be48013..87fc49e08 100644 --- a/test/pack.cxx +++ b/test/pack.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Pack test program for the Fast Light Tool Kit (FLTK). // // Rather crude test of the Fl_Pack object. @@ -13,11 +11,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -105,7 +103,3 @@ int main(int argc, char **argv) { w->show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/pixmap.cxx b/test/pixmap.cxx index 4595e31ae..fe79f8758 100644 --- a/test/pixmap.cxx +++ b/test/pixmap.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Pixmap label test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -87,7 +85,3 @@ int main(int argc, char **argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/pixmap_browser.cxx b/test/pixmap_browser.cxx index b2611703b..4a80f3579 100644 --- a/test/pixmap_browser.cxx +++ b/test/pixmap_browser.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // A shared image test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -50,7 +48,7 @@ void load_file(const char *n) { return; } Fl_Shared_Image *img2 = Fl_Shared_Image::get(n); - + if (!img2) { b->label("@filenew"); // show an empty document b->labelsize(64); @@ -103,7 +101,7 @@ void print_cb(Fl_Widget *widget, void *) { printer.end_page(); printer.end_job(); } - + void svg_cb(Fl_Widget *widget, void *) { Fl_Native_File_Chooser fnfc; fnfc.title("Pick a .svg file"); @@ -147,7 +145,3 @@ int main(int argc, char **argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/resizebox.cxx b/test/resizebox.cxx index 602612c10..c698ac07a 100644 --- a/test/resizebox.cxx +++ b/test/resizebox.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Resize box test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #define W1 (big ? 60 : 40) @@ -87,7 +85,3 @@ int main(int argc, char **argv) { window->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/rgb.txt b/test/rgb.txt index 62eb8961e..8b763621b 100644 --- a/test/rgb.txt +++ b/test/rgb.txt @@ -1,753 +1,753 @@ ! $Xorg: rgb.txt,v 1.3 2000/08/17 19:54:00 cpqbld Exp $ -255 250 250 snow -248 248 255 ghost white -248 248 255 GhostWhite -245 245 245 white smoke -245 245 245 WhiteSmoke -220 220 220 gainsboro -255 250 240 floral white -255 250 240 FloralWhite -253 245 230 old lace -253 245 230 OldLace -250 240 230 linen -250 235 215 antique white -250 235 215 AntiqueWhite -255 239 213 papaya whip -255 239 213 PapayaWhip -255 235 205 blanched almond -255 235 205 BlanchedAlmond -255 228 196 bisque -255 218 185 peach puff -255 218 185 PeachPuff -255 222 173 navajo white -255 222 173 NavajoWhite -255 228 181 moccasin -255 248 220 cornsilk -255 255 240 ivory -255 250 205 lemon chiffon -255 250 205 LemonChiffon -255 245 238 seashell -240 255 240 honeydew -245 255 250 mint cream -245 255 250 MintCream -240 255 255 azure -240 248 255 alice blue -240 248 255 AliceBlue -230 230 250 lavender -255 240 245 lavender blush -255 240 245 LavenderBlush -255 228 225 misty rose -255 228 225 MistyRose -255 255 255 white - 0 0 0 black - 47 79 79 dark slate gray - 47 79 79 DarkSlateGray - 47 79 79 dark slate grey - 47 79 79 DarkSlateGrey -105 105 105 dim gray -105 105 105 DimGray -105 105 105 dim grey -105 105 105 DimGrey -112 128 144 slate gray -112 128 144 SlateGray -112 128 144 slate grey -112 128 144 SlateGrey -119 136 153 light slate gray -119 136 153 LightSlateGray -119 136 153 light slate grey -119 136 153 LightSlateGrey -190 190 190 gray -190 190 190 grey -211 211 211 light grey -211 211 211 LightGrey -211 211 211 light gray -211 211 211 LightGray - 25 25 112 midnight blue - 25 25 112 MidnightBlue - 0 0 128 navy - 0 0 128 navy blue - 0 0 128 NavyBlue -100 149 237 cornflower blue -100 149 237 CornflowerBlue - 72 61 139 dark slate blue - 72 61 139 DarkSlateBlue -106 90 205 slate blue -106 90 205 SlateBlue -123 104 238 medium slate blue -123 104 238 MediumSlateBlue -132 112 255 light slate blue -132 112 255 LightSlateBlue - 0 0 205 medium blue - 0 0 205 MediumBlue - 65 105 225 royal blue - 65 105 225 RoyalBlue - 0 0 255 blue - 30 144 255 dodger blue - 30 144 255 DodgerBlue - 0 191 255 deep sky blue - 0 191 255 DeepSkyBlue -135 206 235 sky blue -135 206 235 SkyBlue -135 206 250 light sky blue -135 206 250 LightSkyBlue - 70 130 180 steel blue - 70 130 180 SteelBlue -176 196 222 light steel blue -176 196 222 LightSteelBlue -173 216 230 light blue -173 216 230 LightBlue -176 224 230 powder blue -176 224 230 PowderBlue -175 238 238 pale turquoise -175 238 238 PaleTurquoise - 0 206 209 dark turquoise - 0 206 209 DarkTurquoise - 72 209 204 medium turquoise - 72 209 204 MediumTurquoise - 64 224 208 turquoise - 0 255 255 cyan -224 255 255 light cyan -224 255 255 LightCyan - 95 158 160 cadet blue - 95 158 160 CadetBlue -102 205 170 medium aquamarine -102 205 170 MediumAquamarine -127 255 212 aquamarine - 0 100 0 dark green - 0 100 0 DarkGreen - 85 107 47 dark olive green - 85 107 47 DarkOliveGreen -143 188 143 dark sea green -143 188 143 DarkSeaGreen - 46 139 87 sea green - 46 139 87 SeaGreen - 60 179 113 medium sea green - 60 179 113 MediumSeaGreen - 32 178 170 light sea green - 32 178 170 LightSeaGreen -152 251 152 pale green -152 251 152 PaleGreen - 0 255 127 spring green - 0 255 127 SpringGreen -124 252 0 lawn green -124 252 0 LawnGreen - 0 255 0 green -127 255 0 chartreuse - 0 250 154 medium spring green - 0 250 154 MediumSpringGreen -173 255 47 green yellow -173 255 47 GreenYellow - 50 205 50 lime green - 50 205 50 LimeGreen -154 205 50 yellow green -154 205 50 YellowGreen - 34 139 34 forest green - 34 139 34 ForestGreen -107 142 35 olive drab -107 142 35 OliveDrab -189 183 107 dark khaki -189 183 107 DarkKhaki -240 230 140 khaki -238 232 170 pale goldenrod -238 232 170 PaleGoldenrod -250 250 210 light goldenrod yellow -250 250 210 LightGoldenrodYellow -255 255 224 light yellow -255 255 224 LightYellow -255 255 0 yellow -255 215 0 gold -238 221 130 light goldenrod -238 221 130 LightGoldenrod -218 165 32 goldenrod -184 134 11 dark goldenrod -184 134 11 DarkGoldenrod -188 143 143 rosy brown -188 143 143 RosyBrown -205 92 92 indian red -205 92 92 IndianRed -139 69 19 saddle brown -139 69 19 SaddleBrown -160 82 45 sienna -205 133 63 peru -222 184 135 burlywood -245 245 220 beige -245 222 179 wheat -244 164 96 sandy brown -244 164 96 SandyBrown -210 180 140 tan -210 105 30 chocolate -178 34 34 firebrick -165 42 42 brown -233 150 122 dark salmon -233 150 122 DarkSalmon -250 128 114 salmon -255 160 122 light salmon -255 160 122 LightSalmon -255 165 0 orange -255 140 0 dark orange -255 140 0 DarkOrange -255 127 80 coral -240 128 128 light coral -240 128 128 LightCoral -255 99 71 tomato -255 69 0 orange red -255 69 0 OrangeRed -255 0 0 red -255 105 180 hot pink -255 105 180 HotPink -255 20 147 deep pink -255 20 147 DeepPink -255 192 203 pink -255 182 193 light pink -255 182 193 LightPink -219 112 147 pale violet red -219 112 147 PaleVioletRed -176 48 96 maroon -199 21 133 medium violet red -199 21 133 MediumVioletRed -208 32 144 violet red -208 32 144 VioletRed -255 0 255 magenta -238 130 238 violet -221 160 221 plum -218 112 214 orchid -186 85 211 medium orchid -186 85 211 MediumOrchid -153 50 204 dark orchid -153 50 204 DarkOrchid -148 0 211 dark violet -148 0 211 DarkViolet -138 43 226 blue violet -138 43 226 BlueViolet -160 32 240 purple -147 112 219 medium purple -147 112 219 MediumPurple -216 191 216 thistle -255 250 250 snow1 -238 233 233 snow2 -205 201 201 snow3 -139 137 137 snow4 -255 245 238 seashell1 -238 229 222 seashell2 -205 197 191 seashell3 -139 134 130 seashell4 -255 239 219 AntiqueWhite1 -238 223 204 AntiqueWhite2 -205 192 176 AntiqueWhite3 -139 131 120 AntiqueWhite4 -255 228 196 bisque1 -238 213 183 bisque2 -205 183 158 bisque3 -139 125 107 bisque4 -255 218 185 PeachPuff1 -238 203 173 PeachPuff2 -205 175 149 PeachPuff3 -139 119 101 PeachPuff4 -255 222 173 NavajoWhite1 -238 207 161 NavajoWhite2 -205 179 139 NavajoWhite3 -139 121 94 NavajoWhite4 -255 250 205 LemonChiffon1 -238 233 191 LemonChiffon2 -205 201 165 LemonChiffon3 -139 137 112 LemonChiffon4 -255 248 220 cornsilk1 -238 232 205 cornsilk2 -205 200 177 cornsilk3 -139 136 120 cornsilk4 -255 255 240 ivory1 -238 238 224 ivory2 -205 205 193 ivory3 -139 139 131 ivory4 -240 255 240 honeydew1 -224 238 224 honeydew2 -193 205 193 honeydew3 -131 139 131 honeydew4 -255 240 245 LavenderBlush1 -238 224 229 LavenderBlush2 -205 193 197 LavenderBlush3 -139 131 134 LavenderBlush4 -255 228 225 MistyRose1 -238 213 210 MistyRose2 -205 183 181 MistyRose3 -139 125 123 MistyRose4 -240 255 255 azure1 -224 238 238 azure2 -193 205 205 azure3 -131 139 139 azure4 -131 111 255 SlateBlue1 -122 103 238 SlateBlue2 -105 89 205 SlateBlue3 - 71 60 139 SlateBlue4 - 72 118 255 RoyalBlue1 - 67 110 238 RoyalBlue2 - 58 95 205 RoyalBlue3 - 39 64 139 RoyalBlue4 - 0 0 255 blue1 - 0 0 238 blue2 - 0 0 205 blue3 - 0 0 139 blue4 - 30 144 255 DodgerBlue1 - 28 134 238 DodgerBlue2 - 24 116 205 DodgerBlue3 - 16 78 139 DodgerBlue4 - 99 184 255 SteelBlue1 - 92 172 238 SteelBlue2 - 79 148 205 SteelBlue3 - 54 100 139 SteelBlue4 - 0 191 255 DeepSkyBlue1 - 0 178 238 DeepSkyBlue2 - 0 154 205 DeepSkyBlue3 - 0 104 139 DeepSkyBlue4 -135 206 255 SkyBlue1 -126 192 238 SkyBlue2 -108 166 205 SkyBlue3 - 74 112 139 SkyBlue4 -176 226 255 LightSkyBlue1 -164 211 238 LightSkyBlue2 -141 182 205 LightSkyBlue3 - 96 123 139 LightSkyBlue4 -198 226 255 SlateGray1 -185 211 238 SlateGray2 -159 182 205 SlateGray3 -108 123 139 SlateGray4 -202 225 255 LightSteelBlue1 -188 210 238 LightSteelBlue2 -162 181 205 LightSteelBlue3 -110 123 139 LightSteelBlue4 -191 239 255 LightBlue1 -178 223 238 LightBlue2 -154 192 205 LightBlue3 -104 131 139 LightBlue4 -224 255 255 LightCyan1 -209 238 238 LightCyan2 -180 205 205 LightCyan3 -122 139 139 LightCyan4 -187 255 255 PaleTurquoise1 -174 238 238 PaleTurquoise2 -150 205 205 PaleTurquoise3 -102 139 139 PaleTurquoise4 -152 245 255 CadetBlue1 -142 229 238 CadetBlue2 -122 197 205 CadetBlue3 - 83 134 139 CadetBlue4 - 0 245 255 turquoise1 - 0 229 238 turquoise2 - 0 197 205 turquoise3 - 0 134 139 turquoise4 - 0 255 255 cyan1 - 0 238 238 cyan2 - 0 205 205 cyan3 - 0 139 139 cyan4 -151 255 255 DarkSlateGray1 -141 238 238 DarkSlateGray2 -121 205 205 DarkSlateGray3 - 82 139 139 DarkSlateGray4 -127 255 212 aquamarine1 -118 238 198 aquamarine2 -102 205 170 aquamarine3 - 69 139 116 aquamarine4 -193 255 193 DarkSeaGreen1 -180 238 180 DarkSeaGreen2 -155 205 155 DarkSeaGreen3 -105 139 105 DarkSeaGreen4 - 84 255 159 SeaGreen1 - 78 238 148 SeaGreen2 - 67 205 128 SeaGreen3 - 46 139 87 SeaGreen4 -154 255 154 PaleGreen1 -144 238 144 PaleGreen2 -124 205 124 PaleGreen3 - 84 139 84 PaleGreen4 - 0 255 127 SpringGreen1 - 0 238 118 SpringGreen2 - 0 205 102 SpringGreen3 - 0 139 69 SpringGreen4 - 0 255 0 green1 - 0 238 0 green2 - 0 205 0 green3 - 0 139 0 green4 -127 255 0 chartreuse1 -118 238 0 chartreuse2 -102 205 0 chartreuse3 - 69 139 0 chartreuse4 -192 255 62 OliveDrab1 -179 238 58 OliveDrab2 -154 205 50 OliveDrab3 -105 139 34 OliveDrab4 -202 255 112 DarkOliveGreen1 -188 238 104 DarkOliveGreen2 -162 205 90 DarkOliveGreen3 -110 139 61 DarkOliveGreen4 -255 246 143 khaki1 -238 230 133 khaki2 -205 198 115 khaki3 -139 134 78 khaki4 -255 236 139 LightGoldenrod1 -238 220 130 LightGoldenrod2 -205 190 112 LightGoldenrod3 -139 129 76 LightGoldenrod4 -255 255 224 LightYellow1 -238 238 209 LightYellow2 -205 205 180 LightYellow3 -139 139 122 LightYellow4 -255 255 0 yellow1 -238 238 0 yellow2 -205 205 0 yellow3 -139 139 0 yellow4 -255 215 0 gold1 -238 201 0 gold2 -205 173 0 gold3 -139 117 0 gold4 -255 193 37 goldenrod1 -238 180 34 goldenrod2 -205 155 29 goldenrod3 -139 105 20 goldenrod4 -255 185 15 DarkGoldenrod1 -238 173 14 DarkGoldenrod2 -205 149 12 DarkGoldenrod3 -139 101 8 DarkGoldenrod4 -255 193 193 RosyBrown1 -238 180 180 RosyBrown2 -205 155 155 RosyBrown3 -139 105 105 RosyBrown4 -255 106 106 IndianRed1 -238 99 99 IndianRed2 -205 85 85 IndianRed3 -139 58 58 IndianRed4 -255 130 71 sienna1 -238 121 66 sienna2 -205 104 57 sienna3 -139 71 38 sienna4 -255 211 155 burlywood1 -238 197 145 burlywood2 -205 170 125 burlywood3 -139 115 85 burlywood4 -255 231 186 wheat1 -238 216 174 wheat2 -205 186 150 wheat3 -139 126 102 wheat4 -255 165 79 tan1 -238 154 73 tan2 -205 133 63 tan3 -139 90 43 tan4 -255 127 36 chocolate1 -238 118 33 chocolate2 -205 102 29 chocolate3 -139 69 19 chocolate4 -255 48 48 firebrick1 -238 44 44 firebrick2 -205 38 38 firebrick3 -139 26 26 firebrick4 -255 64 64 brown1 -238 59 59 brown2 -205 51 51 brown3 -139 35 35 brown4 -255 140 105 salmon1 -238 130 98 salmon2 -205 112 84 salmon3 -139 76 57 salmon4 -255 160 122 LightSalmon1 -238 149 114 LightSalmon2 -205 129 98 LightSalmon3 -139 87 66 LightSalmon4 -255 165 0 orange1 -238 154 0 orange2 -205 133 0 orange3 -139 90 0 orange4 -255 127 0 DarkOrange1 -238 118 0 DarkOrange2 -205 102 0 DarkOrange3 -139 69 0 DarkOrange4 -255 114 86 coral1 -238 106 80 coral2 -205 91 69 coral3 -139 62 47 coral4 -255 99 71 tomato1 -238 92 66 tomato2 -205 79 57 tomato3 -139 54 38 tomato4 -255 69 0 OrangeRed1 -238 64 0 OrangeRed2 -205 55 0 OrangeRed3 -139 37 0 OrangeRed4 -255 0 0 red1 -238 0 0 red2 -205 0 0 red3 -139 0 0 red4 -255 20 147 DeepPink1 -238 18 137 DeepPink2 -205 16 118 DeepPink3 -139 10 80 DeepPink4 -255 110 180 HotPink1 -238 106 167 HotPink2 -205 96 144 HotPink3 -139 58 98 HotPink4 -255 181 197 pink1 -238 169 184 pink2 -205 145 158 pink3 -139 99 108 pink4 -255 174 185 LightPink1 -238 162 173 LightPink2 -205 140 149 LightPink3 -139 95 101 LightPink4 -255 130 171 PaleVioletRed1 -238 121 159 PaleVioletRed2 -205 104 137 PaleVioletRed3 -139 71 93 PaleVioletRed4 -255 52 179 maroon1 -238 48 167 maroon2 -205 41 144 maroon3 -139 28 98 maroon4 -255 62 150 VioletRed1 -238 58 140 VioletRed2 -205 50 120 VioletRed3 -139 34 82 VioletRed4 -255 0 255 magenta1 -238 0 238 magenta2 -205 0 205 magenta3 -139 0 139 magenta4 -255 131 250 orchid1 -238 122 233 orchid2 -205 105 201 orchid3 -139 71 137 orchid4 -255 187 255 plum1 -238 174 238 plum2 -205 150 205 plum3 -139 102 139 plum4 -224 102 255 MediumOrchid1 -209 95 238 MediumOrchid2 -180 82 205 MediumOrchid3 -122 55 139 MediumOrchid4 -191 62 255 DarkOrchid1 -178 58 238 DarkOrchid2 -154 50 205 DarkOrchid3 -104 34 139 DarkOrchid4 -155 48 255 purple1 -145 44 238 purple2 -125 38 205 purple3 - 85 26 139 purple4 -171 130 255 MediumPurple1 -159 121 238 MediumPurple2 -137 104 205 MediumPurple3 - 93 71 139 MediumPurple4 -255 225 255 thistle1 -238 210 238 thistle2 -205 181 205 thistle3 -139 123 139 thistle4 - 0 0 0 gray0 - 0 0 0 grey0 - 3 3 3 gray1 - 3 3 3 grey1 - 5 5 5 gray2 - 5 5 5 grey2 - 8 8 8 gray3 - 8 8 8 grey3 - 10 10 10 gray4 - 10 10 10 grey4 - 13 13 13 gray5 - 13 13 13 grey5 - 15 15 15 gray6 - 15 15 15 grey6 - 18 18 18 gray7 - 18 18 18 grey7 - 20 20 20 gray8 - 20 20 20 grey8 - 23 23 23 gray9 - 23 23 23 grey9 - 26 26 26 gray10 - 26 26 26 grey10 - 28 28 28 gray11 - 28 28 28 grey11 - 31 31 31 gray12 - 31 31 31 grey12 - 33 33 33 gray13 - 33 33 33 grey13 - 36 36 36 gray14 - 36 36 36 grey14 - 38 38 38 gray15 - 38 38 38 grey15 - 41 41 41 gray16 - 41 41 41 grey16 - 43 43 43 gray17 - 43 43 43 grey17 - 46 46 46 gray18 - 46 46 46 grey18 - 48 48 48 gray19 - 48 48 48 grey19 - 51 51 51 gray20 - 51 51 51 grey20 - 54 54 54 gray21 - 54 54 54 grey21 - 56 56 56 gray22 - 56 56 56 grey22 - 59 59 59 gray23 - 59 59 59 grey23 - 61 61 61 gray24 - 61 61 61 grey24 - 64 64 64 gray25 - 64 64 64 grey25 - 66 66 66 gray26 - 66 66 66 grey26 - 69 69 69 gray27 - 69 69 69 grey27 - 71 71 71 gray28 - 71 71 71 grey28 - 74 74 74 gray29 - 74 74 74 grey29 - 77 77 77 gray30 - 77 77 77 grey30 - 79 79 79 gray31 - 79 79 79 grey31 - 82 82 82 gray32 - 82 82 82 grey32 - 84 84 84 gray33 - 84 84 84 grey33 - 87 87 87 gray34 - 87 87 87 grey34 - 89 89 89 gray35 - 89 89 89 grey35 - 92 92 92 gray36 - 92 92 92 grey36 - 94 94 94 gray37 - 94 94 94 grey37 - 97 97 97 gray38 - 97 97 97 grey38 - 99 99 99 gray39 - 99 99 99 grey39 -102 102 102 gray40 -102 102 102 grey40 -105 105 105 gray41 -105 105 105 grey41 -107 107 107 gray42 -107 107 107 grey42 -110 110 110 gray43 -110 110 110 grey43 -112 112 112 gray44 -112 112 112 grey44 -115 115 115 gray45 -115 115 115 grey45 -117 117 117 gray46 -117 117 117 grey46 -120 120 120 gray47 -120 120 120 grey47 -122 122 122 gray48 -122 122 122 grey48 -125 125 125 gray49 -125 125 125 grey49 -127 127 127 gray50 -127 127 127 grey50 -130 130 130 gray51 -130 130 130 grey51 -133 133 133 gray52 -133 133 133 grey52 -135 135 135 gray53 -135 135 135 grey53 -138 138 138 gray54 -138 138 138 grey54 -140 140 140 gray55 -140 140 140 grey55 -143 143 143 gray56 -143 143 143 grey56 -145 145 145 gray57 -145 145 145 grey57 -148 148 148 gray58 -148 148 148 grey58 -150 150 150 gray59 -150 150 150 grey59 -153 153 153 gray60 -153 153 153 grey60 -156 156 156 gray61 -156 156 156 grey61 -158 158 158 gray62 -158 158 158 grey62 -161 161 161 gray63 -161 161 161 grey63 -163 163 163 gray64 -163 163 163 grey64 -166 166 166 gray65 -166 166 166 grey65 -168 168 168 gray66 -168 168 168 grey66 -171 171 171 gray67 -171 171 171 grey67 -173 173 173 gray68 -173 173 173 grey68 -176 176 176 gray69 -176 176 176 grey69 -179 179 179 gray70 -179 179 179 grey70 -181 181 181 gray71 -181 181 181 grey71 -184 184 184 gray72 -184 184 184 grey72 -186 186 186 gray73 -186 186 186 grey73 -189 189 189 gray74 -189 189 189 grey74 -191 191 191 gray75 -191 191 191 grey75 -194 194 194 gray76 -194 194 194 grey76 -196 196 196 gray77 -196 196 196 grey77 -199 199 199 gray78 -199 199 199 grey78 -201 201 201 gray79 -201 201 201 grey79 -204 204 204 gray80 -204 204 204 grey80 -207 207 207 gray81 -207 207 207 grey81 -209 209 209 gray82 -209 209 209 grey82 -212 212 212 gray83 -212 212 212 grey83 -214 214 214 gray84 -214 214 214 grey84 -217 217 217 gray85 -217 217 217 grey85 -219 219 219 gray86 -219 219 219 grey86 -222 222 222 gray87 -222 222 222 grey87 -224 224 224 gray88 -224 224 224 grey88 -227 227 227 gray89 -227 227 227 grey89 -229 229 229 gray90 -229 229 229 grey90 -232 232 232 gray91 -232 232 232 grey91 -235 235 235 gray92 -235 235 235 grey92 -237 237 237 gray93 -237 237 237 grey93 -240 240 240 gray94 -240 240 240 grey94 -242 242 242 gray95 -242 242 242 grey95 -245 245 245 gray96 -245 245 245 grey96 -247 247 247 gray97 -247 247 247 grey97 -250 250 250 gray98 -250 250 250 grey98 -252 252 252 gray99 -252 252 252 grey99 -255 255 255 gray100 -255 255 255 grey100 -169 169 169 dark grey -169 169 169 DarkGrey -169 169 169 dark gray -169 169 169 DarkGray -0 0 139 dark blue -0 0 139 DarkBlue -0 139 139 dark cyan -0 139 139 DarkCyan -139 0 139 dark magenta -139 0 139 DarkMagenta -139 0 0 dark red -139 0 0 DarkRed -144 238 144 light green -144 238 144 LightGreen +255 250 250 snow +248 248 255 ghost white +248 248 255 GhostWhite +245 245 245 white smoke +245 245 245 WhiteSmoke +220 220 220 gainsboro +255 250 240 floral white +255 250 240 FloralWhite +253 245 230 old lace +253 245 230 OldLace +250 240 230 linen +250 235 215 antique white +250 235 215 AntiqueWhite +255 239 213 papaya whip +255 239 213 PapayaWhip +255 235 205 blanched almond +255 235 205 BlanchedAlmond +255 228 196 bisque +255 218 185 peach puff +255 218 185 PeachPuff +255 222 173 navajo white +255 222 173 NavajoWhite +255 228 181 moccasin +255 248 220 cornsilk +255 255 240 ivory +255 250 205 lemon chiffon +255 250 205 LemonChiffon +255 245 238 seashell +240 255 240 honeydew +245 255 250 mint cream +245 255 250 MintCream +240 255 255 azure +240 248 255 alice blue +240 248 255 AliceBlue +230 230 250 lavender +255 240 245 lavender blush +255 240 245 LavenderBlush +255 228 225 misty rose +255 228 225 MistyRose +255 255 255 white + 0 0 0 black + 47 79 79 dark slate gray + 47 79 79 DarkSlateGray + 47 79 79 dark slate grey + 47 79 79 DarkSlateGrey +105 105 105 dim gray +105 105 105 DimGray +105 105 105 dim grey +105 105 105 DimGrey +112 128 144 slate gray +112 128 144 SlateGray +112 128 144 slate grey +112 128 144 SlateGrey +119 136 153 light slate gray +119 136 153 LightSlateGray +119 136 153 light slate grey +119 136 153 LightSlateGrey +190 190 190 gray +190 190 190 grey +211 211 211 light grey +211 211 211 LightGrey +211 211 211 light gray +211 211 211 LightGray + 25 25 112 midnight blue + 25 25 112 MidnightBlue + 0 0 128 navy + 0 0 128 navy blue + 0 0 128 NavyBlue +100 149 237 cornflower blue +100 149 237 CornflowerBlue + 72 61 139 dark slate blue + 72 61 139 DarkSlateBlue +106 90 205 slate blue +106 90 205 SlateBlue +123 104 238 medium slate blue +123 104 238 MediumSlateBlue +132 112 255 light slate blue +132 112 255 LightSlateBlue + 0 0 205 medium blue + 0 0 205 MediumBlue + 65 105 225 royal blue + 65 105 225 RoyalBlue + 0 0 255 blue + 30 144 255 dodger blue + 30 144 255 DodgerBlue + 0 191 255 deep sky blue + 0 191 255 DeepSkyBlue +135 206 235 sky blue +135 206 235 SkyBlue +135 206 250 light sky blue +135 206 250 LightSkyBlue + 70 130 180 steel blue + 70 130 180 SteelBlue +176 196 222 light steel blue +176 196 222 LightSteelBlue +173 216 230 light blue +173 216 230 LightBlue +176 224 230 powder blue +176 224 230 PowderBlue +175 238 238 pale turquoise +175 238 238 PaleTurquoise + 0 206 209 dark turquoise + 0 206 209 DarkTurquoise + 72 209 204 medium turquoise + 72 209 204 MediumTurquoise + 64 224 208 turquoise + 0 255 255 cyan +224 255 255 light cyan +224 255 255 LightCyan + 95 158 160 cadet blue + 95 158 160 CadetBlue +102 205 170 medium aquamarine +102 205 170 MediumAquamarine +127 255 212 aquamarine + 0 100 0 dark green + 0 100 0 DarkGreen + 85 107 47 dark olive green + 85 107 47 DarkOliveGreen +143 188 143 dark sea green +143 188 143 DarkSeaGreen + 46 139 87 sea green + 46 139 87 SeaGreen + 60 179 113 medium sea green + 60 179 113 MediumSeaGreen + 32 178 170 light sea green + 32 178 170 LightSeaGreen +152 251 152 pale green +152 251 152 PaleGreen + 0 255 127 spring green + 0 255 127 SpringGreen +124 252 0 lawn green +124 252 0 LawnGreen + 0 255 0 green +127 255 0 chartreuse + 0 250 154 medium spring green + 0 250 154 MediumSpringGreen +173 255 47 green yellow +173 255 47 GreenYellow + 50 205 50 lime green + 50 205 50 LimeGreen +154 205 50 yellow green +154 205 50 YellowGreen + 34 139 34 forest green + 34 139 34 ForestGreen +107 142 35 olive drab +107 142 35 OliveDrab +189 183 107 dark khaki +189 183 107 DarkKhaki +240 230 140 khaki +238 232 170 pale goldenrod +238 232 170 PaleGoldenrod +250 250 210 light goldenrod yellow +250 250 210 LightGoldenrodYellow +255 255 224 light yellow +255 255 224 LightYellow +255 255 0 yellow +255 215 0 gold +238 221 130 light goldenrod +238 221 130 LightGoldenrod +218 165 32 goldenrod +184 134 11 dark goldenrod +184 134 11 DarkGoldenrod +188 143 143 rosy brown +188 143 143 RosyBrown +205 92 92 indian red +205 92 92 IndianRed +139 69 19 saddle brown +139 69 19 SaddleBrown +160 82 45 sienna +205 133 63 peru +222 184 135 burlywood +245 245 220 beige +245 222 179 wheat +244 164 96 sandy brown +244 164 96 SandyBrown +210 180 140 tan +210 105 30 chocolate +178 34 34 firebrick +165 42 42 brown +233 150 122 dark salmon +233 150 122 DarkSalmon +250 128 114 salmon +255 160 122 light salmon +255 160 122 LightSalmon +255 165 0 orange +255 140 0 dark orange +255 140 0 DarkOrange +255 127 80 coral +240 128 128 light coral +240 128 128 LightCoral +255 99 71 tomato +255 69 0 orange red +255 69 0 OrangeRed +255 0 0 red +255 105 180 hot pink +255 105 180 HotPink +255 20 147 deep pink +255 20 147 DeepPink +255 192 203 pink +255 182 193 light pink +255 182 193 LightPink +219 112 147 pale violet red +219 112 147 PaleVioletRed +176 48 96 maroon +199 21 133 medium violet red +199 21 133 MediumVioletRed +208 32 144 violet red +208 32 144 VioletRed +255 0 255 magenta +238 130 238 violet +221 160 221 plum +218 112 214 orchid +186 85 211 medium orchid +186 85 211 MediumOrchid +153 50 204 dark orchid +153 50 204 DarkOrchid +148 0 211 dark violet +148 0 211 DarkViolet +138 43 226 blue violet +138 43 226 BlueViolet +160 32 240 purple +147 112 219 medium purple +147 112 219 MediumPurple +216 191 216 thistle +255 250 250 snow1 +238 233 233 snow2 +205 201 201 snow3 +139 137 137 snow4 +255 245 238 seashell1 +238 229 222 seashell2 +205 197 191 seashell3 +139 134 130 seashell4 +255 239 219 AntiqueWhite1 +238 223 204 AntiqueWhite2 +205 192 176 AntiqueWhite3 +139 131 120 AntiqueWhite4 +255 228 196 bisque1 +238 213 183 bisque2 +205 183 158 bisque3 +139 125 107 bisque4 +255 218 185 PeachPuff1 +238 203 173 PeachPuff2 +205 175 149 PeachPuff3 +139 119 101 PeachPuff4 +255 222 173 NavajoWhite1 +238 207 161 NavajoWhite2 +205 179 139 NavajoWhite3 +139 121 94 NavajoWhite4 +255 250 205 LemonChiffon1 +238 233 191 LemonChiffon2 +205 201 165 LemonChiffon3 +139 137 112 LemonChiffon4 +255 248 220 cornsilk1 +238 232 205 cornsilk2 +205 200 177 cornsilk3 +139 136 120 cornsilk4 +255 255 240 ivory1 +238 238 224 ivory2 +205 205 193 ivory3 +139 139 131 ivory4 +240 255 240 honeydew1 +224 238 224 honeydew2 +193 205 193 honeydew3 +131 139 131 honeydew4 +255 240 245 LavenderBlush1 +238 224 229 LavenderBlush2 +205 193 197 LavenderBlush3 +139 131 134 LavenderBlush4 +255 228 225 MistyRose1 +238 213 210 MistyRose2 +205 183 181 MistyRose3 +139 125 123 MistyRose4 +240 255 255 azure1 +224 238 238 azure2 +193 205 205 azure3 +131 139 139 azure4 +131 111 255 SlateBlue1 +122 103 238 SlateBlue2 +105 89 205 SlateBlue3 + 71 60 139 SlateBlue4 + 72 118 255 RoyalBlue1 + 67 110 238 RoyalBlue2 + 58 95 205 RoyalBlue3 + 39 64 139 RoyalBlue4 + 0 0 255 blue1 + 0 0 238 blue2 + 0 0 205 blue3 + 0 0 139 blue4 + 30 144 255 DodgerBlue1 + 28 134 238 DodgerBlue2 + 24 116 205 DodgerBlue3 + 16 78 139 DodgerBlue4 + 99 184 255 SteelBlue1 + 92 172 238 SteelBlue2 + 79 148 205 SteelBlue3 + 54 100 139 SteelBlue4 + 0 191 255 DeepSkyBlue1 + 0 178 238 DeepSkyBlue2 + 0 154 205 DeepSkyBlue3 + 0 104 139 DeepSkyBlue4 +135 206 255 SkyBlue1 +126 192 238 SkyBlue2 +108 166 205 SkyBlue3 + 74 112 139 SkyBlue4 +176 226 255 LightSkyBlue1 +164 211 238 LightSkyBlue2 +141 182 205 LightSkyBlue3 + 96 123 139 LightSkyBlue4 +198 226 255 SlateGray1 +185 211 238 SlateGray2 +159 182 205 SlateGray3 +108 123 139 SlateGray4 +202 225 255 LightSteelBlue1 +188 210 238 LightSteelBlue2 +162 181 205 LightSteelBlue3 +110 123 139 LightSteelBlue4 +191 239 255 LightBlue1 +178 223 238 LightBlue2 +154 192 205 LightBlue3 +104 131 139 LightBlue4 +224 255 255 LightCyan1 +209 238 238 LightCyan2 +180 205 205 LightCyan3 +122 139 139 LightCyan4 +187 255 255 PaleTurquoise1 +174 238 238 PaleTurquoise2 +150 205 205 PaleTurquoise3 +102 139 139 PaleTurquoise4 +152 245 255 CadetBlue1 +142 229 238 CadetBlue2 +122 197 205 CadetBlue3 + 83 134 139 CadetBlue4 + 0 245 255 turquoise1 + 0 229 238 turquoise2 + 0 197 205 turquoise3 + 0 134 139 turquoise4 + 0 255 255 cyan1 + 0 238 238 cyan2 + 0 205 205 cyan3 + 0 139 139 cyan4 +151 255 255 DarkSlateGray1 +141 238 238 DarkSlateGray2 +121 205 205 DarkSlateGray3 + 82 139 139 DarkSlateGray4 +127 255 212 aquamarine1 +118 238 198 aquamarine2 +102 205 170 aquamarine3 + 69 139 116 aquamarine4 +193 255 193 DarkSeaGreen1 +180 238 180 DarkSeaGreen2 +155 205 155 DarkSeaGreen3 +105 139 105 DarkSeaGreen4 + 84 255 159 SeaGreen1 + 78 238 148 SeaGreen2 + 67 205 128 SeaGreen3 + 46 139 87 SeaGreen4 +154 255 154 PaleGreen1 +144 238 144 PaleGreen2 +124 205 124 PaleGreen3 + 84 139 84 PaleGreen4 + 0 255 127 SpringGreen1 + 0 238 118 SpringGreen2 + 0 205 102 SpringGreen3 + 0 139 69 SpringGreen4 + 0 255 0 green1 + 0 238 0 green2 + 0 205 0 green3 + 0 139 0 green4 +127 255 0 chartreuse1 +118 238 0 chartreuse2 +102 205 0 chartreuse3 + 69 139 0 chartreuse4 +192 255 62 OliveDrab1 +179 238 58 OliveDrab2 +154 205 50 OliveDrab3 +105 139 34 OliveDrab4 +202 255 112 DarkOliveGreen1 +188 238 104 DarkOliveGreen2 +162 205 90 DarkOliveGreen3 +110 139 61 DarkOliveGreen4 +255 246 143 khaki1 +238 230 133 khaki2 +205 198 115 khaki3 +139 134 78 khaki4 +255 236 139 LightGoldenrod1 +238 220 130 LightGoldenrod2 +205 190 112 LightGoldenrod3 +139 129 76 LightGoldenrod4 +255 255 224 LightYellow1 +238 238 209 LightYellow2 +205 205 180 LightYellow3 +139 139 122 LightYellow4 +255 255 0 yellow1 +238 238 0 yellow2 +205 205 0 yellow3 +139 139 0 yellow4 +255 215 0 gold1 +238 201 0 gold2 +205 173 0 gold3 +139 117 0 gold4 +255 193 37 goldenrod1 +238 180 34 goldenrod2 +205 155 29 goldenrod3 +139 105 20 goldenrod4 +255 185 15 DarkGoldenrod1 +238 173 14 DarkGoldenrod2 +205 149 12 DarkGoldenrod3 +139 101 8 DarkGoldenrod4 +255 193 193 RosyBrown1 +238 180 180 RosyBrown2 +205 155 155 RosyBrown3 +139 105 105 RosyBrown4 +255 106 106 IndianRed1 +238 99 99 IndianRed2 +205 85 85 IndianRed3 +139 58 58 IndianRed4 +255 130 71 sienna1 +238 121 66 sienna2 +205 104 57 sienna3 +139 71 38 sienna4 +255 211 155 burlywood1 +238 197 145 burlywood2 +205 170 125 burlywood3 +139 115 85 burlywood4 +255 231 186 wheat1 +238 216 174 wheat2 +205 186 150 wheat3 +139 126 102 wheat4 +255 165 79 tan1 +238 154 73 tan2 +205 133 63 tan3 +139 90 43 tan4 +255 127 36 chocolate1 +238 118 33 chocolate2 +205 102 29 chocolate3 +139 69 19 chocolate4 +255 48 48 firebrick1 +238 44 44 firebrick2 +205 38 38 firebrick3 +139 26 26 firebrick4 +255 64 64 brown1 +238 59 59 brown2 +205 51 51 brown3 +139 35 35 brown4 +255 140 105 salmon1 +238 130 98 salmon2 +205 112 84 salmon3 +139 76 57 salmon4 +255 160 122 LightSalmon1 +238 149 114 LightSalmon2 +205 129 98 LightSalmon3 +139 87 66 LightSalmon4 +255 165 0 orange1 +238 154 0 orange2 +205 133 0 orange3 +139 90 0 orange4 +255 127 0 DarkOrange1 +238 118 0 DarkOrange2 +205 102 0 DarkOrange3 +139 69 0 DarkOrange4 +255 114 86 coral1 +238 106 80 coral2 +205 91 69 coral3 +139 62 47 coral4 +255 99 71 tomato1 +238 92 66 tomato2 +205 79 57 tomato3 +139 54 38 tomato4 +255 69 0 OrangeRed1 +238 64 0 OrangeRed2 +205 55 0 OrangeRed3 +139 37 0 OrangeRed4 +255 0 0 red1 +238 0 0 red2 +205 0 0 red3 +139 0 0 red4 +255 20 147 DeepPink1 +238 18 137 DeepPink2 +205 16 118 DeepPink3 +139 10 80 DeepPink4 +255 110 180 HotPink1 +238 106 167 HotPink2 +205 96 144 HotPink3 +139 58 98 HotPink4 +255 181 197 pink1 +238 169 184 pink2 +205 145 158 pink3 +139 99 108 pink4 +255 174 185 LightPink1 +238 162 173 LightPink2 +205 140 149 LightPink3 +139 95 101 LightPink4 +255 130 171 PaleVioletRed1 +238 121 159 PaleVioletRed2 +205 104 137 PaleVioletRed3 +139 71 93 PaleVioletRed4 +255 52 179 maroon1 +238 48 167 maroon2 +205 41 144 maroon3 +139 28 98 maroon4 +255 62 150 VioletRed1 +238 58 140 VioletRed2 +205 50 120 VioletRed3 +139 34 82 VioletRed4 +255 0 255 magenta1 +238 0 238 magenta2 +205 0 205 magenta3 +139 0 139 magenta4 +255 131 250 orchid1 +238 122 233 orchid2 +205 105 201 orchid3 +139 71 137 orchid4 +255 187 255 plum1 +238 174 238 plum2 +205 150 205 plum3 +139 102 139 plum4 +224 102 255 MediumOrchid1 +209 95 238 MediumOrchid2 +180 82 205 MediumOrchid3 +122 55 139 MediumOrchid4 +191 62 255 DarkOrchid1 +178 58 238 DarkOrchid2 +154 50 205 DarkOrchid3 +104 34 139 DarkOrchid4 +155 48 255 purple1 +145 44 238 purple2 +125 38 205 purple3 + 85 26 139 purple4 +171 130 255 MediumPurple1 +159 121 238 MediumPurple2 +137 104 205 MediumPurple3 + 93 71 139 MediumPurple4 +255 225 255 thistle1 +238 210 238 thistle2 +205 181 205 thistle3 +139 123 139 thistle4 + 0 0 0 gray0 + 0 0 0 grey0 + 3 3 3 gray1 + 3 3 3 grey1 + 5 5 5 gray2 + 5 5 5 grey2 + 8 8 8 gray3 + 8 8 8 grey3 + 10 10 10 gray4 + 10 10 10 grey4 + 13 13 13 gray5 + 13 13 13 grey5 + 15 15 15 gray6 + 15 15 15 grey6 + 18 18 18 gray7 + 18 18 18 grey7 + 20 20 20 gray8 + 20 20 20 grey8 + 23 23 23 gray9 + 23 23 23 grey9 + 26 26 26 gray10 + 26 26 26 grey10 + 28 28 28 gray11 + 28 28 28 grey11 + 31 31 31 gray12 + 31 31 31 grey12 + 33 33 33 gray13 + 33 33 33 grey13 + 36 36 36 gray14 + 36 36 36 grey14 + 38 38 38 gray15 + 38 38 38 grey15 + 41 41 41 gray16 + 41 41 41 grey16 + 43 43 43 gray17 + 43 43 43 grey17 + 46 46 46 gray18 + 46 46 46 grey18 + 48 48 48 gray19 + 48 48 48 grey19 + 51 51 51 gray20 + 51 51 51 grey20 + 54 54 54 gray21 + 54 54 54 grey21 + 56 56 56 gray22 + 56 56 56 grey22 + 59 59 59 gray23 + 59 59 59 grey23 + 61 61 61 gray24 + 61 61 61 grey24 + 64 64 64 gray25 + 64 64 64 grey25 + 66 66 66 gray26 + 66 66 66 grey26 + 69 69 69 gray27 + 69 69 69 grey27 + 71 71 71 gray28 + 71 71 71 grey28 + 74 74 74 gray29 + 74 74 74 grey29 + 77 77 77 gray30 + 77 77 77 grey30 + 79 79 79 gray31 + 79 79 79 grey31 + 82 82 82 gray32 + 82 82 82 grey32 + 84 84 84 gray33 + 84 84 84 grey33 + 87 87 87 gray34 + 87 87 87 grey34 + 89 89 89 gray35 + 89 89 89 grey35 + 92 92 92 gray36 + 92 92 92 grey36 + 94 94 94 gray37 + 94 94 94 grey37 + 97 97 97 gray38 + 97 97 97 grey38 + 99 99 99 gray39 + 99 99 99 grey39 +102 102 102 gray40 +102 102 102 grey40 +105 105 105 gray41 +105 105 105 grey41 +107 107 107 gray42 +107 107 107 grey42 +110 110 110 gray43 +110 110 110 grey43 +112 112 112 gray44 +112 112 112 grey44 +115 115 115 gray45 +115 115 115 grey45 +117 117 117 gray46 +117 117 117 grey46 +120 120 120 gray47 +120 120 120 grey47 +122 122 122 gray48 +122 122 122 grey48 +125 125 125 gray49 +125 125 125 grey49 +127 127 127 gray50 +127 127 127 grey50 +130 130 130 gray51 +130 130 130 grey51 +133 133 133 gray52 +133 133 133 grey52 +135 135 135 gray53 +135 135 135 grey53 +138 138 138 gray54 +138 138 138 grey54 +140 140 140 gray55 +140 140 140 grey55 +143 143 143 gray56 +143 143 143 grey56 +145 145 145 gray57 +145 145 145 grey57 +148 148 148 gray58 +148 148 148 grey58 +150 150 150 gray59 +150 150 150 grey59 +153 153 153 gray60 +153 153 153 grey60 +156 156 156 gray61 +156 156 156 grey61 +158 158 158 gray62 +158 158 158 grey62 +161 161 161 gray63 +161 161 161 grey63 +163 163 163 gray64 +163 163 163 grey64 +166 166 166 gray65 +166 166 166 grey65 +168 168 168 gray66 +168 168 168 grey66 +171 171 171 gray67 +171 171 171 grey67 +173 173 173 gray68 +173 173 173 grey68 +176 176 176 gray69 +176 176 176 grey69 +179 179 179 gray70 +179 179 179 grey70 +181 181 181 gray71 +181 181 181 grey71 +184 184 184 gray72 +184 184 184 grey72 +186 186 186 gray73 +186 186 186 grey73 +189 189 189 gray74 +189 189 189 grey74 +191 191 191 gray75 +191 191 191 grey75 +194 194 194 gray76 +194 194 194 grey76 +196 196 196 gray77 +196 196 196 grey77 +199 199 199 gray78 +199 199 199 grey78 +201 201 201 gray79 +201 201 201 grey79 +204 204 204 gray80 +204 204 204 grey80 +207 207 207 gray81 +207 207 207 grey81 +209 209 209 gray82 +209 209 209 grey82 +212 212 212 gray83 +212 212 212 grey83 +214 214 214 gray84 +214 214 214 grey84 +217 217 217 gray85 +217 217 217 grey85 +219 219 219 gray86 +219 219 219 grey86 +222 222 222 gray87 +222 222 222 grey87 +224 224 224 gray88 +224 224 224 grey88 +227 227 227 gray89 +227 227 227 grey89 +229 229 229 gray90 +229 229 229 grey90 +232 232 232 gray91 +232 232 232 grey91 +235 235 235 gray92 +235 235 235 grey92 +237 237 237 gray93 +237 237 237 grey93 +240 240 240 gray94 +240 240 240 grey94 +242 242 242 gray95 +242 242 242 grey95 +245 245 245 gray96 +245 245 245 grey96 +247 247 247 gray97 +247 247 247 grey97 +250 250 250 gray98 +250 250 250 grey98 +252 252 252 gray99 +252 252 252 grey99 +255 255 255 gray100 +255 255 255 grey100 +169 169 169 dark grey +169 169 169 DarkGrey +169 169 169 dark gray +169 169 169 DarkGray +0 0 139 dark blue +0 0 139 DarkBlue +0 139 139 dark cyan +0 139 139 DarkCyan +139 0 139 dark magenta +139 0 139 DarkMagenta +139 0 0 dark red +139 0 0 DarkRed +144 238 144 light green +144 238 144 LightGreen diff --git a/test/rotated_text.cxx b/test/rotated_text.cxx index 0d2eb7f62..4cc73a9c0 100644 --- a/test/rotated_text.cxx +++ b/test/rotated_text.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Label test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -46,7 +44,7 @@ class Rotated_Label_Box : public Fl_Widget{ fl_font(labelfont(), labelsize()); fl_color(labelcolor()); int dx(0),dy(0); - + if(rt_align&FL_ALIGN_CLIP)fl_push_clip(x(),y(),w(),h()); else fl_push_no_clip(); fl_measure(rt_text,dx,dy); @@ -213,7 +211,3 @@ int main(int argc, char **argv) { window->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/scroll.cxx b/test/scroll.cxx index 9a82f5503..2ca5ac142 100644 --- a/test/scroll.cxx +++ b/test/scroll.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Scroll test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -112,7 +110,7 @@ int main(int argc, char** argv) { Fl_Light_Button but1(150, 310, 200, 25, "box"); but1.callback(box_cb); - + Fl_Choice choice(150, 335, 200, 25, "type():"); choice.menu(choices); choice.value(3); @@ -129,7 +127,3 @@ int main(int argc, char** argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/shape.cxx b/test/shape.cxx index e45e826b6..f87d59c0d 100644 --- a/test/shape.cxx +++ b/test/shape.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Tiny OpenGL demo program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -62,7 +60,7 @@ void shape_window::draw() { #include <FL/Fl_Box.H> class shape_window : public Fl_Box { -public: +public: int sides; shape_window(int x,int y,int w,int h,const char *l=0) :Fl_Box(FL_DOWN_BOX,x,y,w,h,l){ @@ -100,10 +98,6 @@ int main(int argc, char **argv) { window.end(); window.show(argc,argv); - + return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/subwindow.cxx b/test/subwindow.cxx index 998813864..73a954824 100644 --- a/test/subwindow.cxx +++ b/test/subwindow.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Nested window test program for the Fast Light Tool Kit (FLTK). // // Test to make sure nested windows work. @@ -14,11 +12,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdlib.h> @@ -85,9 +83,9 @@ int testwindow::handle(int e) { if (e != FL_MOVE) printf("%s : %s\n",label(),fl_eventnames[e]); #endif if (crsr!=FL_CURSOR_DEFAULT) { - if (e == FL_ENTER) + if (e == FL_ENTER) cursor(crsr); - if (e == FL_LEAVE) + if (e == FL_LEAVE) cursor(FL_CURSOR_DEFAULT); } if (Fl_Window::handle(e)) return 1; @@ -164,12 +162,12 @@ int main(int argc, char **argv) { subwindow->end(); subwindow->use_cursor(FL_CURSOR_HAND); (new Fl_Box(FL_NO_BOX,0,0,400,100, - "A child Fl_Window with children of its own may " - "be useful for imbedding controls into a GL or display " - "that needs a different visual. There are bugs with the " - "origins being different between drawing and events, " - "which I hope I have solved." - )) -> align(FL_ALIGN_WRAP); + "A child Fl_Window with children of its own may " + "be useful for imbedding controls into a GL or display " + "that needs a different visual. There are bugs with the " + "origins being different between drawing and events, " + "which I hope I have solved." + )) -> align(FL_ALIGN_WRAP); popup = new Fl_Menu_Button(0,0,400,400); popup->type(Fl_Menu_Button::POPUP3); popup->add("This|is|a popup|menu"); @@ -177,7 +175,3 @@ int main(int argc, char **argv) { window->show(argc, argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/sudoku.cxx b/test/sudoku.cxx index 2204b65cb..2f116753f 100644 --- a/test/sudoku.cxx +++ b/test/sudoku.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Sudoku game using the Fast Light Tool Kit (FLTK). // // Copyright 2005-2018 by Michael Sweet. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -60,13 +58,13 @@ // Default sizes... // -#define GROUP_SIZE 160 -#define CELL_SIZE 50 -#define CELL_OFFSET 5 +#define GROUP_SIZE 160 +#define CELL_SIZE 50 +#define CELL_OFFSET 5 #ifdef __APPLE__ -# define MENU_OFFSET 0 +# define MENU_OFFSET 0 #else -# define MENU_OFFSET 25 +# define MENU_OFFSET 25 #endif // __APPLE__ // Sound class for Sudoku... @@ -99,18 +97,18 @@ class SudokuSound { int remaining; static OSStatus audio_cb(AudioDeviceID device, - const AudioTimeStamp *current_time, - const AudioBufferList *data_in, - const AudioTimeStamp *time_in, - AudioBufferList *data_out, - const AudioTimeStamp *time_out, - void *client_data); + const AudioTimeStamp *current_time, + const AudioBufferList *data_in, + const AudioTimeStamp *time_in, + AudioBufferList *data_out, + const AudioTimeStamp *time_out, + void *client_data); #elif defined(_WIN32) - HWAVEOUT device; - HGLOBAL header_handle; - LPWAVEHDR header_ptr; - HGLOBAL data_handle; - LPSTR data_ptr; + HWAVEOUT device; + HGLOBAL header_handle; + LPWAVEHDR header_ptr; + HGLOBAL data_handle; + LPSTR data_ptr; #else # ifdef HAVE_ALSA_ASOUNDLIB_H @@ -128,86 +126,86 @@ class SudokuSound { SudokuSound(); ~SudokuSound(); - void play(char note); + void play(char note); }; // Sudoku cell class... class SudokuCell : public Fl_Widget { - bool readonly_; - int value_; - int test_value_[9]; + bool readonly_; + int value_; + int test_value_[9]; public: - SudokuCell(int X, int Y, int W, int H); - void draw(); - int handle(int event); - void readonly(bool r) { readonly_ = r; redraw(); } - bool readonly() const { return readonly_; } - void test_value(int v, int n) { test_value_[n] = v; redraw(); } - int test_value(int n) const { return test_value_[n]; } - void value(int v) { - value_ = v; - for (int i = 0; i < 8; i ++) test_value_[i] = 0; - redraw(); - } - int value() const { return value_; } + SudokuCell(int X, int Y, int W, int H); + void draw(); + int handle(int event); + void readonly(bool r) { readonly_ = r; redraw(); } + bool readonly() const { return readonly_; } + void test_value(int v, int n) { test_value_[n] = v; redraw(); } + int test_value(int n) const { return test_value_[n]; } + void value(int v) { + value_ = v; + for (int i = 0; i < 8; i ++) test_value_[i] = 0; + redraw(); + } + int value() const { return value_; } }; // Sudoku window class... class Sudoku : public Fl_Double_Window { Fl_Sys_Menu_Bar *menubar_; - Fl_Group *grid_; - time_t seed_; - char grid_values_[9][9]; - SudokuCell *grid_cells_[9][9]; - Fl_Group *grid_groups_[3][3]; - int difficulty_; - SudokuSound *sound_; - - static void check_cb(Fl_Widget *widget, void *); - static void close_cb(Fl_Widget *widget, void *); - static void diff_cb(Fl_Widget *widget, void *d); - static void update_helpers_cb(Fl_Widget *, void *); - static void help_cb(Fl_Widget *, void *); - static void mute_cb(Fl_Widget *widget, void *); - static void new_cb(Fl_Widget *widget, void *); - static void reset_cb(Fl_Widget *widget, void *); - static void restart_cb(Fl_Widget *widget, void *); - void set_title(); - static void solve_cb(Fl_Widget *widget, void *); + Fl_Group *grid_; + time_t seed_; + char grid_values_[9][9]; + SudokuCell *grid_cells_[9][9]; + Fl_Group *grid_groups_[3][3]; + int difficulty_; + SudokuSound *sound_; + + static void check_cb(Fl_Widget *widget, void *); + static void close_cb(Fl_Widget *widget, void *); + static void diff_cb(Fl_Widget *widget, void *d); + static void update_helpers_cb(Fl_Widget *, void *); + static void help_cb(Fl_Widget *, void *); + static void mute_cb(Fl_Widget *widget, void *); + static void new_cb(Fl_Widget *widget, void *); + static void reset_cb(Fl_Widget *widget, void *); + static void restart_cb(Fl_Widget *widget, void *); + void set_title(); + static void solve_cb(Fl_Widget *widget, void *); static Fl_Help_Dialog *help_dialog_; - static Fl_Preferences prefs_; + static Fl_Preferences prefs_; public: - Sudoku(); - ~Sudoku(); - - void check_game(bool highlight = true); - void load_game(); - void new_game(time_t seed); - int next_value(SudokuCell *c); - void resize(int X, int Y, int W, int H); - void save_game(); - void solve_game(); - void update_helpers(); + Sudoku(); + ~Sudoku(); + + void check_game(bool highlight = true); + void load_game(); + void new_game(time_t seed); + int next_value(SudokuCell *c); + void resize(int X, int Y, int W, int H); + void save_game(); + void solve_game(); + void update_helpers(); }; // Sound class globals... int SudokuSound::frequencies[9] = { - 880, // A(5) - 988, // B(5) - 1046, // C(5) - 1174, // D(5) - 1318, // E(5) - 1396, // F(5) - 1568, // G(5) - 1760, // H (A6) - 1976 // I (B6) + 880, // A(5) + 988, // B(5) + 1046, // C(5) + 1174, // D(5) + 1318, // E(5) + 1396, // F(5) + 1568, // G(5) + 1760, // H (A6) + 1976 // I (B6) }; short *SudokuSound::sample_data[9] = { 0 }; int SudokuSound::sample_size = 0; @@ -223,19 +221,19 @@ SudokuSound::SudokuSound() { UInt32 size = sizeof(device); if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, - &size, (void *)&device) != noErr) return; + &size, (void *)&device) != noErr) return; size = sizeof(format); if (AudioDeviceGetProperty(device, 0, false, kAudioDevicePropertyStreamFormat, - &size, &format) != noErr) return; + &size, &format) != noErr) return; // Set up a format we like... - format.mSampleRate = 44100.0; // 44.1kHz - format.mChannelsPerFrame = 2; // stereo + format.mSampleRate = 44100.0; // 44.1kHz + format.mChannelsPerFrame = 2; // stereo if (AudioDeviceSetProperty(device, NULL, 0, false, kAudioDevicePropertyStreamFormat, - sizeof(format), &format) != noErr) return; + sizeof(format), &format) != noErr) return; // Check we got linear pcm - what to do if we did not ??? if (format.mFormatID != kAudioFormatLinearPCM) return; @@ -248,11 +246,11 @@ SudokuSound::SudokuSound() { if (AudioDeviceAddIOProc(device, audio_cb, (void *)this) != noErr) return; AudioDeviceStart(device, audio_cb); # endif - + sample_size = (int)format.mSampleRate / 20; #elif defined(_WIN32) - WAVEFORMATEX format; + WAVEFORMATEX format; memset(&format, 0, sizeof(format)); format.cbSize = sizeof(format); @@ -330,11 +328,11 @@ SudokuSound::SudokuSound() { double val = 0.5 * sin(2.0 * M_PI * theta) + theta - (int)theta - 0.5; if (j < attack) { - *sample_ptr = (int)(32767 * val * j / attack); - } else if (j > decay) { - *sample_ptr = (int)(32767 * val * (sample_size - j + decay) / - sample_size); - } else *sample_ptr = (int)(32767 * val); + *sample_ptr = (int)(32767 * val * j / attack); + } else if (j > decay) { + *sample_ptr = (int)(32767 * val * (sample_size - j + decay) / + sample_size); + } else *sample_ptr = (int)(32767 * val); sample_ptr[1] = *sample_ptr; } @@ -388,12 +386,12 @@ SudokuSound::~SudokuSound() { // Callback function for writing audio data... OSStatus SudokuSound::audio_cb(AudioDeviceID device, - const AudioTimeStamp *current_time, - const AudioBufferList *data_in, - const AudioTimeStamp *time_in, - AudioBufferList *data_out, - const AudioTimeStamp *time_out, - void *client_data) { + const AudioTimeStamp *current_time, + const AudioBufferList *data_in, + const AudioTimeStamp *time_in, + AudioBufferList *data_out, + const AudioTimeStamp *time_out, + void *client_data) { SudokuSound *ss = (SudokuSound *)client_data; int count; float *buffer; @@ -453,8 +451,8 @@ void SudokuSound::play(char note) { # endif // HAVE_ALSA_ASOUNDLIB_H // Just use standard X11 stuff... - XKeyboardState state; - XKeyboardControl control; + XKeyboardState state; + XKeyboardControl control; // Get original pitch and duration... XGetKeyboardControl(fl_display, &state); @@ -466,7 +464,7 @@ void SudokuSound::play(char note) { XChangeKeyboardControl(fl_display, KBBellPercent | KBBellPitch | KBBellDuration, - &control); + &control); XBell(fl_display, 100); XFlush(fl_display); @@ -477,7 +475,7 @@ void SudokuSound::play(char note) { XChangeKeyboardControl(fl_display, KBBellPercent | KBBellPitch | KBBellDuration, - &control); + &control); #endif // __APPLE__ } @@ -555,16 +553,16 @@ SudokuCell::handle(int event) { case FL_PUSH : if (!readonly() && Fl::event_inside(this)) { if (Fl::event_clicks()) { - // 2+ clicks increments/sets value - if (value()) { - if (value() < 9) value(value() + 1); - else value(1); - } else value(((Sudoku *)window())->next_value(this)); - } + // 2+ clicks increments/sets value + if (value()) { + if (value() < 9) value(value() + 1); + else value(1); + } else value(((Sudoku *)window())->next_value(this)); + } Fl::focus(this); - redraw(); - return 1; + redraw(); + return 1; } break; @@ -579,33 +577,33 @@ SudokuCell::handle(int event) { } if (Fl::event_state() & (FL_SHIFT | FL_CAPS_LOCK)) { - int i; + int i; - for (i = 0; i < 8; i ++) - if (test_value_[i] == key) { - test_value_[i] = 0; - break; - } + for (i = 0; i < 8; i ++) + if (test_value_[i] == key) { + test_value_[i] = 0; + break; + } + + if (i >= 8) { + for (i = 0; i < 8; i ++) + if (!test_value_[i]) { + test_value_[i] = key; + break; + } + } if (i >= 8) { - for (i = 0; i < 8; i ++) - if (!test_value_[i]) { - test_value_[i] = key; - break; - } - } - - if (i >= 8) { - for (i = 0; i < 7; i ++) test_value_[i] = test_value_[i + 1]; - test_value_[i] = key; - } - - redraw(); - } else { - value(key); - do_callback(); - } - return 1; + for (i = 0; i < 7; i ++) test_value_[i] = test_value_[i + 1]; + test_value_[i] = key; + } + + redraw(); + } else { + value(key); + do_callback(); + } + return 1; } else if (key == 0 || Fl::event_key() == FL_BackSpace || Fl::event_key() == FL_Delete) { if (readonly()) { @@ -614,8 +612,8 @@ SudokuCell::handle(int event) { } value(0); - do_callback(); - return 1; + do_callback(); + return 1; } break; } @@ -625,8 +623,8 @@ SudokuCell::handle(int event) { // Sudoku class globals... -Fl_Help_Dialog *Sudoku::help_dialog_ = (Fl_Help_Dialog *)0; -Fl_Preferences Sudoku::prefs_(Fl_Preferences::USER, "fltk.org", "sudoku"); +Fl_Help_Dialog *Sudoku::help_dialog_ = (Fl_Help_Dialog *)0; +Fl_Preferences Sudoku::prefs_(Fl_Preferences::USER, "fltk.org", "sudoku"); // Create a Sudoku game window... @@ -636,7 +634,7 @@ Sudoku::Sudoku() int j, k; Fl_Group *g; SudokuCell *cell; - static Fl_Menu_Item items[] = { + static Fl_Menu_Item items[] = { { "&Game", 0, 0, 0, FL_SUBMENU }, { "&New Game", FL_COMMAND | 'n', new_cb, 0, FL_MENU_DIVIDER }, { "&Check Game", FL_COMMAND | 'c', check_cb, 0, 0 }, @@ -682,7 +680,7 @@ Sudoku::Sudoku() for (j = 0; j < 3; j ++) for (k = 0; k < 3; k ++) { g = new Fl_Group(k * GROUP_SIZE, j * GROUP_SIZE + MENU_OFFSET, - GROUP_SIZE, GROUP_SIZE); + GROUP_SIZE, GROUP_SIZE); g->box(FL_BORDER_BOX); if ((int)(j == 1) ^ (int)(k == 1)) g->color(FL_DARK3); else g->color(FL_DARK2); @@ -695,9 +693,9 @@ Sudoku::Sudoku() for (k = 0; k < 9; k ++) { cell = new SudokuCell(k * CELL_SIZE + CELL_OFFSET + (k / 3) * (GROUP_SIZE - 3 * CELL_SIZE), - j * CELL_SIZE + CELL_OFFSET + MENU_OFFSET + - (j / 3) * (GROUP_SIZE - 3 * CELL_SIZE), - CELL_SIZE, CELL_SIZE); + j * CELL_SIZE + CELL_OFFSET + MENU_OFFSET + + (j / 3) * (GROUP_SIZE - 3 * CELL_SIZE), + CELL_SIZE, CELL_SIZE); cell->callback(reset_cb); grid_cells_[j][k] = cell; } @@ -712,7 +710,7 @@ Sudoku::Sudoku() bm.draw(0, 0); Fl_Surface_Device::pop_current(); icon(surf.image()); - + // Catch window close events... callback(close_cb); @@ -767,19 +765,19 @@ Sudoku::check_game(bool highlight) { else { for (m = 0; m < 9; m ++) if ((j != m && grid_cells_[m][k]->value() == val) || - (k != m && grid_cells_[j][m]->value() == val)) break; + (k != m && grid_cells_[j][m]->value() == val)) break; if (m < 9) { if (highlight) { - cell->color(FL_YELLOW); - cell->redraw(); - } - - correct = false; - } else if (highlight) { - cell->color(FL_LIGHT3); - cell->redraw(); - } + cell->color(FL_YELLOW); + cell->redraw(); + } + + correct = false; + } else if (highlight) { + cell->color(FL_LIGHT3); + cell->redraw(); + } } } @@ -788,40 +786,40 @@ Sudoku::check_game(bool highlight) { for (k = 0; k < 9; k += 3) for (int jj = 0; jj < 3; jj ++) for (int kk = 0; kk < 3; kk ++) { - SudokuCell *cell = grid_cells_[j + jj][k + kk]; - int val = cell->value(); + SudokuCell *cell = grid_cells_[j + jj][k + kk]; + int val = cell->value(); - if (cell->readonly() || !val) continue; + if (cell->readonly() || !val) continue; int jjj; for (jjj = 0; jjj < 3; jjj ++) { - int kkk; + int kkk; - for (kkk = 0; kkk < 3; kkk ++) + for (kkk = 0; kkk < 3; kkk ++) if (jj != jjj && kk != kkk && - grid_cells_[j + jjj][k + kkk]->value() == val) break; + grid_cells_[j + jjj][k + kkk]->value() == val) break; if (kkk < 3) break; - } + } if (jjj < 3) { if (highlight) { - cell->color(FL_YELLOW); - cell->redraw(); - } + cell->color(FL_YELLOW); + cell->redraw(); + } - correct = false; - } - } + correct = false; + } + } if (!empty && correct) { // Success! for (j = 0; j < 9; j ++) { for (k = 0; k < 9; k ++) { - SudokuCell *cell = grid_cells_[j][k]; - cell->color(FL_GREEN); - cell->readonly(1); + SudokuCell *cell = grid_cells_[j][k]; + cell->color(FL_GREEN); + cell->readonly(1); } if (sound_) sound_->play('A' + grid_cells_[j][8]->value() - 1); @@ -864,9 +862,9 @@ Sudoku::diff_cb(Fl_Widget *widget, void *d) { if (!val) { prefs_.set("difficulty_warning", 1); - fl_alert("Note: 'Hard' and 'Impossible' puzzles may have more than " - "one possible solution.\n" - "This is not an error or bug."); + fl_alert("Note: 'Hard' and 'Impossible' puzzles may have more than " + "one possible solution.\n" + "This is not an error or bug."); } } @@ -941,50 +939,50 @@ Sudoku::help_cb(Fl_Widget *, void *) { help_dialog_ = new Fl_Help_Dialog(); help_dialog_->value( - "<HTML>\n" - "<HEAD>\n" - "<TITLE>Sudoku Help</TITLE>\n" - "</HEAD>\n" - "<BODY BGCOLOR='#ffffff'>\n" + "<HTML>\n" + "<HEAD>\n" + "<TITLE>Sudoku Help</TITLE>\n" + "</HEAD>\n" + "<BODY BGCOLOR='#ffffff'>\n" - "<H2>About the Game</H2>\n" + "<H2>About the Game</H2>\n" - "<P>Sudoku (pronounced soo-dough-coo with the emphasis on the\n" + "<P>Sudoku (pronounced soo-dough-coo with the emphasis on the\n" "first syllable) is a simple number-based puzzle/game played on a\n" - "9x9 grid that is divided into 3x3 subgrids. The goal is to enter\n" - "a number from 1 to 9 in each cell so that each number appears\n" - "only once in each column and row. In addition, each 3x3 subgrid\n" - "may only contain one of each number.</P>\n" - - "<P>This version of the puzzle is copyright 2005-2010 by Michael R\n" - "Sweet.</P>\n" - - "<P><B>Note:</B> The 'Hard' and 'Impossible' difficulty\n" - "levels generate Sudoku puzzles with multiple possible solutions.\n" - "While some purists insist that these cannot be called 'Sudoku'\n" - "puzzles, the author (me) has personally solved many such puzzles\n" - "in published/printed Sudoku books and finds them far more\n" - "interesting than the simple single solution variety. If you don't\n" - "like it, don't play with the difficulty set to 'High' or\n" - "'Impossible'.</P>\n" - - "<H2>How to Play the Game</H2>\n" - - "<P>At the start of a new game, Sudoku fills in a random selection\n" - "of cells for you - the number of cells depends on the difficulty\n" - "level you use. Click in any of the empty cells or use the arrow\n" - "keys to highlight individual cells and press a number from 1 to 9\n" - "to fill in the cell. To clear a cell, press 0, Delete, or\n" - "Backspace. When you have successfully completed all subgrids, the\n" - "entire puzzle is highlighted in green until you start a new\n" - "game.</P>\n" - - "<P>As you work to complete the puzzle, you can display possible\n" - "solutions inside each cell by holding the Shift key and pressing\n" - "each number in turn. Repeat the process to remove individual\n" - "numbers, or press a number without the Shift key to replace them\n" - "with the actual number to use.</P>\n" - "</BODY>\n" + "9x9 grid that is divided into 3x3 subgrids. The goal is to enter\n" + "a number from 1 to 9 in each cell so that each number appears\n" + "only once in each column and row. In addition, each 3x3 subgrid\n" + "may only contain one of each number.</P>\n" + + "<P>This version of the puzzle is copyright 2005-2010 by Michael R\n" + "Sweet.</P>\n" + + "<P><B>Note:</B> The 'Hard' and 'Impossible' difficulty\n" + "levels generate Sudoku puzzles with multiple possible solutions.\n" + "While some purists insist that these cannot be called 'Sudoku'\n" + "puzzles, the author (me) has personally solved many such puzzles\n" + "in published/printed Sudoku books and finds them far more\n" + "interesting than the simple single solution variety. If you don't\n" + "like it, don't play with the difficulty set to 'High' or\n" + "'Impossible'.</P>\n" + + "<H2>How to Play the Game</H2>\n" + + "<P>At the start of a new game, Sudoku fills in a random selection\n" + "of cells for you - the number of cells depends on the difficulty\n" + "level you use. Click in any of the empty cells or use the arrow\n" + "keys to highlight individual cells and press a number from 1 to 9\n" + "to fill in the cell. To clear a cell, press 0, Delete, or\n" + "Backspace. When you have successfully completed all subgrids, the\n" + "entire puzzle is highlighted in green until you start a new\n" + "game.</P>\n" + + "<P>As you work to complete the puzzle, you can display possible\n" + "solutions inside each cell by holding the Shift key and pressing\n" + "each number in turn. Repeat the process to remove individual\n" + "numbers, or press a number without the Shift key to replace them\n" + "with the actual number to use.</P>\n" + "</BODY>\n" ); } @@ -1010,8 +1008,8 @@ Sudoku::load_game() { sprintf(name, "value%d.%d", j, k); if (!prefs_.get(name, val, 0)) { j = 9; - grid_values_[0][0] = 0; - break; + grid_values_[0][0] = 0; + break; } grid_values_[j][k] = val; @@ -1019,7 +1017,7 @@ Sudoku::load_game() { sprintf(name, "state%d.%d", j, k); prefs_.get(name, val, 0); cell->value(val); - + sprintf(name, "readonly%d.%d", j, k); prefs_.get(name, val, 0); cell->readonly(val != 0); @@ -1027,13 +1025,13 @@ Sudoku::load_game() { if (val) cell->color(FL_GRAY); else { cell->color(FL_LIGHT3); - solved = false; + solved = false; } for (int m = 0; m < 8; m ++) { - sprintf(name, "test%d%d.%d", m, j, k); - prefs_.get(name, val, 0); - cell->test_value(val, m); + sprintf(name, "test%d%d.%d", m, j, k); + prefs_.get(name, val, 0); + cell->test_value(val, m); } } @@ -1090,35 +1088,35 @@ Sudoku::new_game(time_t seed) { for (j = 0; j < 9; j += 3) { for (k = 0; k < 9; k += 3) { for (t = 1; t <= 9; t ++) { - for (count = 0; count < 20; count ++) { - m = j + (rand() % 3); - n = k + (rand() % 3); - if (!grid_values_[m][n]) { - int mm; + for (count = 0; count < 20; count ++) { + m = j + (rand() % 3); + n = k + (rand() % 3); + if (!grid_values_[m][n]) { + int mm; - for (mm = 0; mm < m; mm ++) - if (grid_values_[mm][n] == t) break; + for (mm = 0; mm < m; mm ++) + if (grid_values_[mm][n] == t) break; - if (mm < m) continue; + if (mm < m) continue; - int nn; + int nn; - for (nn = 0; nn < n; nn ++) - if (grid_values_[m][nn] == t) break; + for (nn = 0; nn < n; nn ++) + if (grid_values_[m][nn] == t) break; - if (nn < n) continue; + if (nn < n) continue; - grid_values_[m][n] = t; - break; - } - } + grid_values_[m][n] = t; + break; + } + } - if (count == 20) { - // Unable to find a valid puzzle so far, so start over... - k = 9; - j = -3; - memset(grid_values_, 0, sizeof(grid_values_)); - } + if (count == 20) { + // Unable to find a valid puzzle so far, so start over... + k = 9; + j = -3; + memset(grid_values_, 0, sizeof(grid_values_)); + } } } } @@ -1158,13 +1156,13 @@ Sudoku::new_game(time_t seed) { cell = grid_cells_[j][k]; if (grid_values_[j][k] == t && !cell->readonly()) { - cell->value(grid_values_[j][k]); - cell->readonly(1); - cell->color(FL_GRAY); + cell->value(grid_values_[j][k]); + cell->readonly(1); + cell->color(FL_GRAY); - count --; - break; - } + count --; + break; + } } } } @@ -1174,7 +1172,7 @@ Sudoku::new_game(time_t seed) { // Return the next available value for a cell... int Sudoku::next_value(SudokuCell *c) { - int j = 0, k = 0, m = 0, n = 0; + int j = 0, k = 0, m = 0, n = 0; for (j = 0; j < 9; j ++) { @@ -1211,7 +1209,7 @@ void Sudoku::reset_cb(Fl_Widget *widget, void *) { widget->color(FL_LIGHT3); widget->redraw(); - + ((Sudoku *)(widget->window()))->check_game(false); } @@ -1243,9 +1241,9 @@ Sudoku::restart_cb(Fl_Widget *widget, void *) { if (!cell->readonly()) { solved = false; int v = cell->value(); - cell->value(0); - cell->color(FL_LIGHT3); - if (v && s->sound_) s->sound_->play('A' + v - 1); + cell->value(0); + cell->color(FL_LIGHT3); + if (v && s->sound_) s->sound_->play('A' + v - 1); } } @@ -1272,8 +1270,8 @@ Sudoku::save_game() { prefs_.set(name, cell->readonly()); for (int m = 0; m < 8; m ++) { - sprintf(name, "test%d%d.%d", m, j, k); - prefs_.set(name, cell->test_value(m)); + sprintf(name, "test%d%d.%d", m, j, k); + prefs_.set(name, cell->test_value(m)); } } } @@ -1333,8 +1331,3 @@ main(int argc, char *argv[]) { // Run until the user quits... return (Fl::run()); } - - -// -// End of "$Id$". -// diff --git a/test/sudokurc.h b/test/sudokurc.h index 0cea5434d..ce22927e8 100644 --- a/test/sudokurc.h +++ b/test/sudokurc.h @@ -5,7 +5,7 @@ #define IDI_ICON 101 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 105 diff --git a/test/symbols.cxx b/test/symbols.cxx index 6bb9455b5..43f5217d8 100644 --- a/test/symbols.cxx +++ b/test/symbols.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Symbol test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -144,7 +142,3 @@ bt("@redo"); window->show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/table.cxx b/test/table.cxx index 5c4ab3e69..2e5f0f639 100644 --- a/test/table.cxx +++ b/test/table.cxx @@ -5,7 +5,7 @@ #include <stdio.h> #include <string.h> #ifdef _WIN32 -#include <stdlib.h> // atoi +#include <stdlib.h> // atoi #endif /* _WIN32 */ #include <FL/Fl.H> @@ -27,14 +27,14 @@ Fl_Simple_Terminal *G_tty = 0; class DemoTable : public Fl_Table_Row { private: - Fl_Color cell_bgcolor; // color of cell's bg color - Fl_Color cell_fgcolor; // color of cell's fg color + Fl_Color cell_bgcolor; // color of cell's bg color + Fl_Color cell_fgcolor; // color of cell's fg color protected: - void draw_cell(TableContext context, // table cell drawing - int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0); + void draw_cell(TableContext context, // table cell drawing + int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0); static void event_callback(Fl_Widget*, void*); - void event_callback2(); // callback for table events + void event_callback2(); // callback for table events public: DemoTable(int x, int y, int w, int h, const char *l=0) : Fl_Table_Row(x,y,w,h,l) @@ -42,7 +42,7 @@ public: cell_bgcolor = FL_WHITE; cell_fgcolor = FL_BLACK; callback(&event_callback, (void*)this); - end(); + end(); } ~DemoTable() { } Fl_Color GetCellFGColor() const { return(cell_fgcolor); } @@ -52,66 +52,66 @@ public: }; // Handle drawing all cells in table -void DemoTable::draw_cell(TableContext context, - int R, int C, int X, int Y, int W, int H) +void DemoTable::draw_cell(TableContext context, + int R, int C, int X, int Y, int W, int H) { static char s[40]; - sprintf(s, "%d/%d", R, C); // text for each cell + sprintf(s, "%d/%d", R, C); // text for each cell switch ( context ) { - case CONTEXT_STARTPAGE: - fl_font(FL_HELVETICA, 16); - return; - - case CONTEXT_COL_HEADER: - fl_push_clip(X, Y, W, H); - { - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, col_header_color()); - fl_color(FL_BLACK); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - } - fl_pop_clip(); - return; - - case CONTEXT_ROW_HEADER: - fl_push_clip(X, Y, W, H); - { - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, row_header_color()); - fl_color(FL_BLACK); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - } - fl_pop_clip(); - return; - - case CONTEXT_CELL: - { - fl_push_clip(X, Y, W, H); - { - // BG COLOR - fl_color( row_selected(R) ? selection_color() : cell_bgcolor); - fl_rectf(X, Y, W, H); - - // TEXT - fl_color(cell_fgcolor); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - - // BORDER - fl_color(color()); - fl_rect(X, Y, W, H); - } - fl_pop_clip(); - return; - } - - case CONTEXT_TABLE: - G_tty->printf("TABLE CONTEXT CALLED\n"); - return; - - case CONTEXT_ENDPAGE: - case CONTEXT_RC_RESIZE: - case CONTEXT_NONE: - return; + case CONTEXT_STARTPAGE: + fl_font(FL_HELVETICA, 16); + return; + + case CONTEXT_COL_HEADER: + fl_push_clip(X, Y, W, H); + { + fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, col_header_color()); + fl_color(FL_BLACK); + fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); + } + fl_pop_clip(); + return; + + case CONTEXT_ROW_HEADER: + fl_push_clip(X, Y, W, H); + { + fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, row_header_color()); + fl_color(FL_BLACK); + fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); + } + fl_pop_clip(); + return; + + case CONTEXT_CELL: + { + fl_push_clip(X, Y, W, H); + { + // BG COLOR + fl_color( row_selected(R) ? selection_color() : cell_bgcolor); + fl_rectf(X, Y, W, H); + + // TEXT + fl_color(cell_fgcolor); + fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); + + // BORDER + fl_color(color()); + fl_rect(X, Y, W, H); + } + fl_pop_clip(); + return; + } + + case CONTEXT_TABLE: + G_tty->printf("TABLE CONTEXT CALLED\n"); + return; + + case CONTEXT_ENDPAGE: + case CONTEXT_RC_RESIZE: + case CONTEXT_NONE: + return; } } @@ -179,7 +179,7 @@ void setpositionrow_cb(Fl_Widget *w, void *data) { Fl_Input *in = (Fl_Input*)data; int toprow = atoi(in->value()); - if ( toprow < 0 || toprow >= G_table->rows() ) + if ( toprow < 0 || toprow >= G_table->rows() ) { fl_alert("Must be in range 0 thru #rows"); } else { G_table->row_position(toprow); } @@ -189,7 +189,7 @@ void setpositioncol_cb(Fl_Widget *w, void *data) { Fl_Input *in = (Fl_Input*)data; int leftcol = atoi(in->value()); - if ( leftcol < 0 || leftcol >= G_table->cols() ) + if ( leftcol < 0 || leftcol >= G_table->cols() ) { fl_alert("Must be in range 0 thru #cols"); } else { G_table->col_position(leftcol); } @@ -467,7 +467,7 @@ int main(int argc, char **argv) widgetbox.labelsize(12); widgetbox.textsize(12); widgetbox.menu(widgetbox_choices); - widgetbox.value(2); // down frame + widgetbox.value(2); // down frame Fl_Input tablecolor(400, 640, 120, 25, "Table Color"); tablecolor.labelsize(12); diff --git a/test/threads.cxx b/test/threads.cxx index 2fe40eb54..68370d246 100644 --- a/test/threads.cxx +++ b/test/threads.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Threading example program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <config.h> @@ -62,11 +60,11 @@ extern "C" void* prime_func(void* p) // very simple prime number calculator ! // - // The return at the end of this function can never be reached and thus - // will generate a warning with some compilers, however we need to have - // a return statement or other compilers will complain there is no return - // statement. To avoid warnings on all compilers, we fool the smart ones - // into beleiving that there is a chance that we reach the end by testing + // The return at the end of this function can never be reached and thus + // will generate a warning with some compilers, however we need to have + // a return statement or other compilers will complain there is no return + // statement. To avoid warnings on all compilers, we fool the smart ones + // into beleiving that there is a chance that we reach the end by testing // n>=0, knowing that logically, n will never be negative in this context. if (n>=0) for (;;) { int pp; @@ -123,7 +121,7 @@ int main(int argc, char **argv) value2 = new Fl_Value_Output(100, 175, 200, 25, "Max Prime:"); w->end(); w->show(); - + browser1->add("Prime numbers:"); browser2->add("Prime numbers:"); @@ -157,8 +155,3 @@ int main() { fl_alert("Sorry, threading not supported on this platform!"); } #endif // HAVE_PTHREAD || _WIN32 - - -// -// End of "$Id$". -// diff --git a/test/threads.h b/test/threads.h index d90d6e422..d2c7791dd 100644 --- a/test/threads.h +++ b/test/threads.h @@ -1,6 +1,4 @@ // -// "$Id$" -// // Simple threading API for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Inline classes to provide portable support for threads and mutexes. @@ -75,7 +73,3 @@ static int fl_create_thread(Fl_Thread& t, Fl_Thread_Func* f, void* p) { } # endif // !HAVE_PTHREAD_H #endif // !Threads_h - -// -// End of "$Id$". -// diff --git a/test/tile.cxx b/test/tile.cxx index 5bb8cf851..2b6485ef2 100644 --- a/test/tile.cxx +++ b/test/tile.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Tile test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -91,7 +89,3 @@ int main(int argc, char** argv) { window.show(argc,argv); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/tiled_image.cxx b/test/tiled_image.cxx index f858583df..bb0a8ef55 100644 --- a/test/tiled_image.cxx +++ b/test/tiled_image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_Tiled_Image test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -67,7 +65,7 @@ int main(int argc, char **argv) { exit(1); } fl_colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen), - fl_visual->visual, AllocNone); + fl_visual->visual, AllocNone); fl_xpixel(FL_BLACK); // make sure black is allocated in overlay visuals } else { Fl::visual(FL_RGB); @@ -90,7 +88,3 @@ int main(int argc, char **argv) { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/tree.fl b/test/tree.fl index ba1de8510..d44d4c08b 100644 --- a/test/tree.fl +++ b/test/tree.fl @@ -76,7 +76,7 @@ int height = cw->h(); height += 10; if ( height > 50 ) height = 20; cw->resize(cw->x(), cw->y(), cw->w(), height); -tree->redraw(); // adjusted height +tree->redraw(); // adjusted height tty->printf("'%s' button pushed (height=%d)\\n", w->label(), height);} {} } @@ -139,9 +139,9 @@ for ( Fl_Tree_Item *item = tree->first(); item; item=item->next()) { } else { item->usericon(&L_document_pixmap); item->userdeicon(&L_document_deicon_pixmap); - } + } } else { - // Don't assign custom icons + // Don't assign custom icons item->usericon(0); item->userdeicon(0); @@ -172,14 +172,14 @@ tree->add("Bbb/child-04"); // Assign an FLTK input widget to one of the items with a label() of its own (STR\#2832) Fl_Tree_Item *i; if ( ( i = tree->find_item("Bbb/child-02") ) != NULL ) { - if ( !in ) { // only do this once at program startup + if ( !in ) { // only do this once at program startup tree->begin(); - in = new Fl_Input(1,1,100,1,"Fl_Input test"); // we control w() only + in = new Fl_Input(1,1,100,1,"Fl_Input test"); // we control w() only in->labelsize(10); in->textsize(10); - in->align(FL_ALIGN_RIGHT); // show label to the right of the widget - in->tooltip("Fl_Input inside tree.\\n" - "The widget's label 'Fl_Input test' should appear to the widget's right."); + in->align(FL_ALIGN_RIGHT); // show label to the right of the widget + in->tooltip("Fl_Input inside tree.\\n" + "The widget's label 'Fl_Input test' should appear to the widget's right."); } in->show(); i->widget(in); @@ -192,14 +192,14 @@ tree->add("Bbb/child-04"); // Assign an FLTK widget to one of the items Fl_Tree_Item *i; if ( ( i = tree->find_item("Bbb/child-03") ) != NULL ) { - if ( !but ) { // only do this once at program startup + if ( !but ) { // only do this once at program startup tree->begin(); but = new Fl_Button(1,1,140,1,"ccc button"); // we control w() only but->labelsize(10); - but->callback(Button_CB); - but->tooltip("Button inside tree.\\n" - "If 'Item h() from widget' enabled, " - "pressing button enlarges it."); + but->callback(Button_CB); + but->tooltip("Button inside tree.\\n" + "If 'Item h() from widget' enabled, " + "pressing button enlarges it."); } but->show(); i->widget(but); @@ -210,24 +210,24 @@ tree->add("Bbb/child-04"); // Assign an FLTK group to one of the items with widgets Fl_Tree_Item *i; const char *tipmsg = "A group of two buttons inside the tree.\\n" - "If 'Item h() from widget' enabled, " - "pressing either button enlarges the group " - "and both buttons together."; + "If 'Item h() from widget' enabled, " + "pressing either button enlarges the group " + "and both buttons together."; if ( ( i = tree->find_item("Bbb/child-04") ) != NULL ) { static Fl_Group *grp = 0; - if ( !grp ) { // only do this once at program startup + if ( !grp ) { // only do this once at program startup tree->begin(); grp = new Fl_Group(100,100,140,18); // build group.. tree handles position grp->color(FL_WHITE); grp->begin(); Fl_Button *abut = new Fl_Button(grp->x()+0 ,grp->y()+2,65,15,"D1"); abut->labelsize(10); - abut->callback(Button_CB); - abut->tooltip(tipmsg); + abut->callback(Button_CB); + abut->tooltip(tipmsg); Fl_Button *bbut = new Fl_Button(grp->x()+75,grp->y()+2,65,15,"D2"); bbut->labelsize(10); - bbut->callback(Button_CB); - bbut->tooltip(tipmsg); + bbut->callback(Button_CB); + bbut->tooltip(tipmsg); grp->end(); grp->resizable(grp); @@ -273,7 +273,7 @@ for ( int t=0; t<500; t++ ) { sprintf(s, "500 Items/item %04d", t+1); tree->add(s); } -tree->close("500 Items"); // close the 500 items by default +tree->close("500 Items"); // close the 500 items by default AssignUserIcons(); @@ -373,8 +373,8 @@ if ( item ) { tty->printf("TREE CALLBACK: label='%s' userdata=%ld reason=%s, changed=%d", item->label(), (long)(fl_intptr_t)tree->user_data(), - reason_as_name(tree->callback_reason()), - tree->changed() ? 1 : 0); + reason_as_name(tree->callback_reason()), + tree->changed() ? 1 : 0); // More than one click? show click count // Should only happen if reason==FL_TREE_REASON_RESELECTED. // @@ -382,7 +382,7 @@ if ( item ) { tty->printf(", clicks=%d\\n", (Fl::event_clicks()+1)); } else { tty->printf("\\n"); - } + } } else { tty->printf("TREE CALLBACK: reason=%s, changed=%d, item=(no item -- probably multiple items were changed at once)\\n", reason_as_name(tree->callback_reason()), @@ -508,9 +508,9 @@ tree->redraw();} callback {static const char *L_open_xpm[] = { \#ifdef __APPLE__ "11 11 3 1", - ". c \#fefefe", - "\# c \#444444", - "@ c \#000000", + ". c \#fefefe", + "\# c \#444444", + "@ c \#000000", "\#\#\#\#\#\#\#\#\#\#\#", "\#.........\#", "\#.........\#", @@ -544,9 +544,9 @@ static Fl_Pixmap L_openpixmap(L_open_xpm); static const char *L_close_xpm[] = { \#ifdef __APPLE__ "11 11 3 1", - ". c \#fefefe", - "\# c \#444444", - "@ c \#000000", + ". c \#fefefe", + "\# c \#444444", + "@ c \#000000", "\#\#\#\#\#\#\#\#\#\#\#", "\#.........\#", "\#.........\#", @@ -635,18 +635,18 @@ switch ( connectorstyle_chooser->value() ) { label {Selection Mode} callback {// Set selection mode switch ( selectmode_chooser->value() ) { - case 0: tree->selectmode(FL_TREE_SELECT_NONE); break; // None - case 1: tree->selectmode(FL_TREE_SELECT_SINGLE); break; // Single - case 2: tree->selectmode(FL_TREE_SELECT_MULTI); break; // Multi + case 0: tree->selectmode(FL_TREE_SELECT_NONE); break; // None + case 1: tree->selectmode(FL_TREE_SELECT_SINGLE); break; // Single + case 2: tree->selectmode(FL_TREE_SELECT_MULTI); break; // Multi case 3: tree->selectmode(FL_TREE_SELECT_SINGLE_DRAGGABLE); break; // Single draggable - default: tree->selectmode(FL_TREE_SELECT_SINGLE); break; // Single + default: tree->selectmode(FL_TREE_SELECT_SINGLE); break; // Single }} open tooltip {Tests Fl_Tree::selectmode() Sets how Fl_Tree handles mouse selection of tree items. - NONE -- Not selectable by keyboard/mouse - SINGLE -- Only one item at a time selectable by keyboard/mouse - MULTI -- Multiple items selectable - SINGLE+DRAG -- Lets user drag items to different position in tree} xywh {520 273 140 21} down_box BORDER_BOX labelsize 12 textsize 11 + NONE -- Not selectable by keyboard/mouse + SINGLE -- Only one item at a time selectable by keyboard/mouse + MULTI -- Multiple items selectable + SINGLE+DRAG -- Lets user drag items to different position in tree} xywh {520 273 140 21} down_box BORDER_BOX labelsize 12 textsize 11 code0 {selectmode_chooser->value(2);} code1 {cb_selectmode_chooser(selectmode_chooser, (void*)0);} } { @@ -918,7 +918,7 @@ G_cb_counter = 0; tree->open(root, 0); if ( G_cb_counter ) fl_alert("FAIL G_cb_counter = 0; tree->open_toggle(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n open_toggle(item) triggered cb!"); G_cb_counter = 0; tree->open("ROOT", 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n open(path) triggered cb!"); G_cb_counter = 0; tree->close("ROOT", 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n close(path) triggered cb!"); -tree->open(root,0); // leave root open +tree->open(root,0); // leave root open // select/deselect: Make sure these methods don't trigger cb G_cb_counter = 0; tree->select(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n select(item) triggered cb!"); @@ -938,7 +938,7 @@ G_cb_counter = 0; tree->open(root, 1); if ( !G_cb_counter ) fl_alert("FAI G_cb_counter = 0; tree->close(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n close(item)[2] cb wasn't triggered!"); G_cb_counter = 0; tree->open("ROOT", 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n open(path) cb wasn't triggered!"); G_cb_counter = 0; tree->close("ROOT", 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n close(path) cb wasn't triggered!"); -tree->open(root,0); // leave root open +tree->open(root,0); // leave root open // select/deselect: Make sure these methods don't trigger cb G_cb_counter = 0; tree->select(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n select(item) cb wasn't triggered!"); @@ -956,7 +956,7 @@ G_cb_counter = 0; tree->open(root); if ( !G_cb_counter ) fl_alert("FAILED G_cb_counter = 0; tree->open_toggle(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: open_toggle(item) cb wasn't triggered!"); G_cb_counter = 0; tree->open("ROOT"); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: open(path) cb wasn't triggered!"); G_cb_counter = 0; tree->close("ROOT"); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: close(path) cb wasn't triggered!"); -tree->open(root,0); // leave root open +tree->open(root,0); // leave root open // select/deselect: Make sure these methods don't trigger cb G_cb_counter = 0; tree->select(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST\\n select(item) cb wasn't triggered!"); @@ -1131,9 +1131,9 @@ If none selected, all are changed.} xywh {863 55 140 16} type Horizontal color 4 Fl_Button all_labelfgcolor_button { label {Fl_Tree_Item::labelfgcolor()} callback {// Get first item's color -Fl_Color val = GetSelectedItemFGColor(); // Get color of first selected item -if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') -all_labelfgcolor_button->color(val); // update modified color to button +Fl_Color val = GetSelectedItemFGColor(); // Get color of first selected item +if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') +all_labelfgcolor_button->color(val); // update modified color to button // Do selected items int count = 0; @@ -1159,9 +1159,9 @@ tree->redraw();} Fl_Button all_labelbgcolor_button { label {Fl_Tree_Item::labelbgcolor()} callback {// Get first item's color -Fl_Color val = GetSelectedItemBGColor(); // Get color of first selected item -if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') -all_labelbgcolor_button->color(val); // update modified color to button +Fl_Color val = GetSelectedItemBGColor(); // Get color of first selected item +if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') +all_labelbgcolor_button->color(val); // update modified color to button // Do selected items int count = 0; @@ -1255,8 +1255,8 @@ for ( Fl_Tree_Item *item = tree->first_selected_item(); callback {Fl_Tree_Item *item=tree->first(); while (item) { if ( item->is_selected() ) { - if ( tree->remove(item) == -1 ) break; - item = tree->first(); + if ( tree->remove(item) == -1 ) break; + item = tree->first(); } else { item = item->next(); } @@ -1330,8 +1330,8 @@ if ( !bbb) { return; } int onoff = bbbselect_toggle->value(); -if ( onoff ) tree->select(bbb); // select /Bbb -else tree->deselect(bbb); // deselect /Bbb} +if ( onoff ) tree->select(bbb); // select /Bbb +else tree->deselect(bbb); // deselect /Bbb} tooltip {Toggle selection of just the /Bbb item (Not children)} xywh {814 199 95 16} selection_color 1 labelsize 9 } @@ -1344,8 +1344,8 @@ if ( !bbb) { return; } int onoff = bbbselect2_toggle->value(); -if ( onoff ) tree->select_all(bbb); // select /Bbb and its children -else tree->deselect_all(bbb); // deselect /Bbb and its children} +if ( onoff ) tree->select_all(bbb); // select /Bbb and its children +else tree->deselect_all(bbb); // deselect /Bbb and its children} tooltip {Toggle selection of the /Bbb item and its children} xywh {814 219 95 16} selection_color 1 labelsize 9 } Fl_Light_Button bbbchild02select_toggle { @@ -1372,8 +1372,8 @@ if ( !item) { return; } int onoff = rootselect_toggle->value(); -if ( onoff ) tree->select(item); // select /ROOT and its children -else tree->deselect(item); // deselect /ROOT and its children} +if ( onoff ) tree->select(item); // select /ROOT and its children +else tree->deselect(item); // deselect /ROOT and its children} tooltip {Toggle selection of the ROOT item} xywh {914 199 100 16} selection_color 1 labelsize 9 } Fl_Light_Button rootselect2_toggle { @@ -1385,8 +1385,8 @@ if ( !item) { return; } int onoff = rootselect2_toggle->value(); -if ( onoff ) tree->select_all(item); // select /ROOT and its children -else tree->deselect_all(item); // deselect /ROOT and its children} +if ( onoff ) tree->select_all(item); // select /ROOT and its children +else tree->deselect_all(item); // deselect /ROOT and its children} tooltip {Toggle selection of the ROOT item and all children} xywh {914 219 100 16} selection_color 1 labelsize 9 } Fl_Box {} { @@ -1567,8 +1567,8 @@ tree->redraw();} Fl_Button labelcolor_button { label {labelcolor()} callback {Fl_Color val = tree->labelcolor(); -if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') -labelcolor_button->color(val); // update modified color to button +if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') +labelcolor_button->color(val); // update modified color to button tree->labelcolor(val); window->redraw(); // affects window (tree's label is outside tree's area)} tooltip {Changes Fl_Tree::labelcolor(). @@ -1578,8 +1578,8 @@ This affects the text color of the widget's label.} xywh {813 414 16 16} box DOW Fl_Button color_button { label {color()} callback {Fl_Color val = tree->color(); -if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') -color_button->color(val); // update modified color to button +if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') +color_button->color(val); // update modified color to button tree->color(val); UpdateColorChips(); tree->redraw();} @@ -1590,8 +1590,8 @@ This affects the background color of the widget. It also affects the bg color of Fl_Button selection_color_button { label {selection_color()} callback {Fl_Color val = tree->selection_color(); -if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') -selection_color_button->color(val); // update modified color to button +if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') +selection_color_button->color(val); // update modified color to button tree->selection_color(val); tree->redraw();} tooltip {Sets the Fl_Tree::selection_color(). @@ -1601,9 +1601,9 @@ This affects the item's colors when they're selected.} xywh {813 452 16 16} box Fl_Button item_labelfgcolor_button { label {item_labelfgcolor()} callback {Fl_Color val = tree->item_labelfgcolor(); -if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') -tree->item_labelfgcolor(val); // apply modified color to tree -item_labelfgcolor_button->color(val); // update modified color to button +if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') +tree->item_labelfgcolor(val); // apply modified color to tree +item_labelfgcolor_button->color(val); // update modified color to button tree->redraw();} tooltip {Sets the default label fg color for newly created items.} xywh {973 414 16 16} box DOWN_BOX labelsize 12 align 7 code0 {o->color(tree->item_labelfgcolor());} @@ -1611,9 +1611,9 @@ tree->redraw();} Fl_Button item_labelbgcolor_button { label {item_labelbgcolor()} callback {Fl_Color val = tree->item_labelbgcolor(); -if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') -tree->item_labelbgcolor(val); // apply modified color to tree -item_labelbgcolor_button->color(val); // update modified color to button +if ( EditColor(val) == 0 ) return; // Let user edit color. (return if they hit 'Cancel') +tree->item_labelbgcolor(val); // apply modified color to tree +item_labelbgcolor_button->color(val); // update modified color to button tree->redraw();} tooltip {Sets the default label bg color for newly created items. When set, this overrides the default behavior of using Fl_Tree::color().} xywh {973 433 16 16} box DOWN_BOX labelsize 12 align 7 code0 {item_labelbgcolor_button->color(tree->item_labelbgcolor());} @@ -1756,7 +1756,7 @@ RebuildTree(); //Fl::scheme("gtk+"); -Fl_Tooltip::size(10); // small font for tooltips +Fl_Tooltip::size(10); // small font for tooltips window->resizable(tree); window->size_range(window->w(), window->h(), 0, 0); diff --git a/test/twowin.cxx b/test/twowin.cxx index 3cad87663..82949c4af 100644 --- a/test/twowin.cxx +++ b/test/twowin.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Cross-window focus test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -54,7 +52,3 @@ int main(int argc, char **argv) { win2->show(); return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/test/unittest_about.cxx b/test/unittest_about.cxx index 9e1636221..966c7cb23 100644 --- a/test/unittest_about.cxx +++ b/test/unittest_about.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Help_View.H> @@ -54,7 +52,3 @@ public: }; UnitTest about("About...", About::create); - -// -// End of "$Id$". -// diff --git a/test/unittest_circles.cxx b/test/unittest_circles.cxx index 4bf407376..62ef28060 100644 --- a/test/unittest_circles.cxx +++ b/test/unittest_circles.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Box.H> @@ -23,8 +21,8 @@ //------- test the circle drawing capabilities of this implementation ---------- // class CircleTest : public Fl_Box { -public: - static Fl_Widget *create() { +public: + static Fl_Widget *create() { return new CircleTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); } CircleTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { @@ -84,7 +82,3 @@ public: }; UnitTest circle("circles and arcs", CircleTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_images.cxx b/test/unittest_images.cxx index 80ded9c47..210af96dc 100644 --- a/test/unittest_images.cxx +++ b/test/unittest_images.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Group.H> @@ -23,8 +21,8 @@ #include <FL/fl_draw.H> // Note: currently (March 2010) fl_draw_image() supports transparency with -// alpha channel only on Apple (Mac OS X), but Fl_RGB_Image->draw() -// supports transparency on all platforms ! +// alpha channel only on Apple (Mac OS X), but Fl_RGB_Image->draw() +// supports transparency on all platforms ! // //------- test the image drawing capabilities of this implementation ---------- @@ -34,7 +32,7 @@ // Default values: CB=1, DX=0, IMG=1, LX=0, FLIPH=0 static int CB = 1; // 1 to show the checker board background for alpha images, - // 0 otherwise + // 0 otherwise static int DX = 0; // additional (undefined (0)) pixels per line, must be >= 0 // ignored (irrelevant), if LX == 0 (see below) static int IMG = 1; // 1 to use Fl_RGB_Image for drawing images with transparency, @@ -53,10 +51,10 @@ static int FLIPH = 0; // 1 = Flip image horizontally (only if IMG == 0) // ---------------------------------------------------------------------- // Test scenario for fl_draw_image() with pos. and neg. d and ld args: // ---------------------------------------------------------------------- -// (1) set IMG = 0: normal, but w/o transparency: no checker board -// (2) set LX = -1: images flipped vertically -// (3) set FLIPH = 1: images flipped vertically and horizontally -// (4) set LX = 0: images flipped horizontally +// (1) set IMG = 0: normal, but w/o transparency: no checker board +// (2) set LX = -1: images flipped vertically +// (3) set FLIPH = 1: images flipped vertically and horizontally +// (4) set LX = 0: images flipped horizontally // (5) set FLIPH = 0, IMG = 1: back to default (with transparency) // ---------------------------------------------------------------------- @@ -158,9 +156,9 @@ public: ImageTest(int x, int y, int w, int h) : Fl_Group(x, y, w, h) { label("Testing Image Drawing\n\n" - "This test renders four images, two of them with a checker board\n" - "visible through the graphics. Color and gray gradients should be\n" - "visible. This does not test any image formats such as JPEG."); + "This test renders four images, two of them with a checker board\n" + "visible through the graphics. Color and gray gradients should be\n" + "visible. This does not test any image formats such as JPEG."); align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); box(FL_BORDER_BOX); int cw = 90; @@ -220,8 +218,8 @@ public: // bottom left: RGBA xx = x()+10; yy = y()+10+134; - fl_color(FL_BLACK); fl_rect(xx, yy, 130, 130); // black frame - fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 128, 128); // white background + fl_color(FL_BLACK); fl_rect(xx, yy, 130, 130); // black frame + fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 128, 128); // white background if (CB) { // checker board fl_color(FL_BLACK); fl_rectf(xx+65, yy+1, 64, 64); fl_color(FL_BLACK); fl_rectf(xx+1, yy+65, 64, 64); @@ -259,8 +257,8 @@ public: // bottom right: Gray+Alpha xx = x()+10+200; yy = y()+10+134; - fl_color(FL_BLACK); fl_rect(xx, yy, 130, 130); // black frame - fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 128, 128); // white background + fl_color(FL_BLACK); fl_rect(xx, yy, 130, 130); // black frame + fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 128, 128); // white background if (CB) { // checker board fl_color(FL_BLACK); fl_rectf(xx+65, yy+1, 64, 64); fl_color(FL_BLACK); fl_rectf(xx+1, yy+65, 64, 64); @@ -294,7 +292,3 @@ Fl_RGB_Image *ImageTest::i_rgb = 0; Fl_RGB_Image *ImageTest::i_rgba = 0; UnitTest images("drawing images", ImageTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_lines.cxx b/test/unittest_lines.cxx index df1de65ec..b255159fc 100644 --- a/test/unittest_lines.cxx +++ b/test/unittest_lines.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Box.H> @@ -23,16 +21,16 @@ //------- test the line drawing capabilities of this implementation ---------- // class LineTest : public Fl_Box { -public: +public: static Fl_Widget *create() { return new LineTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); } LineTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { label("testing the integer based fl_line calls\n" - "No red pixels should be visible.\n" - "If you see bright red pixels, the line drawing alignment is off,\n" - "or the last pixel in a line does not get drawn.\n" - "If you see dark red pixels, anti-aliasing must be switched off."); + "No red pixels should be visible.\n" + "If you see bright red pixels, the line drawing alignment is off,\n" + "or the last pixel in a line does not get drawn.\n" + "If you see dark red pixels, anti-aliasing must be switched off."); align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); box(FL_BORDER_BOX); } @@ -77,7 +75,3 @@ public: }; UnitTest lines("drawing lines", LineTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_points.cxx b/test/unittest_points.cxx index 0df95b018..f8affc97e 100644 --- a/test/unittest_points.cxx +++ b/test/unittest_points.cxx @@ -1,6 +1,4 @@ // -// "$Id$: -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Box.H> @@ -29,14 +27,14 @@ public: } PointTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { label("testing the fl_point call\n" - "You should see four pixels each in black, red, green and blue. " - "Make sure that pixels are not anti-aliased (blurred across multiple pixels)!"); + "You should see four pixels each in black, red, green and blue. " + "Make sure that pixels are not anti-aliased (blurred across multiple pixels)!"); align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); box(FL_BORDER_BOX); } void draw() { Fl_Box::draw(); - int a = x()+10, b = y()+10; + int a = x()+10, b = y()+10; fl_color(FL_WHITE); fl_rectf(a, b, 90, 90); fl_color(FL_BLACK); fl_rect(a, b, 90, 90); fl_point(a+10, b+10); fl_point(a+20, b+20); @@ -54,7 +52,3 @@ public: }; UnitTest points("drawing points", PointTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_rects.cxx b/test/unittest_rects.cxx index dc4c4e8ee..69d2ae1e6 100644 --- a/test/unittest_rects.cxx +++ b/test/unittest_rects.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,29 +7,29 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Box.H> -#include <FL/fl_draw.H> // fl_text_extents() +#include <FL/fl_draw.H> // fl_text_extents() // //------- test the rectangle drawing capabilities of this implementation ---------- // class RectTest : public Fl_Box { -public: +public: static Fl_Widget *create() { return new RectTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); } RectTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { label("testing the fl_rect call\n" - "No red pixels should be visible. " - "If you see bright red lines, or if parts of the green frames are hidden, " - "the rect drawing alignment is off."); + "No red pixels should be visible. " + "If you see bright red lines, or if parts of the green frames are hidden, " + "the rect drawing alignment is off."); align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); box(FL_BORDER_BOX); } @@ -51,7 +49,3 @@ public: }; UnitTest rects("rectangles", RectTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_schemes.cxx b/test/unittest_schemes.cxx index 6c1d7273a..9f5123ca6 100644 --- a/test/unittest_schemes.cxx +++ b/test/unittest_schemes.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -11,11 +9,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Choice.H> @@ -50,8 +48,8 @@ class SchemesTest : public Fl_Group { SchemesTest *st = (SchemesTest*)data; const char *name = st->schemechoice->text(); if ( name ) { - Fl::scheme(name); // change scheme - st->window()->redraw(); // redraw window + Fl::scheme(name); // change scheme + st->window()->redraw(); // redraw window } } public: @@ -79,245 +77,245 @@ public: { // Pasted from Edmanuel's gleam test app { Fl_Button* o = new Fl_Button(10, 9, 90, 25, "button"); - o->box(FL_UP_BOX); - o->color((Fl_Color)101); - o->tooltip("selection_color() = default"); - o->labelfont(5); + o->box(FL_UP_BOX); + o->color((Fl_Color)101); + o->tooltip("selection_color() = default"); + o->labelfont(5); } // Fl_Button* o { Fl_Button* o = new Fl_Button(10, 36, 90, 25, "button"); - o->box(FL_UP_BOX); - o->color((Fl_Color)179); - o->selection_color(o->color()); - o->tooltip("selection_color() = color()"); - o->labelfont(4); - o->labelcolor(FL_BACKGROUND2_COLOR); + o->box(FL_UP_BOX); + o->color((Fl_Color)179); + o->selection_color(o->color()); + o->tooltip("selection_color() = color()"); + o->labelfont(4); + o->labelcolor(FL_BACKGROUND2_COLOR); } // Fl_Button* o { Fl_Button* o = new Fl_Button(10, 63, 90, 25, "button"); - o->box(FL_UP_BOX); - o->color((Fl_Color)91); - o->selection_color(fl_lighter(o->color())); - o->tooltip("selection_color() = fl_lighter(color())"); + o->box(FL_UP_BOX); + o->color((Fl_Color)91); + o->selection_color(fl_lighter(o->color())); + o->tooltip("selection_color() = fl_lighter(color())"); } // Fl_Button* o { Fl_Button* o = new Fl_Button(10, 90, 90, 25, "button"); - o->box(FL_UP_BOX); - o->color(FL_INACTIVE_COLOR); - o->selection_color(fl_darker(o->color())); - o->tooltip("selection_color() = fl_darker(color())"); - o->labelcolor(FL_BACKGROUND2_COLOR); + o->box(FL_UP_BOX); + o->color(FL_INACTIVE_COLOR); + o->selection_color(fl_darker(o->color())); + o->tooltip("selection_color() = fl_darker(color())"); + o->labelcolor(FL_BACKGROUND2_COLOR); } // Fl_Button* o { Fl_Tabs* o = new Fl_Tabs(10, 120, 320, 215); - o->color(FL_DARK1); - o->selection_color(FL_DARK1); - { Fl_Group* o = new Fl_Group(14, 141, 310, 190, "tab1"); - //o->box(FL_THIN_UP_BOX); - o->color(FL_DARK1); - o->selection_color((Fl_Color)23); - o->hide(); - { Fl_Clock* o = new Fl_Clock(24, 166, 130, 130); - o->box(FL_THIN_UP_BOX); - o->color((Fl_Color)12); - o->selection_color(FL_BACKGROUND2_COLOR); - o->labelcolor(FL_BACKGROUND2_COLOR); - o->tooltip("Fl_Clock with thin up box"); - } // Fl_Clock* o - { new Fl_Progress(22, 306, 290, 20); - } // Fl_Progress* o - { Fl_Clock* o = new Fl_Clock(179, 166, 130, 130); - o->box(FL_THIN_DOWN_BOX); - o->color((Fl_Color)26); - o->tooltip("Fl_Clock with thin down box"); - } // Fl_Clock* o - o->end(); - } // Fl_Group* o - { Fl_Group* o = new Fl_Group(15, 140, 310, 190, "tab2"); - //o->box(FL_THIN_UP_BOX); - o->color(FL_DARK1); - { Fl_Slider* o = new Fl_Slider(20, 161, 25, 155); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_Slider with down box"); - } // Fl_Slider* o - { Fl_Scrollbar* o = new Fl_Scrollbar(50, 161, 25, 155); + o->color(FL_DARK1); + o->selection_color(FL_DARK1); + { Fl_Group* o = new Fl_Group(14, 141, 310, 190, "tab1"); + //o->box(FL_THIN_UP_BOX); + o->color(FL_DARK1); + o->selection_color((Fl_Color)23); + o->hide(); + { Fl_Clock* o = new Fl_Clock(24, 166, 130, 130); + o->box(FL_THIN_UP_BOX); + o->color((Fl_Color)12); + o->selection_color(FL_BACKGROUND2_COLOR); + o->labelcolor(FL_BACKGROUND2_COLOR); + o->tooltip("Fl_Clock with thin up box"); + } // Fl_Clock* o + { new Fl_Progress(22, 306, 290, 20); + } // Fl_Progress* o + { Fl_Clock* o = new Fl_Clock(179, 166, 130, 130); + o->box(FL_THIN_DOWN_BOX); + o->color((Fl_Color)26); + o->tooltip("Fl_Clock with thin down box"); + } // Fl_Clock* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(15, 140, 310, 190, "tab2"); + //o->box(FL_THIN_UP_BOX); + o->color(FL_DARK1); + { Fl_Slider* o = new Fl_Slider(20, 161, 25, 155); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_Slider with down box"); + } // Fl_Slider* o + { Fl_Scrollbar* o = new Fl_Scrollbar(50, 161, 25, 155); o->value(0, 50, 1, 100); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_Scrollbar with down box"); - } // Fl_Scrollbar* o - { Fl_Value_Slider* o = new Fl_Value_Slider(115, 161, 25, 155); - o->box(FL_DOWN_BOX); - } // Fl_Value_Slider* o - { Fl_Value_Output* o = new Fl_Value_Output(240, 265, 75, 25); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_Value_Output with down box"); - } // Fl_Value_Output* o - { Fl_Adjuster* o = new Fl_Adjuster(185, 210, 100, 25); - o->tooltip("Fl_Adjuster"); - } // Fl_Adjuster* o - { Fl_Counter* o = new Fl_Counter(185, 180, 100, 25); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_Counter with down box"); - } // Fl_Counter* o - { Fl_Roller* o = new Fl_Roller(85, 161, 25, 155); - o->box(FL_UP_BOX); - o->tooltip("Fl_Roller with up box"); - } // Fl_Roller* o - { Fl_Value_Input* o = new Fl_Value_Input(155, 265, 75, 25); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_Value_Input with down box"); - } // Fl_Value_Input* o - o->end(); - } // Fl_Group* o - { Fl_Group* o = new Fl_Group(15, 140, 310, 190, "tab3"); - //o->box(FL_THIN_UP_BOX); - o->color(FL_DARK1); - o->hide(); - { Fl_Input* o = new Fl_Input(40, 230, 120, 25); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_Input with down box"); - } // Fl_Input* o - { Fl_Output* o = new Fl_Output(40, 260, 120, 25); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_Output with down box"); - } // Fl_Output* o - { Fl_Text_Editor* o = new Fl_Text_Editor(180, 160, 125, 55); - o->box(FL_DOWN_FRAME); - o->color((Fl_Color)80); - o->tooltip("Fl_Text_Editor with down frame"); - o->textsize(8); - o->buffer(new Fl_Text_Buffer()); - o->buffer()->text("Text editor"); - } // Fl_Text_Editor* o - { Fl_Text_Display* o = new Fl_Text_Display(180, 230, 125, 55); - o->box(FL_DOWN_FRAME); - o->color((Fl_Color)12); - o->tooltip("Fl_Text_Display with down frame"); - o->textsize(8); - o->buffer(new Fl_Text_Buffer()); - o->buffer()->text("Text display"); - } // Fl_Text_Display* o - { Fl_File_Input* o = new Fl_File_Input(40, 290, 265, 30); - o->box(FL_DOWN_BOX); - o->tooltip("Fl_File_Input with down box"); - } // Fl_File_Input* o - o->end(); - } // Fl_Group* o - { Fl_Group* o = new Fl_Group(15, 140, 310, 190, "tab4"); - // o->box(FL_THIN_UP_BOX); - o->color(FL_DARK1); - o->hide(); - { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 160, 120, 25, "Choice 1"); - o->tooltip("Fl_Radio_Round_Button (default)"); - // don't set selection color (use default selection color) - o->value(1); // selected - } // Fl_Radio_Round_Button* o - { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 190, 120, 25, "Choice 2"); - o->tooltip("Fl_Radio_Round_Button (red)"); - o->selection_color(FL_RED); - } // Fl_Radio_Round_Button* o - { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 220, 120, 25, "Choice 3"); - o->tooltip("Fl_Radio_Round_Button (green)"); - o->selection_color(FL_GREEN); - } // Fl_Radio_Round_Button* o - { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 250, 120, 25, "Choice 4"); - o->tooltip("Fl_Radio_Round_Button (blue)"); - o->selection_color(FL_BLUE); - } // Fl_Radio_Round_Button* o - o->end(); - } // Fl_Group* o - o->end(); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_Scrollbar with down box"); + } // Fl_Scrollbar* o + { Fl_Value_Slider* o = new Fl_Value_Slider(115, 161, 25, 155); + o->box(FL_DOWN_BOX); + } // Fl_Value_Slider* o + { Fl_Value_Output* o = new Fl_Value_Output(240, 265, 75, 25); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_Value_Output with down box"); + } // Fl_Value_Output* o + { Fl_Adjuster* o = new Fl_Adjuster(185, 210, 100, 25); + o->tooltip("Fl_Adjuster"); + } // Fl_Adjuster* o + { Fl_Counter* o = new Fl_Counter(185, 180, 100, 25); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_Counter with down box"); + } // Fl_Counter* o + { Fl_Roller* o = new Fl_Roller(85, 161, 25, 155); + o->box(FL_UP_BOX); + o->tooltip("Fl_Roller with up box"); + } // Fl_Roller* o + { Fl_Value_Input* o = new Fl_Value_Input(155, 265, 75, 25); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_Value_Input with down box"); + } // Fl_Value_Input* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(15, 140, 310, 190, "tab3"); + //o->box(FL_THIN_UP_BOX); + o->color(FL_DARK1); + o->hide(); + { Fl_Input* o = new Fl_Input(40, 230, 120, 25); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_Input with down box"); + } // Fl_Input* o + { Fl_Output* o = new Fl_Output(40, 260, 120, 25); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_Output with down box"); + } // Fl_Output* o + { Fl_Text_Editor* o = new Fl_Text_Editor(180, 160, 125, 55); + o->box(FL_DOWN_FRAME); + o->color((Fl_Color)80); + o->tooltip("Fl_Text_Editor with down frame"); + o->textsize(8); + o->buffer(new Fl_Text_Buffer()); + o->buffer()->text("Text editor"); + } // Fl_Text_Editor* o + { Fl_Text_Display* o = new Fl_Text_Display(180, 230, 125, 55); + o->box(FL_DOWN_FRAME); + o->color((Fl_Color)12); + o->tooltip("Fl_Text_Display with down frame"); + o->textsize(8); + o->buffer(new Fl_Text_Buffer()); + o->buffer()->text("Text display"); + } // Fl_Text_Display* o + { Fl_File_Input* o = new Fl_File_Input(40, 290, 265, 30); + o->box(FL_DOWN_BOX); + o->tooltip("Fl_File_Input with down box"); + } // Fl_File_Input* o + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(15, 140, 310, 190, "tab4"); + // o->box(FL_THIN_UP_BOX); + o->color(FL_DARK1); + o->hide(); + { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 160, 120, 25, "Choice 1"); + o->tooltip("Fl_Radio_Round_Button (default)"); + // don't set selection color (use default selection color) + o->value(1); // selected + } // Fl_Radio_Round_Button* o + { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 190, 120, 25, "Choice 2"); + o->tooltip("Fl_Radio_Round_Button (red)"); + o->selection_color(FL_RED); + } // Fl_Radio_Round_Button* o + { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 220, 120, 25, "Choice 3"); + o->tooltip("Fl_Radio_Round_Button (green)"); + o->selection_color(FL_GREEN); + } // Fl_Radio_Round_Button* o + { Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 250, 120, 25, "Choice 4"); + o->tooltip("Fl_Radio_Round_Button (blue)"); + o->selection_color(FL_BLUE); + } // Fl_Radio_Round_Button* o + o->end(); + } // Fl_Group* o + o->end(); } // Fl_Tabs* o { Fl_Box* o = new Fl_Box(341, 10, 80, 50, "thin box\ndown1"); - o->box(FL_THIN_DOWN_BOX); - o->color((Fl_Color)20); - o->labelsize(10); + o->box(FL_THIN_DOWN_BOX); + o->color((Fl_Color)20); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(430, 10, 80, 50, "thin box\nup1"); - o->box(FL_THIN_UP_BOX); - o->color(FL_SELECTION_COLOR); - o->labelcolor((Fl_Color)6); - o->labelsize(10); + o->box(FL_THIN_UP_BOX); + o->color(FL_SELECTION_COLOR); + o->labelcolor((Fl_Color)6); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(341, 71, 80, 44, "thin box\ndown2"); - o->box(FL_THIN_DOWN_BOX); - o->color((Fl_Color)190); - o->labelsize(10); + o->box(FL_THIN_DOWN_BOX); + o->color((Fl_Color)190); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(430, 71, 80, 44, "thin box\nup2"); - o->box(FL_THIN_UP_BOX); - o->color((Fl_Color)96); - o->labelcolor(FL_BACKGROUND2_COLOR); - o->labelsize(10); + o->box(FL_THIN_UP_BOX); + o->color((Fl_Color)96); + o->labelcolor(FL_BACKGROUND2_COLOR); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(341, 127, 80, 50, "box down3"); - o->box(FL_DOWN_BOX); - o->color((Fl_Color)3); - o->labelsize(10); + o->box(FL_DOWN_BOX); + o->color((Fl_Color)3); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(430, 127, 80, 50, "box up3"); - o->box(FL_UP_BOX); - o->color((Fl_Color)104); - o->labelcolor((Fl_Color)3); - o->labelsize(10); + o->box(FL_UP_BOX); + o->color((Fl_Color)104); + o->labelcolor((Fl_Color)3); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(341, 189, 80, 50, "box down4"); - o->box(FL_DOWN_BOX); - o->color((Fl_Color)42); - o->labelcolor(FL_DARK_RED); - o->labelsize(10); + o->box(FL_DOWN_BOX); + o->color((Fl_Color)42); + o->labelcolor(FL_DARK_RED); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(430, 189, 80, 50, "box up4"); - o->box(FL_UP_BOX); - o->color((Fl_Color)30); - o->labelcolor((Fl_Color)26); - o->labelsize(10); + o->box(FL_UP_BOX); + o->color((Fl_Color)30); + o->labelcolor((Fl_Color)26); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(341, 251, 80, 82, "box down5"); - o->box(FL_DOWN_BOX); - o->color((Fl_Color)19); - o->labelcolor((Fl_Color)4); - o->labelsize(10); + o->box(FL_DOWN_BOX); + o->color((Fl_Color)19); + o->labelcolor((Fl_Color)4); + o->labelsize(10); } // Fl_Box* o { Fl_Box* o = new Fl_Box(430, 251, 80, 82, "box up5"); - o->box(FL_UP_BOX); - o->color(FL_FOREGROUND_COLOR); - o->labelcolor(FL_BACKGROUND2_COLOR); - o->labelsize(10); + o->box(FL_UP_BOX); + o->color(FL_FOREGROUND_COLOR); + o->labelcolor(FL_BACKGROUND2_COLOR); + o->labelsize(10); } // Fl_Box* o { Fl_Light_Button* o = new Fl_Light_Button(110, 10, 105, 25, "Light"); - o->box(FL_DOWN_BOX); - o->color(FL_BACKGROUND2_COLOR); - o->selection_color((Fl_Color)30); - o->selection_color((Fl_Color)FL_RED); - o->tooltip("Fl_Light_Button with down box"); + o->box(FL_DOWN_BOX); + o->color(FL_BACKGROUND2_COLOR); + o->selection_color((Fl_Color)30); + o->selection_color((Fl_Color)FL_RED); + o->tooltip("Fl_Light_Button with down box"); } // Fl_Light_Button* o { Fl_Check_Button* o = new Fl_Check_Button(110, 37, 105, 25, "Check"); - o->box(FL_DOWN_FRAME); - o->down_box(FL_DOWN_BOX); - o->color(FL_DARK1); - o->selection_color((Fl_Color)FL_GREEN); - o->tooltip("Fl_Check_Button with down frame"); + o->box(FL_DOWN_FRAME); + o->down_box(FL_DOWN_BOX); + o->color(FL_DARK1); + o->selection_color((Fl_Color)FL_GREEN); + o->tooltip("Fl_Check_Button with down frame"); } // Fl_Check_Button* o { Fl_Input* o = new Fl_Input(220, 10, 100, 25); - o->box(FL_DOWN_BOX); - o->color((Fl_Color)23); - o->tooltip("Fl_Input with down box"); + o->box(FL_DOWN_BOX); + o->color((Fl_Color)23); + o->tooltip("Fl_Input with down box"); } // Fl_Input* o { Fl_Adjuster* o = new Fl_Adjuster(110, 65, 80, 43); - o->box(FL_UP_BOX); - o->color(FL_INACTIVE_COLOR); - o->selection_color(FL_BACKGROUND2_COLOR); - o->labelcolor((Fl_Color)55); - o->tooltip("Fl_Adjuster with up box"); + o->box(FL_UP_BOX); + o->color(FL_INACTIVE_COLOR); + o->selection_color(FL_BACKGROUND2_COLOR); + o->labelcolor((Fl_Color)55); + o->tooltip("Fl_Adjuster with up box"); } // Fl_Adjuster* o { Fl_Text_Editor* o = new Fl_Text_Editor(220, 53, 100, 29, "down frame"); - o->box(FL_DOWN_FRAME); - o->color((Fl_Color)19); - o->selection_color(FL_DARK1); - o->tooltip("Fl_Adjuster with down frame"); + o->box(FL_DOWN_FRAME); + o->color((Fl_Color)19); + o->selection_color(FL_DARK1); + o->tooltip("Fl_Adjuster with down frame"); } // Fl_Text_Editor* o { Fl_Text_Editor* o = new Fl_Text_Editor(220, 99, 100, 38, "up frame"); - o->box(FL_UP_FRAME); - o->color((Fl_Color)19); - o->selection_color(FL_DARK1); - o->tooltip("Fl_Text_Editor with up frame"); + o->box(FL_UP_FRAME); + o->color((Fl_Color)19); + o->selection_color(FL_DARK1); + o->tooltip("Fl_Text_Editor with up frame"); } // Fl_Text_Editor* o } subwin->end(); @@ -327,7 +325,3 @@ public: }; UnitTest schemestest("schemes test", SchemesTest::create); - -// -// End of "$Id$ -// diff --git a/test/unittest_scrollbarsize.cxx b/test/unittest_scrollbarsize.cxx index 4c8a23833..f0aacd137 100644 --- a/test/unittest_scrollbarsize.cxx +++ b/test/unittest_scrollbarsize.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Group.H> @@ -35,21 +33,21 @@ class MyTable : public Fl_Table { static char s[10]; switch ( context ) { case CONTEXT_STARTPAGE: // before page is drawn.. - fl_font(FL_HELVETICA, 8); // set font for drawing operations - return; + fl_font(FL_HELVETICA, 8); // set font for drawing operations + return; case CONTEXT_CELL: // Draw data in cells sprintf(s, "%c", 'A'+ROW+COL); - fl_push_clip(X,Y,W,H); - // Draw cell bg - fl_color(FL_WHITE); fl_rectf(X,Y,W,H); - // Draw cell data - fl_color(FL_GRAY0); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); - // Draw box border - fl_color(color()); fl_rect(X,Y,W,H); - fl_pop_clip(); - return; + fl_push_clip(X,Y,W,H); + // Draw cell bg + fl_color(FL_WHITE); fl_rectf(X,Y,W,H); + // Draw cell data + fl_color(FL_GRAY0); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER); + // Draw box border + fl_color(color()); fl_rect(X,Y,W,H); + fl_pop_clip(); + return; default: - return; + return; } } public: @@ -63,7 +61,7 @@ class MyTable : public Fl_Table { // Cols cols(13); // how many columns col_width_all(10); // default width of columns - end(); // end the Fl_Table group + end(); // end the Fl_Table group } ~MyTable() { } }; @@ -82,60 +80,60 @@ class ScrollBarSizeTest : public Fl_Group { Fl_Text_Display *text_a, *text_b, *text_c; Fl_Browser *makebrowser(int X,int Y,int W,int H,const char*L=0) { - Fl_Browser *b = new Fl_Browser(X,Y,W,H,L); - b->type(FL_MULTI_BROWSER); - b->align(FL_ALIGN_TOP); - for (int t=0; phonetics[t]; t++ ) { - b->add(phonetics[t]); - if ( phonetics[t][0] == 'C' ) b->add("Long entry will show h-bar"); - } - return(b); + Fl_Browser *b = new Fl_Browser(X,Y,W,H,L); + b->type(FL_MULTI_BROWSER); + b->align(FL_ALIGN_TOP); + for (int t=0; phonetics[t]; t++ ) { + b->add(phonetics[t]); + if ( phonetics[t][0] == 'C' ) b->add("Long entry will show h-bar"); + } + return(b); } Fl_Tree *maketree(int X,int Y,int W,int H,const char*L=0) { - Fl_Tree *b = new Fl_Tree(X,Y,W,H,L); - b->type(FL_TREE_SELECT_MULTI); - b->align(FL_ALIGN_TOP); - for (int t=0; phonetics[t]; t++ ) { - b->add(phonetics[t]); - if ( phonetics[t][0] == 'C' ) b->add("Long entry will show h-bar"); - } - return(b); + Fl_Tree *b = new Fl_Tree(X,Y,W,H,L); + b->type(FL_TREE_SELECT_MULTI); + b->align(FL_ALIGN_TOP); + for (int t=0; phonetics[t]; t++ ) { + b->add(phonetics[t]); + if ( phonetics[t][0] == 'C' ) b->add("Long entry will show h-bar"); + } + return(b); } MyTable *maketable(int X,int Y,int W,int H,const char*L=0) { - MyTable *mta = new MyTable(X,Y,W,H,L); - mta->align(FL_ALIGN_TOP); - mta->end(); - return(mta); + MyTable *mta = new MyTable(X,Y,W,H,L); + mta->align(FL_ALIGN_TOP); + mta->end(); + return(mta); } Fl_Text_Display *maketextdisplay(int X,int Y,int W,int H,const char*L=0) { - Fl_Text_Display *dpy = new Fl_Text_Display(X,Y,W,H,L); - Fl_Text_Buffer *buf = new Fl_Text_Buffer(); - dpy->buffer(buf); - for (int t=0; phonetics[t]; t++ ) { - buf->printf("%s\n", phonetics[t]); - if ( phonetics[t][0] == 'C' ) buf->printf("Long entry will show h-bar\n"); - } - return(dpy); + Fl_Text_Display *dpy = new Fl_Text_Display(X,Y,W,H,L); + Fl_Text_Buffer *buf = new Fl_Text_Buffer(); + dpy->buffer(buf); + for (int t=0; phonetics[t]; t++ ) { + buf->printf("%s\n", phonetics[t]); + if ( phonetics[t][0] == 'C' ) buf->printf("Long entry will show h-bar\n"); + } + return(dpy); } void slide_cb2(Fl_Value_Slider *in) { - const char *label = in->label(); - int val = int(in->value()); - //fprintf(stderr, "VAL='%d'\n",val); - if ( strcmp(label,"A: Scroll Size") == 0 ) { - brow_a->scrollbar_size(val); - tree_a->scrollbar_size(val); - table_a->scrollbar_size(val); - text_a->scrollbar_size(val); - } else { - Fl::scrollbar_size(val); - } - in->window()->redraw(); + const char *label = in->label(); + int val = int(in->value()); + //fprintf(stderr, "VAL='%d'\n",val); + if ( strcmp(label,"A: Scroll Size") == 0 ) { + brow_a->scrollbar_size(val); + tree_a->scrollbar_size(val); + table_a->scrollbar_size(val); + text_a->scrollbar_size(val); + } else { + Fl::scrollbar_size(val); + } + in->window()->redraw(); } static void slide_cb(Fl_Widget *w, void *data) { ScrollBarSizeTest *o = (ScrollBarSizeTest*)data; - o->slide_cb2((Fl_Value_Slider*)w); + o->slide_cb2((Fl_Value_Slider*)w); } -public: +public: static Fl_Widget *create() { return(new ScrollBarSizeTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H)); } @@ -146,19 +144,19 @@ public: // _____________ _______________ // |_____________| |_______________| // --- ----- <-- tgrpy - // brow_a brow_b brow_c | 14 | + // brow_a brow_b brow_c | 14 | // ---------- ---------- ---------- --- | <-- browy // | | | | | | |browh | // | | | | | | | | - // ---------- ---------- ---------- --- tgrph + // ---------- ---------- ---------- --- tgrph // | | - // tree_a tree_b tree_c | 20 | + // tree_a tree_b tree_c | 20 | // ---------- ---------- ---------- --- | <-- treey // | | | | | | |treeh | // | | | | | | | | // ---------- ---------- ---------- --- | // | | - // table_a table_b table_c | 20 | + // table_a table_b table_c | 20 | // ---------- ---------- ---------- --- | <-- tabley // | | | | | | |tableh| // | | | | | | | | @@ -203,7 +201,7 @@ public: slide_browa->callback(slide_cb, (void*)this); slide_browa->labelsize(12); int msgbox_x = brow_c->x() + brow_c->w() + 20; - int msgbox_w = W-(msgbox_x-X); + int msgbox_w = W-(msgbox_x-X); Fl_Box *msgbox = new Fl_Box(msgbox_x,browy,msgbox_w,H-Y-48); msgbox->label("\nVerify global scrollbar sizing and per-widget scrollbar sizing. " "Scrollbar's size should change interactively as size sliders are changed. " @@ -212,14 +210,10 @@ public: "for all the 'A' group widgets."); msgbox->labelsize(12); msgbox->align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER|FL_ALIGN_LEFT|FL_ALIGN_WRAP); - msgbox->box(FL_FLAT_BOX); - msgbox->color(53); // 90% gray + msgbox->box(FL_FLAT_BOX); + msgbox->color(53); // 90% gray end(); } }; UnitTest scrollbarsize("scrollbar size", ScrollBarSizeTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_simple_terminal.cxx b/test/unittest_simple_terminal.cxx index 8d6d44f6c..bfda6fe1c 100644 --- a/test/unittest_simple_terminal.cxx +++ b/test/unittest_simple_terminal.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <time.h> @@ -63,7 +61,7 @@ class SimpleTerminal : public Fl_Group { "\033[7m 30% white Courier 14\n" "\033[8m 20% white Courier 14\n" "\033[9m 10% white Courier 14\n" - "\033[0m"); + "\033[0m"); } static void DateTimer_CB(void *data) { Fl_Simple_Terminal *tty = (Fl_Simple_Terminal*)data; @@ -76,7 +74,7 @@ public: return new SimpleTerminal(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); } SimpleTerminal(int x, int y, int w, int h) : Fl_Group(x, y, w, h) { - static Fl_Text_Display::Style_Table_Entry my_stable[] = { // 10 entry grayscale + static Fl_Text_Display::Style_Table_Entry my_stable[] = { // 10 entry grayscale // Font Color Font Face Font Size ANSI Sequence // ---------- ---------------- --------- ------------- { 0xffffff00, FL_COURIER_BOLD, 14 }, // "\033[0m" 0 white 100% @@ -118,7 +116,3 @@ public: }; UnitTest simple_terminal("simple terminal", SimpleTerminal::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_symbol.cxx b/test/unittest_symbol.cxx index ddd2d28b4..ee95d1505 100644 --- a/test/unittest_symbol.cxx +++ b/test/unittest_symbol.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Box.H> @@ -44,7 +42,7 @@ class SymbolTest : public Fl_Widget fl_color(FL_BLACK); fl_draw(txt, X, Y, 10, 10, FL_ALIGN_INSIDE|FL_ALIGN_TOP|FL_ALIGN_LEFT, 0, 1); } -public: +public: static Fl_Widget *create() { return new SymbolTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); } @@ -63,15 +61,15 @@ public: fl_font(FL_HELVETICA, fsize); int xx = x0+10; int yy = y0+10; - DrawTextAndBoxes("Text" ,xx,yy); yy += fsize+10; // check no symbols - DrawTextAndBoxes("@->" ,xx,yy); yy += fsize+10; // check symbol alone - DrawTextAndBoxes("@-> " ,xx,yy); yy += fsize+10; // check symbol with trailing space - DrawTextAndBoxes("@-> Rt Arrow" ,xx,yy); yy += fsize+10; // check symbol at left edge - DrawTextAndBoxes("Lt Arrow @<-" ,xx,yy); yy += fsize+10; // check symbol at right edge - DrawTextAndBoxes("@-> Rt/Lt @<-" ,xx,yy); yy += fsize+10; // check symbol at lt+rt edges - DrawTextAndBoxes("@@ At/Lt @<-" ,xx,yy); yy += fsize+10; // check @@ at left, symbol at right - DrawTextAndBoxes("@-> Lt/At @@" ,xx,yy); yy += fsize+10; // check symbol at left, @@ at right - DrawTextAndBoxes("@@ At/At @@" ,xx,yy); yy += fsize+10; // check @@ at left+right + DrawTextAndBoxes("Text" ,xx,yy); yy += fsize+10; // check no symbols + DrawTextAndBoxes("@->" ,xx,yy); yy += fsize+10; // check symbol alone + DrawTextAndBoxes("@-> " ,xx,yy); yy += fsize+10; // check symbol with trailing space + DrawTextAndBoxes("@-> Rt Arrow" ,xx,yy); yy += fsize+10; // check symbol at left edge + DrawTextAndBoxes("Lt Arrow @<-" ,xx,yy); yy += fsize+10; // check symbol at right edge + DrawTextAndBoxes("@-> Rt/Lt @<-" ,xx,yy); yy += fsize+10; // check symbol at lt+rt edges + DrawTextAndBoxes("@@ At/Lt @<-" ,xx,yy); yy += fsize+10; // check @@ at left, symbol at right + DrawTextAndBoxes("@-> Lt/At @@" ,xx,yy); yy += fsize+10; // check symbol at left, @@ at right + DrawTextAndBoxes("@@ At/At @@" ,xx,yy); yy += fsize+10; // check @@ at left+right xx = x0+200; yy = y0+10; DrawTextAndBoxes("Line1\nLine2" ,xx,yy); yy += (fsize+10)*2; // check 2 lines, no symbol @@ -89,7 +87,3 @@ public: }; UnitTest symbolExtents("symbol text", SymbolTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_text.cxx b/test/unittest_text.cxx index 5768ae779..80cce72e1 100644 --- a/test/unittest_text.cxx +++ b/test/unittest_text.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Box.H> @@ -41,7 +39,7 @@ class TextExtentsTest : public Fl_Widget fl_color(FL_BLACK); fl_draw(txt, X, Y); } -public: +public: static Fl_Widget *create() { return new TextExtentsTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); } @@ -60,12 +58,12 @@ public: fl_font(FL_HELVETICA, 30); int xx = x0+55; int yy = y0+40; - DrawTextAndBoxes("!abcdeABCDE\"#A", xx, yy); yy += 50; // mixed string - DrawTextAndBoxes("oacs", xx, yy); xx += 100; // small glyphs - DrawTextAndBoxes("qjgIPT", xx, yy); yy += 50; xx -= 100; // glyphs with descenders - DrawTextAndBoxes("````````", xx, yy); yy += 50; // high small glyphs - DrawTextAndBoxes("--------", xx, yy); yy += 50; // mid small glyphs - DrawTextAndBoxes("________", xx, yy); yy += 50; // low small glyphs + DrawTextAndBoxes("!abcdeABCDE\"#A", xx, yy); yy += 50; // mixed string + DrawTextAndBoxes("oacs", xx, yy); xx += 100; // small glyphs + DrawTextAndBoxes("qjgIPT", xx, yy); yy += 50; xx -= 100; // glyphs with descenders + DrawTextAndBoxes("````````", xx, yy); yy += 50; // high small glyphs + DrawTextAndBoxes("--------", xx, yy); yy += 50; // mid small glyphs + DrawTextAndBoxes("________", xx, yy); yy += 50; // low small glyphs fl_font(FL_HELVETICA, 14); fl_color(FL_RED); fl_draw("fl_measure bounding box in RED", xx, yy); yy += 20; @@ -82,7 +80,3 @@ public: }; UnitTest textExtents("rendering text", TextExtentsTest::create); - -// -// End of "$Id$" -// diff --git a/test/unittest_viewport.cxx b/test/unittest_viewport.cxx index 98d557049..52026256a 100644 --- a/test/unittest_viewport.cxx +++ b/test/unittest_viewport.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl_Box.H> @@ -23,11 +21,11 @@ //------- test viewport clipping ---------- // class ViewportTest : public Fl_Box { -public: +public: static Fl_Widget *create() { return new ViewportTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); } - ViewportTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { + ViewportTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { label("Testing Viewport Alignment\n\n" "Only green lines should be visible.\n" "If red lines are visible in the corners of this window,\n" @@ -49,7 +47,3 @@ public: }; UnitTest viewport("viewport test", ViewportTest::create); - -// -// End of "$Id$ -// diff --git a/test/unittests.cxx b/test/unittests.cxx index 5d0a4ad6e..12b65fe2a 100644 --- a/test/unittests.cxx +++ b/test/unittests.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Unit tests for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2017 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Fltk unit tests @@ -29,19 +27,19 @@ #include <FL/Fl_Help_View.H> #include <FL/Fl_Group.H> #include <FL/Fl_Box.H> -#include <FL/fl_draw.H> // fl_text_extents() +#include <FL/fl_draw.H> // fl_text_extents() // WINDOW/WIDGET SIZES -#define MAINWIN_W 700 // main window w() -#define MAINWIN_H 400 // main window h() -#define BROWSER_X 10 // browser x() -#define BROWSER_Y 25 // browser y() -#define BROWSER_W 150 // browser w() -#define BROWSER_H MAINWIN_H-35 // browser h() -#define TESTAREA_X (BROWSER_W + 20) // test area x() -#define TESTAREA_Y 25 // test area y() -#define TESTAREA_W (MAINWIN_W - BROWSER_W - 30) // test area w() -#define TESTAREA_H BROWSER_H // test area h() +#define MAINWIN_W 700 // main window w() +#define MAINWIN_H 400 // main window h() +#define BROWSER_X 10 // browser x() +#define BROWSER_Y 25 // browser y() +#define BROWSER_W 150 // browser w() +#define BROWSER_H MAINWIN_H-35 // browser h() +#define TESTAREA_X (BROWSER_W + 20) // test area x() +#define TESTAREA_Y 25 // test area y() +#define TESTAREA_W (MAINWIN_W - BROWSER_W - 30) // test area w() +#define TESTAREA_H BROWSER_H // test area h() typedef void (*UnitTestCallback)(const char*,Fl_Group*); @@ -197,7 +195,3 @@ int main(int argc, char **argv) { Browser_CB(browser,0); return(Fl::run()); } - -// -// End of "$Id$". -// diff --git a/test/utf8.cxx b/test/utf8.cxx index 5dd9f57df..ed1dd1063 100644 --- a/test/utf8.cxx +++ b/test/utf8.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // UTF-8 test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -77,13 +75,13 @@ static void cb_exit(Fl_Button*, void*) { class FontDisplay : public Fl_Widget { void draw(void); - + public: int font, size; - + int test_fixed_pitch(void); - - FontDisplay(Fl_Boxtype B, int X, int Y, int W, int H, const char *L = 0) + + FontDisplay(Fl_Boxtype B, int X, int Y, int W, int H, const char *L = 0) : Fl_Widget(X, Y, W, H, L) { box(B); @@ -109,23 +107,23 @@ int FontDisplay::test_fixed_pitch(void) { int w1, w2; int h1, h2; - + w1 = w2 = 0; h1 = h2 = 0; - + fl_font((Fl_Font)font, size); - + fl_measure("MHMHWWMHMHMHM###WWX__--HUW", w1, h1, 0); fl_measure("iiiiiiiiiiiiiiiiiiiiiiiiii", w2, h2, 0); - + if (w1 == w2) return 1; // exact match - fixed pitch - + // Is the font "nearly" fixed pitch? If it is within 5%, say it is... double f1 = (double)w1; double f2 = (double)w2; double delta = fabs(f1 - f2) * 5.0; if (delta <= f1) return 2; // nearly fixed pitch... - + return 0; // NOT fixed pitch } @@ -136,14 +134,14 @@ static FontDisplay *textobj; static void size_cb(Fl_Widget *, long) { int size_idx = sizeobj->value(); - + if (!size_idx) return; - + const char *c = sizeobj->text(size_idx); - + while (*c < '0' || *c > '9') c++; // find the first numeric char pickedsize = atoi(c); // convert the number string to a value - + // Now set the font view to the selected size and redraw it. textobj->size = pickedsize; textobj->redraw(); @@ -153,13 +151,13 @@ static void size_cb(Fl_Widget *, long) static void font_cb(Fl_Widget *, long) { int font_idx = fontobj->value() + first_free; - + if (!font_idx) return; font_idx--; - + textobj->font = font_idx; sizeobj->clear(); - + int size_count = numsizes[font_idx-first_free]; int *size_array = sizes[font_idx-first_free]; if (!size_count) @@ -192,7 +190,7 @@ static void font_cb(Fl_Widget *, long) { // find the nearest available size to the current picked size if (size_array[i] <= pickedsize) w = i; - + char buf[16]; sprintf(buf, "@b%d", size_array[i]); sizeobj->add(buf); @@ -200,7 +198,7 @@ static void font_cb(Fl_Widget *, long) sizeobj->value(w + 1); } size_cb(sizeobj, 0); // force selection of nearest valid size, then redraw - + // Now check to see if the font looks like a fixed pitch font or not... int looks_fixed = textobj->test_fixed_pitch(); if(looks_fixed) @@ -231,11 +229,11 @@ static void choose_cb(Fl_Widget *, long) const char *name = Fl::get_font_name((Fl_Font)font_idx, &font_type); printf("idx %d\nUser name :%s:\n", font_idx, name); printf("FLTK name :%s:\n", Fl::get_font((Fl_Font)font_idx)); - + Fl::set_font(extra_font, (Fl_Font)font_idx); - // Fl::set_font(extra_font, Fl::get_font((Fl_Font)font_idx)); + // Fl::set_font(extra_font, Fl::get_font((Fl_Font)font_idx)); } - + int size_idx = sizeobj->value(); if (!size_idx) { @@ -246,10 +244,10 @@ static void choose_cb(Fl_Widget *, long) const char *c = sizeobj->text(size_idx); while (*c < '0' || *c > '9') c++; // find the first numeric char int pickedsize = atoi(c); // convert the number string to a value - + printf("size %d\n\n", pickedsize); } - + fflush(stdout); main_win->redraw(); } @@ -266,30 +264,30 @@ static void own_face_cb(Fl_Widget *, void *) int font_idx; int cursor_restore = 0; static int i_was = -1; // used to keep track of where we were in the list... - + if (i_was < 0) { // not been here before i_was = 1; } else { i_was = fontobj->topline(); // record which was the topmost visible line fontobj->clear(); - // Populating the font widget can be slower than an old dog with three legs + // Populating the font widget can be slower than an old dog with three legs // on a bad day, show a wait cursor fnt_chooser_win->cursor(FL_CURSOR_WAIT); cursor_restore = 1; } - - + + // Populate the font list with the names of the fonts found for (font_idx = first_free; font_idx < font_count; font_idx++) { int font_type; const char *name = Fl::get_font_name((Fl_Font)font_idx, &font_type); char buffer[128]; - + if(own_face->value() == 0) { char *p = buffer; // if the font is BOLD, set the bold attribute in the list - if (font_type & FL_BOLD) { + if (font_type & FL_BOLD) { *p++ = '@'; *p++ = 'b'; } @@ -301,9 +299,9 @@ static void own_face_cb(Fl_Widget *, void *) *p++ = '@'; *p++ = '.'; strcpy(p, name); - } else { + } else { // Show font in its own face - // this is neat, but really slow on some systems: + // this is neat, but really slow on some systems: // uses each font to display its own name sprintf (buffer, "@F%d@.%s", font_idx, name); } @@ -334,7 +332,7 @@ static void create_font_widget() i += fl_utf8encode((unsigned int)c, label + i); } label[i] = 0; - + // Create the window layout fnt_chooser_win = new Fl_Double_Window(380, 420, "Font Selector"); { @@ -342,61 +340,61 @@ static void create_font_widget() { Fl_Group *textgroup = new Fl_Group(0, 0, 380, 105); { - + textobj = new FontDisplay(FL_FRAME_BOX, 10, 10, 360, 90, label); textobj->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP); textobj->color(53, 3); - + textgroup->box(FL_FLAT_BOX); textgroup->resizable(textobj); textgroup->end(); - } + } Fl_Group *fontgroup = new Fl_Group(0, 105, 380, 315); - { + { fontobj = new Fl_Hold_Browser(10, 110, 290, 270); fontobj->box(FL_FRAME_BOX); fontobj->color(53, 3); fontobj->callback(font_cb); fnt_chooser_win->resizable(fontobj); - + sizeobj = new Fl_Hold_Browser(310, 110, 60, 270); sizeobj->box(FL_FRAME_BOX); sizeobj->color(53, 3); sizeobj->callback(size_cb); - + // Create the status bar Fl_Group *stat_bar = new Fl_Group (10, 385, 380, 30); - { + { fnt_cnt = new Fl_Value_Output(10, 390, 40, 20); fnt_cnt->label("fonts"); fnt_cnt->align(FL_ALIGN_RIGHT); - + fix_prop = new Fl_Output(100, 390, 40, 20); fix_prop->color(FL_BACKGROUND_COLOR); fix_prop->value("prop"); fix_prop->clear_visible_focus(); - + own_face = new Fl_Check_Button(150, 390, 40, 20, "Self"); own_face->value(0); own_face->type(FL_TOGGLE_BUTTON); own_face->clear_visible_focus(); own_face->callback(own_face_cb); own_face->tooltip("Display font names in their own face"); - + Fl_Box * dummy = new Fl_Box(220, 390, 1, 1); - + choose_btn = new Fl_Button(240, 385, 60, 30); choose_btn->label("Select"); choose_btn->callback(choose_cb); - + refresh_btn = new Fl_Button(310, 385, 60, 30); refresh_btn->label("Refresh"); refresh_btn->callback(refresh_cb); - + stat_bar->resizable (dummy); stat_bar->end(); } - + fontgroup->box(FL_FLAT_BOX); fontgroup->resizable(fontobj); fontgroup->end(); @@ -405,7 +403,7 @@ static void create_font_widget() } fnt_chooser_win->resizable(tile); fnt_chooser_win->end(); - fnt_chooser_win->callback((Fl_Callback*)cb_exit); + fnt_chooser_win->callback((Fl_Callback*)cb_exit); } } @@ -413,27 +411,27 @@ static void create_font_widget() int make_font_chooser(void) { int font_idx; - + // create the widget frame create_font_widget(); - + // Load the systems available fonts - ask for everything - // font_count = Fl::set_fonts("*"); + // font_count = Fl::set_fonts("*"); #ifdef _WIN32 font_count = Fl::set_fonts("*"); #elif defined(__APPLE__) font_count = Fl::set_fonts("*"); #else - // Load the systems available fonts - ask for everything that claims to be + // Load the systems available fonts - ask for everything that claims to be // iso10646 compatible font_count = Fl::set_fonts("-*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1"); #endif - - // allocate space for the sizes and numsizes array, now we know how many + + // allocate space for the sizes and numsizes array, now we know how many // entries it needs sizes = new int*[font_count]; numsizes = new int[font_count]; - + // Populate the font list with the names of the fonts found first_free = FL_FREE_FONT; for (font_idx = first_free; font_idx < font_count; font_idx++) @@ -450,20 +448,20 @@ int make_font_chooser(void) sizes[font_idx-first_free][j] = size_array[j]; } } // end of font list filling loop - + // Call this once to get the font browser loaded up own_face_cb(NULL, 0); - + fontobj->value(1); // optional hard-coded font for testing - do not use! - // fontobj->textfont(261); - + // fontobj->textfont(261); + font_cb(fontobj, 0); - + fnt_cnt->value(font_count); - + return font_count; - + } // make_font_chooser /* End of Font Chooser Widget code */ @@ -568,16 +566,16 @@ public: int main(int argc, char** argv) { int l; - const char *latin1 = + const char *latin1 = "\x41\x42\x43\x61\x62\x63\xe0\xe8\xe9\xef\xe2\xee\xf6\xfc\xe3\x31\x32\x33"; char *utf8 = (char*) malloc(strlen(latin1) * 5 + 1); l = 0; - // l = fl_latin12utf((const unsigned char*)latin1, strlen(latin1), utf8); + // l = fl_latin12utf((const unsigned char*)latin1, strlen(latin1), utf8); l = fl_utf8froma(utf8, (strlen(latin1) * 5 + 1), latin1, strlen(latin1)); - + make_font_chooser(); extra_font = FL_TIMES_BOLD_ITALIC; - + /* setup the extra font */ Fl::set_font(extra_font, #ifdef _WIN32 @@ -588,15 +586,15 @@ int main(int argc, char** argv) "-*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1" #endif ); - + main_win = new Fl_Double_Window (200 + 5*75, 400, "Unicode Display Test"); main_win->begin(); - + Fl_Input i1(5, 5, 190, 25); utf8[l] = '\0'; i1.value(utf8); Fl_Scroll scroll(200,0,5 * 75,400); - + int off = 2; int end_list = 0x10000 / 16; if (argc > 1) { @@ -629,50 +627,50 @@ int main(int argc, char** argv) } scroll.end(); main_win->resizable(scroll); - + thescroll = &scroll; - + char *utf8l = (char*) malloc(strlen(utf8) * 3 + 1); Fl_Input i2(5, 35, 190, 25); l = fl_utf_tolower((const unsigned char*)utf8, l, utf8l); utf8l[l] = '\0'; i2.value(utf8l); - + char *utf8u = (char*) malloc(strlen(utf8l) * 3 + 1); Fl_Input i3(5, 65, 190, 25); l = fl_utf_toupper((const unsigned char*)utf8l, l, utf8u); utf8u[l] = '\0'; i3.value(utf8u); - + const char *ltr_txt = "\\->e\xCC\x82=\xC3\xAA"; Fl_Input i4(5, 90, 190, 25); i4.value(ltr_txt); i4.textfont(extra_font); - - wchar_t r_to_l_txt[] = {/*8238,*/ + + wchar_t r_to_l_txt[] = {/*8238,*/ 1610, 1608, 1606, 1604, 1603, 1608, 1583, 0}; - + char abuf[40]; // l = fl_unicode2utf(r_to_l_txt, 8, abuf); l = fl_utf8fromwc(abuf, 40, r_to_l_txt, 8); abuf[l] = 0; - + right_left_input i5(5, 115, 190, 50); i5.textfont(extra_font); i5.textsize(30); i5.value(abuf); - + Fl_Input i7(5, 230, 190, 25); Fl_Input i8(5, 260, 190, 25); i7.callback(i7_cb, &i8); i7.textsize(20); i7.value(abuf); i7.when(FL_WHEN_CHANGED); - - wchar_t r_to_l_txt1[] = { /*8238,*/ - 1610, 0x20, 1608, 0x20, 1606, 0x20, + + wchar_t r_to_l_txt1[] = { /*8238,*/ + 1610, 0x20, 1608, 0x20, 1606, 0x20, 1604, 0x20, 1603, 0x20, 1608, 0x20, 1583, 0}; - + // l = fl_unicode2utf(r_to_l_txt1, 14, abuf); l = fl_utf8fromwc(abuf, 40, r_to_l_txt1, 14); abuf[l] = 0; @@ -680,27 +678,27 @@ int main(int argc, char** argv) i6.textfont(extra_font); i6.textsize(30); i6.value(abuf); - + // Now try Greg Ercolano's Japanese test sequence // SOME JAPANESE UTF-8 TEXT - const char *utfstr = + const char *utfstr = "\xe4\xbd\x95\xe3\x82\x82\xe8\xa1" - "\x8c\xe3\x82\x8b\xe3\x80\x82"; - + "\x8c\xe3\x82\x8b\xe3\x80\x82"; + UCharDropBox db(5, 300, 190, 30); db.textsize(16); db.value("unichar drop box"); - + Fl_Output o9(5, 330, 190, 45); o9.textfont(extra_font); o9.textsize(30); o9.value(utfstr); - + main_win->end(); main_win->callback((Fl_Callback*)cb_exit); fl_set_status(0, 370, 100, 30); - + main_win->show(argc,argv); fnt_chooser_win->show(); @@ -713,7 +711,3 @@ int main(int argc, char** argv) return ret; } - -// -// End of "$Id$". -// diff --git a/test/windowfocus.cxx b/test/windowfocus.cxx index 87238e69a..84c0741b4 100644 --- a/test/windowfocus.cxx +++ b/test/windowfocus.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Cross-window show/focus test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <FL/Fl.H> @@ -40,8 +38,8 @@ int main(int argc, char **argv) { Fl_Box *b = new Fl_Box(10, 10, 280, 130); b->label("Type something to pop the subwindow up. " - "The focus should stay on the input, " - "and you should be able to continue typing."); + "The focus should stay on the input, " + "and you should be able to continue typing."); b->align(FL_ALIGN_WRAP | FL_ALIGN_LEFT | FL_ALIGN_INSIDE); input1 = new Fl_Input(10, 150, 150, 25); @@ -58,7 +56,3 @@ int main(int argc, char **argv) { return Fl::run(); } - -// -// End of "$Id$". -// diff --git a/zlib/Makefile b/zlib/Makefile index 213f66ba3..61fdfed42 100644 --- a/zlib/Makefile +++ b/zlib/Makefile @@ -1,6 +1,4 @@ # -# "$Id$" -# # GNU ZIP library makefile for the Fast Light Toolkit (FLTK). # # Copyright 1998-2011 by Bill Spitzak and others. @@ -9,11 +7,11 @@ # 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 +# https://www.fltk.org/COPYING.php # -# Please report all bugs and problems on the following page: +# Please see the following page on how to report bugs and issues: # -# http://www.fltk.org/str.php +# https://www.fltk.org/bugs.php # include ../makeinclude @@ -95,8 +93,3 @@ depend: $(OBJS:.o=.c) include makedepend $(OBJS): ../makeinclude - - -# -# End of "$Id$". -# -- GitLab