summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt16
-rw-r--r--src/Fl.cxx86
-rw-r--r--src/Fl_Adjuster.cxx104
-rw-r--r--src/Fl_BMP_Image.cxx17
-rw-r--r--src/Fl_Bitmap.cxx52
-rw-r--r--src/Fl_Box.cxx17
-rw-r--r--src/Fl_Browser.cxx199
-rw-r--r--src/Fl_Browser_.cxx302
-rw-r--r--src/Fl_Browser_load.cxx28
-rw-r--r--src/Fl_Button.cxx37
-rw-r--r--src/Fl_Chart.cxx160
-rw-r--r--src/Fl_Check_Browser.cxx358
-rw-r--r--src/Fl_Check_Button.cxx8
-rw-r--r--src/Fl_Choice.cxx26
-rw-r--r--src/Fl_Clock.cxx13
-rw-r--r--src/Fl_Color_Chooser.cxx77
-rw-r--r--src/Fl_Copy_Surface.cxx12
-rw-r--r--src/Fl_Counter.cxx31
-rw-r--r--src/Fl_Device.cxx20
-rw-r--r--src/Fl_Dial.cxx13
-rw-r--r--src/Fl_Double_Window.cxx12
-rw-r--r--src/Fl_File_Browser.cxx193
-rw-r--r--src/Fl_File_Chooser.cxx12
-rw-r--r--src/Fl_File_Chooser.fl14
-rw-r--r--src/Fl_File_Chooser2.cxx430
-rw-r--r--src/Fl_File_Icon.cxx259
-rw-r--r--src/Fl_File_Icon2.cxx695
-rw-r--r--src/Fl_File_Input.cxx87
-rw-r--r--src/Fl_GIF_Image.cxx25
-rw-r--r--src/Fl_Gl_Choice.H14
-rw-r--r--src/Fl_Gl_Choice.cxx48
-rw-r--r--src/Fl_Gl_Device_Plugin.cxx12
-rw-r--r--src/Fl_Gl_Overlay.cxx12
-rw-r--r--src/Fl_Gl_Window.cxx122
-rw-r--r--src/Fl_Gl_Window_Driver.H12
-rw-r--r--src/Fl_Graphics_Driver.cxx16
-rw-r--r--src/Fl_Group.cxx159
-rw-r--r--src/Fl_Help_Dialog.cxx20
-rw-r--r--src/Fl_Help_Dialog.fl14
-rw-r--r--src/Fl_Help_Dialog_Dox.cxx16
-rw-r--r--src/Fl_Help_View.cxx2521
-rw-r--r--src/Fl_Image.cxx112
-rw-r--r--src/Fl_Image_Reader.cxx4
-rw-r--r--src/Fl_Image_Reader.h4
-rw-r--r--src/Fl_Image_Surface.cxx21
-rw-r--r--src/Fl_Input.cxx208
-rw-r--r--src/Fl_Input_.cxx196
-rw-r--r--src/Fl_Input_Choice.cxx24
-rw-r--r--src/Fl_JPEG_Image.cxx29
-rw-r--r--src/Fl_Light_Button.cxx137
-rw-r--r--src/Fl_MacOS_Sys_Menu_Bar.mm46
-rw-r--r--src/Fl_Menu.cxx362
-rw-r--r--src/Fl_Menu_.cxx134
-rw-r--r--src/Fl_Menu_Bar.cxx14
-rw-r--r--src/Fl_Menu_Button.cxx16
-rw-r--r--src/Fl_Menu_Window.cxx23
-rw-r--r--src/Fl_Menu_add.cxx126
-rw-r--r--src/Fl_Menu_global.cxx16
-rw-r--r--src/Fl_Multi_Label.cxx12
-rw-r--r--src/Fl_Native_File_Chooser.cxx25
-rw-r--r--src/Fl_Native_File_Chooser_FLTK.cxx81
-rw-r--r--src/Fl_Native_File_Chooser_GTK.cxx117
-rw-r--r--src/Fl_Native_File_Chooser_MAC.mm197
-rw-r--r--src/Fl_Native_File_Chooser_WIN32.cxx405
-rw-r--r--src/Fl_Overlay_Window.cxx12
-rw-r--r--src/Fl_PNG_Image.cxx35
-rw-r--r--src/Fl_PNM_Image.cxx49
-rw-r--r--src/Fl_Pack.cxx16
-rw-r--r--src/Fl_Paged_Device.cxx26
-rw-r--r--src/Fl_Pixmap.cxx136
-rw-r--r--src/Fl_Positioner.cxx14
-rw-r--r--src/Fl_Preferences.cxx82
-rw-r--r--src/Fl_Printer.cxx14
-rw-r--r--src/Fl_Progress.cxx25
-rw-r--r--src/Fl_Repeat_Button.cxx23
-rw-r--r--src/Fl_Return_Button.cxx15
-rw-r--r--src/Fl_Roller.cxx36
-rw-r--r--src/Fl_Round_Button.cxx13
-rw-r--r--src/Fl_SVG_Image.cxx20
-rw-r--r--src/Fl_Screen_Driver.H22
-rw-r--r--src/Fl_Screen_Driver.cxx114
-rw-r--r--src/Fl_Scroll.cxx106
-rw-r--r--src/Fl_Scrollbar.cxx91
-rw-r--r--src/Fl_Shared_Image.cxx85
-rw-r--r--src/Fl_Simple_Terminal.cxx26
-rw-r--r--src/Fl_Single_Window.cxx27
-rw-r--r--src/Fl_Slider.cxx173
-rw-r--r--src/Fl_Spinner.cxx31
-rw-r--r--src/Fl_Sys_Menu_Bar.cxx18
-rw-r--r--src/Fl_Sys_Menu_Bar_Driver.H12
-rw-r--r--src/Fl_System_Driver.H10
-rw-r--r--src/Fl_System_Driver.cxx48
-rw-r--r--src/Fl_Table.cxx356
-rw-r--r--src/Fl_Table_Row.cxx108
-rw-r--r--src/Fl_Tabs.cxx74
-rw-r--r--src/Fl_Text_Buffer.cxx406
-rw-r--r--src/Fl_Text_Display.cxx209
-rw-r--r--src/Fl_Text_Editor.cxx70
-rw-r--r--src/Fl_Tile.cxx45
-rw-r--r--src/Fl_Tiled_Image.cxx55
-rw-r--r--src/Fl_Tooltip.cxx42
-rw-r--r--src/Fl_Tree.cxx774
-rw-r--r--src/Fl_Tree_Item.cxx416
-rw-r--r--src/Fl_Tree_Item_Array.cxx54
-rw-r--r--src/Fl_Tree_Prefs.cxx26
-rw-r--r--src/Fl_Valuator.cxx14
-rw-r--r--src/Fl_Value_Input.cxx14
-rw-r--r--src/Fl_Value_Output.cxx12
-rw-r--r--src/Fl_Value_Slider.cxx27
-rw-r--r--src/Fl_Widget.cxx56
-rw-r--r--src/Fl_Widget_Surface.cxx22
-rw-r--r--src/Fl_Window.cxx60
-rw-r--r--src/Fl_Window_Driver.H18
-rw-r--r--src/Fl_Window_Driver.cxx24
-rw-r--r--src/Fl_Window_fullscreen.cxx14
-rw-r--r--src/Fl_Window_hotspot.cxx12
-rw-r--r--src/Fl_Window_iconize.cxx12
-rw-r--r--src/Fl_Wizard.cxx44
-rw-r--r--src/Fl_XBM_Image.cxx23
-rw-r--r--src/Fl_XColor.H18
-rw-r--r--src/Fl_XPM_Image.cxx63
-rw-r--r--src/Fl_abort.cxx12
-rw-r--r--src/Fl_add_idle.cxx18
-rw-r--r--src/Fl_arg.cxx82
-rw-r--r--src/Fl_cocoa.mm444
-rw-r--r--src/Fl_compose.cxx30
-rw-r--r--src/Fl_display.cxx20
-rw-r--r--src/Fl_get_key.cxx12
-rw-r--r--src/Fl_get_key_mac.cxx60
-rw-r--r--src/Fl_get_key_win32.cxx150
-rw-r--r--src/Fl_get_system_colors.cxx57
-rw-r--r--src/Fl_grab.cxx13
-rw-r--r--src/Fl_lock.cxx50
-rw-r--r--src/Fl_own_colormap.cxx18
-rw-r--r--src/Fl_visual.cxx21
-rw-r--r--src/Fl_win32.cxx1172
-rw-r--r--src/Fl_x.cxx464
-rw-r--r--src/Makefile12
-rw-r--r--src/Xutf8.h117
-rw-r--r--src/cgdebug.h38
-rw-r--r--src/cmap.cxx62
-rw-r--r--src/config_lib.h18
-rw-r--r--src/drivers/Android/Fl_Android_Application.H12
-rw-r--r--src/drivers/Android/Fl_Android_Application.cxx13
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Clipping.H12
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Clipping.cxx13
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.H12
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.cxx13
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Font.H12
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Font.cxx13
-rw-r--r--src/drivers/Android/Fl_Android_Image_Surface_Driver.cxx12
-rw-r--r--src/drivers/Android/Fl_Android_Screen_Driver.H16
-rw-r--r--src/drivers/Android/Fl_Android_Screen_Driver.cxx13
-rw-r--r--src/drivers/Android/Fl_Android_Screen_Keyboard.cxx30
-rw-r--r--src/drivers/Android/Fl_Android_System_Driver.H10
-rw-r--r--src/drivers/Android/Fl_Android_System_Driver.cxx114
-rw-r--r--src/drivers/Android/Fl_Android_Window_Driver.H16
-rw-r--r--src/drivers/Android/Fl_Android_Window_Driver.cxx40
-rw-r--r--src/drivers/Android/README.txt2
-rw-r--r--src/drivers/Android/stb_truetype.h108
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm34
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H20
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx120
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H20
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx12
-rw-r--r--src/drivers/Cocoa/Fl_MacOS_Sys_Menu_Bar_Driver.H12
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.H12
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.cxx30
-rw-r--r--src/drivers/GDI/Fl_Font.H12
-rw-r--r--src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx14
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.H12
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx12
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx12
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx30
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx32
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx122
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx12
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx14
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx16
-rw-r--r--src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx13
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Display_Device.H12
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx13
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H12
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx24
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx12
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx12
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx15
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx12
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx13
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx16
-rw-r--r--src/drivers/Pico/Fl_Pico_Graphics_Driver.H12
-rw-r--r--src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx18
-rw-r--r--src/drivers/Pico/Fl_Pico_Screen_Driver.H12
-rw-r--r--src/drivers/Pico/Fl_Pico_Screen_Driver.cxx13
-rw-r--r--src/drivers/Pico/Fl_Pico_System_Driver.H12
-rw-r--r--src/drivers/Pico/Fl_Pico_System_Driver.cxx13
-rw-r--r--src/drivers/Pico/Fl_Pico_Window_Driver.H12
-rw-r--r--src/drivers/Pico/Fl_Pico_Window_Driver.cxx12
-rw-r--r--src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.H12
-rw-r--r--src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx14
-rw-r--r--src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.H16
-rw-r--r--src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx19
-rw-r--r--src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.H12
-rw-r--r--src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx12
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.H12
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx14
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.H12
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx15
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx12
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H14
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx13
-rw-r--r--src/drivers/Posix/Fl_Posix_Printer_Driver.cxx45
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.H10
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx14
-rw-r--r--src/drivers/PostScript/Fl_PostScript.cxx152
-rw-r--r--src/drivers/PostScript/Fl_PostScript_image.cxx24
-rw-r--r--src/drivers/Quartz/Fl_Font.H12
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H12
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx14
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H14
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx14
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx12
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx12
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx52
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx34
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx18
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx12
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx16
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx14
-rw-r--r--src/drivers/SVG/Fl_SVG_File_Surface.cxx32
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx30
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H14
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx102
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.H10
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx114
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H16
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx40
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.H16
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx222
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.H14
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.cxx124
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.H20
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.cxx43
-rw-r--r--src/drivers/Xlib/Fl_Font.H22
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.cxx12
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H12
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx12
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx12
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx26
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx132
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx66
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx64
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx22
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx34
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx12
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.cxx12
-rw-r--r--src/dump_compose.c8
-rw-r--r--src/filename_absolute.cxx62
-rw-r--r--src/filename_expand.cxx14
-rw-r--r--src/filename_ext.cxx12
-rw-r--r--src/filename_isdir.cxx22
-rw-r--r--src/filename_list.cxx20
-rw-r--r--src/filename_match.cxx56
-rw-r--r--src/filename_setext.cxx13
-rw-r--r--src/fl_arc.cxx52
-rw-r--r--src/fl_ask.cxx52
-rw-r--r--src/fl_boxtype.cxx144
-rw-r--r--src/fl_call_main.c12
-rw-r--r--src/fl_cmap.h518
-rw-r--r--src/fl_color.cxx16
-rw-r--r--src/fl_cursor.cxx23
-rw-r--r--src/fl_curve.cxx18
-rw-r--r--src/fl_diamond_box.cxx12
-rw-r--r--src/fl_dnd_win32.cxx44
-rw-r--r--src/fl_dnd_x.cxx79
-rw-r--r--src/fl_draw.cxx56
-rw-r--r--src/fl_draw_pixmap.cxx36
-rw-r--r--src/fl_encoding_latin1.cxx48
-rw-r--r--src/fl_encoding_mac_roman.cxx42
-rw-r--r--src/fl_engraved_label.cxx12
-rw-r--r--src/fl_file_dir.cxx81
-rw-r--r--src/fl_font.cxx12
-rw-r--r--src/fl_gleam.cxx13
-rw-r--r--src/fl_gtk.cxx21
-rw-r--r--src/fl_images_core.cxx31
-rw-r--r--src/fl_labeltype.cxx28
-rw-r--r--src/fl_open_uri.cxx20
-rw-r--r--src/fl_oval_box.cxx12
-rw-r--r--src/fl_overlay.cxx12
-rw-r--r--src/fl_overlay_visual.cxx36
-rw-r--r--src/fl_plastic.cxx33
-rw-r--r--src/fl_read_image.cxx13
-rw-r--r--src/fl_rect.cxx13
-rw-r--r--src/fl_round_box.cxx20
-rw-r--r--src/fl_rounded_box.cxx22
-rw-r--r--src/fl_scroll_area.cxx12
-rw-r--r--src/fl_set_font.cxx16
-rw-r--r--src/fl_shadow_box.cxx12
-rw-r--r--src/fl_shortcut.cxx28
-rw-r--r--src/fl_show_colormap.cxx18
-rw-r--r--src/fl_symbols.cxx78
-rw-r--r--src/fl_utf8.cxx20
-rw-r--r--src/fl_vertex.cxx12
-rw-r--r--src/flstring.c40
-rw-r--r--src/flstring.h16
-rw-r--r--src/forms_bitmap.cxx12
-rw-r--r--src/forms_compatibility.cxx12
-rw-r--r--src/forms_free.cxx32
-rw-r--r--src/forms_fselect.cxx20
-rw-r--r--src/forms_pixmap.cxx12
-rw-r--r--src/forms_timer.cxx26
-rw-r--r--src/gl_draw.cxx36
-rw-r--r--src/gl_start.cxx14
-rw-r--r--src/glut_compatibility.cxx30
-rw-r--r--src/glut_font.cxx56
-rw-r--r--src/numericsort.c24
-rw-r--r--src/print_panel.cxx28
-rw-r--r--src/print_panel.h14
-rw-r--r--src/scandir_posix.c12
-rw-r--r--src/scandir_win32.c80
-rw-r--r--src/screen_xywh.cxx13
-rw-r--r--src/utf8_internal.h14
-rw-r--r--src/vsnprintf.c267
-rw-r--r--src/xutf8/COPYING8
-rw-r--r--src/xutf8/case.c14
-rw-r--r--src/xutf8/fl_wcwidth.c12
-rw-r--r--src/xutf8/headers/case_tbl.txt16
-rw-r--r--src/xutf8/headers/spacing_tbl.txt20
-rw-r--r--src/xutf8/headers/tbl.txt244
-rw-r--r--src/xutf8/imKStoUCS.c52
-rw-r--r--src/xutf8/is_right2left.c13
-rw-r--r--src/xutf8/is_spacing.c13
-rw-r--r--src/xutf8/keysym2Ucs.c13
-rw-r--r--src/xutf8/lcUniConv/cp936ext.h12
-rw-r--r--src/xutf8/lcUniConv/gbk_tab_to_h.c2
-rw-r--r--src/xutf8/lcUniConv/iso8859_9e.h2
-rw-r--r--src/xutf8/mk_wcwidth.c6
-rw-r--r--src/xutf8/test.c139
-rw-r--r--src/xutf8/test2.c95
-rw-r--r--src/xutf8/ucs2fontmap.c127
-rw-r--r--src/xutf8/ucs2fontmap.c.mini13
-rw-r--r--src/xutf8/utf8Input.c195
-rw-r--r--src/xutf8/utf8Utils.c227
-rw-r--r--src/xutf8/utf8Wrap.c379
-rw-r--r--src/xutf8/utils/Makefile4
-rwxr-xr-xsrc/xutf8/utils/case.sh14
-rw-r--r--src/xutf8/utils/conv_gen.c43
-rw-r--r--src/xutf8/utils/convert_map.c25
-rw-r--r--src/xutf8/utils/create_table.c59
-rw-r--r--src/xutf8/utils/euc_tw.c12
-rwxr-xr-xsrc/xutf8/utils/non_spacing.sh14
-rwxr-xr-xsrc/xutf8/utils/tbl_gen.sh16
352 files changed, 10698 insertions, 12738 deletions
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 (&bull;) Unicode: U+2022, UTF-8 (hex): e2 80 a2
+ {
+ // draw bullet (&bull;) 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. "&amp;"
- 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>&nbsp; </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>&nbsp; </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,7 +1,5 @@
//
-// "$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,7 +1,5 @@
//
-// "$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&nbsp</code>&nbsp&nbsp&nbsp%c\n",
- p[0],(p-compose_pairs)/2+0xA0);
+ printf("<td><code>%c&nbsp</code>&nbsp&nbsp&nbsp%c\n",
+ p[0],(p-compose_pairs)/2+0xA0);
else
- printf("<td><code>%c%c</code>&nbsp&nbsp&nbsp%c\n",
- p[0],p[1],(p-compose_pairs)/2+0xA0);
+ printf("<td><code>%c%c</code>&nbsp&nbsp&nbsp%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