summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron M. Ucko <ucko@debian.org>2017-01-12 21:40:18 -0500
committerAaron M. Ucko <ucko@debian.org>2017-01-12 21:40:18 -0500
commit10b16ce2223d6869b94dfb68aff76e62971842ee (patch)
tree5479fe884c9d817aaafaf6618cc104ae12f89d9f /src
parenta3d0ced57399c9fd8075377b7310d545f968e524 (diff)
New upstream version 1.3.4
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt246
-rw-r--r--src/Fl.cxx163
-rw-r--r--src/Fl_BMP_Image.cxx32
-rw-r--r--src/Fl_Bitmap.cxx12
-rw-r--r--src/Fl_Browser.cxx40
-rw-r--r--src/Fl_Browser_.cxx16
-rw-r--r--src/Fl_Choice.cxx44
-rw-r--r--src/Fl_Clock.cxx16
-rw-r--r--src/Fl_Copy_Surface.cxx104
-rw-r--r--src/Fl_Device.cxx38
-rw-r--r--src/Fl_Double_Window.cxx48
-rw-r--r--src/Fl_File_Browser.cxx41
-rw-r--r--src/Fl_File_Chooser.cxx28
-rw-r--r--src/Fl_File_Chooser.fl49
-rw-r--r--src/Fl_File_Chooser2.cxx77
-rw-r--r--src/Fl_File_Icon.cxx6
-rw-r--r--src/Fl_File_Icon2.cxx8
-rw-r--r--src/Fl_GDI_Printer.cxx20
-rw-r--r--src/Fl_GIF_Image.cxx26
-rw-r--r--src/Fl_Gl_Choice.H20
-rw-r--r--src/Fl_Gl_Choice.cxx135
-rw-r--r--src/Fl_Gl_Device_Plugin.cxx134
-rw-r--r--src/Fl_Gl_Window.cxx144
-rw-r--r--src/Fl_Group.cxx4
-rw-r--r--src/Fl_Help_Dialog.cxx8
-rw-r--r--src/Fl_Help_Dialog.fl22
-rw-r--r--src/Fl_Help_View.cxx1169
-rw-r--r--src/Fl_Image.cxx382
-rw-r--r--src/Fl_Image_Surface.cxx146
-rw-r--r--src/Fl_Input.cxx17
-rw-r--r--src/Fl_Input_.cxx6
-rw-r--r--src/Fl_JPEG_Image.cxx28
-rw-r--r--src/Fl_Light_Button.cxx30
-rw-r--r--src/Fl_Menu.cxx57
-rw-r--r--src/Fl_Menu_.cxx169
-rw-r--r--src/Fl_Menu_add.cxx68
-rw-r--r--src/Fl_Native_File_Chooser_FLTK.cxx133
-rw-r--r--src/Fl_Native_File_Chooser_GTK.cxx3
-rw-r--r--src/Fl_Native_File_Chooser_MAC.mm30
-rw-r--r--src/Fl_Native_File_Chooser_WIN32.cxx266
-rw-r--r--src/Fl_PNG_Image.cxx30
-rw-r--r--src/Fl_PNM_Image.cxx50
-rw-r--r--src/Fl_Paged_Device.cxx27
-rw-r--r--src/Fl_Pixmap.cxx94
-rw-r--r--src/Fl_PostScript.cxx79
-rw-r--r--src/Fl_Preferences.cxx48
-rw-r--r--src/Fl_Printer.cxx16
-rw-r--r--src/Fl_Quartz_Printer.mm21
-rw-r--r--src/Fl_Return_Button.cxx13
-rw-r--r--src/Fl_Scroll.cxx78
-rw-r--r--src/Fl_Scrollbar.cxx10
-rw-r--r--src/Fl_Shared_Image.cxx288
-rw-r--r--src/Fl_Slider.cxx12
-rw-r--r--src/Fl_Sys_Menu_Bar.mm196
-rw-r--r--src/Fl_Table.cxx18
-rw-r--r--src/Fl_Tabs.cxx114
-rw-r--r--src/Fl_Text_Display.cxx293
-rw-r--r--src/Fl_Text_Editor.cxx228
-rw-r--r--src/Fl_Tile.cxx21
-rw-r--r--src/Fl_Tiled_Image.cxx117
-rw-r--r--src/Fl_Tooltip.cxx71
-rw-r--r--src/Fl_Tree.cxx120
-rw-r--r--src/Fl_Tree_Item.cxx121
-rw-r--r--src/Fl_Tree_Prefs.cxx51
-rw-r--r--src/Fl_Valuator.cxx53
-rw-r--r--src/Fl_Widget.cxx30
-rw-r--r--src/Fl_Window.cxx103
-rw-r--r--src/Fl_Window_fullscreen.cxx9
-rw-r--r--src/Fl_Window_shape.cxx78
-rw-r--r--src/Fl_XBM_Image.cxx11
-rw-r--r--src/Fl_XPM_Image.cxx9
-rw-r--r--src/Fl_cocoa.mm2040
-rw-r--r--src/Fl_get_key_mac.cxx6
-rw-r--r--src/Fl_get_system_colors.cxx42
-rw-r--r--src/Fl_grab.cxx8
-rw-r--r--src/Fl_lock.cxx33
-rw-r--r--src/Fl_own_colormap.cxx6
-rw-r--r--src/Fl_win32.cxx302
-rw-r--r--src/Fl_x.cxx116
-rw-r--r--src/Makefile231
-rw-r--r--src/Xutf8.h9
-rw-r--r--src/filename_absolute.cxx6
-rw-r--r--src/filename_expand.cxx6
-rw-r--r--src/fl_arci.cxx4
-rw-r--r--src/fl_ask.cxx66
-rw-r--r--src/fl_boxtype.cxx148
-rw-r--r--src/fl_color_mac.cxx5
-rw-r--r--src/fl_diamond_box.cxx10
-rw-r--r--src/fl_dnd_win32.cxx8
-rw-r--r--src/fl_draw.cxx20
-rw-r--r--src/fl_draw_image.cxx66
-rw-r--r--src/fl_draw_image_mac.cxx40
-rw-r--r--src/fl_draw_image_win32.cxx21
-rw-r--r--src/fl_draw_pixmap.cxx6
-rw-r--r--src/fl_file_dir.cxx33
-rw-r--r--src/fl_font.cxx10
-rw-r--r--src/fl_font_mac.cxx58
-rw-r--r--src/fl_font_win32.cxx8
-rw-r--r--src/fl_font_x.cxx14
-rw-r--r--src/fl_font_xft.cxx8
-rw-r--r--src/fl_gleam.cxx31
-rw-r--r--src/fl_gtk.cxx12
-rw-r--r--src/fl_line_style.cxx12
-rw-r--r--src/fl_oval_box.cxx8
-rw-r--r--src/fl_read_image.cxx169
-rw-r--r--src/fl_read_image_mac.cxx8
-rw-r--r--src/fl_read_image_win32.cxx14
-rw-r--r--src/fl_rect.cxx51
-rw-r--r--src/fl_round_box.cxx8
-rw-r--r--src/fl_rounded_box.cxx42
-rw-r--r--src/fl_scroll_area.cxx6
-rw-r--r--src/fl_set_font.cxx16
-rw-r--r--src/fl_set_fonts_mac.cxx10
-rw-r--r--src/fl_shadow_box.cxx8
-rw-r--r--src/fl_shortcut.cxx111
-rw-r--r--src/fl_utf.c74
-rw-r--r--src/fl_utf8.cxx1110
-rw-r--r--src/fl_vertex.cxx4
-rw-r--r--src/flstring.h14
-rw-r--r--src/gl_draw.cxx227
-rw-r--r--src/gl_start.cxx10
-rw-r--r--src/glut_compatability.cxx24
-rw-r--r--src/makedepend1958
-rw-r--r--src/makefile.wat229
-rw-r--r--src/numericsort.c12
-rw-r--r--src/print_panel.cxx61
-rw-r--r--src/print_panel.h7
-rw-r--r--src/ps_image.cxx288
-rw-r--r--src/scandir.c7
-rw-r--r--src/screen_xywh.cxx100
-rw-r--r--src/vsnprintf.c12
-rw-r--r--src/xutf8/README60
-rw-r--r--src/xutf8/case.c6
-rw-r--r--src/xutf8/is_spacing.c4
-rw-r--r--src/xutf8/stamp-h1
-rw-r--r--src/xutf8/stamp-h.in1
-rw-r--r--src/xutf8/utf8Input.c6
-rw-r--r--src/xutf8/utf8Wrap.c61
138 files changed, 8798 insertions, 5708 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d53ab80..e90fe40 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -197,8 +197,7 @@ set(CFILES
fl_utf.c
)
-add_definitions(-DFL_LIBRARY)
-if(APPLE)
+if (APPLE AND NOT OPTION_APPLE_X11)
set(MMFILES
Fl_cocoa.mm
Fl_Quartz_Printer.mm
@@ -208,153 +207,174 @@ if(APPLE)
else()
set(MMFILES
)
-endif(APPLE)
+endif (APPLE AND NOT OPTION_APPLE_X11)
#######################################################################
-FL_ADD_LIBRARY(fltk STATIC "${CPPFILES};${MMFILES};${CFILES};fl_call_main.c")
-if(USE_THREADS)
- target_link_libraries(fltk ${CMAKE_THREAD_LIBS_INIT} ${LIB_dl})
-endif(USE_THREADS)
+# prepare source files for shared and static FLTK libraries
+
+set (SHARED_FILES ${CPPFILES} ${MMFILES} ${CFILES})
+
+set (STATIC_FILES ${SHARED_FILES})
+
+if (WIN32)
+ list(APPEND STATIC_FILES fl_call_main.c)
+endif (WIN32)
+
+add_definitions(-DFL_LIBRARY)
+
+#######################################################################
+
+# prepare optional libs for shared and static FLTK libraries
+
+set (OPTIONAL_LIBS)
+
+if (LIB_dl)
+ list(APPEND OPTIONAL_LIBS ${LIB_dl})
+endif (LIB_dl)
-if(USE_X11)
- target_link_libraries(fltk ${X11_LIBRARIES})
-endif(USE_X11)
+if (USE_THREADS)
+ list(APPEND OPTIONAL_LIBS ${CMAKE_THREAD_LIBS_INIT})
+endif (USE_THREADS)
-if(WIN32)
- target_link_libraries(fltk comctl32)
-endif(WIN32)
+if (USE_X11)
+ list(APPEND OPTIONAL_LIBS ${X11_LIBRARIES})
+endif (USE_X11)
-if(FLTK_HAVE_CAIRO)
- target_link_libraries(fltk fltk_cairo ${PKG_CAIRO_LIBRARIES})
-ENDif(FLTK_HAVE_CAIRO)
+if (WIN32)
+ list(APPEND OPTIONAL_LIBS comctl32)
+endif (WIN32)
-if(HAVE_XINERAMA)
- target_link_libraries(fltk ${X11_Xinerama_LIB})
-endif(HAVE_XINERAMA)
+if (FLTK_HAVE_CAIRO)
+ list(APPEND OPTIONAL_LIBS fltk_cairo ${PKG_CAIRO_LIBRARIES})
+ENDif (FLTK_HAVE_CAIRO)
-if(HAVE_XFIXES)
- target_link_libraries(fltk ${X11_Xfixes_LIB})
-endif(HAVE_XFIXES)
+if (HAVE_XINERAMA)
+ list(APPEND OPTIONAL_LIBS ${X11_Xinerama_LIB})
+endif (HAVE_XINERAMA)
-if(HAVE_XCURSOR)
- target_link_libraries(fltk ${X11_Xcursor_LIB})
-endif(HAVE_XCURSOR)
+if (HAVE_XFIXES)
+ list(APPEND OPTIONAL_LIBS ${X11_Xfixes_LIB})
+endif (HAVE_XFIXES)
-if(USE_XFT)
- target_link_libraries(fltk ${X11_Xft_LIB})
- if(LIB_fontconfig)
- target_link_libraries(fltk ${LIB_fontconfig})
- endif(LIB_fontconfig)
-endif(USE_XFT)
+if (HAVE_XCURSOR)
+ list(APPEND OPTIONAL_LIBS ${X11_Xcursor_LIB})
+endif (HAVE_XCURSOR)
+
+if (HAVE_XRENDER)
+ list(APPEND OPTIONAL_LIBS ${X11_Xrender_LIB})
+endif (HAVE_XRENDER)
+
+if (USE_XFT)
+ list(APPEND OPTIONAL_LIBS ${X11_Xft_LIB})
+ if (LIB_fontconfig)
+ list(APPEND OPTIONAL_LIBS ${LIB_fontconfig})
+ endif (LIB_fontconfig)
+endif (USE_XFT)
+
+#######################################################################
+
+FL_ADD_LIBRARY(fltk STATIC "${STATIC_FILES}")
+target_link_libraries(fltk ${OPTIONAL_LIBS})
#######################################################################
+
FL_ADD_LIBRARY(fltk_forms STATIC "${FLCPPFILES}")
target_link_libraries(fltk_forms fltk)
#######################################################################
+
FL_ADD_LIBRARY(fltk_images STATIC "${IMGCPPFILES}")
-target_link_libraries(fltk_images fltk ${FLTK_PNG_LIBRARIES}
- ${FLTK_JPEG_LIBRARIES} ${FLTK_ZLIB_LIBRARIES})
+target_link_libraries(fltk_images fltk)
-if(OPTION_USE_SYSTEM_LIBJPEG)
+if (OPTION_USE_SYSTEM_LIBJPEG)
target_link_libraries(fltk_images ${FLTK_JPEG_LIBRARIES})
else()
target_link_libraries(fltk_images fltk_jpeg)
-endif(OPTION_USE_SYSTEM_LIBJPEG)
+endif (OPTION_USE_SYSTEM_LIBJPEG)
-if(OPTION_USE_SYSTEM_ZLIB)
+if (OPTION_USE_SYSTEM_ZLIB)
target_link_libraries(fltk_images ${FLTK_ZLIB_LIBRARIES})
else()
target_link_libraries(fltk_images fltk_z)
-endif(OPTION_USE_SYSTEM_ZLIB)
+endif (OPTION_USE_SYSTEM_ZLIB)
-if(OPTION_USE_SYSTEM_LIBPNG)
+if (OPTION_USE_SYSTEM_LIBPNG)
target_link_libraries(fltk_images ${FLTK_PNG_LIBRARIES})
else()
target_link_libraries(fltk_images fltk_png)
-endif(OPTION_USE_SYSTEM_LIBPNG)
+endif (OPTION_USE_SYSTEM_LIBPNG)
#######################################################################
-if(OPENGL_FOUND)
+
+if (OPENGL_FOUND)
FL_ADD_LIBRARY(fltk_gl STATIC "${GLCPPFILES}")
target_link_libraries(fltk_gl fltk ${OPENGL_LIBRARIES})
-endif(OPENGL_FOUND)
+endif (OPENGL_FOUND)
#######################################################################
+# Build shared libraries (optional)
#######################################################################
-if(OPTION_BUILD_SHARED_LIBS)
-
-#######################################################################
-FL_ADD_LIBRARY(fltk SHARED "${CPPFILES};${MMFILES};${CFILES}")
-if(USE_THREADS)
- target_link_libraries(fltk_SHARED ${CMAKE_THREAD_LIBS_INIT} ${LIB_dl})
-endif(USE_THREADS)
+# Note to devs: As of 08 Aug 2016 we can build shared libs (dlls)
+# under Windows with Visual Studio (MSVC) but we can't link for instance
+# fltk_images_SHARED with fltk_SHARED - we have to use fltk, i.e. the
+# "static" object library instead. I don't know how to fix this, but
+# at least we can build shared libraries (dlls) with Visual Studio.
+# AlbrechtS
+
+if (OPTION_BUILD_SHARED_LIBS)
+
+ FL_ADD_LIBRARY(fltk SHARED "${SHARED_FILES}")
+ target_link_libraries(fltk_SHARED ${OPTIONAL_LIBS})
+
+ ###################################################################
+
+ FL_ADD_LIBRARY(fltk_forms SHARED "${FLCPPFILES}")
+ if (MSVC)
+ target_link_libraries(fltk_forms_SHARED fltk)
+ else ()
+ target_link_libraries(fltk_forms_SHARED fltk_SHARED)
+ endif (MSVC)
+
+ ###################################################################
+
+ FL_ADD_LIBRARY(fltk_images SHARED "${IMGCPPFILES}")
+ if (MSVC)
+ target_link_libraries(fltk_images_SHARED fltk)
+ else ()
+ target_link_libraries(fltk_images_SHARED fltk_SHARED)
+ endif (MSVC)
+
+ if (OPTION_USE_SYSTEM_LIBJPEG)
+ target_link_libraries(fltk_images_SHARED ${FLTK_JPEG_LIBRARIES})
+ else()
+ target_link_libraries(fltk_images_SHARED fltk_jpeg_SHARED)
+ endif (OPTION_USE_SYSTEM_LIBJPEG)
+
+ if (OPTION_USE_SYSTEM_LIBPNG)
+ target_link_libraries(fltk_images_SHARED ${FLTK_PNG_LIBRARIES})
+ else()
+ target_link_libraries(fltk_images_SHARED fltk_png_SHARED)
+ endif (OPTION_USE_SYSTEM_LIBPNG)
+
+ if (OPTION_USE_SYSTEM_ZLIB)
+ target_link_libraries(fltk_images_SHARED ${FLTK_ZLIB_LIBRARIES})
+ else()
+ target_link_libraries(fltk_images_SHARED fltk_z_SHARED)
+ endif (OPTION_USE_SYSTEM_ZLIB)
+
+ ###################################################################
+
+ if (OPENGL_FOUND)
+ FL_ADD_LIBRARY(fltk_gl SHARED "${GLCPPFILES}")
+ if (MSVC)
+ target_link_libraries(fltk_gl_SHARED fltk ${OPENGL_LIBRARIES})
+ else ()
+ target_link_libraries(fltk_gl_SHARED fltk_SHARED ${OPENGL_LIBRARIES})
+ endif (MSVC)
+ endif (OPENGL_FOUND)
+
+endif (OPTION_BUILD_SHARED_LIBS)
-if(USE_X11)
- target_link_libraries(fltk_SHARED ${X11_LIBRARIES})
-endif(USE_X11)
-
-if(WIN32)
- target_link_libraries(fltk_SHARED comctl32)
-endif(WIN32)
-
-if(FLTK_HAVE_CAIRO)
- target_link_libraries(fltk_SHARED fltk_cairo_SHARED ${PKG_CAIRO_LIBRARIES})
-ENDif(FLTK_HAVE_CAIRO)
-
-if(HAVE_XINERAMA)
- target_link_libraries(fltk_SHARED ${X11_Xinerama_LIB})
-endif(HAVE_XINERAMA)
-
-if(USE_XFT)
- target_link_libraries(fltk_SHARED ${X11_Xft_LIB})
- if(LIB_fontconfig)
- target_link_libraries(fltk_SHARED ${LIB_fontconfig})
- endif(LIB_fontconfig)
-endif(USE_XFT)
-
-#######################################################################
-FL_ADD_LIBRARY(fltk_forms SHARED "${FLCPPFILES}")
-target_link_libraries(fltk_forms_SHARED fltk_SHARED)
-
-if(USE_THREADS)
- target_link_libraries(fltk_forms_SHARED ${CMAKE_THREAD_LIBS_INIT} ${LIB_dl})
-endif(USE_THREADS)
-
-if(USE_X11)
- target_link_libraries(fltk_forms_SHARED ${X11_LIBRARIES})
-endif(USE_X11)
-
-#######################################################################
-FL_ADD_LIBRARY(fltk_images SHARED "${IMGCPPFILES}")
-target_link_libraries(fltk_images_SHARED fltk_SHARED)
-
-if(OPTION_USE_SYSTEM_LIBJPEG)
- target_link_libraries(fltk_images_SHARED ${FLTK_JPEG_LIBRARIES})
-else()
- target_link_libraries(fltk_images_SHARED fltk_jpeg_SHARED)
-endif(OPTION_USE_SYSTEM_LIBJPEG)
-
-if(OPTION_USE_SYSTEM_ZLIB)
- target_link_libraries(fltk_images_SHARED ${FLTK_ZLIB_LIBRARIES})
-else()
- target_link_libraries(fltk_images_SHARED fltk_z_SHARED)
-endif(OPTION_USE_SYSTEM_ZLIB)
-
-if(OPTION_USE_SYSTEM_LIBPNG)
- target_link_libraries(fltk_images_SHARED ${FLTK_PNG_LIBRARIES})
-else()
- target_link_libraries(fltk_images_SHARED fltk_png_SHARED)
-endif(OPTION_USE_SYSTEM_LIBPNG)
-
-#######################################################################
-if(OPENGL_FOUND)
- FL_ADD_LIBRARY(fltk_gl SHARED "${GLCPPFILES}")
- target_link_libraries(fltk_gl_SHARED fltk_SHARED ${OPENGL_LIBRARIES})
-endif(OPENGL_FOUND)
-
-#######################################################################
-endif(OPTION_BUILD_SHARED_LIBS)
#######################################################################
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 05618d6..07d9cc1 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl.cxx 10364 2014-10-08 12:47:20Z ossman $"
+// "$Id: Fl.cxx 11321 2016-03-08 16:58:43Z AlbrechtS $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -51,7 +51,6 @@
#include <FL/x.H>
#include <ctype.h>
-#include <stdio.h>
#include <stdlib.h>
#include "flstring.h"
@@ -73,6 +72,22 @@ extern double fl_mac_flush_and_wait(double time_to_wait);
//
// Globals...
//
+
+// Pointers you can use to change FLTK to a foreign language.
+// Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx
+#if !defined(__APPLE__) || defined(FL_DOXYGEN)
+ const char* fl_local_alt = "Alt"; ///< string pointer used in shortcuts, you can change it to another language
+ const char* fl_local_ctrl = "Ctrl"; ///< string pointer used in shortcuts, you can change it to another language
+ const char* fl_local_meta = "Meta"; ///< string pointer used in shortcuts, you can change it to another language
+ const char* fl_local_shift = "Shift"; ///< string pointer used in shortcuts, you can change it to another language
+#else
+ const char* fl_local_alt = "\xe2\x8c\xa5\\"; // U+2325 (option key)
+ const char* fl_local_ctrl = "\xe2\x8c\x83\\"; // U+2303 (up arrowhead)
+ const char* fl_local_meta = "\xe2\x8c\x98\\"; // U+2318 (place of interest sign)
+ const char* fl_local_shift = "\xe2\x87\xa7\\"; // U+21E7 (upwards white arrow)
+#endif
+
+// Apple App Menu
#if defined(__APPLE__) || defined(FL_DOXYGEN)
const char *Fl_Mac_App_Menu::about = "About %@";
const char *Fl_Mac_App_Menu::print = "Print Front Window";
@@ -82,6 +97,7 @@ const char *Fl_Mac_App_Menu::hide_others = "Hide Others";
const char *Fl_Mac_App_Menu::show = "Show All";
const char *Fl_Mac_App_Menu::quit = "Quit %@";
#endif // __APPLE__
+
#ifndef FL_DOXYGEN
Fl_Widget *Fl::belowmouse_,
*Fl::pushed_,
@@ -127,16 +143,33 @@ char const * const Fl::clipboard_image = "image";
// 'Fl::version()' - Return the API version number...
//
-double
/**
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.
*/
-Fl::version() {
+double Fl::version() {
return FL_VERSION;
}
/**
+ Returns the compiled-in value of the FL_API_VERSION constant. This
+ is useful for checking the version of a shared library.
+*/
+int Fl::api_version() {
+ return FL_API_VERSION;
+}
+
+/**
+ Returns the compiled-in value of the FL_ABI_VERSION constant. This
+ is useful for checking the version of a shared library.
+*/
+int Fl::abi_version() {
+ return FL_ABI_VERSION;
+}
+
+/**
Gets the default scrollbar size used by
Fl_Browser_,
Fl_Help_View,
@@ -681,20 +714,13 @@ Fl_X* Fl_X::first;
Fl_Window* fl_find(Window xid) {
Fl_X *window;
for (Fl_X **pp = &Fl_X::first; (window = *pp); pp = &window->next)
-#if defined(WIN32) || defined(USE_X11)
- if (window->xid == xid)
-#elif defined(__APPLE_QUARTZ__)
- if (window->xid == xid && !window->w->window())
-#else
-# error unsupported platform
-#endif // __APPLE__
- {
+ if (window->xid == xid) {
if (window != Fl_X::first && !Fl::modal()) {
- // make this window be first to speed up searches
- // this is not done if modal is true to avoid messing up modal stack
- *pp = window->next;
- window->next = Fl_X::first;
- Fl_X::first = window;
+ // make this window be first to speed up searches
+ // this is not done if modal is true to avoid messing up modal stack
+ *pp = window->next;
+ window->next = Fl_X::first;
+ Fl_X::first = window;
}
return window->w;
}
@@ -802,7 +828,7 @@ static handler_link *handlers = 0;
- \ref FL_SCREEN_CONFIGURATION_CHANGED events.
Under X11, this event requires the libXrandr.so shared library to be
loadable at run-time and the X server to implement the RandR extension.
- - \ref FL_FULLSCREEN events sent to a window that enters of leaves
+ - \ref FL_FULLSCREEN events sent to a window that enters or leaves
fullscreen mode.
- System events that FLTK does not recognize. See fl_xevent.
- \e Some other events when the widget FLTK selected returns
@@ -829,7 +855,7 @@ void Fl::remove_handler(Fl_Event_Handler ha) {
handler_link *l, *p;
// Search for the handler in the list...
- for (l = handlers, p = 0; l && l->handle != ha; p = l, l = l->next);
+ for (l = handlers, p = 0; l && l->handle != ha; p = l, l = l->next) {/*empty*/}
if (l) {
// Found it, so remove it from the list...
@@ -1124,10 +1150,41 @@ void fl_throw_focus(Fl_Widget *o) {
////////////////////////////////////////////////////////////////
+// Find the first active_r() widget, starting at the widget wi and
+// walking up the widget hierarchy to the top level window.
+//
+// In other words: find_active() returns an active group that contains
+// the inactive widget and all inactive parent groups.
+//
+// This is used to send FL_SHORTCUT events to the Fl::belowmouse() widget
+// in case the target widget itself is inactive_r(). In this case the event
+// is sent to the first active_r() parent.
+//
+// This prevents sending events to inactive widgets that might get the
+// input focus otherwise. The search is fast and light and avoids calling
+// inactive_r() multiple times.
+// See STR #3216.
+//
+// Returns: first active_r() widget "above" the widget wi or NULL if
+// no widget is active. May return the top level window.
+
+static Fl_Widget *find_active(Fl_Widget *wi) {
+ Fl_Widget *found = 0;
+ for (; wi; wi = wi->parent()) {
+ if (wi->active()) {
+ if (!found) found = wi;
+ }
+ else found = 0;
+ }
+ return found;
+}
+
+////////////////////////////////////////////////////////////////
+
// Call to->handle(), but first replace the mouse x/y with the correct
// values to account for nested windows. 'window' is the outermost
// window the event was posted to by the system:
-static int send(int event, Fl_Widget* to, Fl_Window* window) {
+static int send_event(int event, Fl_Widget* to, Fl_Window* window) {
int dx, dy;
int old_event = Fl::e_number;
if (window) {
@@ -1269,7 +1326,7 @@ int Fl::handle_(int e, Fl_Window* window)
else if (modal() && wi != modal()) return 0;
pushed_ = wi;
Fl_Tooltip::current(wi);
- if (send(e, wi, window)) return 1;
+ if (send_event(e, wi, window)) return 1;
// raise windows that are clicked on:
window->show();
return 1;
@@ -1313,11 +1370,11 @@ int Fl::handle_(int e, Fl_Window* window)
Fl::event_y_root() >= tooltip->y() && Fl::event_y_root() < tooltip->y() + tooltip->h() );
}
// if inside, send event to tooltip window instead of background window
- if (inside) ret = send(e, tooltip, window);
- else ret = (wi && send(e, wi, window));
+ if (inside) ret = send_event(e, tooltip, window);
+ else ret = (wi && send_event(e, wi, window));
} else
#endif
- ret = (wi && send(e, wi, window));
+ ret = (wi && send_event(e, wi, window));
if (pbm != belowmouse()) {
#ifdef DEBUG
printf("Fl::handle(e=%d, window=%p);\n", e, window);
@@ -1337,7 +1394,7 @@ int Fl::handle_(int e, Fl_Window* window)
wi = pushed();
pushed_ = 0; // must be zero before callback is done!
} else if (modal() && wi != modal()) return 0;
- int r = send(e, wi, window);
+ int r = send_event(e, wi, window);
fl_fix_focus();
return r;}
@@ -1359,7 +1416,7 @@ int Fl::handle_(int e, Fl_Window* window)
// a KEYUP there. I believe that the current solution is
// "close enough".
for (wi = grab() ? grab() : focus(); wi; wi = wi->parent())
- if (send(FL_KEYUP, wi, window)) return 1;
+ if (send_event(FL_KEYUP, wi, window)) return 1;
return 0;
case FL_KEYBOARD:
@@ -1373,7 +1430,7 @@ int Fl::handle_(int e, Fl_Window* window)
// Try it as keystroke, sending it to focus and all parents:
for (wi = grab() ? grab() : focus(); wi; wi = wi->parent())
- if (send(FL_KEYBOARD, wi, window)) return 1;
+ if (send_event(FL_KEYBOARD, wi, window)) return 1;
// recursive call to try shortcut:
if (handle(FL_SHORTCUT, window)) return 1;
@@ -1389,16 +1446,16 @@ int Fl::handle_(int e, Fl_Window* window)
if (grab()) {wi = grab(); break;} // send it to grab window
// Try it as shortcut, sending to mouse widget and all parents:
- wi = belowmouse();
+ wi = find_active(belowmouse()); // STR #3216
if (!wi) {
wi = modal();
if (!wi) wi = window;
} else if (wi->window() != first_window()) {
- if (send(FL_SHORTCUT, first_window(), first_window())) return 1;
+ if (send_event(FL_SHORTCUT, first_window(), first_window())) return 1;
}
for (; wi; wi = wi->parent()) {
- if (send(FL_SHORTCUT, wi, wi->window())) return 1;
+ if (send_event(FL_SHORTCUT, wi, wi->window())) return 1;
}
// try using add_handle() functions:
@@ -1440,19 +1497,19 @@ int Fl::handle_(int e, Fl_Window* window)
// Try sending it to the "grab" first
if (grab() && grab()!=modal() && grab()!=window) {
- if (send(FL_MOUSEWHEEL, grab(), window)) return 1;
+ if (send_event(FL_MOUSEWHEEL, grab(), window)) return 1;
}
// Now try sending it to the "modal" window
if (modal()) {
- send(FL_MOUSEWHEEL, modal(), window);
+ send_event(FL_MOUSEWHEEL, modal(), window);
return 1;
}
// Finally try sending it to the window, the event occured in
- if (send(FL_MOUSEWHEEL, window, window)) return 1;
+ if (send_event(FL_MOUSEWHEEL, window, window)) return 1;
default:
break;
}
- if (wi && send(e, wi, window)) {
+ if (wi && send_event(e, wi, window)) {
dnd_flag = 0;
return 1;
}
@@ -1505,7 +1562,6 @@ void Fl_Window::hide() {
for (; *pp != ip; pp = &(*pp)->next) if (!*pp) return;
*pp = ip->next;
#ifdef __APPLE__
- ip->unlink();
// MacOS X manages a single pointer per application. Make sure that hiding
// a toplevel window will not leave us with some random pointer shape, or
// worst case, an invisible pointer
@@ -1556,7 +1612,7 @@ void Fl_Window::hide() {
}
#elif defined(__APPLE_QUARTZ__)
Fl_X::q_release_context(ip);
- if ( ip->xid == fl_window && !parent() )
+ if ( ip->xid == fl_window )
fl_window = 0;
#endif
@@ -1577,11 +1633,15 @@ void Fl_Window::hide() {
}
XDestroyWindow(fl_display, ip->xid);
// end of fix for STR#3079
- for (int ii = 0; ii < count; ii++) {
- doit[ii]->hide();
- doit[ii]->show();
+ if (count) {
+ int ii;
+ for (ii = 0; ii < count; ii++) doit[ii]->hide();
+ for (ii = 0; ii < count; ii++) {
+ if (ii != 0) doit[0]->show(); // Fix for STR#3165
+ doit[ii]->show();
+ }
+ delete[] doit;
}
- if (count) delete[] doit;
#elif defined(__APPLE_QUARTZ__)
ip->destroy();
#else
@@ -1872,7 +1932,13 @@ static Fl_Widget **dwidgets = 0;
When deleting groups or windows, you must only delete the group or
window widget and not the individual child widgets.
- \since FLTK 1.3 it is not necessary to remove widgets from their parent
+ \since FLTK 1.3.4 the widget will be hidden immediately, but the actual
+ destruction will be delayed until the event loop is finished. Up to
+ FLTK 1.3.3 windows wouldn't be hidden before the event loop was done,
+ hence you had to hide() a window in your window close callback if
+ you called Fl::delete_widget() to destroy (and hide) the window.
+
+ \since FLTK 1.3.0 it is not necessary to remove widgets from their parent
groups or windows before calling this, because it will be done in the
widget's destructor, but it is not a failure to do this nevertheless.
@@ -1883,8 +1949,13 @@ static Fl_Widget **dwidgets = 0;
*/
void Fl::delete_widget(Fl_Widget *wi) {
if (!wi) return;
-
- // don;t add the same widget twice
+
+ // if the widget is shown(), hide() it (FLTK 1.3.4)
+ if (wi->visible_r()) wi->hide();
+ Fl_Window *win = wi->as_window();
+ if (win && win->shown()) win->hide(); // case of iconified window
+
+ // don't add the same widget twice to the widget delete list
for (int i = 0; i < num_dwidgets; i++) {
if (dwidgets[i]==wi) return;
}
@@ -2189,7 +2260,7 @@ Fl_Widget_Tracker::~Fl_Widget_Tracker()
Fl::release_widget_pointer(wp_); // remove pointer from watch list
}
-
+int Fl::use_high_res_GL_ = 0;
//
-// End of "$Id: Fl.cxx 10364 2014-10-08 12:47:20Z ossman $".
+// End of "$Id: Fl.cxx 11321 2016-03-08 16:58:43Z AlbrechtS $".
//
diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx
index d22c3b5..67254bf 100644
--- a/src/Fl_BMP_Image.cxx
+++ b/src/Fl_BMP_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_BMP_Image.cxx 9709 2012-11-09 16:02:08Z manolo $"
+// "$Id: Fl_BMP_Image.cxx 10751 2015-06-14 17:07:31Z AlbrechtS $"
//
// Fl_BMP_Image routines.
//
@@ -52,13 +52,19 @@
static int read_long(FILE *fp);
static unsigned short read_word(FILE *fp);
static unsigned int read_dword(FILE *fp);
-/**
- The constructor loads the named BMP image from the given bmp filename.
- <P>The inherited destructor free all memory and server resources that are used by
- the image.
- <P>The destructor free all memory and server resources that are used by
- the image
-*/
+
+
+/**
+ The constructor loads the named BMP image from the given bmp filename.
+
+ The destructor frees all memory and server resources that are used by
+ the image.
+
+ Use Fl_Image::fail() to check if Fl_BMP_Image failed to load. fail() returns
+ ERR_FILE_ACCESS if the file could not be opened or read, ERR_FORMAT if the
+ BMP format could not be decoded, and ERR_NO_IMAGE if the image could not
+ be loaded for another reason.
+ */
Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
: Fl_RGB_Image(0,0,0) {
FILE *fp; // File pointer
@@ -86,13 +92,17 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
// Open the file...
- if ((fp = fl_fopen(bmp, "rb")) == NULL) return;
+ if ((fp = fl_fopen(bmp, "rb")) == NULL) {
+ ld(ERR_FILE_ACCESS);
+ return;
+ }
// Get the header...
byte = (uchar)getc(fp); // Check "BM" sync chars
bit = (uchar)getc(fp);
if (byte != 'B' || bit != 'M') {
fclose(fp);
+ ld(ERR_FORMAT);
return;
}
@@ -161,6 +171,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
// Check header data...
if (!w() || !h() || !depth) {
fclose(fp);
+ w(0); h(0); d(0); ld(ERR_FORMAT);
return;
}
@@ -191,6 +202,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
if (((size_t)w()) * h() * d() > max_size() ) {
Fl::warning("BMP file \"%s\" is too large!\n", bmp);
fclose(fp);
+ w(0); h(0); d(0); ld(ERR_FORMAT);
return;
}
array = new uchar[w() * h() * d()];
@@ -488,5 +500,5 @@ read_long(FILE *fp) { // I - File to read from
//
-// End of "$Id: Fl_BMP_Image.cxx 9709 2012-11-09 16:02:08Z manolo $".
+// End of "$Id: Fl_BMP_Image.cxx 10751 2015-06-14 17:07:31Z AlbrechtS $".
//
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx
index 67a2905..5cf5828 100644
--- a/src/Fl_Bitmap.cxx
+++ b/src/Fl_Bitmap.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Bitmap.cxx 10132 2014-04-28 09:17:12Z manolo $"
+// "$Id: Fl_Bitmap.cxx 12026 2016-10-14 14:33:14Z AlbrechtS $"
//
// Bitmap drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -243,7 +243,7 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
fl_graphics_driver->draw(this, XP, YP, WP, HP, cx, cy);
}
-int Fl_Bitmap::start(int XP, int YP, int WP, int HP, int &cx, int &cy,
+int Fl_Bitmap::start(int XP, int YP, int WP, int HP, int &cx, int &cy,
int &X, int &Y, int &W, int &H)
{
if (!array) {
@@ -363,7 +363,7 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP
#endif
/**
- The destructor free all memory and server resources that are used by
+ The destructor frees all memory and server resources that are used by
the bitmap.
*/
Fl_Bitmap::~Fl_Bitmap() {
@@ -419,7 +419,7 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) {
xstep, ystep; // X & Y step increments
- // Figure out Bresenheim step/modulus values...
+ // Figure out Bresenham step/modulus values...
xmod = w() % W;
xstep = w() / W;
ymod = h() % H;
@@ -470,5 +470,5 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) {
//
-// End of "$Id: Fl_Bitmap.cxx 10132 2014-04-28 09:17:12Z manolo $".
+// End of "$Id: Fl_Bitmap.cxx 12026 2016-10-14 14:33:14Z AlbrechtS $".
//
diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx
index e4302f3..099a827 100644
--- a/src/Fl_Browser.cxx
+++ b/src/Fl_Browser.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Browser.cxx 9637 2012-07-24 04:37:22Z matt $"
+// "$Id: Fl_Browser.cxx 11464 2016-03-29 11:34:10Z AlbrechtS $"
//
// Browser widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -80,7 +80,7 @@ void* Fl_Browser::item_next(void* item) const {return ((FL_BLINE*)item)->next;}
/**
Returns the previous item before \p item.
\param[in] item The 'current' item
- \returns The previous item before \p item, or NULL if there none before this one.
+ \returns The previous item before \p item, or NULL if there are none before this one.
\see item_first(), item_last(), item_next(), item_prev()
*/
void* Fl_Browser::item_prev(void* item) const {return ((FL_BLINE*)item)->prev;}
@@ -284,6 +284,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
int l = (int) strlen(newtext);
FL_BLINE* t = (FL_BLINE*)malloc(sizeof(FL_BLINE)+l);
t->length = (short)l;
@@ -319,6 +320,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
int l = (int) strlen(newtext);
if (l > t->length) {
FL_BLINE* n = (FL_BLINE*)malloc(sizeof(FL_BLINE)+l);
@@ -649,6 +651,34 @@ int Fl_Browser::topline() const {
}
/**
+ Sets the default text size (in pixels) for the lines in the browser to \p newSize.
+
+ This method recalculates all item heights and caches the total height
+ internally for optimization of later item changes. This can be slow
+ if there are many items in the browser.
+
+ It returns immediately (w/o recalculation) if \p newSize equals
+ the current textsize().
+
+ You \e may need to call redraw() to see the effect and to have the
+ scrollbar positions recalculated.
+
+ You should set the text size \e before populating the browser with items
+ unless you really need to \e change the size later.
+*/
+void Fl_Browser::textsize(Fl_Fontsize newSize) {
+ if (newSize == textsize())
+ return; // avoid recalculation
+ Fl_Browser_::textsize(newSize);
+ new_list();
+ full_height_ = 0;
+ if (lines == 0) return;
+ for (FL_BLINE* itm=(FL_BLINE *)item_first(); itm; itm=(FL_BLINE *)item_next(itm)) {
+ full_height_ += item_height(itm);
+ }
+}
+
+/**
Removes all the lines in the browser.
\see add(), insert(), remove(), swap(int,int), clear()
*/
@@ -789,7 +819,7 @@ int Fl_Browser::visible(int line) const {
}
/**
- Returns the line number of the currently selected line, or 0 if none.
+ Returns the line number of the currently selected line, or 0 if none selected.
\returns The line number of current selection, or 0 if none selected.
\see select(), selected(), value(), item_select(), item_selected()
*/
@@ -930,5 +960,5 @@ Fl_Select_Browser::Fl_Select_Browser(int X,int Y,int W,int H,const char *L)
//
-// End of "$Id: Fl_Browser.cxx 9637 2012-07-24 04:37:22Z matt $".
+// End of "$Id: Fl_Browser.cxx 11464 2016-03-29 11:34:10Z AlbrechtS $".
//
diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx
index 043656f..3e6bc51 100644
--- a/src/Fl_Browser_.cxx
+++ b/src/Fl_Browser_.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Browser_.cxx 9737 2012-12-05 17:17:31Z greg.ercolano $"
+// "$Id: Fl_Browser_.cxx 11849 2016-07-29 09:23:44Z AlbrechtS $"
//
// Base Browser widget class for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -113,6 +113,7 @@ void Fl_Browser_::resize(int X, int Y, int W, int H) {
hscrollbar.resize(
X, scrollbar.align()&FL_ALIGN_TOP ? Y-scrollsize : Y+H,
W, scrollsize);
+ max_width = 0;
}
// Cause minimal update to redraw the given item:
@@ -713,9 +714,10 @@ int Fl_Browser_::handle(int event) {
if (type()==FL_HOLD_BROWSER) {
switch (Fl::event_key()) {
case FL_Down:
- while ((l = item_next(l)))
- if (item_height(l)>0) {select_only(l, when()); break;}
- return 1;
+ 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) {
@@ -813,7 +815,7 @@ J1:
} else {
void* l = find_item(my);
whichway = 1;
- if (Fl::event_state(FL_CTRL)) { // toggle selection:
+ if (Fl::event_state(FL_COMMAND)) { // toggle selection:
TOGGLE:
if (l) {
whichway = !item_selected(l);
@@ -1096,5 +1098,5 @@ void Fl_Browser_::item_select(void *item, int val) {}
int Fl_Browser_::item_selected(void* item) const { return item==selection_ ? 1 : 0; }
//
-// End of "$Id: Fl_Browser_.cxx 9737 2012-12-05 17:17:31Z greg.ercolano $".
+// End of "$Id: Fl_Browser_.cxx 11849 2016-07-29 09:23:44Z AlbrechtS $".
//
diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx
index deca912..ecdfedd 100644
--- a/src/Fl_Choice.cxx
+++ b/src/Fl_Choice.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Choice.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_Choice.cxx 11907 2016-08-30 19:08:36Z greg.ercolano $"
//
// Choice widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -26,21 +26,34 @@
// button: it draws the text of the current pick and a down-arrow.
void Fl_Choice::draw() {
- int dx = Fl::box_dx(FL_DOWN_BOX);
- int dy = Fl::box_dy(FL_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 = (H > 20) ? 20 : H;
+ 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;
+
+ // Arrow object
int w1 = (W - 4) / 3; if (w1 < 1) w1 = 1;
int x1 = X + (W - 2 * w1 - 1) / 2;
int y1 = Y + (H - w1 - 1) / 2;
if (Fl::scheme()) {
- draw_box(FL_UP_BOX, color());
+ // NON-DEFAULT SCHEME
+ // Draw widget box
+ draw_box(btype, color());
+
+ // Draw arrow area
fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
- if (!strcmp(Fl::scheme(), "plastic")) {
+ if (Fl::is_scheme("plastic")) {
// Show larger up/down arrows...
fl_polygon(x1, y1 + 3, x1 + w1, y1 + w1 + 3, x1 + 2 * w1, y1 + 3);
fl_polygon(x1, y1 + 1, x1 + w1, y1 - w1 + 1, x1 + 2 * w1, y1 + 1);
@@ -58,26 +71,30 @@ void Fl_Choice::draw() {
fl_yxline(x1 - 6, y1 - 8, y1 + 8);
}
} else {
+ // DEFAULT SCHEME
+
+ // Draw widget box
if (fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) == textcolor()) {
- draw_box(FL_DOWN_BOX, FL_BACKGROUND2_COLOR);
+ draw_box(btype, FL_BACKGROUND2_COLOR);
} else {
- draw_box(FL_DOWN_BOX, fl_lighter(color()));
+ draw_box(btype, fl_lighter(color()));
}
- draw_box(FL_UP_BOX,X,Y,W,H,color());
+ // Draw arrow area
+ draw_box(FL_UP_BOX,X,Y,W,H,color());
fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
fl_polygon(x1, y1, x1 + w1, y1 + w1, x1 + 2 * w1, y1);
}
W += 2 * dx;
+ // Draw menu item's label
if (mvalue()) {
Fl_Menu_Item m = *mvalue();
if (active_r()) m.activate(); else m.deactivate();
- // ERCO
+ // Clip
int xx = x() + dx, yy = y() + dy + 1, ww = w() - W, hh = H - 2;
-
fl_push_clip(xx, yy, ww, hh);
if ( Fl::scheme()) {
@@ -104,6 +121,7 @@ void Fl_Choice::draw() {
fl_pop_clip();
}
+ // Widget's label
draw_label();
}
@@ -200,5 +218,5 @@ int Fl_Choice::handle(int e) {
}
//
-// End of "$Id: Fl_Choice.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_Choice.cxx 11907 2016-08-30 19:08:36Z greg.ercolano $".
//
diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx
index d5ea8e2..ad7ffb1 100644
--- a/src/Fl_Clock.cxx
+++ b/src/Fl_Clock.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Clock.cxx 9637 2012-07-24 04:37:22Z matt $"
+// "$Id: Fl_Clock.cxx 11849 2016-07-29 09:23:44Z AlbrechtS $"
//
// Clock widget for the Fast Light Tool Kit (FLTK).
//
@@ -38,10 +38,14 @@ static void drawhand(double ang,const float v[][2],Fl_Color fill,Fl_Color line)
{
fl_push_matrix();
fl_rotate(ang);
- fl_color(fill); fl_begin_polygon();
- int i; for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]); fl_end_polygon();
- fl_color(line); fl_begin_loop();
- for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]); fl_end_loop();
+ fl_color(fill);
+ fl_begin_polygon();
+ int i; for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]);
+ fl_end_polygon();
+ fl_color(line);
+ fl_begin_loop();
+ for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]);
+ fl_end_loop();
fl_pop_matrix();
}
@@ -215,5 +219,5 @@ Fl_Round_Clock::Fl_Round_Clock(int X,int Y,int W,int H, const char *L)
//
-// End of "$Id: Fl_Clock.cxx 9637 2012-07-24 04:37:22Z matt $".
+// End of "$Id: Fl_Clock.cxx 11849 2016-07-29 09:23:44Z AlbrechtS $".
//
diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx
index ecb8ebc..abebb3f 100644
--- a/src/Fl_Copy_Surface.cxx
+++ b/src/Fl_Copy_Surface.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Copy_Surface.cxx 10209 2014-06-26 16:14:42Z manolo $"
+// "$Id: Fl_Copy_Surface.cxx 11898 2016-08-27 15:17:02Z manolo $"
//
// Copy-to-clipboard code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -22,9 +22,6 @@
#if defined(__APPLE__)
#include <ApplicationServices/ApplicationServices.h>
-#if defined(__ppc__)
-#include <QuickTime/QuickTimeComponents.h>
-#endif // __ppc__
Fl_Quartz_Surface_::Fl_Quartz_Surface_(int w, int h) : Fl_System_Printer(), width(w), height(h) {
}
@@ -90,11 +87,14 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Surface_Device(NULL)
int hdots = GetDeviceCaps(hdc, HORZRES);
int vmm = GetDeviceCaps(hdc, VERTSIZE);
int vdots = GetDeviceCaps(hdc, VERTRES);
+ int dhr = GetDeviceCaps(hdc, DESKTOPHORZRES); // true number of pixels on display
ReleaseDC(NULL, hdc);
- float factorw = (100. * hmm) / hdots;
- float factorh = (100. * vmm) / vdots + 0.5;
+ float factorw = (100.f * hmm) / hdots;
+ float factorh = (100.f * vmm) / vdots;
+ // Global display scaling factor: 1, 1.25, 1.5, 1.75, etc...
+ float scaling = dhr/float(hdots);
- RECT rect; rect.left = 0; rect.top = 0; rect.right = w * factorw; rect.bottom = h * factorh;
+ RECT rect; rect.left = 0; rect.top = 0; rect.right = (LONG)(w * factorw / scaling); rect.bottom = (LONG)(h * factorh / scaling);
gc = CreateEnhMetaFile (NULL, NULL, &rect, NULL);
if (gc != NULL) {
SetTextAlign(gc, TA_BASELINE|TA_LEFT);
@@ -188,7 +188,7 @@ void Fl_Copy_Surface::init_PDF_context(int w, int h)
pdfdata = CFDataCreateMutable(NULL, 0);
CGDataConsumerRef myconsumer;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- if(CGDataConsumerCreateWithCFData != NULL) {
+ if (&CGDataConsumerCreateWithCFData != NULL) {
myconsumer = CGDataConsumerCreateWithCFData(pdfdata); // 10.4
}
else
@@ -212,50 +212,54 @@ void Fl_Copy_Surface::prepare_copy_pdf_and_tiff(int w, int h)
CGContextSaveGState(gc);
}
+void Fl_Copy_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int delta_y)
+{
+ int bt = win->decorated_h() - win->h();
+ draw(win, delta_x, bt + delta_y ); // draw the window content
+ if (win->border()) {
+ // draw the window title bar
+ CGContextSaveGState(gc);
+ CGContextTranslateCTM(gc, delta_x, bt + delta_y);
+ CGContextScaleCTM(gc, 1, -1);
+ Fl_X::clip_to_rounded_corners(gc, win->w(), bt);
+ void *layer = Fl_X::get_titlebar_layer(win);
+ if (layer) {
+ CGColorSpaceRef cspace = CGColorSpaceCreateDeviceRGB();
+ // for unknown reason, rendering the layer to the Fl_Copy_Surface pdf graphics context does not work;
+ // we use an auxiliary bitmap context
+ CGContextRef auxgc = CGBitmapContextCreate(NULL, win->w(), bt, 8, 0, cspace, kCGImageAlphaPremultipliedLast);
+ CGColorSpaceRelease(cspace);
+ CGContextTranslateCTM(auxgc, 0, bt);
+ CGContextScaleCTM(auxgc, 1, -1);
+ Fl_X::draw_layer_to_context(layer, auxgc, win->w(), bt);
+ Fl_RGB_Image *image = new Fl_RGB_Image((const uchar*)CGBitmapContextGetData(auxgc), win->w(), bt, 4,
+ CGBitmapContextGetBytesPerRow(auxgc)); // 10.2
+ image->draw(0, 0);
+ delete image;
+ CGContextRelease(auxgc);
+ } else {
+ CGImageRef img = Fl_X::CGImage_from_window_rect(win, 0, -bt, win->w(), bt);
+ CGContextDrawImage(gc, CGRectMake(0, 0, win->w(), bt), img);
+ CFRelease(img);
+ }
+ CGContextRestoreGState(gc);
+ }
+}
+
+#else
-void Fl_Copy_Surface::complete_copy_pdf_and_tiff()
+/** Copies a window and its borders and title bar to the clipboard.
+ \param win an FLTK window to copy
+ \param delta_x and \param delta_y give
+ the position in the clipboard of the top-left corner of the window's title bar
+*/
+void Fl_Copy_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int delta_y)
{
- CGContextRestoreGState(gc);
- CGContextEndPage(gc);
- CGContextRelease(gc);
- PasteboardRef clipboard = NULL;
- PasteboardCreate(kPasteboardClipboard, &clipboard);
- PasteboardClear(clipboard); // first, copy PDF to clipboard
- PasteboardPutItemFlavor (clipboard, (PasteboardItemID)1,
- CFSTR("com.adobe.pdf"), // kUTTypePDF
- pdfdata, kPasteboardFlavorNoFlags);
- //second, transform this PDF to a bitmap image and put it as tiff in clipboard
- CGDataProviderRef prov;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- if(fl_mac_os_version >= 100400)
- prov = CGDataProviderCreateWithCFData(pdfdata); // 10.4
- else
-#endif
- prov = CGDataProviderCreateWithData(NULL, CFDataGetBytePtr(pdfdata), CFDataGetLength(pdfdata), NULL);
- CGPDFDocumentRef pdfdoc = CGPDFDocumentCreateWithProvider(prov);
- CGPDFPageRef pdfpage = CGPDFDocumentGetPage(pdfdoc, 1);
- CGDataProviderRelease(prov);
- CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
- void *mem = ( fl_mac_os_version >= 100600 ? NULL : malloc(width * height * 4) );
- gc = CGBitmapContextCreate(mem, width, height, 8, width * 4, space, kCGImageAlphaNoneSkipLast);
- CFRelease(space);
- if (gc == NULL) { if (mem) free(mem); return; }
- CGRect rect = CGRectMake(0, 0, width, height);
- CGContextSetRGBFillColor(gc, 1,1,1,1);//need to clear background
- CGContextFillRect(gc, rect);
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- CGContextDrawPDFPage(gc, pdfpage); // requires 10.3
-#endif
- CGPDFDocumentRelease(pdfdoc);
- CFRelease(pdfdata);
- PasteboardPutItemFlavor(clipboard, (PasteboardItemID)1, CFSTR("public.tiff"),
- Fl_X::CGBitmapContextToTIFF(gc), kPasteboardFlavorNoFlags);
- CFRelease(clipboard);
- CGContextRelease(gc);
- if (mem) free(mem);
+ helper->draw_decorated_window(win, delta_x, delta_y, this);
}
-#endif // __APPLE__
+#endif // __APPLE__
+
#if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN))
/* graphics driver that translates all graphics coordinates before calling Xlib */
@@ -395,5 +399,5 @@ const char *Fl_Xlib_Surface_::class_id = "Fl_Xlib_Surface_";
#endif
//
-// End of "$Id: Fl_Copy_Surface.cxx 10209 2014-06-26 16:14:42Z manolo $".
+// End of "$Id: Fl_Copy_Surface.cxx 11898 2016-08-27 15:17:02Z manolo $".
//
diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx
index b129c20..e066759 100644
--- a/src/Fl_Device.cxx
+++ b/src/Fl_Device.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Device.cxx 9685 2012-09-27 12:49:39Z manolo $"
+// "$Id: Fl_Device.cxx 10970 2015-12-16 07:18:34Z manolo $"
//
// implementation of Fl_Device class for the Fast Light Tool Kit (FLTK).
//
@@ -26,6 +26,9 @@ const char *Fl_Display_Device::class_id = "Fl_Display_Device";
const char *Fl_Graphics_Driver::class_id = "Fl_Graphics_Driver";
#if defined(__APPLE__) || defined(FL_DOXYGEN)
const char *Fl_Quartz_Graphics_Driver::class_id = "Fl_Quartz_Graphics_Driver";
+# ifndef FL_DOXYGEN
+ bool Fl_Display_Device::high_res_window_ = false;
+# endif
#endif
#if defined(WIN32) || defined(FL_DOXYGEN)
const char *Fl_GDI_Graphics_Driver::class_id = "Fl_GDI_Graphics_Driver";
@@ -36,7 +39,8 @@ const char *Fl_Xlib_Graphics_Driver::class_id = "Fl_Xlib_Graphics_Driver";
#endif
-/** \brief Use this drawing surface for future graphics requests. */
+/** \brief Make this surface the current drawing surface.
+ This surface will receive all future graphics requests. */
void Fl_Surface_Device::set_current(void)
{
fl_graphics_driver = _driver;
@@ -69,11 +73,35 @@ void Fl_Graphics_Driver::text_extents(const char*t, int n, int& dx, int& dy, int
dy = descent();
}
-Fl_Display_Device::Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device( graphics_driver) {
-this->set_current();
+/** A constructor that sets the graphics driver used by the display */
+Fl_Display_Device::Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(graphics_driver) {
+ this->set_current();
};
+/** Returns the platform display device. */
+Fl_Display_Device *Fl_Display_Device::display_device() {
+ static Fl_Display_Device *display = new Fl_Display_Device(new
+#if defined(__APPLE__)
+ Fl_Quartz_Graphics_Driver
+#elif defined(WIN32)
+ Fl_GDI_Graphics_Driver
+#else
+ Fl_Xlib_Graphics_Driver
+#endif
+ );
+ return display;
+};
+
+
+Fl_Surface_Device *Fl_Surface_Device::default_surface()
+{
+ return Fl_Display_Device::display_device();
+}
+
+
+Fl_Display_Device *Fl_Display_Device::_display = Fl_Display_Device::display_device();
+
//
-// End of "$Id: Fl_Device.cxx 9685 2012-09-27 12:49:39Z manolo $".
+// End of "$Id: Fl_Device.cxx 10970 2015-12-16 07:18:34Z manolo $".
//
diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx
index 6fbfa24..3603b25 100644
--- a/src/Fl_Double_Window.cxx
+++ b/src/Fl_Double_Window.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Double_Window.cxx 10335 2014-09-23 10:48:36Z manolo $"
+// "$Id: Fl_Double_Window.cxx 11312 2016-03-08 05:18:28Z manolo $"
//
// Double-buffered window code for the Fast Light Tool Kit (FLTK).
//
@@ -129,14 +129,44 @@ void Fl_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Offscreen
#if defined(USE_X11)
+#if HAVE_XRENDER
+#include <X11/extensions/Xrender.h>
+#endif
+
void Fl_Xlib_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
XCopyArea(fl_display, pixmap, fl_window, fl_gc, srcx, srcy, w, h, x, y);
}
+void Fl_Xlib_Graphics_Driver::copy_offscreen_with_alpha(int x, int y, int w, int h,
+ Fl_Offscreen pixmap, int srcx, int srcy) {
+#if HAVE_XRENDER
+ XRenderPictureAttributes srcattr;
+ memset(&srcattr, 0, sizeof(XRenderPictureAttributes));
+ static XRenderPictFormat *srcfmt = XRenderFindStandardFormat(fl_display, PictStandardARGB32);
+ static XRenderPictFormat *dstfmt = XRenderFindStandardFormat(fl_display, PictStandardRGB24);
+
+ Picture src = XRenderCreatePicture(fl_display, pixmap, srcfmt, 0, &srcattr);
+ Picture dst = XRenderCreatePicture(fl_display, fl_window, dstfmt, 0, &srcattr);
+
+ if (!src || !dst) {
+ fprintf(stderr, "Failed to create Render pictures (%lu %lu)\n", src, dst);
+ return;
+ }
+
+ const Fl_Region clipr = fl_clip_region();
+ if (clipr)
+ XRenderSetPictureClipRegion(fl_display, dst, clipr);
+
+ XRenderComposite(fl_display, PictOpOver, src, None, dst, srcx, srcy, 0, 0,
+ x, y, w, h);
+
+ XRenderFreePicture(fl_display, src);
+ XRenderFreePicture(fl_display, dst);
+#endif
+}
-// maybe someone feels inclined to implement alpha blending on X11?
char fl_can_do_alpha_blending() {
- return 0;
+ return Fl_X::xrender_supported();
}
#elif defined(WIN32)
@@ -283,7 +313,7 @@ void Fl_Quartz_Graphics_Driver::copy_offscreen(int x,int y,int w,int h,Fl_Offscr
CGImageRef img = CGImageCreate( sw, sh, 8, 4*8, 4*sw, lut, alpha,
src_bytes, 0L, false, kCGRenderingIntentDefault);
// fl_push_clip();
- CGRect rect = { { x, y }, { w, h } };
+ CGRect rect = CGRectMake(x, y, w, h);
Fl_X::q_begin_image(rect, srcx, srcy, sw, sh);
CGContextDrawImage(fl_gc, rect, img);
Fl_X::q_end_image();
@@ -331,8 +361,9 @@ void fl_begin_offscreen(Fl_Offscreen ctx) {
/** Quit sending drawing commands to the current offscreen buffer.
*/
void fl_end_offscreen() {
- Fl_X::q_release_context();
fl_pop_clip();
+ CGContextRestoreGState(fl_gc); // matches CGContextSaveGState in fl_begin_offscreen()
+ CGContextFlush(fl_gc);
if (stack_ix>0)
stack_ix--;
else
@@ -475,7 +506,10 @@ void Fl_Double_Window::hide() {
Fl_X* myi = Fl_X::i(this);
if (myi && myi->other_xid) {
#if USE_XDBE
- if (!use_xdbe)
+ if (use_xdbe) {
+ XdbeDeallocateBackBufferName(fl_display, myi->other_xid);
+ }
+ else
#endif
fl_delete_offscreen(myi->other_xid);
}
@@ -511,5 +545,5 @@ Fl_Overlay_Window::Fl_Overlay_Window(int X, int Y, int W, int H, const char *l)
//
-// End of "$Id: Fl_Double_Window.cxx 10335 2014-09-23 10:48:36Z manolo $".
+// End of "$Id: Fl_Double_Window.cxx 11312 2016-03-08 05:18:28Z manolo $".
//
diff --git a/src/Fl_File_Browser.cxx b/src/Fl_File_Browser.cxx
index d7f3d2a..999a3dc 100644
--- a/src/Fl_File_Browser.cxx
+++ b/src/Fl_File_Browser.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Browser.cxx 10145 2014-05-04 13:46:09Z manolo $"
+// "$Id: Fl_File_Browser.cxx 12047 2016-10-19 05:55:03Z manolo $"
//
// Fl_File_Browser routines.
//
@@ -351,9 +351,8 @@ Fl_File_Browser::item_draw(void *p, // I - List item data
else
fl_color(fl_inactive(c));
- for (t = line->txt, ptr = fragment; *t != '\0'; t ++)
- if (*t == '\n')
- {
+ for (t = line->txt, ptr = fragment; *t != '\0'; t ++) {
+ if (*t == '\n') {
// Newline - nul terminate this fragment and draw it...
*ptr = '\0';
@@ -365,21 +364,18 @@ Fl_File_Browser::item_draw(void *p, // I - List item data
width = 0;
Y += fl_height();
column = 0;
- }
- else if (*t == column_char())
- {
+ } else if (*t == column_char()) {
// Tab - nul terminate this fragment and draw it...
*ptr = '\0';
int cW = W - width; // Clip width...
- if (columns)
- {
- // Try clipping inside this column...
+ if (columns) {
+ // 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(),
@@ -387,21 +383,18 @@ Fl_File_Browser::item_draw(void *p, // I - List item data
// Advance to the next column...
column ++;
- if (columns)
- {
+ if (columns) {
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
*ptr++ = *t;
-
- if (ptr > fragment)
- {
+ }
+ if (ptr > fragment) {
// Nul terminate this fragment and draw it...
*ptr = '\0';
@@ -641,6 +634,9 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load
if (mtab != NULL)
{
+ // We always have the root filesystem
+ add("/", icon);
+ num_files ++;
while (fgets(line, sizeof(line), mtab) != NULL)
{
if (line[0] == '#' || line[0] == '\n')
@@ -648,10 +644,9 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load
if (sscanf(line, "%*s%4095s", filename) != 1)
continue;
+ if (strcmp("/", filename) == 0) continue; // root was added before
// Add a trailing slash (except for the root filesystem)
- if (strcmp("/", filename) != 0) {
- strlcat(filename, "/", sizeof(filename));
- }
+ strlcat(filename, "/", sizeof(filename));
// printf("Fl_File_Browser::load() - adding \"%s\" to list...\n", filename);
add(filename, icon);
@@ -736,5 +731,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
//
-// End of "$Id: Fl_File_Browser.cxx 10145 2014-05-04 13:46:09Z manolo $".
+// End of "$Id: Fl_File_Browser.cxx 12047 2016-10-19 05:55:03Z manolo $".
//
diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx
index 935127e..e8e9e68 100644
--- a/src/Fl_File_Chooser.cxx
+++ b/src/Fl_File_Chooser.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_File_Chooser.cxx 10358 2014-10-05 11:56:06Z AlbrechtS $"
+// "$Id: Fl_File_Chooser.cxx 10973 2015-12-19 06:35:26Z manolo $"
//
// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -15,15 +15,15 @@
//
// http://www.fltk.org/str.php
//
-// ========================================================================
+// =======================================================================
// DO NOT EDIT FL/Fl_File_Chooser.H and src/Fl_File_Chooser.cxx !!!
-// ========================================================================
+// =======================================================================
// Please use fluid to change src/Fl_File_Chooser.fl interactively
// and then use fluid to "write code" or edit and use fluid -c .
-// ========================================================================
+// =======================================================================
//
-// generated by Fast Light User Interface Designer (fluid) version 1.0303
+// generated by Fast Light User Interface Designer (fluid) version 1.0304
#include "../FL/Fl_File_Chooser.H"
#include <FL/fl_draw.H>
@@ -63,7 +63,10 @@ void Fl_File_Chooser::cb_newButton(Fl_Button* o, void* v) {
static const unsigned char idata_new[] =
{0,0,120,0,132,0,2,1,1,254,1,128,49,128,49,128,253,128,253,128,49,128,49,
128,1,128,1,128,255,255,0,0};
-static Fl_Bitmap image_new(idata_new, 16, 16);
+static Fl_Image *image_new() {
+ static Fl_Image *image = new Fl_Bitmap(idata_new, 16, 16);
+ return image;
+}
void Fl_File_Chooser::cb__i(Fl_Tile*, void*) {
update_preview();
@@ -164,6 +167,9 @@ void Fl_File_Chooser::cb_favOkButton(Fl_Return_Button* o, void* v) {
}
Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char *title) {
+ if (!prefs_) {
+ prefs_ = new Fl_Preferences(Fl_Preferences::USER, "fltk.org", "filechooser");
+ }
Fl_Group *prev_current = Fl_Group::current();
{ window = new Fl_Double_Window(490, 380, "Choose File");
window->callback((Fl_Callback*)cb_window, (void*)(this));
@@ -182,7 +188,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
favoritesButton->label(favorites_label);
} // Fl_Menu_Button* favoritesButton
{ Fl_Button* o = newButton = new Fl_Button(455, 10, 25, 25);
- newButton->image(image_new);
+ newButton->image( image_new() );
newButton->labelsize(8);
newButton->callback((Fl_Callback*)cb_newButton);
o->tooltip(new_directory_tooltip);
@@ -305,7 +311,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
value(d);
type(t);
int e;
- prefs_.get("preview", e, 1);
+ prefs_->get("preview", e, 1);
preview(e);
Fl_Group::current(prev_current);
ext_group=(Fl_Widget*)0;
@@ -369,7 +375,7 @@ const char * Fl_File_Chooser::label() {
}
void Fl_File_Chooser::ok_label(const char *l) {
- okButton->label(l);
+ if (l) okButton->label(l);
int w=0, h=0;
okButton->measure_label(w, h);
okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(),
@@ -469,5 +475,5 @@ Fl_Widget* Fl_File_Chooser::add_extra(Fl_Widget* gr) {
}
//
-// End of "$Id: Fl_File_Chooser.cxx 10358 2014-10-05 11:56:06Z AlbrechtS $".
+// End of "$Id: Fl_File_Chooser.cxx 10973 2015-12-19 06:35:26Z manolo $".
//
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl
index b2a528b..b8d3d65 100644
--- a/src/Fl_File_Chooser.fl
+++ b/src/Fl_File_Chooser.fl
@@ -1,13 +1,13 @@
# data file for the Fltk User Interface Designer (fluid)
-version 1.0303
-header_name {../FL/Fl_File_Chooser.H}
+version 1.0304
+header_name {../FL/Fl_File_Chooser.H}
code_name {.cxx}
comment {//
-// "$Id: Fl_File_Chooser.fl 10357 2014-10-05 11:28:29Z AlbrechtS $"
+// "$Id: Fl_File_Chooser.fl 10973 2015-12-19 06:35:26Z manolo $"
//
// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -19,24 +19,24 @@ comment {//
//
// http://www.fltk.org/str.php
//
-// ========================================================================
+// =======================================================================
// DO NOT EDIT FL/Fl_File_Chooser.H and src/Fl_File_Chooser.cxx !!!
-// ========================================================================
+// =======================================================================
// Please use fluid to change src/Fl_File_Chooser.fl interactively
// and then use fluid to "write code" or edit and use fluid -c .
-// ========================================================================
+// =======================================================================
//
} {in_source in_header
-}
+}
decl {\#include <FL/fl_draw.H>} {private local
-}
+}
class FL_EXPORT Fl_File_Chooser {open
} {
decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {public local
}
- decl {static Fl_Preferences prefs_;} {private local
+ decl {static Fl_Preferences *prefs_;} {private local
}
decl {void (*callback_)(Fl_File_Chooser*, void *);} {private local
}
@@ -69,6 +69,9 @@ class FL_EXPORT Fl_File_Chooser {open
decl {void update_preview();} {private local
}
Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {} {
+ code {if (!prefs_) {
+ prefs_ = new Fl_Preferences(Fl_Preferences::USER, "fltk.org", "filechooser");
+}} {}
code {Fl_Group *prev_current = Fl_Group::current();} {}
Fl_Window window {
label {Choose File}
@@ -76,11 +79,11 @@ class FL_EXPORT Fl_File_Chooser {open
fileList->deselect();
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
window->hide();} open
- private xywh {507 327 490 380} type Double resizable
+ private xywh {507 327 490 380} type Double hide resizable
code0 {if (title) window->label(title);}
code1 {\#include <stdio.h>}
code2 {\#include <stdlib.h>}
- code3 {\#include <string.h>} modal visible
+ code3 {\#include <string.h>} modal
} {
Fl_Group {} {open
private xywh {10 10 470 25}
@@ -181,8 +184,8 @@ window->hide();}
}
Fl_Window favWindow {
label {Manage Favorites}
- private xywh {413 100 355 150} type Double resizable
- code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible
+ private xywh {413 100 355 150} type Double hide resizable
+ code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0}
} {
Fl_File_Browser favList {
callback {favoritesCB(favList);}
@@ -238,7 +241,7 @@ update_favorites();
value(d);
type(t);
int e;
-prefs_.get("preview", e, 1);
+prefs_->get("preview", e, 1);
preview(e);
Fl_Group::current(prev_current);} {}
code {ext_group=(Fl_Widget*)0;} {}
@@ -307,7 +310,7 @@ showChoiceCB();} {}
}
Function {ok_label(const char *l)} {return_type void
} {
- code {okButton->label(l);
+ code {if (l) okButton->label(l);
int w=0, h=0;
okButton->measure_label(w, h);
okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(),
@@ -474,22 +477,22 @@ window->resizable(svres);} {}
}
code {return ret;} {}
}
-}
+}
decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);} {public local
-}
+}
decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);} {public local
-}
+}
decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public local
-}
+}
decl {FL_EXPORT void fl_file_chooser_ok_label(const char*l);} {public local
-}
+}
comment {
//
-// End of "$Id: Fl_File_Chooser.fl 10357 2014-10-05 11:28:29Z AlbrechtS $".
+// End of "$Id: Fl_File_Chooser.fl 10973 2015-12-19 06:35:26Z manolo $".
//} {in_source in_header
-}
+}
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index a1a0b9e..74d57b4 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Chooser2.cxx 10004 2013-10-21 04:58:43Z greg.ercolano $"
+// "$Id: Fl_File_Chooser2.cxx 11813 2016-07-15 20:01:08Z AlbrechtS $"
//
// More Fl_File_Chooser routines.
//
@@ -379,7 +379,7 @@
// File chooser label strings and sort function...
//
-Fl_Preferences Fl_File_Chooser::prefs_(Fl_Preferences::USER, "fltk.org", "filechooser");
+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 (*)";
@@ -410,6 +410,8 @@ 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);
+// use platform dependent getenv() to get the home directory (STR #3166)
+static const char* get_homedir();
//
// 'Fl_File_Chooser::count()' - Return the number of selected files.
@@ -539,13 +541,13 @@ Fl_File_Chooser::favoritesButtonCB()
if (!v) {
// Add current directory to favorites...
- if (getenv("HOME")) v = favoritesButton->size() - 5;
+ if (get_homedir()) v = favoritesButton->size() - 5;
else v = favoritesButton->size() - 4;
sprintf(menuname, "favorite%02d", v);
- prefs_.set(menuname, directory_);
- prefs_.flush();
+ prefs_->set(menuname, directory_);
+ prefs_->flush();
quote_pathname(menuname, directory_, sizeof(menuname));
favoritesButton->add(menuname);
@@ -588,7 +590,7 @@ Fl_File_Chooser::favoritesCB(Fl_Widget *w)
// Get favorite directory 0 to 99...
sprintf(name, "favorite%02d", i);
- prefs_.get(name, pathname, "", sizeof(pathname));
+ prefs_->get(name, pathname, "", sizeof(pathname));
// Stop on the first empty favorite...
if (!pathname[0]) break;
@@ -667,7 +669,7 @@ Fl_File_Chooser::favoritesCB(Fl_Widget *w)
// Set favorite directory 0 to 99...
sprintf(name, "favorite%02d", i);
- prefs_.set(name, favList->text(i + 1));
+ prefs_->set(name, favList->text(i + 1));
}
// Clear old entries as necessary...
@@ -675,14 +677,14 @@ Fl_File_Chooser::favoritesCB(Fl_Widget *w)
// Clear favorite directory 0 to 99...
sprintf(name, "favorite%02d", i);
- prefs_.get(name, pathname, "", sizeof(pathname));
+ prefs_->get(name, pathname, "", sizeof(pathname));
- if (pathname[0]) prefs_.set(name, "");
+ if (pathname[0]) prefs_->set(name, "");
else break;
}
update_favorites();
- prefs_.flush();
+ prefs_->flush();
favWindow->hide();
}
@@ -886,10 +888,10 @@ Fl_File_Chooser::fileNameCB()
#if defined(WIN32) || defined(__EMX__)
if (strcasecmp(pathname, directory_) &&
- (pathname[0] || strcasecmp("/", directory_))) {
+ (pathname[0] || strcmp("/", directory_))) {
#else
if (strcmp(pathname, directory_) &&
- (pathname[0] || strcasecmp("/", directory_))) {
+ (pathname[0] || strcmp("/", directory_))) {
#endif // WIN32 || __EMX__
int p = fileName->position();
int m = fileName->mark();
@@ -1095,8 +1097,8 @@ Fl_File_Chooser::newdir()
void Fl_File_Chooser::preview(int e)
{
previewButton->value(e);
- prefs_.set("preview", e);
- prefs_.flush();
+ prefs_->set("preview", e);
+ prefs_->flush();
Fl_Group *p = previewBox->parent();
if (e) {
@@ -1273,15 +1275,15 @@ Fl_File_Chooser::update_favorites()
favoritesButton->add(add_favorites_label, FL_ALT + 'a', 0);
favoritesButton->add(manage_favorites_label, FL_ALT + 'm', 0, 0, FL_MENU_DIVIDER);
favoritesButton->add(filesystems_label, FL_ALT + 'f', 0);
-
- if ((home = getenv("HOME")) != NULL) {
+
+ if ((home = get_homedir()) != NULL) {
quote_pathname(menuname, home, sizeof(menuname));
favoritesButton->add(menuname, FL_ALT + 'h', 0);
}
for (i = 0; i < 100; i ++) {
sprintf(menuname, "favorite%02d", i);
- prefs_.get(menuname, pathname, "", sizeof(pathname));
+ prefs_->get(menuname, pathname, "", sizeof(pathname));
if (!pathname[0]) break;
quote_pathname(menuname, pathname, sizeof(menuname));
@@ -1402,7 +1404,7 @@ Fl_File_Chooser::update_preview()
if (*ptr || ptr == preview_text_) {
for (ptr = preview_text_;
*ptr && (isprint(*ptr & 255) || isspace(*ptr & 255));
- ptr ++);
+ ptr ++) {/*empty*/}
}
if (*ptr || ptr == preview_text_) {
@@ -1425,7 +1427,8 @@ Fl_File_Chooser::update_preview()
}
} else if (image && ( (image->w() <= 0) ||
(image->h() <= 0) ||
- (image->d() <= 0) )) {
+ (image->d() < 0) ||
+ (image->count() <= 0))) {
// Image has errors? Show big 'X'
previewBox->label("X");
previewBox->align(FL_ALIGN_CLIP);
@@ -1665,18 +1668,22 @@ quote_pathname(char *dst, // O - Destination string
const char *src, // I - Source string
int dstsize) // I - Size of destination string
{
- dstsize --;
+ dstsize--; // prepare for trailing zero
while (*src && dstsize > 1) {
if (*src == '\\') {
// Convert backslash to forward slash...
*dst++ = '\\';
*dst++ = '/';
+ dstsize -= 2;
src ++;
} else {
- if (*src == '/') *dst++ = '\\';
-
+ if (*src == '/') {
+ *dst++ = '\\';
+ dstsize--;
+ }
*dst++ = *src++;
+ dstsize--;
}
}
@@ -1693,17 +1700,35 @@ unquote_pathname(char *dst, // O - Destination string
const char *src, // I - Source string
int dstsize) // I - Size of destination string
{
- dstsize --;
+ dstsize--; // prepare for trailing zero
- while (*src && dstsize > 1) {
- if (*src == '\\') src ++;
+ while (*src && dstsize > 0) {
+ if (*src == '\\') src++;
*dst++ = *src++;
+ dstsize--;
}
*dst = '\0';
}
+//
+// 'get_homedir()' - Try to find the home directory (platform dependent).
+
+static const char*
+get_homedir() {
+
+ const char *home = fl_getenv("HOME");
+
+#ifdef WIN32
+
+ if (!home) home = fl_getenv("UserProfile");
+
+#endif // WIN32
+
+ return home;
+}
+
//
-// End of "$Id: Fl_File_Chooser2.cxx 10004 2013-10-21 04:58:43Z greg.ercolano $".
+// End of "$Id: Fl_File_Chooser2.cxx 11813 2016-07-15 20:01:08Z AlbrechtS $".
//
diff --git a/src/Fl_File_Icon.cxx b/src/Fl_File_Icon.cxx
index 1dff04a..52adcf1 100644
--- a/src/Fl_File_Icon.cxx
+++ b/src/Fl_File_Icon.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Icon.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_File_Icon.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $"
//
// Fl_File_Icon routines.
//
@@ -120,7 +120,7 @@ Fl_File_Icon::~Fl_File_Icon() {
// Find the icon in the list...
for (current = first_, prev = (Fl_File_Icon *)0;
current != this && current != (Fl_File_Icon *)0;
- prev = current, current = current->next_);
+ prev = current, current = current->next_) {/*empty*/}
// Remove the icon from the list as needed...
if (current)
@@ -479,5 +479,5 @@ Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data
//
-// End of "$Id: Fl_File_Icon.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_File_Icon.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $".
//
diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx
index 89d7958..45f65f3 100644
--- a/src/Fl_File_Icon2.cxx
+++ b/src/Fl_File_Icon2.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Icon2.cxx 10140 2014-05-01 15:55:03Z manolo $"
+// "$Id: Fl_File_Icon2.cxx 12028 2016-10-14 16:35:44Z AlbrechtS $"
//
// Fl_File_Icon system icon routines.
//
@@ -353,9 +353,10 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from
temp; // Temporary color
const uchar *row; // Pointer into image
+ const int extra_data = img->ld() ? (img->ld()-img->w()*img->d()) : 0;
// Loop through grayscale or RGB image...
- for (y = 0, row = (const uchar *)(*(img->data())); y < img->h(); y ++, row += img->ld())
+ for (y = 0, row = (const uchar *)(*(img->data())); y < img->h(); y ++, row += extra_data)
{
for (x = 0, startx = 0, c = (Fl_Color)-1;
x < img->w();
@@ -427,7 +428,6 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from
int x, y; // X & Y in image
int startx; // Starting X coord
-
// Get the pixmap data...
ptr = img->data();
sscanf(*ptr, "%*d%*d%d%d", &ncolors, &chars_per_color);
@@ -1014,5 +1014,5 @@ get_kde_val(char *str,
//
-// End of "$Id: Fl_File_Icon2.cxx 10140 2014-05-01 15:55:03Z manolo $".
+// End of "$Id: Fl_File_Icon2.cxx 12028 2016-10-14 16:35:44Z AlbrechtS $".
//
diff --git a/src/Fl_GDI_Printer.cxx b/src/Fl_GDI_Printer.cxx
index ad1988b..4c32884 100644
--- a/src/Fl_GDI_Printer.cxx
+++ b/src/Fl_GDI_Printer.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_GDI_Printer.cxx 10391 2014-10-23 11:33:43Z AlbrechtS $"
+// "$Id: Fl_GDI_Printer.cxx 10713 2015-04-22 14:40:01Z manolo $"
//
// Support for WIN32 printing for the Fast Light Tool Kit (FLTK).
//
@@ -55,6 +55,7 @@ static void WIN_SetupPrinterDeviceContext(HDC prHDC)
int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage)
// returns 0 iff OK
{
+ if (pagecount == 0) pagecount = 10000;
DWORD commdlgerr;
DOCINFO di;
char docName [256];
@@ -67,7 +68,12 @@ int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage)
pd.Flags = PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE | PD_NOSELECTION;
pd.nMinPage = 1;
pd.nMaxPage = pagecount;
- if (PrintDlg (&pd) != 0) {
+ BOOL b = PrintDlg (&pd);
+ if (pd.hwndOwner) { // restore the correct state of mouse buttons and keyboard modifier keys (STR #3221)
+ WNDPROC windproc = (WNDPROC)GetWindowLongPtrW(pd.hwndOwner, GWLP_WNDPROC);
+ CallWindowProc(windproc, pd.hwndOwner, WM_ACTIVATEAPP, 1, 0);
+ }
+ if (b != 0) {
hPr = pd.hDC;
if (hPr != NULL) {
strcpy (docName, "FLTK");
@@ -76,14 +82,14 @@ int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage)
di.lpszDocName = (LPCSTR) docName;
prerr = StartDoc (hPr, &di);
if (prerr < 1) {
- abortPrint = TRUE;
- //fl_alert ("StartDoc error %d", prerr);
- err = 1;
+ abortPrint = TRUE;
+ //fl_alert ("StartDoc error %d", prerr);
+ err = 1;
}
} else {
commdlgerr = CommDlgExtendedError ();
fl_alert ("Unable to create print context, error %lu",
- (unsigned long) commdlgerr);
+ (unsigned long) commdlgerr);
err = 1;
}
} else {
@@ -277,5 +283,5 @@ void Fl_System_Printer::untranslate (void)
#endif // WIN32
//
-// End of "$Id: Fl_GDI_Printer.cxx 10391 2014-10-23 11:33:43Z AlbrechtS $".
+// End of "$Id: Fl_GDI_Printer.cxx 10713 2015-04-22 14:40:01Z manolo $".
//
diff --git a/src/Fl_GIF_Image.cxx b/src/Fl_GIF_Image.cxx
index 179d04a..9616a60 100644
--- a/src/Fl_GIF_Image.cxx
+++ b/src/Fl_GIF_Image.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_GIF_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_GIF_Image.cxx 10751 2015-06-14 17:07:31Z AlbrechtS $"
//
// Fl_GIF_Image routines.
//
-// Copyright 1997-2010 by Bill Spitzak and others.
+// Copyright 1997-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -70,28 +70,37 @@ typedef unsigned char uchar;
#define NEXTBYTE (uchar)getc(GifFile)
#define GETSHORT(var) var = NEXTBYTE; var += NEXTBYTE << 8
-/**
- The constructor loads the named GIF image.
- <P>The inherited destructor free all memory and server resources that are used by
- the image.
-*/
+/**
+ The constructor loads the named GIF image.
+
+ The destructor frees all memory and server resources that are used by
+ the image.
+
+ Use Fl_Image::fail() to check if Fl_GIF_Image failed to load. fail() returns
+ ERR_FILE_ACCESS if the file could not be opened or read, ERR_FORMAT if the
+ GIF format could not be decoded, and ERR_NO_IMAGE if the image could not
+ be loaded for another reason.
+ */
Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
FILE *GifFile; // File to read
char **new_data; // Data array
if ((GifFile = fl_fopen(infname, "rb")) == NULL) {
Fl::error("Fl_GIF_Image: Unable to open %s!", infname);
+ ld(ERR_FILE_ACCESS);
return;
}
{char b[6];
if (fread(b,1,6,GifFile)<6) {
fclose(GifFile);
+ ld(ERR_FILE_ACCESS);
return; /* quit on eof */
}
if (b[0]!='G' || b[1]!='I' || b[2] != 'F') {
fclose(GifFile);
Fl::error("Fl_GIF_Image: %s is not a GIF file.\n", infname);
+ ld(ERR_FORMAT);
return;
}
if (b[3]!='8' || b[4]>'9' || b[5]!= 'a')
@@ -135,6 +144,7 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
if (i<0) {
fclose(GifFile);
Fl::error("Fl_GIF_Image: %s - unexpected EOF",infname);
+ w(0); h(0); d(0); ld(ERR_FORMAT);
return;
}
int blocklen;
@@ -377,5 +387,5 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
//
-// End of "$Id: Fl_GIF_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_GIF_Image.cxx 10751 2015-06-14 17:07:31Z AlbrechtS $".
//
diff --git a/src/Fl_Gl_Choice.H b/src/Fl_Gl_Choice.H
index b9616c9..e67c5a4 100644
--- a/src/Fl_Gl_Choice.H
+++ b/src/Fl_Gl_Choice.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Gl_Choice.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_Gl_Choice.H 10498 2014-12-20 07:19:23Z manolo $"
//
// OpenGL definitions for the Fast Light Tool Kit (FLTK).
//
@@ -51,10 +51,16 @@
# include <FL/gl.h>
# define GLContext HGLRC
#elif defined(__APPLE_QUARTZ__)
-// warning: the Quartz version should probably use Core GL (CGL) instead of AGL
# include <OpenGL/gl.h>
-# include <AGL/agl.h>
-# define GLContext AGLContext
+#ifdef __OBJC__
+@class NSOpenGLPixelFormat;
+@class NSOpenGLContext;
+#else
+class NSOpenGLPixelFormat;
+class NSOpenGLContext;
+#endif // __OBJC__
+typedef NSOpenGLContext* FLOpenGLContextPtr;
+# define GLContext FLOpenGLContextPtr
#else
# include <GL/glx.h>
# define GLContext GLXContext
@@ -70,8 +76,7 @@ public:
int pixelformat; // the visual to use
PIXELFORMATDESCRIPTOR pfd; // some wgl calls need this thing
#elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
- AGLPixelFormat pixelformat;
+ NSOpenGLPixelFormat* pixelformat;
#else
XVisualInfo *vis; // the visual to use
Colormap colormap; // a colormap for that visual
@@ -89,7 +94,6 @@ class Fl_Window;
GLContext fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*, int layer=0);
#elif defined(__APPLE_QUARTZ__)
-// warning: the Quartz version should probably use Core GL (CGL) instead of AGL
GLContext fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*, int layer=0);
@@ -111,5 +115,5 @@ void fl_delete_gl_context(GLContext);
#endif
//
-// End of "$Id: Fl_Gl_Choice.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_Gl_Choice.H 10498 2014-12-20 07:19:23Z manolo $".
//
diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx
index 47afcbe..ca912af 100644
--- a/src/Fl_Gl_Choice.cxx
+++ b/src/Fl_Gl_Choice.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Gl_Choice.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_Gl_Choice.cxx 10848 2015-08-31 16:43:41Z manolo $"
//
// OpenGL visual selection code for the Fast Light Tool Kit (FLTK).
//
@@ -27,14 +27,11 @@
# include "flstring.h"
# include <FL/fl_utf8.h>
-# ifdef __APPLE__
-# include <ApplicationServices/ApplicationServices.h>
-# include <FL/Fl_Window.H>
-# endif
-
# ifdef WIN32
void fl_save_dc(HWND, HDC);
-# endif
+#elif defined(__APPLE__)
+extern void gl_texture_reset();
+#endif
static Fl_Gl_Choice *first;
@@ -108,53 +105,7 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int m, const int *alistp) {
}
#elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
- const int *blist;
- int list[32];
-
- if (alistp)
- blist = alistp;
- else {
- int n = 0;
- if (m & FL_INDEX) {
- list[n++] = AGL_BUFFER_SIZE;
- list[n++] = 8; // glut tries many sizes, but this should work...
- } else {
- list[n++] = AGL_RGBA;
- list[n++] = AGL_GREEN_SIZE;
- list[n++] = (m & FL_RGB8) ? 8 : 1;
- if (m & FL_ALPHA) {
- list[n++] = AGL_ALPHA_SIZE;
- list[n++] = (m & FL_RGB8) ? 8 : 1;
- }
- if (m & FL_ACCUM) {
- list[n++] = AGL_ACCUM_GREEN_SIZE;
- list[n++] = 1;
- if (m & FL_ALPHA) {
- list[n++] = AGL_ACCUM_ALPHA_SIZE;
- list[n++] = 1;
- }
- }
- }
- if (m & FL_DOUBLE) {
- list[n++] = AGL_DOUBLEBUFFER;
- }
- if (m & FL_DEPTH) {
- list[n++] = AGL_DEPTH_SIZE; list[n++] = 24;
- }
- if (m & FL_STENCIL) {
- list[n++] = AGL_STENCIL_SIZE; list[n++] = 1;
- }
-# ifdef AGL_STEREO
- if (m & FL_STEREO) {
- list[n++] = AGL_STEREO;
- }
-# endif
- list[n] = AGL_NONE;
- blist = list;
- }
- fl_open_display();
- AGLPixelFormat fmt = aglChoosePixelFormat(NULL, 0, (GLint*)blist);
+ NSOpenGLPixelFormat* fmt = Fl_X::mode_to_NSOpenGLPixelFormat(m, alistp);
if (!fmt) return 0;
#elif defined(WIN32)
@@ -216,7 +167,6 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int m, const int *alistp) {
g->pixelformat = pixelformat;
g->pfd = chosen_pfd;
# elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
g->pixelformat = fmt;
# else
# error unsupported platform
@@ -287,44 +237,16 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
}
# elif defined(__APPLE_QUARTZ__)
-#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && __LP64__)
-static CGrafPtr fl_GetWindowPort(WindowRef window)
-{
- typedef CGrafPtr (*wf)(WindowRef);
- static wf f = NULL;
- if ( ! f) f = (wf)Fl_X::get_carbon_function("GetWindowPort");
- return (*f)(window);
-}
-#endif
-// warning: the Quartz version should probably use Core GL (CGL) instead of AGL
GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer) {
GLContext context, shared_ctx = 0;
if (context_list && nContext) shared_ctx = context_list[0];
- context = aglCreateContext( g->pixelformat, shared_ctx);
+ // resets the pile of string textures used to draw strings
+ // necessary before the first context is created
+ if (!shared_ctx) gl_texture_reset();
+ context = Fl_X::create_GLcontext_for_window(g->pixelformat, shared_ctx, window);
if (!context) return 0;
add_context((GLContext)context);
- if ( window->parent() ) {
- int H = window->window()->h();
- GLint rect[] = { window->x(), H-window->h()-window->y(), window->w(), window->h() };
- aglSetInteger( (GLContext)context, AGL_BUFFER_RECT, rect );
- aglEnable( (GLContext)context, AGL_BUFFER_RECT );
- }
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-#if __LP64__
- // 64 bit version
- aglSetWindowRef(context, Fl_X::i(window)->window_ref() );
-#else
- // 32 bit version >= 10.5
- if (aglSetWindowRef != NULL)
- aglSetWindowRef(context, Fl_X::i(window)->window_ref() );
- else
- aglSetDrawable( context, fl_GetWindowPort( Fl_X::i(window)->window_ref() ) );
-#endif
-#else
- // 32 bit version < 10.5
- aglSetDrawable( context, fl_GetWindowPort( Fl_X::i(window)->window_ref() ) );
-#endif
return (context);
}
# else
@@ -343,29 +265,7 @@ void fl_set_gl_context(Fl_Window* w, GLContext context) {
# elif defined(WIN32)
wglMakeCurrent(Fl_X::i(w)->private_dc, context);
# elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
- if ( w->parent() ) { //: resize our GL buffer rectangle
- int H = w->window()->h();
- GLint rect[] = { w->x(), H-w->h()-w->y(), w->w(), w->h() };
- aglSetInteger( context, AGL_BUFFER_RECT, rect );
- aglEnable( context, AGL_BUFFER_RECT );
- }
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-#if __LP64__
- // 64 bit version
- aglSetWindowRef(context, Fl_X::i(w)->window_ref() );
-#else
- // 32 bit version >= 10.5
- if (aglSetWindowRef != NULL)
- aglSetWindowRef(context, Fl_X::i(w)->window_ref() );
- else
- aglSetDrawable( context, fl_GetWindowPort( Fl_X::i(w)->window_ref() ) );
-#endif
-#else
- // 32 bit version < 10.5
- aglSetDrawable( context, fl_GetWindowPort( Fl_X::i(w)->window_ref() ) );
-#endif
- aglSetCurrentContext(context);
+ Fl_X::GLcontext_makecurrent(context);
# else
# error unsupported platform
# endif
@@ -380,15 +280,7 @@ void fl_no_gl_context() {
# elif defined(WIN32)
wglMakeCurrent(0, 0);
# elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
- AGLContext ctx = aglGetCurrentContext();
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- if (aglSetWindowRef != NULL)
- { if(ctx) aglSetWindowRef(ctx, NULL ); }
- else
-#endif
- if(ctx) aglSetDrawable( ctx, NULL );
- aglSetCurrentContext(0);
+ Fl_X::GL_cleardrawable();
# else
# error unsupported platform
# endif
@@ -401,8 +293,7 @@ void fl_delete_gl_context(GLContext context) {
# elif defined(WIN32)
wglDeleteContext(context);
# elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
- aglDestroyContext( context );
+ Fl_X::GLcontext_release(context);
# else
# error unsupported platform
# endif
@@ -413,5 +304,5 @@ void fl_delete_gl_context(GLContext context) {
//
-// End of "$Id: Fl_Gl_Choice.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_Gl_Choice.cxx 10848 2015-08-31 16:43:41Z manolo $".
//
diff --git a/src/Fl_Gl_Device_Plugin.cxx b/src/Fl_Gl_Device_Plugin.cxx
index 313cd8e..9720091 100644
--- a/src/Fl_Gl_Device_Plugin.cxx
+++ b/src/Fl_Gl_Device_Plugin.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Gl_Device_Plugin.cxx 10051 2014-01-10 16:50:55Z manolo $"
+// "$Id: Fl_Gl_Device_Plugin.cxx 11943 2016-09-13 11:51:24Z manolo $"
//
// implementation of class Fl_Gl_Device_Plugin for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010 by Bill Spitzak and others.
+// Copyright 2010-2014 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -20,26 +20,47 @@
#include <FL/Fl_Printer.H>
#include <FL/Fl_Gl_Window.H>
#include "Fl_Gl_Choice.H"
+#include <FL/Fl_RGB_Image.H>
#include "FL/Fl.H"
-#ifndef __APPLE__
-#include "FL/fl_draw.H"
-#endif
#if defined(__APPLE__)
-static void imgProviderReleaseData (void *info, const void *data, size_t size)
+uchar *convert_BGRA_to_RGB(uchar *baseAddress, int w, int h, int mByteWidth)
{
- free((void *)data);
+ uchar *newimg = new uchar[3*w*h];
+ uchar *to = newimg;
+ for (int i = 0; i < h; i++) {
+ uchar *from = baseAddress + i * mByteWidth;
+ for (int j = 0; j < w; j++, from += 4) {
+#if defined(__ppc__) && __ppc__
+ memcpy(to, from + 1, 3);
+ to += 3;
+#else
+ *(to++) = *(from+2);
+ *(to++) = *(from+1);
+ *(to++) = *from;
+#endif
+ }
+ }
+ delete[] baseAddress;
+ return newimg;
}
#endif
-static void print_gl_window(Fl_Gl_Window *glw, int x, int y, int height)
+static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w, int h)
+/* captures a rectangle of a Fl_Gl_Window window, and returns it as a RGB image
+ stored from bottom to top.
+ */
{
#if defined(__APPLE__)
const int bytesperpixel = 4;
+ float factor = glw->pixels_per_unit();
+ if (factor > 1) {
+ w *= factor; h *= factor; x *= factor; y *= factor;
+ }
#else
const int bytesperpixel = 3;
#endif
- glw->flush(); // forces a GL redraw necessary for the glpuzzle demo
+ glw->flush(); // forces a GL redraw, necessary for the glpuzzle demo
// Read OpenGL context pixels directly.
// For extra safety, save & restore OpenGL states that are changed
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
@@ -48,66 +69,73 @@ static void print_gl_window(Fl_Gl_Window *glw, int x, int y, int height)
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
// Read a block of pixels from the frame buffer
- int mByteWidth = glw->w() * bytesperpixel;
+ int mByteWidth = w * bytesperpixel;
mByteWidth = (mByteWidth + 3) & ~3; // Align to 4 bytes
- uchar *baseAddress = (uchar*)malloc(mByteWidth * glw->h());
- glReadPixels(0, 0, glw->w(), glw->h(),
+ uchar *baseAddress = new uchar[mByteWidth * h];
+ glReadPixels(x, glw->pixel_h() - (y+h), w, h,
#if defined(__APPLE__)
- GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
#else
- GL_RGB, GL_UNSIGNED_BYTE,
+ GL_RGB, GL_UNSIGNED_BYTE,
#endif
- baseAddress);
+ baseAddress);
glPopClientAttrib();
#if defined(__APPLE__)
-// kCGBitmapByteOrder32Host and CGBitmapInfo are supposed to arrive with 10.4
-// but some 10.4 don't have kCGBitmapByteOrder32Host, so we play a little #define game
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
-#define kCGBitmapByteOrder32Host 0
-#define CGBitmapInfo CGImageAlphaInfo
-#elif ! defined(kCGBitmapByteOrder32Host)
-#ifdef __BIG_ENDIAN__
-#define kCGBitmapByteOrder32Host (4 << 12)
-#else /* Little endian. */
-#define kCGBitmapByteOrder32Host (2 << 12)
-#endif
+ baseAddress = convert_BGRA_to_RGB(baseAddress, w, h, mByteWidth);
+ mByteWidth = 3 * w;
#endif
- CGColorSpaceRef cSpace = CGColorSpaceCreateDeviceRGB();
- CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, baseAddress, mByteWidth * glw->h(), imgProviderReleaseData);
- CGImageRef image = CGImageCreate(glw->w(), glw->h(), 8, 8*bytesperpixel, mByteWidth, cSpace,
- (CGBitmapInfo)(kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host),
- provider, NULL, false, kCGRenderingIntentDefault);
- if(image == NULL) return;
- CGContextSaveGState(fl_gc);
- CGContextTranslateCTM(fl_gc, 0, height);
- CGContextScaleCTM(fl_gc, 1.0f, -1.0f);
- CGRect rect = { { x, height - y - glw->h() }, { glw->w(), glw->h() } };
- Fl_X::q_begin_image(rect, 0, 0, glw->w(), glw->h());
- CGContextDrawImage(fl_gc, rect, image);
- Fl_X::q_end_image();
- CGContextRestoreGState(fl_gc);
- CGImageRelease(image);
- CGColorSpaceRelease(cSpace);
- CGDataProviderRelease(provider);
-#else
- fl_draw_image(baseAddress + (glw->h() - 1) * mByteWidth, x, y , glw->w(), glw->h(), bytesperpixel, - mByteWidth);
- free(baseAddress);
-#endif // __APPLE__
+ Fl_RGB_Image *img = new Fl_RGB_Image(baseAddress, w, h, 3, mByteWidth);
+ img->alloc_array = 1;
+ return img;
+}
+
+#ifdef __APPLE__
+static void imgProviderReleaseData (void *info, const void *data, size_t size)
+{
+ delete (Fl_RGB_Image *)info;
}
+#endif
/**
- This class will make sure that OpenGL printing is available if fltk_gl
- was linked to the program.
+ This class will make sure that OpenGL printing/screen capture is available if fltk_gl
+ was linked to the program
*/
class Fl_Gl_Device_Plugin : public Fl_Device_Plugin {
public:
Fl_Gl_Device_Plugin() : Fl_Device_Plugin(name()) { }
virtual const char *name() { return "opengl.device.fltk.org"; }
- virtual int print(Fl_Widget *w, int x, int y, int height) {
+ virtual int print(Fl_Widget *w, int x, int y, int height /*useless*/) {
Fl_Gl_Window *glw = w->as_gl_window();
if (!glw) return 0;
- print_gl_window(glw, x, y, height);
- return 1;
+ Fl_RGB_Image *img = capture_gl_rectangle(glw, 0, 0, glw->w(), glw->h());
+#ifdef __APPLE__
+ if (Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) {
+ // convert the image to CGImage, and draw it at full res (useful on retina display)
+ CGColorSpaceRef cSpace = CGColorSpaceCreateDeviceRGB();
+ CGDataProviderRef provider = CGDataProviderCreateWithData(img, img->array, img->ld() * img->h(), imgProviderReleaseData);
+ CGImageRef cgimg = CGImageCreate(img->w(), img->h(), 8, 24, img->ld(), cSpace,
+ (CGBitmapInfo)(kCGImageAlphaNone),
+ provider, NULL, false, kCGRenderingIntentDefault);
+ CGColorSpaceRelease(cSpace);
+ CGDataProviderRelease(provider);
+ CGContextDrawImage(fl_gc, CGRectMake(0, 0, glw->w(), glw->h()), cgimg);
+ CFRelease(cgimg);
+ return 1;
+ } else if (img->w() > glw->w()) {
+ Fl_RGB_Image *img2 = (Fl_RGB_Image*)img->copy(glw->w(), glw->h());
+ delete img;
+ img = img2;
+ }
+#endif
+ int ld = img->ld() ? img->ld() : img->w() * img->d();
+ fl_draw_image(img->array + (img->h() - 1) * ld, x, y , img->w(), img->h(), 3, - ld);
+ delete img;
+ return 1;
+ }
+ virtual Fl_RGB_Image* rectangle_capture(Fl_Widget *widget, int x, int y, int w, int h) {
+ Fl_Gl_Window *glw = widget->as_gl_window();
+ if (!glw) return NULL;
+ return capture_gl_rectangle(glw, x, y, w, h);
}
};
@@ -118,5 +146,5 @@ static Fl_Gl_Device_Plugin Gl_Device_Plugin;
FL_EXPORT int fl_gl_load_plugin = 0;
//
-// End of "$Id: Fl_Gl_Device_Plugin.cxx 10051 2014-01-10 16:50:55Z manolo $".
+// End of "$Id: Fl_Gl_Device_Plugin.cxx 11943 2016-09-13 11:51:24Z manolo $".
//
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 257085c..7e46fe5 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Gl_Window.cxx 10214 2014-06-30 10:30:58Z ossman $"
+// "$Id: Fl_Gl_Window.cxx 11787 2016-06-22 05:44:14Z manolo $"
//
// OpenGL window code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -20,16 +20,14 @@
#if HAVE_GL
extern int fl_gl_load_plugin;
-#ifdef __APPLE__
-extern void gl_texture_reset();
-#endif
#include <FL/Fl.H>
#include <FL/x.H>
+#include "Fl_Gl_Choice.H"
#ifdef __APPLE__
#include <FL/gl.h>
+#include <OpenGL/OpenGL.h>
#endif
-#include "Fl_Gl_Choice.H"
#include <FL/Fl_Gl_Window.H>
#include <stdlib.h>
#include <FL/fl_utf8.h>
@@ -71,7 +69,6 @@ void Fl_Gl_Window::show() {
if (!shown()) {
if (!g) {
g = Fl_Gl_Choice::find(mode_,alist);
-
if (!g && (mode_ & FL_DOUBLE) == FL_SINGLE) {
g = Fl_Gl_Choice::find(mode_ | FL_DOUBLE,alist);
if (g) mode_ |= FL_FAKE_SINGLE;
@@ -97,6 +94,15 @@ void Fl_Gl_Window::show() {
#endif /* __APPLE__ */
}
+#if defined(__APPLE__)
+
+float Fl_Gl_Window::pixels_per_unit()
+{
+ return (fl_mac_os_version >= 100700 && Fl::use_high_res_GL() && Fl_X::i(this) && Fl_X::i(this)->mapped_to_retina()) ? 2 : 1;
+}
+
+#endif // __APPLE__
+
/**
The invalidate() method turns off valid() and is
equivalent to calling value(0).
@@ -112,13 +118,25 @@ void Fl_Gl_Window::invalidate() {
#endif
}
-/**
- See const int Fl_Gl_Window::mode() const
-*/
int Fl_Gl_Window::mode(int m, const int *a) {
if (m == mode_ && a == alist) return 0;
#ifndef __APPLE__
int oldmode = mode_;
+#endif
+#if defined(__APPLE__) || defined(USE_X11)
+ if (a) { // when the mode is set using the a array of system-dependent values, and if asking for double buffer,
+ // the FL_DOUBLE flag must be set in the mode_ member variable
+ const int *aa = a;
+ while (*aa) {
+ if (*(aa++) ==
+# if defined(__APPLE__)
+ kCGLPFADoubleBuffer
+# else
+ GLX_DOUBLEBUFFER
+# endif
+ ) { m |= FL_DOUBLE; break; }
+ }
+ }
#endif // !__APPLE__
#if !defined(WIN32) && !defined(__APPLE__)
Fl_Gl_Choice* oldg = g;
@@ -140,7 +158,6 @@ int Fl_Gl_Window::mode(int m, const int *a) {
show();
}
#elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
redraw();
#else
# error unsupported platform
@@ -163,41 +180,22 @@ int Fl_Gl_Window::mode(int m, const int *a) {
void Fl_Gl_Window::make_current() {
// puts("Fl_Gl_Window::make_current()");
// printf("make_current: context_=%p\n", context_);
+#if defined(__APPLE__)
+ // detect if the window was moved between low and high resolution displays
+ if (Fl_X::i(this)->changed_resolution()){
+ Fl_X::i(this)->changed_resolution(false);
+ invalidate();
+ Fl_X::GLcontext_update(context_);
+ }
+#endif
if (!context_) {
mode_ &= ~NON_LOCAL_CONTEXT;
context_ = fl_create_gl_context(this, g);
valid(0);
context_valid(0);
-#ifdef __APPLE__
- // resets the pile of string textures used to draw strings
- gl_texture_reset();
-#endif
}
fl_set_gl_context(this, context_);
-#ifdef __APPLE__
- // Set the buffer rectangle here, since in resize() we won't have the
- // correct parent window size to work with...
- GLint xywh[4];
-
- if (window()) {
- int xoff,yoff;
- const Fl_Window *win = top_window_offset(xoff, yoff); // STR #2944 [2]
- xywh[0] = xoff;
- xywh[1] = win->h() - yoff - h();
- } else {
- xywh[0] = 0;
- xywh[1] = 0;
- }
-
- xywh[2] = w();
- xywh[3] = h();
-
- aglSetInteger(context_, AGL_BUFFER_RECT, xywh);
- aglEnable(context_, AGL_BUFFER_RECT);
-// printf("make_current: xywh=[%d %d %d %d]\n", xywh[0], xywh[1], xywh[2], xywh[3]);
-#endif // __APPLE__
-
#if defined(WIN32) && USE_COLORMAP
if (fl_palette) {
fl_GetDC(fl_xid(this));
@@ -227,8 +225,8 @@ void Fl_Gl_Window::ortho() {
GLint v[2];
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, v);
glLoadIdentity();
- glViewport(w()-v[0], h()-v[1], v[0], v[1]);
- glOrtho(w()-v[0], w(), h()-v[1], h(), -1, 1);
+ glViewport(pixel_w()-v[0], pixel_h()-v[1], v[0], v[1]);
+ glOrtho(pixel_w()-v[0], pixel_w(), pixel_h()-v[1], pixel_h(), -1, 1);
#endif
}
@@ -252,7 +250,7 @@ void Fl_Gl_Window::swap_buffers() {
// STR# 2944 [1]
// Save matrixmode/proj/modelview/rasterpos before doing overlay.
//
- int wo=w(), ho=h();
+ int wo=pixel_w(), ho=pixel_h();
GLint matrixmode;
GLfloat pos[4];
glGetIntegerv(GL_MATRIX_MODE, &matrixmode);
@@ -278,8 +276,10 @@ void Fl_Gl_Window::swap_buffers() {
glMatrixMode(matrixmode);
glRasterPos3f(pos[0], pos[1], pos[2]); // restore original glRasterPos
}
- else
+ /* // nothing to do here under Cocoa because [NSOpenGLContext -flushBuffer] done later replaces it
+ else
aglSwapBuffers((AGLContext)context_);
+ */
#else
# error unsupported platform
#endif
@@ -298,19 +298,6 @@ void Fl_Gl_Window::flush() {
uchar save_valid_f = valid_f_;
#endif
-#if defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
- //: clear previous clipping in this shared port
-#if ! __LP64__
-/*GrafPtr port = GetWindowPort( Fl_X::i(this)->window_ref() );
- Rect rect; SetRect( &rect, 0, 0, 0x7fff, 0x7fff );
- GrafPtr old; GetPort( &old );
- SetPort( port );
- ClipRect( &rect );
- SetPort( old );*/
-#endif
-#endif
-
#if HAVE_GL_OVERLAY && defined(WIN32)
// Draw into hardware overlay planes if they are damaged:
@@ -391,22 +378,25 @@ void Fl_Gl_Window::flush() {
glReadBuffer(GL_BACK);
glDrawBuffer(GL_FRONT);
glLoadIdentity();
- glViewport(0, 0, w(), h());
- glOrtho(0, w(), 0, h(), -1, 1);
+ 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,w(),h(),GL_COLOR);
+ glCopyPixels(0,0,pixel_w(),pixel_h(),GL_COLOR);
make_current(); // set current context back to draw overlay
damage1_ = 0;
} else {
- damage1_ = damage();
- clear_damage(0xff); draw();
- swap_buffers();
+ damage1_ = damage();
+ clear_damage(0xff); draw();
+ swap_buffers();
}
}
+#ifdef __APPLE__
+ Fl_X::GLcontext_flushbuffer(context_);
+#endif
if (overlay==this && SWAP_TYPE != SWAP) { // fake overlay in front buffer
glDrawBuffer(GL_FRONT);
@@ -431,12 +421,16 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
// printf("Fl_Gl_Window::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
// printf("current: x()=%d, y()=%d, w()=%d, h()=%d\n", x(), y(), w(), h());
- if (W != w() || H != h()) valid(0);
-
+ int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h());
+ if (is_a_resize) valid(0);
+
#ifdef __APPLE__
- if (X != x() || Y != y() || W != w() || H != h()) aglUpdateContext(context_);
-#elif !defined(WIN32)
- if ((W != w() || H != h()) && !resizable() && overlay && overlay != this) {
+ Fl_X *flx = Fl_X::i(this);
+ if (flx && flx->in_windowDidResize()) Fl_X::GLcontext_update(context_);
+#endif
+
+#if ! ( defined(__APPLE__) || defined(WIN32) )
+ if (is_a_resize && !resizable() && overlay && overlay != this) {
((Fl_Gl_Window*)overlay)->resize(0,0,W,H);
}
#endif
@@ -445,8 +439,8 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
}
/**
- Returns or sets a pointer to the GLContext that this window is
- using. This is a system-dependent structure, but it is portable to copy
+ Sets a pointer to the GLContext that this window is using.
+ This is a system-dependent structure, but it is portable to copy
the context from one window to another. You can also set it to NULL,
which will force FLTK to recreate the context the next time make_current()
is called, this is useful for getting around bugs in OpenGL implementations.
@@ -548,18 +542,6 @@ void Fl_Gl_Window::draw() {
*/
int Fl_Gl_Window::handle(int event)
{
-#ifdef __APPLE_QUARTZ__
- if (event==FL_HIDE) {
- // if we are not hidden, just the parent was hidden, so we must throw away the context
- if (!visible_r())
- context(0); // remove context without setting the hidden flags
- }
- if (event==FL_SHOW) {
- // if we are not hidden, just the parent was shown, so we must create a new context
- if (visible_r())
- show(); //
- }
-#endif
return Fl_Window::handle(event);
}
@@ -569,5 +551,5 @@ int Fl_Gl_Window::gl_plugin_linkage() {
}
//
-// End of "$Id: Fl_Gl_Window.cxx 10214 2014-06-30 10:30:58Z ossman $".
+// End of "$Id: Fl_Gl_Window.cxx 11787 2016-06-22 05:44:14Z manolo $".
//
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx
index 3f9f8fc..d08e0bd 100644
--- a/src/Fl_Group.cxx
+++ b/src/Fl_Group.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Group.cxx 10261 2014-08-29 12:10:11Z cand $"
+// "$Id: Fl_Group.cxx 10945 2015-12-02 09:59:37Z manolo $"
//
// Group widget for the Fast Light Tool Kit (FLTK).
//
@@ -877,5 +877,5 @@ Fl_Spinner::Fl_Spinner(int X, int Y, int W, int H, const char *L)
//
-// End of "$Id: Fl_Group.cxx 10261 2014-08-29 12:10:11Z cand $".
+// End of "$Id: Fl_Group.cxx 10945 2015-12-02 09:59:37Z manolo $".
//
diff --git a/src/Fl_Help_Dialog.cxx b/src/Fl_Help_Dialog.cxx
index b608cbe..23a360a 100644
--- a/src/Fl_Help_Dialog.cxx
+++ b/src/Fl_Help_Dialog.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Help_Dialog.cxx 10357 2014-10-05 11:28:29Z AlbrechtS $"
+// "$Id: Fl_Help_Dialog.cxx 10612 2015-03-10 01:41:55Z AlbrechtS $"
//
// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -23,7 +23,7 @@
// ========================================================================
//
-// generated by Fast Light User Interface Designer (fluid) version 1.0303
+// generated by Fast Light User Interface Designer (fluid) version 1.0304
#include "../FL/Fl_Help_Dialog.H"
#include "flstring.h"
@@ -295,5 +295,5 @@ int Fl_Help_Dialog::y() {
}
//
-// End of "$Id: Fl_Help_Dialog.cxx 10357 2014-10-05 11:28:29Z AlbrechtS $".
+// End of "$Id: Fl_Help_Dialog.cxx 10612 2015-03-10 01:41:55Z AlbrechtS $".
//
diff --git a/src/Fl_Help_Dialog.fl b/src/Fl_Help_Dialog.fl
index 42dc5d2..193b921 100644
--- a/src/Fl_Help_Dialog.fl
+++ b/src/Fl_Help_Dialog.fl
@@ -1,13 +1,13 @@
# data file for the Fltk User Interface Designer (fluid)
-version 1.0303
-header_name {../FL/Fl_Help_Dialog.H}
+version 1.0304
+header_name {../FL/Fl_Help_Dialog.H}
code_name {.cxx}
comment {//
-// "$Id: Fl_Help_Dialog.fl 10357 2014-10-05 11:28:29Z AlbrechtS $"
+// "$Id: Fl_Help_Dialog.fl 10783 2015-07-09 02:09:33Z AlbrechtS $"
//
// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -27,13 +27,13 @@ comment {//
// ========================================================================
//
} {in_source in_header
-}
+}
decl {\#include "flstring.h"} {private local
-}
+}
decl {\#include <FL/fl_ask.H>} {private local
-}
+}
class FL_EXPORT Fl_Help_Dialog {open
} {
@@ -51,7 +51,7 @@ class FL_EXPORT Fl_Help_Dialog {open
} {
Fl_Window window_ {
label {Help Dialog} open
- private xywh {398 64 530 385} type Double resizable size_range {260 150 0 0} visible
+ private xywh {398 64 530 385} type Double hide resizable size_range {260 150 0 0}
} {
Fl_Group {} {open selected
xywh {10 10 511 25}
@@ -261,10 +261,10 @@ window_->label(view_->title());} {}
} {
code {return (window_->y());} {}
}
-}
+}
comment {
//
-// End of "$Id: Fl_Help_Dialog.fl 10357 2014-10-05 11:28:29Z AlbrechtS $".
+// End of "$Id: Fl_Help_Dialog.fl 10783 2015-07-09 02:09:33Z AlbrechtS $".
//} {in_source in_header
-}
+}
diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx
index f2e3fe0..686cce9 100644
--- a/src/Fl_Help_View.cxx
+++ b/src/Fl_Help_View.cxx
@@ -1,11 +1,14 @@
//
-// "$Id: Fl_Help_View.cxx 10234 2014-08-21 12:18:32Z cand $"
+// "$Id: Fl_Help_View.cxx 11844 2016-07-23 04:25:40Z greg.ercolano $"
//
// Fl_Help_View widget routines.
//
// Copyright 1997-2010 by Easy Software Products.
// Image support by Matthias Melcher, Copyright 2000-2009.
//
+// Buffer management (HV_Edit_Buffer) and more by AlbrechtS and others.
+// Copyright 2011-2016 by Bill Spitzak and others.
+//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
@@ -68,7 +71,6 @@
#define MAX_COLUMNS 200
-
//
// Typedef the C API sort function type the only way I know how...
//
@@ -231,17 +233,15 @@ Fl_Color Fl_Help_View::hv_selection_color;
Fl_Color Fl_Help_View::hv_selection_text_color;
/*
- * Limitation: if a word contains &code; notations, we will calculate a wrong length.
- *
* This function must be optimized for speed!
*/
-void Fl_Help_View::hv_draw(const char *t, int x, int y)
+void Fl_Help_View::hv_draw(const char *t, int x, int y, int entity_extra_length)
{
if (selected && current_view==this && current_pos<selection_last && current_pos>=selection_first) {
Fl_Color c = fl_color();
fl_color(hv_selection_color);
int w = (int)fl_width(t);
- if (current_pos+(int)strlen(t)<selection_last)
+ if (current_pos+(int)strlen(t)<selection_last)
w += (int)fl_width(' ');
fl_rectf(x, y+fl_descent()-fl_height(), w, fl_height());
fl_color(hv_selection_text_color);
@@ -261,13 +261,228 @@ void Fl_Help_View::hv_draw(const char *t, int x, int y)
selection_push_last = l;
} else {
selection_drag_first = f;
- selection_drag_last = l;
+ selection_drag_last = l + entity_extra_length;
}
}
}
}
}
+#define DEBUG_EDIT_BUFFER 0
+
+#if (DEBUG_EDIT_BUFFER > 1)
+#define DEBUG_FUNCTION(L,F) \
+ printf("\n========\n [%d] --- %s\n========\n", L, F); \
+ fflush(stdout);
+#else
+#define DEBUG_FUNCTION(L,F)
+#endif
+
+
+/* ** Intentionally not Doxygen docs.
+ HelpView Edit Buffer management class.
+ <b>Internal use only.</b>
+
+ This class is for internal use in this file. Its sole purpose is to
+ allow buffer management to avoid buffer overflows in stack variables
+ used to edit strings for formatting and drawing (STR #3275).
+
+ This class will likely be superseded by an Fl_String or Fl_Buffer class
+ in a later FLTK release (1.4.x).
+
+ Note: The buffer allocation and extension size (chunk size) must be
+ a power of 2, but this is deliberately never checked, because this
+ class is only used here with default values. Using extension sizes
+ that are not a power of 2 may result in unpredictable behavior.
+*/
+
+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)
+
+ char *buf_; // internal buffer
+
+public:
+
+ HV_Edit_Buffer (int alloc = 1024, int ext = 1024); // c'tor
+ ~HV_Edit_Buffer (); // d'tor
+
+ char *c_str() { return buf_; }
+ void clear();
+ int size() { return size_; }
+ void check(int size);
+ const char *add(const char *text, int size = -1);
+ void add(char c);
+ void add(int ucs);
+
+ int cmp(const char * str) { return !strcasecmp(buf_, str); }
+ int width() { return (int)fl_width(buf_); }
+
+ char & operator[] (int idx) { return buf_[idx]; }
+ char operator[] (int idx) const { return buf_[idx]; }
+
+#if (DEBUG_EDIT_BUFFER)
+ void print(const char *text = "");
+#endif
+};
+
+/*
+ Edit buffer constructor.
+*/
+HV_Edit_Buffer::HV_Edit_Buffer(
+ int alloc,
+ int ext)
+{
+ alloc = (alloc + ext-1) & (~(ext-1)); // round to chunk size
+
+ size_ = 0;
+ allocated_ = alloc;
+ extend_ = ext;
+ buf_ = (char *)malloc(alloc);
+}
+
+/*
+ Clears the edit buffer, but doesn't free the buffer.
+*/
+void HV_Edit_Buffer::clear()
+{
+
+ // DEBUG_FUNCTION(__LINE__,__FUNCTION__);
+
+ size_ = 0;
+ buf_[0] = '\0';
+}
+
+/*
+ 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
+*/
+const char *HV_Edit_Buffer::add(const char *text, int size) {
+
+ if (size < 0) size = (int)strlen(text);
+ if (!size) return text;
+
+ check(size);
+
+#if (DEBUG_EDIT_BUFFER > 1)
+ printf("HV_Edit_Buffer::add(text,%d), allocated=%d, size=%d\n",
+ size, allocated_, size_+size);
+ fflush(stdout);
+#endif
+
+ memcpy(buf_+size_, text, size);
+ size_ += size;
+ buf_[size_] = '\0';
+
+ return (text + size);
+
+} // add(const char *text, int size)
+
+/*
+ Adds one byte (character) to the buffer.
+
+ \note It is possible to add partial UTF-8 sequences.
+
+ \param[in] c byte (char) to be added
+*/
+void HV_Edit_Buffer::add(char c) {
+
+ check(1);
+
+#if (DEBUG_EDIT_BUFFER > 1)
+ printf("HV_Edit_Buffer::add(char = '%c'), allocated=%d, size=%d\n",
+ c, allocated_, size_+1);
+ fflush(stdout);
+#endif
+
+ buf_[size_++] = c;
+ buf_[size_] = '\0';
+
+} // add(char c)
+
+/*
+ Adds one Unicode character (int) to the buffer.
+
+ 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
+*/
+void HV_Edit_Buffer::add(int ucs) {
+
+ int len;
+ char cbuf[6];
+
+ len = fl_utf8encode((unsigned int)ucs, cbuf);
+ if (len < 1) len = 1;
+ add(cbuf,len);
+
+} // add(int ucs)
+
+/*
+ Checks needed buffer size and reallocates the buffer if necessary.
+
+ Tests if the given string \p size can be added to the string buffer.
+ An additional nul byte is also considered in the calculation.
+
+ \p size must be >= 0.
+
+ 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)
+*/
+void HV_Edit_Buffer::check(int size) {
+
+ if (size_ + size + 1 <= allocated_) return;
+
+ int new_size = (allocated_ + size + extend_) & (~(extend_-1)); // round to chunk size
+
+ buf_ = (char *)realloc(buf_, new_size);
+
+#if (DEBUG_EDIT_BUFFER)
+ printf("HV_Edit_Buffer::check(%d), allocated: %d ->%d\n",
+ size, allocated_, new_size);
+ fflush(stdout);
+#endif
+
+ allocated_ = new_size;
+
+} // HV_Edit_Buffer::check()
+
+
+/*
+ The destructor frees the edit buffer.
+*/
+HV_Edit_Buffer::~HV_Edit_Buffer() {
+
+ if (buf_) {
+#if (DEBUG_EDIT_BUFFER)
+ printf("~HV_Edit_Buffer(): size = %d, allocated = %d\n",
+ size_, allocated_);
+ fflush(stdout);
+#endif
+ free(buf_);
+ }
+} // ~HV_Edit_Buffer()
+
+
+/*
+ Prints the edit buffer (Debug only).
+*/
+#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_);
+ 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
@@ -281,8 +496,8 @@ Fl_Help_View::add_block(const char *s, // I - Pointer to start of block text
Fl_Help_Block *temp; // New block
-// printf("add_block(s = %p, xx = %d, yy = %d, ww = %d, hh = %d, border = %d)\n",
-// s, xx, yy, ww, hh, border);
+ // printf("add_block(s = %p, xx = %d, yy = %d, ww = %d, hh = %d, border = %d)\n",
+ // s, xx, yy, ww, hh, border);
if (nblocks_ >= ablocks_)
{
@@ -432,14 +647,13 @@ Fl_Help_View::draw()
const Fl_Help_Block *block; // Pointer to current block
const char *ptr, // Pointer to text in block
*attrs; // Pointer to start of element attributes
- char *s, // Pointer into buffer
- buf[1024], // Text buffer
- attr[1024]; // Attribute buffer
+ 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
+ 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;
@@ -447,6 +661,8 @@ Fl_Help_View::draw()
int underline, // Underline text?
xtra_ww; // Extra width for underlined space between words
+ DEBUG_FUNCTION(__LINE__,__FUNCTION__);
+
// Draw the scrollbar(s) and box first...
ww = w();
hh = h();
@@ -512,17 +728,17 @@ Fl_Help_View::draw()
underline = 0;
initfont(font, fsize, fcolor);
-
- for (ptr = block->start, s = buf; ptr < block->end;)
+ // byte length difference between html entity (encoded by &...;) and
+ // UTF-8 encoding of same character
+ int entity_extra_length = 0;
+ for (ptr = block->start, buf.clear(); ptr < block->end;)
{
- if ((*ptr == '<' || isspace((*ptr)&255)) && s > buf)
+ if ((*ptr == '<' || isspace((*ptr)&255)) && buf.size() > 0)
{
if (!head && !pre)
{
// Check width...
- *s = '\0';
- s = buf;
- ww = (int)fl_width(buf);
+ ww = buf.width();
if (needspace && xx > block->x)
xx += (int)fl_width(' ');
@@ -536,7 +752,9 @@ Fl_Help_View::draw()
hh = 0;
}
- hv_draw(buf, xx + x() - leftline_, yy + y());
+ hv_draw(buf.c_str(), xx + x() - leftline_, yy + y(), entity_extra_length);
+ buf.clear();
+ entity_extra_length = 0;
if (underline) {
xtra_ww = isspace((*ptr)&255)?(int)fl_width(' '):0;
fl_xyline(xx + x() - leftline_, yy + y() + 1,
@@ -556,17 +774,13 @@ Fl_Help_View::draw()
{
if (*ptr == '\n')
{
- *s = '\0';
- s = buf;
-
- hv_draw(buf, xx + x() - leftline_, yy + y());
+ hv_draw(buf.c_str(), xx + x() - leftline_, yy + y());
if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1,
- xx + x() - leftline_ +
- (int)fl_width(buf));
-
- current_pos = (int) (ptr-value_);
+ xx + x() - leftline_ + buf.width());
+ buf.clear();
+ current_pos = (int) (ptr-value_);
if (line < 31)
- line ++;
+ line ++;
xx = block->line[line];
yy += hh;
hh = fsize + 2;
@@ -574,25 +788,24 @@ Fl_Help_View::draw()
else if (*ptr == '\t')
{
// Do tabs every 8 columns...
- while (((s - buf) & 7))
- *s++ = ' ';
+ buf.add(' '); // add at least one space
+ while (buf.size() & 7)
+ buf.add(' ');
+ }
+ else {
+ buf.add(' ');
}
- else
- *s++ = ' ';
-
if ((fsize + 2) > hh)
hh = fsize + 2;
ptr ++;
}
- if (s > buf)
+ if (buf.size() > 0)
{
- *s = '\0';
- s = buf;
-
- hv_draw(buf, xx + x() - leftline_, yy + y());
- ww = (int)fl_width(buf);
+ 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);
xx += ww;
@@ -603,7 +816,7 @@ Fl_Help_View::draw()
}
else
{
- s = buf;
+ buf.clear();
while (isspace((*ptr)&255))
ptr ++;
@@ -629,13 +842,7 @@ Fl_Help_View::draw()
}
while (*ptr && *ptr != '>' && !isspace((*ptr)&255))
- if (s < (buf + sizeof(buf) - 1))
- *s++ = *ptr++;
- else
- ptr ++;
-
- *s = '\0';
- s = buf;
+ buf.add(*ptr++);
attrs = ptr;
while (*ptr && *ptr != '>')
@@ -646,9 +853,9 @@ Fl_Help_View::draw()
// end of command reached, set the supposed start of printed eord here
current_pos = (int) (ptr-value_);
- if (strcasecmp(buf, "HEAD") == 0)
+ if (buf.cmp("HEAD"))
head = 1;
- else if (strcasecmp(buf, "BR") == 0)
+ else if (buf.cmp("BR"))
{
if (line < 31)
line ++;
@@ -656,7 +863,7 @@ Fl_Help_View::draw()
yy += hh;
hh = 0;
}
- else if (strcasecmp(buf, "HR") == 0)
+ else if (buf.cmp("HR"))
{
fl_line(block->x + x(), yy + y(), block->w + x(),
yy + y());
@@ -664,67 +871,64 @@ Fl_Help_View::draw()
if (line < 31)
line ++;
xx = block->line[line];
- yy += 2 * hh;
+ yy += 2 * fsize; //hh;
hh = 0;
}
- else if (strcasecmp(buf, "CENTER") == 0 ||
- strcasecmp(buf, "P") == 0 ||
- strcasecmp(buf, "H1") == 0 ||
- strcasecmp(buf, "H2") == 0 ||
- strcasecmp(buf, "H3") == 0 ||
- strcasecmp(buf, "H4") == 0 ||
- strcasecmp(buf, "H5") == 0 ||
- strcasecmp(buf, "H6") == 0 ||
- strcasecmp(buf, "UL") == 0 ||
- strcasecmp(buf, "OL") == 0 ||
- strcasecmp(buf, "DL") == 0 ||
- strcasecmp(buf, "LI") == 0 ||
- strcasecmp(buf, "DD") == 0 ||
- strcasecmp(buf, "DT") == 0 ||
- strcasecmp(buf, "PRE") == 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 (strcasecmp(buf, "DT") == 0)
+ else if (buf.cmp("DT"))
{
font = textfont_ | FL_ITALIC;
fsize = textsize_;
}
- else if (strcasecmp(buf, "PRE") == 0)
+ else if (buf.cmp("PRE"))
{
font = FL_COURIER;
fsize = textsize_;
pre = 1;
}
- if (strcasecmp(buf, "LI") == 0)
+ if (buf.cmp("LI"))
{
-// fl_font(FL_SYMBOL, fsize); // The default SYMBOL font on my XP box is not Unicode...
- char buf[8];
- wchar_t b[] = {0x2022, 0x0};
-// buf[fl_unicode2utf(b, 1, buf)] = 0;
- unsigned dstlen = fl_utf8fromwc(buf, 8, b, 1);
- buf[dstlen] = 0;
- hv_draw(buf, xx - fsize + x() - leftline_, yy + y());
+ // 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 (strcasecmp(buf, "A") == 0 &&
+ else if (buf.cmp("A") &&
get_attr(attrs, "HREF", attr, sizeof(attr)) != NULL)
{
fl_color(linkcolor_);
underline = 1;
}
- else if (strcasecmp(buf, "/A") == 0)
+ else if (buf.cmp("/A"))
{
fl_color(textcolor_);
underline = 0;
}
- else if (strcasecmp(buf, "FONT") == 0)
+ else if (buf.cmp("FONT"))
{
if (get_attr(attrs, "COLOR", attr, sizeof(attr)) != NULL) {
textcolor_ = get_color(attr, textcolor_);
@@ -752,19 +956,19 @@ Fl_Help_View::draw()
pushfont(font, fsize);
}
- else if (strcasecmp(buf, "/FONT") == 0)
+ else if (buf.cmp("/FONT"))
{
popfont(font, fsize, textcolor_);
}
- else if (strcasecmp(buf, "U") == 0)
+ else if (buf.cmp("U"))
underline = 1;
- else if (strcasecmp(buf, "/U") == 0)
+ else if (buf.cmp("/U"))
underline = 0;
- else if (strcasecmp(buf, "B") == 0 ||
- strcasecmp(buf, "STRONG") == 0)
+ else if (buf.cmp("B") ||
+ buf.cmp("STRONG"))
pushfont(font |= FL_BOLD, fsize);
- else if (strcasecmp(buf, "TD") == 0 ||
- strcasecmp(buf, "TH") == 0)
+ else if (buf.cmp("TD") ||
+ buf.cmp("TH"))
{
int tx, ty, tw, th;
@@ -803,39 +1007,39 @@ Fl_Help_View::draw()
if (block->border)
fl_rect(tx, ty, tw, th);
}
- else if (strcasecmp(buf, "I") == 0 ||
- strcasecmp(buf, "EM") == 0)
+ else if (buf.cmp("I") ||
+ buf.cmp("EM"))
pushfont(font |= FL_ITALIC, fsize);
- else if (strcasecmp(buf, "CODE") == 0 ||
- strcasecmp(buf, "TT") == 0)
+ else if (buf.cmp("CODE") ||
+ buf.cmp("TT"))
pushfont(font = FL_COURIER, fsize);
- else if (strcasecmp(buf, "KBD") == 0)
+ else if (buf.cmp("KBD"))
pushfont(font = FL_COURIER_BOLD, fsize);
- else if (strcasecmp(buf, "VAR") == 0)
+ else if (buf.cmp("VAR"))
pushfont(font = FL_COURIER_ITALIC, fsize);
- else if (strcasecmp(buf, "/HEAD") == 0)
+ else if (buf.cmp("/HEAD"))
head = 0;
- else if (strcasecmp(buf, "/H1") == 0 ||
- strcasecmp(buf, "/H2") == 0 ||
- strcasecmp(buf, "/H3") == 0 ||
- strcasecmp(buf, "/H4") == 0 ||
- strcasecmp(buf, "/H5") == 0 ||
- strcasecmp(buf, "/H6") == 0 ||
- strcasecmp(buf, "/B") == 0 ||
- strcasecmp(buf, "/STRONG") == 0 ||
- strcasecmp(buf, "/I") == 0 ||
- strcasecmp(buf, "/EM") == 0 ||
- strcasecmp(buf, "/CODE") == 0 ||
- strcasecmp(buf, "/TT") == 0 ||
- strcasecmp(buf, "/KBD") == 0 ||
- strcasecmp(buf, "/VAR") == 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 (strcasecmp(buf, "/PRE") == 0)
+ else if (buf.cmp("/PRE"))
{
popfont(font, fsize, fcolor);
pre = 0;
}
- else if (strcasecmp(buf, "IMG") == 0)
+ else if (buf.cmp("IMG"))
{
Fl_Shared_Image *img = 0;
int width, height;
@@ -885,13 +1089,12 @@ Fl_Help_View::draw()
needspace = 0;
}
+ buf.clear();
}
else if (*ptr == '\n' && pre)
{
- *s = '\0';
- s = buf;
-
- hv_draw(buf, xx + x() - leftline_, yy + y());
+ hv_draw(buf.c_str(), xx + x() - leftline_, yy + y());
+ buf.clear();
if (line < 31)
line ++;
@@ -908,12 +1111,13 @@ Fl_Help_View::draw()
if (pre)
{
if (*ptr == ' ')
- *s++ = ' ';
+ buf.add(' ');
else
{
// Do tabs every 8 columns...
- while (((s - buf) & 7))
- *s++ = ' ';
+ buf.add(' '); // at least one space
+ while (buf.size() & 7)
+ buf.add(' ');
}
}
@@ -921,20 +1125,21 @@ Fl_Help_View::draw()
if (!pre) current_pos = (int) (ptr-value_);
needspace = 1;
}
- else if (*ptr == '&')
+ else if (*ptr == '&') // process html entity
{
ptr ++;
int qch = quote_char(ptr);
if (qch < 0)
- *s++ = '&';
+ buf.add('&');
else {
- int l;
- l = fl_utf8encode((unsigned int) qch, s);
- if (l < 1) l = 1;
- s += l;
+ int utf8l = buf.size();
+ buf.add(qch);
+ utf8l = buf.size() - utf8l; // length of added UTF-8 text
+ const char *oldptr = ptr;
ptr = strchr(ptr, ';') + 1;
+ entity_extra_length += ptr - (oldptr-1) - utf8l; // extra length between html entity and UTF-8
}
if ((fsize + 2) > hh)
@@ -942,18 +1147,16 @@ Fl_Help_View::draw()
}
else
{
- *s++ = *ptr++;
+ buf.add(*ptr++);
if ((fsize + 2) > hh)
hh = fsize + 2;
}
}
- *s = '\0';
-
- if (s > buf && !pre && !head)
+ if (buf.size() > 0 && !pre && !head)
{
- ww = (int)fl_width(buf);
+ ww = buf.width();
if (needspace && xx > block->x)
xx += (int)fl_width(' ');
@@ -968,9 +1171,9 @@ Fl_Help_View::draw()
}
}
- if (s > buf && !head)
+ if (buf.size() > 0 && !head)
{
- hv_draw(buf, xx + x() - leftline_, yy + y());
+ hv_draw(buf.c_str(), xx + x() - leftline_, yy + y());
if (underline) fl_xyline(xx + x() - leftline_, yy + y() + 1,
xx + x() - leftline_ + ww);
current_pos = (int) (ptr-value_);
@@ -978,7 +1181,7 @@ Fl_Help_View::draw()
}
fl_pop_clip();
-}
+} // draw()
@@ -998,6 +1201,8 @@ Fl_Help_View::find(const char *s, // I - String to find
*sp; // Search string pointer
+ DEBUG_FUNCTION(__LINE__,__FUNCTION__);
+
// Range check input and value...
if (!s || !value_) return -1;
@@ -1019,10 +1224,18 @@ Fl_Help_View::find(const char *s, // I - String to find
continue;
} else if (*bp == '&') {
// decode HTML entity...
- if ((c = quote_char(bp + 1)) < 0) c = '&';
+ 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)
+ // At this point c may be an arbitrary Unicode Code Point corresponding
+ // to a quoted character (see above), i.e. it _can_ be a multi byte
+ // UTF-8 sequence and must be compared with the corresponding
+ // multi byte string in (*sp)...
+ // For instance: "&euro;" == 0x20ac -> 0xe2 0x82 0xac (UTF-8: 3 bytes).
+ // Hint: use fl_utf8encode() [see below]
+
if (tolower(*sp) == tolower(c)) sp ++;
else {
// No match, so reset to start of search...
@@ -1055,9 +1268,8 @@ void Fl_Help_View::format() {
const char *ptr, // Pointer into block
*start, // Pointer to start of element
*attrs; // Pointer to start of element attributes
- char *s, // Pointer into buffer
- buf[1024], // Text buffer
- attr[1024], // Attribute buffer
+ 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
@@ -1083,6 +1295,7 @@ void Fl_Help_View::format() {
// Box to draw...
fl_margins margins; // Left margin stack...
+ DEBUG_FUNCTION(__LINE__,__FUNCTION__);
// Reset document width...
int scrollsize = scrollbar_size_ ? scrollbar_size_ : Fl::scrollbar_size();
@@ -1130,14 +1343,13 @@ void Fl_Help_View::format() {
table_offset = 0;
// Html text character loop
- for (ptr = value_, s = buf; *ptr;)
+ for (ptr = value_, buf.clear(); *ptr;)
{
// End of word?
- if ((*ptr == '<' || isspace((*ptr)&255)) && s > buf)
+ if ((*ptr == '<' || isspace((*ptr)&255)) && buf.size() > 0)
{
// Get width of word parsed so far...
- *s = '\0';
- ww = (int)fl_width(buf);
+ ww = buf.width();
if (!head && !pre)
{
@@ -1219,7 +1431,7 @@ void Fl_Help_View::format() {
ptr ++;
}
- s = buf;
+ buf.clear();
}
if (*ptr == '<')
@@ -1242,15 +1454,7 @@ void Fl_Help_View::format() {
}
while (*ptr && *ptr != '>' && !isspace((*ptr)&255))
- if (s < (buf + sizeof(buf) - 1))
- *s++ = *ptr++;
- else
- ptr ++;
-
- *s = '\0';
- s = buf;
-
-// puts(buf);
+ buf.add(*ptr++);
attrs = ptr;
while (*ptr && *ptr != '>')
@@ -1259,21 +1463,22 @@ void Fl_Help_View::format() {
if (*ptr == '>')
ptr ++;
- if (strcasecmp(buf, "HEAD") == 0)
+ if (buf.cmp("HEAD"))
head = 1;
- else if (strcasecmp(buf, "/HEAD") == 0)
+ else if (buf.cmp("/HEAD"))
head = 0;
- else if (strcasecmp(buf, "TITLE") == 0)
+ else if (buf.cmp("TITLE"))
{
// Copy the title in the document...
- for (s = title_;
- *ptr != '<' && *ptr && s < (title_ + sizeof(title_) - 1);
- *s++ = *ptr++);
+ char *st;
+ for (st = title_;
+ *ptr != '<' && *ptr && st < (title_ + sizeof(title_) - 1);
+ *st++ = *ptr++) {/*empty*/}
- *s = '\0';
- s = buf;
+ *st = '\0';
+ buf.clear();
}
- else if (strcasecmp(buf, "A") == 0)
+ else if (buf.cmp("A"))
{
if (get_attr(attrs, "NAME", attr, sizeof(attr)) != NULL)
add_target(attr, yy - fsize - 2);
@@ -1281,9 +1486,9 @@ void Fl_Help_View::format() {
if (get_attr(attrs, "HREF", attr, sizeof(attr)) != NULL)
strlcpy(linkdest, attr, sizeof(linkdest));
}
- else if (strcasecmp(buf, "/A") == 0)
+ else if (buf.cmp("/A"))
linkdest[0] = '\0';
- else if (strcasecmp(buf, "BODY") == 0)
+ else if (buf.cmp("BODY"))
{
bgcolor_ = get_color(get_attr(attrs, "BGCOLOR", attr, sizeof(attr)),
color());
@@ -1292,7 +1497,7 @@ void Fl_Help_View::format() {
linkcolor_ = get_color(get_attr(attrs, "LINK", attr, sizeof(attr)),
fl_contrast(FL_BLUE, color()));
}
- else if (strcasecmp(buf, "BR") == 0)
+ else if (buf.cmp("BR"))
{
line = do_align(block, line, xx, newalign, links);
xx = block->x;
@@ -1300,38 +1505,38 @@ void Fl_Help_View::format() {
yy += hh;
hh = 0;
}
- else if (strcasecmp(buf, "CENTER") == 0 ||
- strcasecmp(buf, "P") == 0 ||
- strcasecmp(buf, "H1") == 0 ||
- strcasecmp(buf, "H2") == 0 ||
- strcasecmp(buf, "H3") == 0 ||
- strcasecmp(buf, "H4") == 0 ||
- strcasecmp(buf, "H5") == 0 ||
- strcasecmp(buf, "H6") == 0 ||
- strcasecmp(buf, "UL") == 0 ||
- strcasecmp(buf, "OL") == 0 ||
- strcasecmp(buf, "DL") == 0 ||
- strcasecmp(buf, "LI") == 0 ||
- strcasecmp(buf, "DD") == 0 ||
- strcasecmp(buf, "DT") == 0 ||
- strcasecmp(buf, "HR") == 0 ||
- strcasecmp(buf, "PRE") == 0 ||
- strcasecmp(buf, "TABLE") == 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 = strcasecmp(buf, "CENTER") ? LEFT : CENTER;
+ newalign = buf.cmp("CENTER") ? CENTER : LEFT;
xx = block->x;
block->h += hh;
- if (strcasecmp(buf, "UL") == 0 ||
- strcasecmp(buf, "OL") == 0 ||
- strcasecmp(buf, "DL") == 0)
+ if (buf.cmp("UL") ||
+ buf.cmp("OL") ||
+ buf.cmp("DL"))
{
block->h += fsize + 2;
xx = margins.push(4 * fsize);
}
- else if (strcasecmp(buf, "TABLE") == 0)
+ else if (buf.cmp("TABLE"))
{
if (get_attr(attrs, "BORDER", attr, sizeof(attr)))
border = (uchar)atoi(attr);
@@ -1377,12 +1582,12 @@ void Fl_Help_View::format() {
font = FL_HELVETICA_BOLD;
fsize = textsize_ + '7' - buf[1];
}
- else if (strcasecmp(buf, "DT") == 0)
+ else if (buf.cmp("DT"))
{
font = textfont_ | FL_ITALIC;
fsize = textsize_;
}
- else if (strcasecmp(buf, "PRE") == 0)
+ else if (buf.cmp("PRE"))
{
font = FL_COURIER;
fsize = textsize_;
@@ -1400,11 +1605,11 @@ void Fl_Help_View::format() {
hh = 0;
if ((tolower(buf[0]) == 'h' && isdigit(buf[1])) ||
- strcasecmp(buf, "DD") == 0 ||
- strcasecmp(buf, "DT") == 0 ||
- strcasecmp(buf, "P") == 0)
+ buf.cmp("DD") ||
+ buf.cmp("DT") ||
+ buf.cmp("P"))
yy += fsize + 2;
- else if (strcasecmp(buf, "HR") == 0)
+ else if (buf.cmp("HR"))
{
hh += 2 * fsize;
yy += fsize;
@@ -1418,47 +1623,47 @@ void Fl_Help_View::format() {
needspace = 0;
line = 0;
- if (strcasecmp(buf, "CENTER") == 0)
+ if (buf.cmp("CENTER"))
newalign = talign = CENTER;
else
newalign = get_align(attrs, talign);
}
- else if (strcasecmp(buf, "/CENTER") == 0 ||
- strcasecmp(buf, "/P") == 0 ||
- strcasecmp(buf, "/H1") == 0 ||
- strcasecmp(buf, "/H2") == 0 ||
- strcasecmp(buf, "/H3") == 0 ||
- strcasecmp(buf, "/H4") == 0 ||
- strcasecmp(buf, "/H5") == 0 ||
- strcasecmp(buf, "/H6") == 0 ||
- strcasecmp(buf, "/PRE") == 0 ||
- strcasecmp(buf, "/UL") == 0 ||
- strcasecmp(buf, "/OL") == 0 ||
- strcasecmp(buf, "/DL") == 0 ||
- strcasecmp(buf, "/TABLE") == 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("/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 (strcasecmp(buf, "/UL") == 0 ||
- strcasecmp(buf, "/OL") == 0 ||
- strcasecmp(buf, "/DL") == 0)
+ if (buf.cmp("/UL") ||
+ buf.cmp("/OL") ||
+ buf.cmp("/DL"))
{
xx = margins.pop();
block->h += fsize + 2;
}
- else if (strcasecmp(buf, "/TABLE") == 0)
+ else if (buf.cmp("/TABLE"))
{
block->h += fsize + 2;
xx = margins.current();
}
- else if (strcasecmp(buf, "/PRE") == 0)
+ else if (buf.cmp("/PRE"))
{
pre = 0;
hh = 0;
}
- else if (strcasecmp(buf, "/CENTER") == 0)
+ else if (buf.cmp("/CENTER"))
talign = LEFT;
popfont(font, fsize, fcolor);
@@ -1485,7 +1690,7 @@ void Fl_Help_View::format() {
line = 0;
newalign = talign;
}
- else if (strcasecmp(buf, "TR") == 0)
+ else if (buf.cmp("TR"))
{
block->end = start;
line = do_align(block, line, xx, newalign, links);
@@ -1524,7 +1729,7 @@ void Fl_Help_View::format() {
rc = get_color(get_attr(attrs, "BGCOLOR", attr, sizeof(attr)), tc);
}
- else if (strcasecmp(buf, "/TR") == 0 && row)
+ else if (buf.cmp("/TR") && row)
{
line = do_align(block, line, xx, newalign, links);
block->end = start;
@@ -1555,8 +1760,8 @@ void Fl_Help_View::format() {
row = 0;
line = 0;
}
- else if ((strcasecmp(buf, "TD") == 0 ||
- strcasecmp(buf, "TH") == 0) && row)
+ else if ((buf.cmp("TD") ||
+ buf.cmp("TH")) && row)
{
int colspan; // COLSPAN attribute
@@ -1565,7 +1770,7 @@ void Fl_Help_View::format() {
block->end = start;
block->h += hh;
- if (strcasecmp(buf, "TH") == 0)
+ if (buf.cmp("TH"))
font = textfont_ | FL_BOLD;
else
font = textfont_;
@@ -1609,15 +1814,15 @@ void Fl_Help_View::format() {
block->bgcolor = get_color(get_attr(attrs, "BGCOLOR", attr,
sizeof(attr)), rc);
}
- else if ((strcasecmp(buf, "/TD") == 0 ||
- strcasecmp(buf, "/TH") == 0) && row)
+ 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 (strcasecmp(buf, "FONT") == 0)
+ else if (buf.cmp("FONT"))
{
if (get_attr(attrs, "FACE", attr, sizeof(attr)) != NULL) {
if (!strncasecmp(attr, "helvetica", 9) ||
@@ -1641,39 +1846,39 @@ void Fl_Help_View::format() {
pushfont(font, fsize);
}
- else if (strcasecmp(buf, "/FONT") == 0)
+ else if (buf.cmp("/FONT"))
popfont(font, fsize, fcolor);
- else if (strcasecmp(buf, "B") == 0 ||
- strcasecmp(buf, "STRONG") == 0)
+ else if (buf.cmp("B") ||
+ buf.cmp("STRONG"))
pushfont(font |= FL_BOLD, fsize);
- else if (strcasecmp(buf, "I") == 0 ||
- strcasecmp(buf, "EM") == 0)
+ else if (buf.cmp("I") ||
+ buf.cmp("EM"))
pushfont(font |= FL_ITALIC, fsize);
- else if (strcasecmp(buf, "CODE") == 0 ||
- strcasecmp(buf, "TT") == 0)
+ else if (buf.cmp("CODE") ||
+ buf.cmp("TT"))
pushfont(font = FL_COURIER, fsize);
- else if (strcasecmp(buf, "KBD") == 0)
+ else if (buf.cmp("KBD"))
pushfont(font = FL_COURIER_BOLD, fsize);
- else if (strcasecmp(buf, "VAR") == 0)
+ else if (buf.cmp("VAR"))
pushfont(font = FL_COURIER_ITALIC, fsize);
- else if (strcasecmp(buf, "/B") == 0 ||
- strcasecmp(buf, "/STRONG") == 0 ||
- strcasecmp(buf, "/I") == 0 ||
- strcasecmp(buf, "/EM") == 0 ||
- strcasecmp(buf, "/CODE") == 0 ||
- strcasecmp(buf, "/TT") == 0 ||
- strcasecmp(buf, "/KBD") == 0 ||
- strcasecmp(buf, "/VAR") == 0)
+ 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 (strcasecmp(buf, "IMG") == 0)
+ 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));
+ get_attr(attrs, "WIDTH", wattr, sizeof(wattr));
+ get_attr(attrs, "HEIGHT", hattr, sizeof(hattr));
width = get_length(wattr);
height = get_length(hattr);
@@ -1704,7 +1909,7 @@ void Fl_Help_View::format() {
}
if (linkdest[0])
- add_link(linkdest, xx, yy - height, ww, height);
+ add_link(linkdest, xx, yy-fsize, ww, height);
xx += ww;
if ((height + 2) > hh)
@@ -1712,6 +1917,7 @@ void Fl_Help_View::format() {
needspace = 0;
}
+ buf.clear();
}
else if (*ptr == '\n' && pre)
{
@@ -1739,7 +1945,7 @@ void Fl_Help_View::format() {
}
ptr ++;
}
- else if (*ptr == '&' && s < (buf + sizeof(buf) - 1))
+ else if (*ptr == '&')
{
// Handle html '&' codes, eg. "&amp;"
ptr ++;
@@ -1747,12 +1953,9 @@ void Fl_Help_View::format() {
int qch = quote_char(ptr);
if (qch < 0)
- *s++ = '&';
+ buf.add('&');
else {
- int l;
- l = fl_utf8encode((unsigned int) qch, s);
- if (l < 1) l = 1;
- s += l;
+ buf.add(qch);
ptr = strchr(ptr, ';') + 1;
}
@@ -1761,20 +1964,16 @@ void Fl_Help_View::format() {
}
else
{
- if (s < (buf + sizeof(buf) - 1))
- *s++ = *ptr++;
- else
- ptr ++;
+ buf.add(*ptr++);
if ((fsize + 2) > hh)
hh = fsize + 2;
}
}
- if (s > buf && !head)
+ if (buf.size() > 0 && !head)
{
- *s = '\0';
- ww = (int)fl_width(buf);
+ ww = buf.width();
// printf("line = %d, xx = %d, ww = %d, block->x = %d, block->w = %d\n",
// line, xx, ww, block->x, block->w);
@@ -1879,9 +2078,8 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
incell, // In a table cell?
pre, // <PRE> text?
needspace; // Need whitespace?
- char *s, // Pointer into buffer
- buf[1024], // Text buffer
- attr[1024], // Other attribute
+ 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
@@ -1892,6 +2090,8 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
Fl_Fontsize fsize; // Current font and size
Fl_Color fcolor; // Currrent font color
+ DEBUG_FUNCTION(__LINE__,__FUNCTION__);
+
// Clear widths...
*table_width = 0;
for (column = 0; column < MAX_COLUMNS; column ++)
@@ -1908,20 +2108,19 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
fstack_.top(font, fsize, fcolor);
// Scan the table...
- for (ptr = table, column = -1, width = 0, s = buf, incell = 0; *ptr;)
+ for (ptr = table, column = -1, width = 0, incell = 0; *ptr;)
{
- if ((*ptr == '<' || isspace((*ptr)&255)) && s > buf && incell)
+ if ((*ptr == '<' || isspace((*ptr)&255)) && buf.size() > 0 && incell)
{
// Check width...
if (needspace)
{
- *s++ = ' ';
+ buf.add(' ');
needspace = 0;
}
- *s = '\0';
- temp_width = (int)fl_width(buf);
- s = buf;
+ temp_width = buf.width();
+ buf.clear();
if (temp_width > minwidths[column])
minwidths[column] = temp_width;
@@ -1936,14 +2135,8 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
{
start = ptr;
- for (s = buf, ptr ++; *ptr && *ptr != '>' && !isspace((*ptr)&255);)
- if (s < (buf + sizeof(buf) - 1))
- *s++ = *ptr++;
- else
- ptr ++;
-
- *s = '\0';
- s = buf;
+ for (buf.clear(), ptr ++; *ptr && *ptr != '>' && !isspace((*ptr)&255);)
+ buf.add(*ptr++);
attrs = ptr;
while (*ptr && *ptr != '>')
@@ -1952,29 +2145,29 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
if (*ptr == '>')
ptr ++;
- if (strcasecmp(buf, "BR") == 0 ||
- strcasecmp(buf, "HR") == 0)
+ if (buf.cmp("BR") ||
+ buf.cmp("HR"))
{
width = 0;
needspace = 0;
}
- else if (strcasecmp(buf, "TABLE") == 0 && start > table)
+ else if (buf.cmp("TABLE") && start > table)
break;
- else if (strcasecmp(buf, "CENTER") == 0 ||
- strcasecmp(buf, "P") == 0 ||
- strcasecmp(buf, "H1") == 0 ||
- strcasecmp(buf, "H2") == 0 ||
- strcasecmp(buf, "H3") == 0 ||
- strcasecmp(buf, "H4") == 0 ||
- strcasecmp(buf, "H5") == 0 ||
- strcasecmp(buf, "H6") == 0 ||
- strcasecmp(buf, "UL") == 0 ||
- strcasecmp(buf, "OL") == 0 ||
- strcasecmp(buf, "DL") == 0 ||
- strcasecmp(buf, "LI") == 0 ||
- strcasecmp(buf, "DD") == 0 ||
- strcasecmp(buf, "DT") == 0 ||
- strcasecmp(buf, "PRE") == 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"))
{
width = 0;
needspace = 0;
@@ -1984,18 +2177,18 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
font = FL_HELVETICA_BOLD;
fsize = textsize_ + '7' - buf[1];
}
- else if (strcasecmp(buf, "DT") == 0)
+ else if (buf.cmp("DT"))
{
font = textfont_ | FL_ITALIC;
fsize = textsize_;
}
- else if (strcasecmp(buf, "PRE") == 0)
+ else if (buf.cmp("PRE"))
{
font = FL_COURIER;
fsize = textsize_;
pre = 1;
}
- else if (strcasecmp(buf, "LI") == 0)
+ else if (buf.cmp("LI"))
{
width += 4 * fsize;
font = textfont_;
@@ -2009,29 +2202,29 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
pushfont(font, fsize);
}
- else if (strcasecmp(buf, "/CENTER") == 0 ||
- strcasecmp(buf, "/P") == 0 ||
- strcasecmp(buf, "/H1") == 0 ||
- strcasecmp(buf, "/H2") == 0 ||
- strcasecmp(buf, "/H3") == 0 ||
- strcasecmp(buf, "/H4") == 0 ||
- strcasecmp(buf, "/H5") == 0 ||
- strcasecmp(buf, "/H6") == 0 ||
- strcasecmp(buf, "/PRE") == 0 ||
- strcasecmp(buf, "/UL") == 0 ||
- strcasecmp(buf, "/OL") == 0 ||
- strcasecmp(buf, "/DL") == 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("/PRE") ||
+ buf.cmp("/UL") ||
+ buf.cmp("/OL") ||
+ buf.cmp("/DL"))
{
width = 0;
needspace = 0;
popfont(font, fsize, fcolor);
}
- else if (strcasecmp(buf, "TR") == 0 || strcasecmp(buf, "/TR") == 0 ||
- strcasecmp(buf, "/TABLE") == 0)
+ else if (buf.cmp("TR") || buf.cmp("/TR") ||
+ buf.cmp("/TABLE"))
{
// printf("%s column = %d, colspan = %d, num_columns = %d\n",
-// buf, column, colspan, num_columns);
+// buf.c_str(), column, colspan, num_columns);
if (column >= 0)
{
@@ -2048,7 +2241,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
}
}
- if (strcasecmp(buf, "/TABLE") == 0)
+ if (buf.cmp("/TABLE"))
break;
needspace = 0;
@@ -2057,8 +2250,8 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
max_width = 0;
incell = 0;
}
- else if (strcasecmp(buf, "TD") == 0 ||
- strcasecmp(buf, "TH") == 0)
+ else if (buf.cmp("TD") ||
+ buf.cmp("TH"))
{
// printf("BEFORE column = %d, colspan = %d, num_columns = %d\n",
// column, colspan, num_columns);
@@ -2095,7 +2288,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
width = 0;
incell = 1;
- if (strcasecmp(buf, "TH") == 0)
+ if (buf.cmp("TH"))
font = textfont_ | FL_BOLD;
else
font = textfont_;
@@ -2111,35 +2304,35 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
// printf("max_width = %d\n", max_width);
}
- else if (strcasecmp(buf, "/TD") == 0 ||
- strcasecmp(buf, "/TH") == 0)
+ else if (buf.cmp("/TD") ||
+ buf.cmp("/TH"))
{
incell = 0;
popfont(font, fsize, fcolor);
}
- else if (strcasecmp(buf, "B") == 0 ||
- strcasecmp(buf, "STRONG") == 0)
+ else if (buf.cmp("B") ||
+ buf.cmp("STRONG"))
pushfont(font |= FL_BOLD, fsize);
- else if (strcasecmp(buf, "I") == 0 ||
- strcasecmp(buf, "EM") == 0)
+ else if (buf.cmp("I") ||
+ buf.cmp("EM"))
pushfont(font |= FL_ITALIC, fsize);
- else if (strcasecmp(buf, "CODE") == 0 ||
- strcasecmp(buf, "TT") == 0)
+ else if (buf.cmp("CODE") ||
+ buf.cmp("TT"))
pushfont(font = FL_COURIER, fsize);
- else if (strcasecmp(buf, "KBD") == 0)
+ else if (buf.cmp("KBD"))
pushfont(font = FL_COURIER_BOLD, fsize);
- else if (strcasecmp(buf, "VAR") == 0)
+ else if (buf.cmp("VAR"))
pushfont(font = FL_COURIER_ITALIC, fsize);
- else if (strcasecmp(buf, "/B") == 0 ||
- strcasecmp(buf, "/STRONG") == 0 ||
- strcasecmp(buf, "/I") == 0 ||
- strcasecmp(buf, "/EM") == 0 ||
- strcasecmp(buf, "/CODE") == 0 ||
- strcasecmp(buf, "/TT") == 0 ||
- strcasecmp(buf, "/KBD") == 0 ||
- strcasecmp(buf, "/VAR") == 0)
+ 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 (strcasecmp(buf, "IMG") == 0 && incell)
+ else if (buf.cmp("IMG") && incell)
{
Fl_Shared_Image *img = 0;
int iwidth, iheight;
@@ -2168,6 +2361,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
needspace = 0;
}
+ buf.clear();
}
else if (*ptr == '\n' && pre)
{
@@ -2181,29 +2375,22 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
ptr ++;
}
- else if (*ptr == '&' && s < (buf + sizeof(buf) - 1))
+ else if (*ptr == '&' )
{
ptr ++;
int qch = quote_char(ptr);
if (qch < 0)
- *s++ = '&';
+ buf.add('&');
else {
-// int l;
-// l = fl_utf8encode((unsigned int) qch, s);
-// if (l < 1) l = 1;
-// s += l;
- *s++ = qch;
+ buf.add(qch);
ptr = strchr(ptr, ';') + 1;
}
}
else
{
- if (s < (buf + sizeof(buf) - 1))
- *s++ = *ptr++;
- else
- ptr ++;
+ buf.add(*ptr++);
}
}
@@ -2305,12 +2492,13 @@ Fl_Help_View::free_data() {
if (value_) {
const char *ptr, // Pointer into block
*attrs; // Pointer to start of element attributes
- char *s, // Pointer into buffer
- buf[1024], // Text buffer
- attr[1024], // Attribute buffer
+ 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__);
+
for (ptr = value_; *ptr;)
{
if (*ptr == '<')
@@ -2330,15 +2518,10 @@ Fl_Help_View::free_data() {
break;
}
- s = buf;
+ buf.clear();
while (*ptr && *ptr != '>' && !isspace((*ptr)&255))
- if (s < (buf + sizeof(buf) - 1))
- *s++ = *ptr++;
- else
- ptr ++;
-
- *s = '\0';
+ buf.add(*ptr++);
attrs = ptr;
while (*ptr && *ptr != '>')
@@ -2347,7 +2530,7 @@ Fl_Help_View::free_data() {
if (*ptr == '>')
ptr ++;
- if (strcasecmp(buf, "IMG") == 0)
+ if (buf.cmp("IMG"))
{
Fl_Shared_Image *img;
int width;
@@ -2399,7 +2582,7 @@ Fl_Help_View::free_data() {
ntargets_ = 0;
targets_ = 0;
}
-}
+} // free_data()
/** Gets an alignment attribute. */
int // O - Alignment
@@ -2851,28 +3034,30 @@ static unsigned int command(const char *cmd)
#define CMD(a, b, c, d) ((a<<24)|(b<<16)|(c<<8)|d)
-void Fl_Help_View::end_selection(int clipboard)
+void Fl_Help_View::end_selection(int clipboard)
{
- if (!selected || current_view!=this)
+ if (!selected || current_view!=this)
return;
- // convert the select part of our html text into some kind of somewhat readable ASCII
+ // convert the select part of our html text into some kind of somewhat readable UTF-8
// and store it in the selection buffer
- char p = 0, pre = 0;;
+ int p = 0;
+ char pre = 0;
int len = (int) strlen(value_);
char *txt = (char*)malloc(len+1), *d = txt;
const char *s = value_, *cmd, *src;
for (;;) {
- char c = *s++;
+ int c = (*s++) & 0xff;
if (c==0) break;
if (c=='<') { // begin of some html command. Skip until we find a '>'
cmd = s;
for (;;) {
- c = *s++;
+ c = (*s++) & 0xff;
if (c==0 || c=='>') break;
}
if (c==0) break;
// do something with this command... .
- // the replacement string must not be longer that the command itself plus '<' and '>'
+ // The replacement string must not be longer than the command
+ // itself plus '<' and '>'
src = 0;
switch (command(cmd)) {
case CMD('p','r','e', 0 ): pre = 1; break;
@@ -2903,31 +3088,38 @@ void Fl_Help_View::end_selection(int clipboard)
while (*src) {
*d++ = *src++;
}
- c = src[-1];
- p = isspace(c&255) ? ' ' : c;
+ c = src[-1] & 0xff;
+ p = isspace(c) ? ' ' : c;
}
continue;
}
- if (c=='&') { // special characters
+ const char *s2 = s;
+ if (c=='&') { // special characters (HTML entities)
int xx = quote_char(s);
- if (xx>=0) {
- c = (char)xx;
+ if (xx >= 0) {
+ c = xx;
for (;;) {
char cc = *s++;
if (!cc || cc==';') break;
}
}
}
- int n = (int) (s-value_);
+ int n = (int) (s2-value_);
if (n>selection_first && n<=selection_last) {
- if (!pre && isspace(c&255)) c = ' ';
- if (p!=' '||c!=' ')
- *d++ = c;
+ if (!pre && c < 256 && isspace(c)) c = ' ';
+ if (p != ' ' || c != ' ') {
+ if (s2 != s) { // c was an HTML entity
+ d += fl_utf8encode(c, d);
+ }
+ else *d++ = c;
+ }
p = c;
}
+ if (n>selection_last) break; // stop parsing html after end of selection
}
*d = 0;
Fl::copy(txt, (int) strlen(txt), clipboard);
+ // printf("copy [%s]\n", txt);
free(txt);
}
@@ -3003,7 +3195,8 @@ Fl_Help_View::handle(int event) // I - Event to handle
}
return 1;
case FL_SHORTCUT: {
- if (Fl::event_state() == FL_COMMAND) {
+ 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':
@@ -3015,7 +3208,7 @@ Fl_Help_View::handle(int event) // I - Event to handle
return (Fl_Group::handle(event));
}
-/**
+/**
The constructor creates the Fl_Help_View widget at the specified
position and size.
*/
@@ -3351,14 +3544,30 @@ Fl_Help_View::value(const char *val) // I - Text to view
}
-#ifdef ENC
-# undef ENC
-#endif
-// part b in the table seems to be mac_roman - beku
-# define ENC(a, b) a
+/* Returns the Unicode Code Point associated with a quoted character
+ (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
+ 'nn..' = decimal or hexadecimal number, resp.
-/** Returns the character code associated with a quoted char. */
+ Contents of the table names[] below:
+
+ All printable ASCII (32-126) and ISO-8859-1 (160-255) characters
+ are encoded with the same value in Unicode. Special characters
+ outside the range [0-255] are encoded with their Unicode Code Point
+ as hexadecimal constants. Example:
+ - Euro sign: (Unicode) U+20ac = (hex) 0x20ac
+
+ Note: Converted to correct Unicode values and tested (compared with
+ the display of Firefox). AlbrechtS, 14 Feb. 2016.
+
+ 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
@@ -3368,111 +3577,111 @@ quote_char(const char *p) { // I - Quoted string
int code;
} *nameptr, // Pointer into name array
names[] = { // Quoting names
- { "Aacute;", 7, ENC(193,231) },
- { "aacute;", 7, ENC(225,135) },
- { "Acirc;", 6, ENC(194,229) },
- { "acirc;", 6, ENC(226,137) },
- { "acute;", 6, ENC(180,171) },
- { "AElig;", 6, ENC(198,174) },
- { "aelig;", 6, ENC(230,190) },
- { "Agrave;", 7, ENC(192,203) },
- { "agrave;", 7, ENC(224,136) },
- { "amp;", 4, ENC('&','&') },
- { "Aring;", 6, ENC(197,129) },
- { "aring;", 6, ENC(229,140) },
- { "Atilde;", 7, ENC(195,204) },
- { "atilde;", 7, ENC(227,139) },
- { "Auml;", 5, ENC(196,128) },
- { "auml;", 5, ENC(228,138) },
- { "brvbar;", 7, ENC(166, -1) },
- { "bull;", 5, ENC(149,165) },
- { "Ccedil;", 7, ENC(199,199) },
- { "ccedil;", 7, ENC(231,141) },
- { "cedil;", 6, ENC(184,252) },
- { "cent;", 5, ENC(162,162) },
- { "copy;", 5, ENC(169,169) },
- { "curren;", 7, ENC(164, -1) },
- { "deg;", 4, ENC(176,161) },
- { "divide;", 7, ENC(247,214) },
- { "Eacute;", 7, ENC(201,131) },
- { "eacute;", 7, ENC(233,142) },
- { "Ecirc;", 6, ENC(202,230) },
- { "ecirc;", 6, ENC(234,144) },
- { "Egrave;", 7, ENC(200,233) },
- { "egrave;", 7, ENC(232,143) },
- { "ETH;", 4, ENC(208, -1) },
- { "eth;", 4, ENC(240, -1) },
- { "Euml;", 5, ENC(203,232) },
- { "euml;", 5, ENC(235,145) },
- { "euro;", 5, ENC(128,219) },
- { "frac12;", 7, ENC(189, -1) },
- { "frac14;", 7, ENC(188, -1) },
- { "frac34;", 7, ENC(190, -1) },
- { "gt;", 3, ENC('>','>') },
- { "Iacute;", 7, ENC(205,234) },
- { "iacute;", 7, ENC(237,146) },
- { "Icirc;", 6, ENC(206,235) },
- { "icirc;", 6, ENC(238,148) },
- { "iexcl;", 6, ENC(161,193) },
- { "Igrave;", 7, ENC(204,237) },
- { "igrave;", 7, ENC(236,147) },
- { "iquest;", 7, ENC(191,192) },
- { "Iuml;", 5, ENC(207,236) },
- { "iuml;", 5, ENC(239,149) },
- { "laquo;", 6, ENC(171,199) },
- { "lt;", 3, ENC('<','<') },
- { "macr;", 5, ENC(175,248) },
- { "micro;", 6, ENC(181,181) },
- { "middot;", 7, ENC(183,225) },
- { "nbsp;", 5, ENC(' ',' ') },
- { "not;", 4, ENC(172,194) },
- { "Ntilde;", 7, ENC(209,132) },
- { "ntilde;", 7, ENC(241,150) },
- { "Oacute;", 7, ENC(211,238) },
- { "oacute;", 7, ENC(243,151) },
- { "Ocirc;", 6, ENC(212,239) },
- { "ocirc;", 6, ENC(244,153) },
- { "Ograve;", 7, ENC(210,241) },
- { "ograve;", 7, ENC(242,152) },
- { "ordf;", 5, ENC(170,187) },
- { "ordm;", 5, ENC(186,188) },
- { "Oslash;", 7, ENC(216,175) },
- { "oslash;", 7, ENC(248,191) },
- { "Otilde;", 7, ENC(213,205) },
- { "otilde;", 7, ENC(245,155) },
- { "Ouml;", 5, ENC(214,133) },
- { "ouml;", 5, ENC(246,154) },
- { "para;", 5, ENC(182,166) },
- { "premil;", 7, ENC(137,228) },
- { "plusmn;", 7, ENC(177,177) },
- { "pound;", 6, ENC(163,163) },
- { "quot;", 5, ENC('\"','\"') },
- { "raquo;", 6, ENC(187,200) },
- { "reg;", 4, ENC(174,168) },
- { "sect;", 5, ENC(167,164) },
- { "shy;", 4, ENC(173,'-') },
- { "sup1;", 5, ENC(185, -1) },
- { "sup2;", 5, ENC(178, -1) },
- { "sup3;", 5, ENC(179, -1) },
- { "szlig;", 6, ENC(223,167) },
- { "THORN;", 6, ENC(222, -1) },
- { "thorn;", 6, ENC(254, -1) },
- { "times;", 6, ENC(215,'x') },
- { "trade;", 6, ENC(153,170) },
- { "Uacute;", 7, ENC(218,242) },
- { "uacute;", 7, ENC(250,156) },
- { "Ucirc;", 6, ENC(219,243) },
- { "ucirc;", 6, ENC(251,158) },
- { "Ugrave;", 7, ENC(217,244) },
- { "ugrave;", 7, ENC(249,157) },
- { "uml;", 4, ENC(168,172) },
- { "Uuml;", 5, ENC(220,134) },
- { "uuml;", 5, ENC(252,159) },
- { "Yacute;", 7, ENC(221, -1) },
- { "yacute;", 7, ENC(253, -1) },
- { "yen;", 4, ENC(165,180) },
- { "Yuml;", 5, ENC(159,217) },
- { "yuml;", 5, ENC(255,216) }
+ { "Aacute;", 7, 193 },
+ { "aacute;", 7, 225 },
+ { "Acirc;", 6, 194 },
+ { "acirc;", 6, 226 },
+ { "acute;", 6, 180 },
+ { "AElig;", 6, 198 },
+ { "aelig;", 6, 230 },
+ { "Agrave;", 7, 192 },
+ { "agrave;", 7, 224 },
+ { "amp;", 4, '&' },
+ { "Aring;", 6, 197 },
+ { "aring;", 6, 229 },
+ { "Atilde;", 7, 195 },
+ { "atilde;", 7, 227 },
+ { "Auml;", 5, 196 },
+ { "auml;", 5, 228 },
+ { "brvbar;", 7, 166 },
+ { "bull;", 5, 0x2022 },
+ { "Ccedil;", 7, 199 },
+ { "ccedil;", 7, 231 },
+ { "cedil;", 6, 184 },
+ { "cent;", 5, 162 },
+ { "copy;", 5, 169 },
+ { "curren;", 7, 164 },
+ { "deg;", 4, 176 },
+ { "divide;", 7, 247 },
+ { "Eacute;", 7, 201 },
+ { "eacute;", 7, 233 },
+ { "Ecirc;", 6, 202 },
+ { "ecirc;", 6, 234 },
+ { "Egrave;", 7, 200 },
+ { "egrave;", 7, 232 },
+ { "ETH;", 4, 208 },
+ { "eth;", 4, 240 },
+ { "Euml;", 5, 203 },
+ { "euml;", 5, 235 },
+ { "euro;", 5, 0x20ac },
+ { "frac12;", 7, 189 },
+ { "frac14;", 7, 188 },
+ { "frac34;", 7, 190 },
+ { "gt;", 3, '>' },
+ { "Iacute;", 7, 205 },
+ { "iacute;", 7, 237 },
+ { "Icirc;", 6, 206 },
+ { "icirc;", 6, 238 },
+ { "iexcl;", 6, 161 },
+ { "Igrave;", 7, 204 },
+ { "igrave;", 7, 236 },
+ { "iquest;", 7, 191 },
+ { "Iuml;", 5, 207 },
+ { "iuml;", 5, 239 },
+ { "laquo;", 6, 171 },
+ { "lt;", 3, '<' },
+ { "macr;", 5, 175 },
+ { "micro;", 6, 181 },
+ { "middot;", 7, 183 },
+ { "nbsp;", 5, ' ' },
+ { "not;", 4, 172 },
+ { "Ntilde;", 7, 209 },
+ { "ntilde;", 7, 241 },
+ { "Oacute;", 7, 211 },
+ { "oacute;", 7, 243 },
+ { "Ocirc;", 6, 212 },
+ { "ocirc;", 6, 244 },
+ { "Ograve;", 7, 210 },
+ { "ograve;", 7, 242 },
+ { "ordf;", 5, 170 },
+ { "ordm;", 5, 186 },
+ { "Oslash;", 7, 216 },
+ { "oslash;", 7, 248 },
+ { "Otilde;", 7, 213 },
+ { "otilde;", 7, 245 },
+ { "Ouml;", 5, 214 },
+ { "ouml;", 5, 246 },
+ { "para;", 5, 182 },
+ { "permil;", 7, 0x2030 },
+ { "plusmn;", 7, 177 },
+ { "pound;", 6, 163 },
+ { "quot;", 5, '\"' },
+ { "raquo;", 6, 187 },
+ { "reg;", 4, 174 },
+ { "sect;", 5, 167 },
+ { "shy;", 4, 173 },
+ { "sup1;", 5, 185 },
+ { "sup2;", 5, 178 },
+ { "sup3;", 5, 179 },
+ { "szlig;", 6, 223 },
+ { "THORN;", 6, 222 },
+ { "thorn;", 6, 254 },
+ { "times;", 6, 215 },
+ { "trade;", 6, 0x2122 },
+ { "Uacute;", 7, 218 },
+ { "uacute;", 7, 250 },
+ { "Ucirc;", 6, 219 },
+ { "ucirc;", 6, 251 },
+ { "Ugrave;", 7, 217 },
+ { "ugrave;", 7, 249 },
+ { "uml;", 4, 168 },
+ { "Uuml;", 5, 220 },
+ { "uuml;", 5, 252 },
+ { "Yacute;", 7, 221 },
+ { "yacute;", 7, 253 },
+ { "yen;", 4, 165 },
+ { "Yuml;", 5, 0x0178 },
+ { "yuml;", 5, 255 }
};
if (!strchr(p, ';')) return -1;
@@ -3505,5 +3714,5 @@ hscrollbar_callback(Fl_Widget *s, void *)
//
-// End of "$Id: Fl_Help_View.cxx 10234 2014-08-21 12:18:32Z cand $".
+// End of "$Id: Fl_Help_View.cxx 11844 2016-07-23 04:25:40Z greg.ercolano $".
//
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index da0bccf..56788b3 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Image.cxx 10377 2014-10-14 11:53:51Z AlbrechtS $"
+// "$Id: Fl_Image.cxx 12073 2016-11-02 11:47:36Z AlbrechtS $"
//
// Image drawing code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -22,6 +22,7 @@
#include <FL/Fl_Widget.H>
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Image.H>
+#include <FL/Fl_Printer.H>
#include "flstring.h"
#ifdef WIN32
@@ -36,6 +37,17 @@ void fl_restore_clip(); // from fl_rect.cxx
Fl_RGB_Scaling Fl_Image::RGB_scaling_ = FL_RGB_SCALING_NEAREST;
+
+/**
+ The constructor creates an empty image with the specified
+ width, height, and depth. The width and height are in pixels.
+ The depth is 0 for bitmaps, 1 for pixmap (colormap) images, and
+ 1 to 4 for color images.
+ */
+Fl_Image::Fl_Image(int W, int H, int D) :
+ w_(W), h_(H), d_(D), ld_(0), count_(0), data_(0L)
+{}
+
/**
The destructor is a virtual method that frees all memory used
by the image.
@@ -86,8 +98,10 @@ 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. <I>The original image data is not altered by this
- method.</I>
+ color.
+
+ An internal copy is made of the original image before
+ changes are applied, to avoid modifying the original image.
*/
void Fl_Image::color_average(Fl_Color, float) {
}
@@ -95,8 +109,10 @@ 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. <I>This method does not alter
- the original image data.</I>
+ the alpha channel is preserved.
+
+ An internal copy is made of the original image before
+ changes are applied, to avoid modifying the original image.
*/
void Fl_Image::desaturate() {
}
@@ -124,6 +140,44 @@ void Fl_Image::label(Fl_Menu_Item* m) {
m->label(_FL_IMAGE_LABEL, (const char*)this);
}
+/**
+ Returns a value that is not 0 if there is currently no image
+ available.
+
+ Example use:
+ \code
+ [..]
+ Fl_Box box(X,Y,W,H);
+ Fl_JPEG_Image jpg("/tmp/foo.jpg");
+ switch ( jpg.fail() ) {
+ case Fl_Image::ERR_NO_IMAGE:
+ case Fl_Image::ERR_FILE_ACCESS:
+ fl_alert("/tmp/foo.jpg: %s", strerror(errno)); // shows actual os error to user
+ exit(1);
+ case Fl_Image::ERR_FORMAT:
+ fl_alert("/tmp/foo.jpg: couldn't decode image");
+ exit(1);
+ }
+ box.image(jpg);
+ [..]
+ \endcode
+
+ \return ERR_NO_IMAGE if no image was found
+ \return ERR_FILE_ACCESS if there was a file access related error (errno should be set)
+ \return ERR_FORMAT if image decoding failed.
+ */
+int Fl_Image::fail()
+{
+ // if no image exists, ld_ may contain a simple error code
+ if ( (w_<=0) || (h_<=0) || (d_<=0) ) {
+ if (ld_==0)
+ return ERR_NO_IMAGE;
+ else
+ return ld_;
+ }
+ return 0;
+}
+
void
Fl_Image::labeltype(const Fl_Label *lo, // I - Label
int lx, // I - X position
@@ -181,30 +235,100 @@ size_t Fl_RGB_Image::max_size_ = ~((size_t)0);
int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg);
-/** The constructor creates a new RGBA image from the specified Fl_Pixmap.
-
- The RGBA image is built fully opaque except for the transparent area
- of the pixmap that is assigned the \par bg color with full transparency */
+
+/**
+ The constructor creates a new image from the specified data.
+
+ The data array \p bits must contain sufficient data to provide
+ \p W * \p H * \p D image bytes and optional line padding, see \p LD.
+
+ \p W and \p H are the width and height of the image in pixels, resp.
+
+ \p D is the image depth and can be:
+ - D=1: each uchar in \p bits[] is a grayscale pixel value
+ - D=2: each uchar pair in \p bits[] is a grayscale + alpha pixel value
+ - D=3: each uchar triplet in \p bits[] is an R/G/B pixel value
+ - D=4: each uchar quad in \p bits[] is an R/G/B/A pixel value
+
+ \p LD specifies the line data size of the array, see Fl_Image::ld(int).
+ If \p LD is zero, then \p W * \p D is assumed, otherwise \p LD must be
+ greater than or equal to \p W * \p D to account for (unused) extra data
+ per line (padding).
+
+ The caller is responsible that the image data array \p bits persists as
+ long as the image is used.
+
+ This constructor sets Fl_RGB_Image::alloc_array to 0.
+ To have the image object control the deallocation of the data array
+ \p bits, set alloc_array to non-zero after construction.
+
+ \param[in] bits The image data array.
+ \param[in] W The width of the image in pixels.
+ \param[in] H The height of the image in pixels.
+ \param[in] D The image depth, or 'number of channels' (default=3).
+ \param[in] LD Line data size (default=0).
+
+ \see Fl_Image::data(), Fl_Image::w(), Fl_Image::h(), Fl_Image::d(), Fl_Image::ld(int)
+*/
+Fl_RGB_Image::Fl_RGB_Image(const uchar *bits, int W, int H, int D, int LD) :
+ Fl_Image(W,H,D),
+ array(bits),
+ alloc_array(0),
+ id_(0),
+ mask_(0)
+{
+ data((const char **)&array, 1);
+ ld(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
+ of the pixmap that is assigned the \p bg color with full transparency.
+
+ This constructor creates a new internal data array and sets
+ Fl_RGB_Image::alloc_array to 1 so the data array is deleted when the
+ image is destroyed.
+*/
Fl_RGB_Image::Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg):
- Fl_Image(pxm->w(), pxm->h(), 4), id_(0), mask_(0)
+ Fl_Image(pxm->w(), pxm->h(), 4),
+ array(0),
+ alloc_array(0),
+ id_(0),
+ mask_(0)
{
- array = new uchar[w() * h() * d()];
- alloc_array = 1;
- fl_convert_pixmap(pxm->data(), (uchar*)array, bg);
+ if (pxm && pxm->w() > 0 && pxm->h() > 0) {
+ array = new uchar[w() * h() * d()];
+ alloc_array = 1;
+ fl_convert_pixmap(pxm->data(), (uchar*)array, bg);
+ }
data((const char **)&array, 1);
}
-/** The destructor frees all memory and server resources that are used by the image. */
+
+/**
+ The destructor frees all memory and server resources that are used by
+ the image.
+*/
Fl_RGB_Image::~Fl_RGB_Image() {
+#ifdef __APPLE__
+ if (id_) CGImageRelease((CGImageRef)id_);
+ else if (alloc_array) delete[] (uchar *)array;
+#else
uncache();
if (alloc_array) delete[] (uchar *)array;
+#endif
}
void Fl_RGB_Image::uncache() {
-#ifdef __APPLE_QUARTZ__
+#ifdef __APPLE__
if (id_) {
+ if (mask_) *(bool*)mask_ = false;
CGImageRelease((CGImageRef)id_);
id_ = 0;
+ mask_ = NULL;
}
#else
if (id_) {
@@ -246,35 +370,39 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
new_image->alloc_array = 1;
return new_image;
- } else return new Fl_RGB_Image(array, w(), h(), d(), ld());
+ } else {
+ return new Fl_RGB_Image(array, w(), h(), d(), ld());
+ }
}
if (W <= 0 || H <= 0) return 0;
- // OK, need to resize the image data; allocate memory and
+ // 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 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
- line_d; // stride from line to line
-
-
- // Figure out Bresenheim step/modulus values...
- xmod = w() % W;
- xstep = (w() / W) * d();
- ymod = h() % H;
- ystep = h() / H;
- line_d = ld() ? ld() : w() * d();
+ 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()];
new_image = new Fl_RGB_Image(new_array, W, H, d());
new_image->alloc_array = 1;
+ line_d = ld() ? ld() : w() * d();
+
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
+
+ // Figure out Bresenham step/modulus values...
+ xmod = w() % W;
+ xstep = (w() / W) * d();
+ ymod = h() % H;
+ ystep = h() / 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 * line_d; dx > 0; dx --) {
@@ -303,7 +431,7 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
for (dy = 0; dy < H; dy++) {
float oldy = dy * yscale;
if (oldy >= h())
- oldy = h() - 1;
+ oldy = float(h() - 1);
const float yfract = oldy - (unsigned) oldy;
for (dx = 0; dx < W; dx++) {
@@ -311,17 +439,17 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
float oldx = dx * xscale;
if (oldx >= w())
- oldx = w() - 1;
+ oldx = float(w() - 1);
const float xfract = oldx - (unsigned) oldx;
- const unsigned leftx = oldx;
- const unsigned lefty = oldy;
- const unsigned rightx = oldx + 1 >= w() ? oldx : oldx + 1;
- const unsigned righty = oldy;
- const unsigned dleftx = oldx;
- const unsigned dlefty = oldy + 1 >= h() ? oldy : oldy + 1;
- const unsigned drightx = rightx;
- const unsigned drighty = dlefty;
+ const unsigned leftx = (unsigned)oldx;
+ const unsigned lefty = (unsigned)oldy;
+ const unsigned rightx = (unsigned)(oldx + 1 >= w() ? oldx : oldx + 1);
+ const unsigned righty = (unsigned)oldy;
+ const unsigned dleftx = (unsigned)oldx;
+ const unsigned dlefty = (unsigned)(oldy + 1 >= h() ? oldy : oldy + 1);
+ const unsigned drightx = (unsigned)rightx;
+ const unsigned drighty = (unsigned)dlefty;
uchar left[4], right[4], downleft[4], downright[4];
memcpy(left, array + lefty * line_d + leftx * d(), d());
@@ -332,10 +460,10 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
int i;
if (d() == 4) {
for (i = 0; i < 3; i++) {
- left[i] *= left[3] / 255.0f;
- right[i] *= right[3] / 255.0f;
- downleft[i] *= downleft[3] / 255.0f;
- downright[i] *= downright[3] / 255.0f;
+ left[i] = (uchar)(left[i] * left[3] / 255.0f);
+ right[i] = (uchar)(right[i] * right[3] / 255.0f);
+ downleft[i] = (uchar)(downleft[i] * downleft[3] / 255.0f);
+ downright[i] = (uchar)(downright[i] * downright[3] / 255.0f);
}
}
@@ -345,15 +473,15 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
const float downf = yfract;
for (i = 0; i < d(); i++) {
- new_ptr[i] = (left[i] * leftf +
+ new_ptr[i] = (uchar)((left[i] * leftf +
right[i] * rightf) * upf +
(downleft[i] * leftf +
- downright[i] * rightf) * downf;
+ downright[i] * rightf) * downf);
}
if (d() == 4 && new_ptr[3]) {
for (i = 0; i < 3; i++) {
- new_ptr[i] /= new_ptr[3] / 255.0f;
+ new_ptr[i] = (uchar)(new_ptr[i] / (new_ptr[3] / 255.0f));
}
}
}
@@ -461,7 +589,7 @@ void Fl_RGB_Image::desaturate() {
d(new_d);
}
-#if !defined(WIN32) && !defined(__APPLE_QUARTZ__)
+#if !defined(WIN32) && !defined(__APPLE__)
// Composite an image with alpha on systems that don't have accelerated
// alpha compositing...
static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, int cy) {
@@ -518,7 +646,7 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i
delete[] dst;
}
-#endif // !WIN32 && !__APPLE_QUARTZ__
+#endif // !WIN32 && !__APPLE__
void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
fl_graphics_driver->draw(this, XP, YP, WP, HP, cx, cy);
@@ -540,16 +668,20 @@ static int start(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int w, int h
return 0;
}
+/** Draws an Fl_Image scaled to width \p W & height \p H with top-left corner at \em X,Y
+ \return zero when the graphics driver doesn't implement scaled drawing, non-zero if it does implement it.
+ */
+int Fl_Graphics_Driver::draw_scaled(Fl_Image *img, int X, int Y, int W, int H) {
+ return 0;
+}
+
#ifdef __APPLE__
static void imgProviderReleaseData (void *info, const void *data, size_t size)
{
- delete[] (unsigned char *)data;
+ if (!info || *(bool*)info) delete[] (unsigned char *)data;
+ delete (bool*)info;
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
-typedef void (*CGDataProviderReleaseDataCallback)(void *info, const void *data, size_t size);
-#endif
-
void Fl_Quartz_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy) {
int X, Y, W, H;
// Don't draw an empty image...
@@ -561,39 +693,86 @@ void Fl_Quartz_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP,
return;
}
if (!img->id_) {
- CGColorSpaceRef lut = 0;
- CGDataProviderReleaseDataCallback release_cb = NULL;
- const uchar* img_bytes = img->array;
+ CGColorSpaceRef lut = img->d()<=2 ? CGColorSpaceCreateDeviceGray() : CGColorSpaceCreateDeviceRGB();
int ld = img->ld();
- if (Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) {
- // when printing, duplicate the image data so it can be deleted later, at page end
- release_cb = imgProviderReleaseData;
- Fl_RGB_Image* img2 = (Fl_RGB_Image*)img->copy();
- img2->alloc_array = 0;
- img_bytes = img2->array;
- ld = 0;
- delete img2;
- }
- if (img->d()<=2)
- lut = CGColorSpaceCreateDeviceGray();
- else
- lut = CGColorSpaceCreateDeviceRGB();
- CGDataProviderRef src = CGDataProviderCreateWithData( NULL, img_bytes, img->w()*img->h()*img->d(), release_cb);
- img->id_ = CGImageCreate( img->w(), img->h(), 8, img->d()*8, ld?ld:img->w()*img->d(),
- lut, (img->d()&1)?kCGImageAlphaNone:kCGImageAlphaLast,
- src, 0L, false, kCGRenderingIntentDefault);
+ if (!ld) ld = img->w() * img->d();
+ // If img->alloc_array == 0, the CGImage data provider must not release the image data.
+ // If img->alloc_array != 0, the CGImage data provider will take responsibilty of deleting RGB image data after use:
+ // when the CGImage is deallocated, the release callback of its data provider
+ // (imgProviderReleaseData) is called and can delete the RGB image data.
+ // If the CGImage is printed, it is not deallocated until after the end of the page,
+ // therefore, with img->alloc_array != 0, the RGB image can be safely deleted any time after return from this function.
+ // The previously unused mask_ member allows to make sure the RGB image data is not deleted by Fl_RGB_Image::uncache().
+ if (img->alloc_array) img->mask_ = new bool(true);
+ CGDataProviderRef src = CGDataProviderCreateWithData(img->mask_, img->array, ld * img->h(),
+ img->alloc_array?imgProviderReleaseData:NULL);
+ img->id_ = CGImageCreate(img->w(), img->h(), 8, img->d()*8, ld,
+ lut, (img->d()&1)?kCGImageAlphaNone:kCGImageAlphaLast,
+ src, 0L, false, kCGRenderingIntentDefault);
CGColorSpaceRelease(lut);
CGDataProviderRelease(src);
}
if (img->id_ && fl_gc) {
- CGRect rect = { { X, Y }, { W, H } };
+ if (!img->alloc_array && Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id && !CGImageGetShouldInterpolate((CGImageRef)img->id_)) {
+ // When printing, the image data is used when the page is completed, that is, after return from this function.
+ // If the image has alloc_array = 0, we must protect against image data being freed before it is used:
+ // we duplicate the image data and have it deleted after use by the release-callback of the CGImage data provider
+ Fl_RGB_Image* img2 = (Fl_RGB_Image*)img->copy();
+ img2->alloc_array = 0;
+ const uchar *img_bytes = img2->array;
+ int ld = img2->ld();
+ if (!ld) ld = img2->w() * img2->d();
+ delete img2;
+ img->uncache();
+ CGColorSpaceRef lut = img->d()<=2 ? CGColorSpaceCreateDeviceGray() : CGColorSpaceCreateDeviceRGB();
+ CGDataProviderRef src = CGDataProviderCreateWithData( NULL, img_bytes, ld * img->h(), imgProviderReleaseData);
+ img->id_ = CGImageCreate(img->w(), img->h(), 8, img->d()*8, ld,
+ lut, (img->d()&1)?kCGImageAlphaNone:kCGImageAlphaLast,
+ src, 0L, true, kCGRenderingIntentDefault);
+ CGColorSpaceRelease(lut);
+ CGDataProviderRelease(src);
+ }
+ CGRect rect = CGRectMake(X, Y, W, H);
Fl_X::q_begin_image(rect, cx, cy, img->w(), img->h());
CGContextDrawImage(fl_gc, rect, (CGImageRef)img->id_);
Fl_X::q_end_image();
}
}
+int Fl_Quartz_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP) {
+ int X, Y, W, H;
+ fl_clip_box(XP,YP,WP,HP,X,Y,W,H); // X,Y,W,H will give the unclipped area of XP,YP,WP,HP
+ if (W == 0 || H == 0) return 1;
+ fl_push_no_clip(); // remove the FLTK clip that can't be rescaled
+ CGContextSaveGState(fl_gc);
+ CGContextClipToRect(fl_gc, CGRectMake(X, Y, W, H)); // this clip path will be rescaled & translated
+ CGContextTranslateCTM(fl_gc, XP, YP);
+ CGContextScaleCTM(fl_gc, float(WP)/img->w(), float(HP)/img->h());
+ img->draw(0, 0, img->w(), img->h(), 0, 0);
+ CGContextRestoreGState(fl_gc);
+ fl_pop_clip(); // restore FLTK's clip
+ return 1;
+}
+
#elif defined(WIN32)
+static Fl_Offscreen build_id(Fl_RGB_Image *img, void **pmask)
+{
+ Fl_Offscreen offs = fl_create_offscreen(img->w(), img->h());
+ if ((img->d() == 2 || img->d() == 4) && fl_can_do_alpha_blending()) {
+ fl_begin_offscreen(offs);
+ fl_draw_image(img->array, 0, 0, img->w(), img->h(), img->d()|FL_IMAGE_WITH_ALPHA, img->ld());
+ fl_end_offscreen();
+ } else {
+ fl_begin_offscreen(offs);
+ fl_draw_image(img->array, 0, 0, img->w(), img->h(), img->d(), img->ld());
+ fl_end_offscreen();
+ if (img->d() == 2 || img->d() == 4) {
+ *pmask = fl_create_alphamask(img->w(), img->h(), img->d(), img->ld(), img->array);
+ }
+ }
+ return offs;
+}
+
void Fl_GDI_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy) {
int X, Y, W, H;
// Don't draw an empty image...
@@ -604,21 +783,7 @@ void Fl_GDI_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int
if (start(img, XP, YP, WP, HP, img->w(), img->h(), cx, cy, X, Y, W, H)) {
return;
}
- if (!img->id_) {
- img->id_ = fl_create_offscreen(img->w(), img->h());
- if ((img->d() == 2 || img->d() == 4) && fl_can_do_alpha_blending()) {
- fl_begin_offscreen((Fl_Offscreen)img->id_);
- fl_draw_image(img->array, 0, 0, img->w(), img->h(), img->d()|FL_IMAGE_WITH_ALPHA, img->ld());
- fl_end_offscreen();
- } else {
- fl_begin_offscreen((Fl_Offscreen)img->id_);
- fl_draw_image(img->array, 0, 0, img->w(), img->h(), img->d(), img->ld());
- fl_end_offscreen();
- if (img->d() == 2 || img->d() == 4) {
- img->mask_ = fl_create_alphamask(img->w(), img->h(), img->d(), img->ld(), img->array);
- }
- }
- }
+ if (!img->id_) img->id_ = build_id(img, &(img->mask_));
if (img->mask_) {
HDC new_gc = CreateCompatibleDC(fl_gc);
int save = SaveDC(new_gc);
@@ -635,6 +800,20 @@ void Fl_GDI_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int
}
}
+int Fl_GDI_Printer_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP) {
+ XFORM old_tr, tr;
+ GetWorldTransform(fl_gc, &old_tr); // storing old transform
+ tr.eM11 = float(WP)/float(img->w());
+ tr.eM22 = float(HP)/float(img->h());
+ tr.eM12 = tr.eM21 = 0;
+ tr.eDx = XP;
+ tr.eDy = YP;
+ ModifyWorldTransform(fl_gc, &tr, MWT_LEFTMULTIPLY);
+ img->draw(0, 0, img->w(), img->h(), 0, 0);
+ SetWorldTransform(fl_gc, &old_tr);
+ return 1;
+}
+
#else
void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy) {
int X, Y, W, H;
@@ -652,6 +831,12 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in
fl_begin_offscreen((Fl_Offscreen)img->id_);
fl_draw_image(img->array, 0, 0, img->w(), img->h(), img->d(), img->ld());
fl_end_offscreen();
+ } else if (img->d() == 4 && fl_can_do_alpha_blending()) {
+ img->id_ = fl_create_offscreen_with_alpha(img->w(), img->h());
+ fl_begin_offscreen((Fl_Offscreen)img->id_);
+ fl_draw_image(img->array, 0, 0, img->w(), img->h(), img->d() | FL_IMAGE_WITH_ALPHA,
+ img->ld());
+ fl_end_offscreen();
}
}
if (img->id_) {
@@ -667,9 +852,12 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in
int oy = Y-cy; if (oy < 0) oy += img->h();
XSetClipOrigin(fl_display, fl_gc, X-cx, Y-cy);
}
-
- copy_offscreen(X, Y, W, H, img->id_, cx, cy);
-
+
+ if (img->d() == 4 && fl_can_do_alpha_blending())
+ copy_offscreen_with_alpha(X, Y, W, H, img->id_, cx, cy);
+ else
+ copy_offscreen(X, Y, W, H, img->id_, cx, cy);
+
if (img->mask_) {
// put the old clip region back
XSetClipOrigin(fl_display, fl_gc, 0, 0);
@@ -693,5 +881,5 @@ void Fl_RGB_Image::label(Fl_Menu_Item* m) {
}
//
-// End of "$Id: Fl_Image.cxx 10377 2014-10-14 11:53:51Z AlbrechtS $".
+// End of "$Id: Fl_Image.cxx 12073 2016-11-02 11:47:36Z AlbrechtS $".
//
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx
index b69b477..a8e232a 100644
--- a/src/Fl_Image_Surface.cxx
+++ b/src/Fl_Image_Surface.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Image_Surface.cxx 10200 2014-06-18 01:22:16Z manolo $"
+// "$Id: Fl_Image_Surface.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $"
//
// Draw-to-image code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -20,45 +20,76 @@
#include <FL/Fl_Printer.H>
#include <FL/Fl.H>
-
const char *Fl_Image_Surface::class_id = "Fl_Image_Surface";
-/** The constructor.
- \param w and \param h give the size in pixels of the resulting image.
- */
-Fl_Image_Surface::Fl_Image_Surface(int w, int h) : Fl_Surface_Device(NULL) {
+void Fl_Image_Surface::prepare_(int w, int h, int highres) {
width = w;
height = h;
-#if !(defined(__APPLE__) || defined(WIN32))
- gc = 0;
- if (!fl_display) { // allows use of this class before any window is shown
- fl_open_display();
- gc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0);
- fl_gc = gc;
- }
+#if FL_ABI_VERSION < 10304
+ highres = 0;
+ if (highres) {/* avoid compiler warning (Linux + Windows */}
#endif
- offscreen = fl_create_offscreen(w, h);
#ifdef __APPLE__
- helper = new Fl_Quartz_Flipped_Surface_(width, height);
+ offscreen = fl_create_offscreen(highres ? 2*w : w, highres ? 2*h : h);
+ helper = new Fl_Quartz_Flipped_Surface_(w, h);
+ if (highres) {
+ CGContextScaleCTM(offscreen, 2, 2);
+ }
driver(helper->driver());
+ CGContextSetShouldAntialias(offscreen, false);
+ CGContextSaveGState(offscreen);
+ CGContextTranslateCTM(offscreen, 0, height);
+ CGContextScaleCTM(offscreen, 1.0f, -1.0f);
+ CGContextSetRGBFillColor(offscreen, 1, 1, 1, 1);
+ CGContextFillRect(offscreen, CGRectMake(0,0,w,h) );
#elif defined(WIN32)
+ offscreen = fl_create_offscreen(w, h);
helper = new Fl_GDI_Surface_();
driver(helper->driver());
#else
+ gc = 0;
+ if (!fl_gc) { // allows use of this class before any window is shown
+ fl_open_display();
+ gc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0);
+ fl_gc = gc;
+ }
+ offscreen = fl_create_offscreen(w, h);
helper = new Fl_Xlib_Surface_();
driver(helper->driver());
#endif
}
+/** Constructor with optional high resolution.
+ \param w and \param h give the size in pixels of the resulting image.
+ \param highres if non-zero, the surface pixel size is twice as high and wide as w and h,
+ which is useful to draw it later on a high resolution display (e.g., retina display).
+ This is implemented for the Mac OS platform only.
+ If \p highres is non-zero, use Fl_Image_Surface::highres_image() to get the image data.
+ \version 1.3.4 and requires compilation with -DFL_ABI_VERSION=10304 (1.3.3 without the highres parameter)
+ */
+Fl_Image_Surface::Fl_Image_Surface(int w, int h, int highres) : Fl_Surface_Device(NULL) {
+ prepare_(w, h, highres);
+}
+#if FLTK_ABI_VERSION < 10304
+Fl_Image_Surface::Fl_Image_Surface(int w, int h) : Fl_Surface_Device(NULL) {
+ prepare_(w, h, 0);
+}
+#endif
+
+
/** The destructor.
*/
Fl_Image_Surface::~Fl_Image_Surface() {
- fl_delete_offscreen(offscreen);
#ifdef __APPLE__
+ void *data = CGBitmapContextGetData((CGContextRef)offscreen);
+ free(data);
+ CGContextRelease((CGContextRef)offscreen);
delete (Fl_Quartz_Flipped_Surface_*)helper;
#elif defined(WIN32)
+ fl_delete_offscreen(offscreen);
delete (Fl_GDI_Surface_*)helper;
#else
+ fl_delete_offscreen(offscreen);
if (gc) { XFreeGC(fl_display, gc); fl_gc = 0; }
delete (Fl_Xlib_Surface_*)helper;
#endif
@@ -66,14 +97,20 @@ Fl_Image_Surface::~Fl_Image_Surface() {
/** Returns an image made of all drawings sent to the Fl_Image_Surface object.
The returned object contains its own copy of the RGB data.
+ Prefer Fl_Image_Surface::highres_image() if the surface was
+ constructed with the highres option on.
*/
Fl_RGB_Image* Fl_Image_Surface::image()
{
unsigned char *data;
+ int W = width, H = height;
#ifdef __APPLE__
CGContextFlush(offscreen);
- data = fl_read_image(NULL, 0, 0, width, height, 0);
- fl_end_offscreen();
+ W = CGBitmapContextGetWidth(offscreen);
+ H = CGBitmapContextGetHeight(offscreen);
+ Fl_X::set_high_resolution(0);
+ data = fl_read_image(NULL, 0, 0, W, H, 0);
+ fl_gc = 0;
#elif defined(WIN32)
fl_pop_clip();
data = fl_read_image(NULL, 0, 0, width, height, 0);
@@ -88,11 +125,24 @@ Fl_RGB_Image* Fl_Image_Surface::image()
fl_window = pre_window;
previous->set_current();
#endif
- Fl_RGB_Image *image = new Fl_RGB_Image(data, width, height);
+ Fl_RGB_Image *image = new Fl_RGB_Image(data, W, H);
image->alloc_array = 1;
return 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 image is scaled to a size of WxH drawing units and may have a pixel size twice as wide and high.
+ The returned object should be deallocated with Fl_Shared_Image::release() after use.
+ \version 1.3.4 and requires compilation with -DFL_ABI_VERSION=10304
+ */
+Fl_Shared_Image* Fl_Image_Surface::highres_image()
+{
+ Fl_Shared_Image *s_img = Fl_Shared_Image::get(image());
+ s_img->scale(width, height);
+ return s_img;
+}
+
/** Draws a widget in the image surface
\param widget any FLTK widget (e.g., standard, custom, window, GL view) to draw in the image
@@ -108,10 +158,9 @@ void Fl_Image_Surface::draw(Fl_Widget *widget, int delta_x, int delta_y)
void Fl_Image_Surface::set_current()
{
#if defined(__APPLE__)
- fl_begin_offscreen(offscreen);
- fl_pop_clip();
- Fl_Surface_Device::set_current();
- fl_push_no_clip();
+ fl_gc = offscreen; fl_window = 0;
+ Fl_Surface_Device::set_current();
+ Fl_X::set_high_resolution( CGBitmapContextGetWidth(offscreen) > width );
#elif defined(WIN32)
_sgc=fl_gc;
_sw=fl_window;
@@ -150,8 +199,53 @@ void Fl_Quartz_Flipped_Surface_::untranslate() {
const char *Fl_Quartz_Flipped_Surface_::class_id = "Fl_Quartz_Flipped_Surface_";
-#endif // __APPLE__
+
+void Fl_Image_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int delta_y)
+{
+ int bt = win->decorated_h() - win->h();
+ draw(win, delta_x, bt + delta_y ); // draw the window content
+ if (win->border()) {
+ // draw the window title bar
+ helper->translate(delta_x, delta_y);
+ CGContextTranslateCTM(fl_gc, 0, bt);
+ CGContextScaleCTM(fl_gc, 1, -1);
+ void *layer = Fl_X::get_titlebar_layer(win);
+ if (layer) {
+ Fl_X::draw_layer_to_context(layer, fl_gc, win->w(), bt);
+ } else {
+ CGImageRef img = Fl_X::CGImage_from_window_rect(win, 0, -bt, win->w(), bt);
+ CGContextDrawImage(fl_gc, CGRectMake(0, 0, win->w(), bt), img);
+ CFRelease(img);
+ }
+ helper->untranslate();
+ CGContextTranslateCTM(fl_gc, delta_x, height+delta_y);
+ CGContextScaleCTM(fl_gc, 1.0f, -1.0f);
+ }
+}
+
+#else
+
+/** Draws a window and its borders and title bar to the image drawing surface.
+ \param win an FLTK window to draw in the image
+ \param delta_x and \param delta_y give
+ the position in the image of the top-left corner of the window's title bar
+*/
+void Fl_Image_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int delta_y)
+{
+#ifdef WIN32
+ // draw_decorated_window() will change the current drawing surface, and set it
+ // back to us; it's necessary to do some cleaning before
+ fl_pop_clip();
+ RestoreDC(fl_gc, _savedc);
+ DeleteDC(fl_gc);
+#elif !defined(__APPLE__)
+ fl_pop_clip();
+#endif
+ helper->draw_decorated_window(win, delta_x, delta_y, this);
+}
+#endif
+
//
-// End of "$Id: Fl_Image_Surface.cxx 10200 2014-06-18 01:22:16Z manolo $".
+// End of "$Id: Fl_Image_Surface.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $".
//
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index 623e87f..0168bc5 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Input.cxx 10031 2013-12-13 16:28:38Z manolo $"
+// "$Id: Fl_Input.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $"
//
// Input widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -678,7 +678,12 @@ int Fl_Input::handle(int event) {
dnd_save_mark = mark();
dnd_save_focus = this;
// drag the data:
- copy(0); Fl::dnd();
+ copy(0);
+#ifdef __APPLE__
+ Fl_X::dnd(1);
+#else
+ Fl::dnd();
+#endif
return 1;
}
}
@@ -718,7 +723,7 @@ int Fl_Input::handle(int event) {
// fall through:
case FL_DND_DRAG:
//int p = mouse_position(X, Y, W, H);
-#if DND_OUT_XXXX
+#ifdef DND_OUT_XXXX
if (Fl::focus()==this && (p>=dnd_save_position && p<=dnd_save_mark ||
p>=dnd_save_mark && p<=dnd_save_position)) {
position(dnd_save_position, dnd_save_mark);
@@ -734,7 +739,7 @@ int Fl_Input::handle(int event) {
case FL_DND_LEAVE:
position(dnd_save_position, dnd_save_mark);
-#if DND_OUT_XXXX
+#ifdef DND_OUT_XXXX
if (!focused())
#endif
if (dnd_save_focus && dnd_save_focus != this) {
@@ -844,5 +849,5 @@ int Fl_Secret_Input::handle(int event) {
}
//
-// End of "$Id: Fl_Input.cxx 10031 2013-12-13 16:28:38Z manolo $".
+// End of "$Id: Fl_Input.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $".
//
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 08b4222..7827742 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input_.cxx 10402 2014-10-28 15:33:17Z cand $"
+// "$Id: Fl_Input_.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
@@ -1213,7 +1213,7 @@ 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++);
+ for (; i<size_ && i<len && str[i]==value_[i]; i++) {/*empty*/}
if (i==size_ && i==len) return 0;
}
minimal_update(i);
@@ -1338,5 +1338,5 @@ unsigned int Fl_Input_::index(int i) const
}
//
-// End of "$Id: Fl_Input_.cxx 10402 2014-10-28 15:33:17Z cand $".
+// End of "$Id: Fl_Input_.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $".
//
diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx
index 179ade6..3ea31f5 100644
--- a/src/Fl_JPEG_Image.cxx
+++ b/src/Fl_JPEG_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_JPEG_Image.cxx 9980 2013-09-21 16:41:23Z greg.ercolano $"
+// "$Id: Fl_JPEG_Image.cxx 10743 2015-06-07 06:21:40Z manolo $"
//
// Fl_JPEG_Image routines.
//
@@ -88,8 +88,11 @@ extern "C" {
The inherited destructor frees all memory and server resources that are used
by the image.
- There is no error function in this class. If the image has loaded correctly,
- w(), h(), and d() should return values greater zero.
+ 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.
*/
@@ -111,7 +114,10 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *filename) // I - File to load
array = (uchar *)0;
// Open the image file...
- if ((fp = fl_fopen(filename, "rb")) == NULL) return;
+ if ((fp = fl_fopen(filename, "rb")) == NULL) {
+ ld(ERR_FILE_ACCESS);
+ return;
+ }
// Setup the decompressor info and read the header...
dinfo.err = jpeg_std_error((jpeg_error_mgr *)&jerr);
@@ -150,12 +156,13 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *filename) // I - File to load
free(max_destroy_decompress_err);
free(max_finish_decompress_err);
+ ld(ERR_FORMAT);
return;
}
jpeg_create_decompress(&dinfo);
jpeg_stdio_src(&dinfo, fp);
- jpeg_read_header(&dinfo, 1);
+ jpeg_read_header(&dinfo, TRUE);
dinfo.quantize_colors = (boolean)FALSE;
dinfo.out_color_space = JCS_RGB;
@@ -275,8 +282,11 @@ static void jpeg_mem_src(j_decompress_ptr cinfo, const unsigned char *data)
The inherited destructor frees all memory and server resources that are used
by the image.
- There is no error function in this class. If the image has loaded correctly,
- w(), h(), and d() should return values greater zero.
+ 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 name A unique name or NULL
\param data A pointer to the memory location of the JPEG image
@@ -337,7 +347,7 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *name, const unsigned char *data)
jpeg_create_decompress(&dinfo);
jpeg_mem_src(&dinfo, data);
- jpeg_read_header(&dinfo, 1);
+ jpeg_read_header(&dinfo, TRUE);
dinfo.quantize_colors = (boolean)FALSE;
dinfo.out_color_space = JCS_RGB;
@@ -377,5 +387,5 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *name, const unsigned char *data)
}
//
-// End of "$Id: Fl_JPEG_Image.cxx 9980 2013-09-21 16:41:23Z greg.ercolano $".
+// End of "$Id: Fl_JPEG_Image.cxx 10743 2015-06-07 06:21:40Z manolo $".
//
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx
index c303ad4..c949300 100644
--- a/src/Fl_Light_Button.cxx
+++ b/src/Fl_Light_Button.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Light_Button.cxx 9738 2012-12-07 16:29:49Z AlbrechtS $"
+// "$Id: Fl_Light_Button.cxx 10775 2015-06-27 15:20:23Z AlbrechtS $"
//
// Lighted button widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -33,13 +33,12 @@ void Fl_Light_Button::draw() {
if (box()) draw_box(this==Fl::pushed() ? fl_down(box()) : box(), color());
Fl_Color col = value() ? (active_r() ? selection_color() :
fl_inactive(selection_color())) : color();
- int W;
- int dx, dy;
- W = labelsize();
- dx = Fl::box_dx(box()) + 2;
- dy = (h() - W) / 2;
- // if (dy < 0) dy = 0; // neg. offset o.k. for vertical centering
+ 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)
if (down_box()) {
// draw other down_box() styles:
@@ -51,7 +50,7 @@ void Fl_Light_Button::draw() {
// Check box...
draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR);
if (value()) {
- if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+ if (Fl::is_scheme("gtk+")) {
fl_color(FL_SELECTION_COLOR);
} else {
fl_color(col);
@@ -77,7 +76,7 @@ void Fl_Light_Button::draw() {
int tdx = dx + (W - tW) / 2;
int tdy = dy + (W - tW) / 2;
- if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+ 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);
@@ -110,7 +109,7 @@ void Fl_Light_Button::draw() {
break;
}
- if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+ 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);
}
@@ -120,22 +119,23 @@ void Fl_Light_Button::draw() {
draw_box(down_box(), x()+dx, y()+dy, W, W, col);
break;
}
+ lx = dx + W + 2;
} else {
// if down_box() is zero, draw light button style:
int hh = h()-2*dy - 2;
int ww = W/2+1;
int xx = dx;
if (w()<ww+2*xx) xx = (w()-ww)/2;
- if (Fl::scheme() && !strcmp(Fl::scheme(), "plastic")) {
+ if (Fl::is_scheme("plastic")) {
col = active_r() ? selection_color() : fl_inactive(selection_color());
fl_color(value() ? col : fl_color_average(col, FL_BLACK, 0.5f));
fl_pie(x()+xx, y()+dy+1, ww, hh, 0, 360);
} else {
draw_box(FL_THIN_DOWN_BOX, x()+xx, y()+dy+1, ww, hh, col);
}
- dx = (ww + 2 * dx - W) / 2;
+ lx = dx + ww + 2;
}
- draw_label(x()+W+2*dx, y(), w()-W-2*dx, h());
+ draw_label(x()+lx, y(), w()-lx-bx, h());
if (Fl::focus() == this) draw_focus();
}
@@ -169,5 +169,5 @@ Fl_Radio_Light_Button::Fl_Radio_Light_Button(int X,int Y,int W,int H,const char
//
-// End of "$Id: Fl_Light_Button.cxx 9738 2012-12-07 16:29:49Z AlbrechtS $".
+// End of "$Id: Fl_Light_Button.cxx 10775 2015-06-27 15:20:23Z AlbrechtS $".
//
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 20c9eed..4849533 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Menu.cxx 10211 2014-06-28 12:29:51Z manolo $"
+// "$Id: Fl_Menu.cxx 11321 2016-03-08 16:58:43Z AlbrechtS $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -29,7 +29,32 @@
#include <stdio.h>
#include "flstring.h"
-/** Size of the menu starting from this menu item */
+/** Size of the menu starting from this menu item.
+
+ This method counts all menu items starting with \p this menu item,
+ including all menu items in the same (sub)menu level, all nested
+ submenus, \b and the terminating empty (0) menu item.
+
+ It does \b not count menu items referred to by FL_SUBMENU_POINTER
+ menu items (except the single menu item with FL_SUBMENU_POINTER).
+
+ All menu items counted are consecutive in memory (one array).
+
+ Example:
+
+ \code
+ schemechoice = new Fl_Choice(X+125,Y,140,25,"FLTK Scheme");
+ schemechoice->add("none");
+ schemechoice->add("plastic");
+ schemechoice->add("gtk+");
+ schemechoice->add("gleam");
+ printf("schemechoice->menu()->size() = %d\n", schemechoice->menu()->size());
+ \endcode
+
+ Output:
+
+ schemechoice->menu()->%size() = 5
+*/
int Fl_Menu_Item::size() const {
const Fl_Menu_Item* m = this;
int nest = 0;
@@ -189,13 +214,11 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
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::scheme()) {
- if (!strcmp(Fl::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_);
+ 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) {
@@ -224,7 +247,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
break;
}
- if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+ 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);
}
@@ -232,7 +255,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
} else {
fl_draw_box(FL_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR);
if (value()) {
- if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+ if (Fl::is_scheme("gtk+")) {
fl_color(FL_SELECTION_COLOR);
} else {
fl_color(labelcolor_);
@@ -327,7 +350,7 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
if (w1 > W) W = w1;
// calculate the maximum width of all shortcuts
if (m->shortcut_) {
- // s is a pointerto the utf8 string for the entire shortcut
+ // s is a pointer to the UTF-8 string for the entire shortcut
// k points only to the key part (minus the modifier keys)
const char *k, *s = fl_shortcut_label(m->shortcut_, &k);
if (fl_utf_nb_char((const unsigned char*)k, (int) strlen(k))<=4) {
@@ -459,10 +482,12 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int n, int eraseit) {
button ? button->textsize() : FL_NORMAL_SIZE);
const char *k, *s = fl_shortcut_label(m->shortcut_, &k);
if (fl_utf_nb_char((const unsigned char*)k, (int) strlen(k))<=4) {
- // righ-align the modifiers and left-align the key
- char buf[32]; strcpy(buf, s); buf[k-s] = 0;
+ // right-align the modifiers and left-align the key
+ char *buf = (char*)malloc(k-s+1);
+ memcpy(buf, s, k-s); buf[k-s] = 0;
fl_draw(buf, xx, yy, ww-shortcutWidth, hh, FL_ALIGN_RIGHT);
fl_draw( k, xx+ww-shortcutWidth, yy, shortcutWidth, hh, FL_ALIGN_LEFT);
+ free(buf);
} else {
// right-align to the menu
fl_draw(s, xx, yy, ww-4, hh, FL_ALIGN_RIGHT);
@@ -1052,5 +1077,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
-// End of "$Id: Fl_Menu.cxx 10211 2014-06-28 12:29:51Z manolo $".
+// End of "$Id: Fl_Menu.cxx 11321 2016-03-08 16:58:43Z AlbrechtS $".
//
diff --git a/src/Fl_Menu_.cxx b/src/Fl_Menu_.cxx
index bd0186d..2d51cbf 100644
--- a/src/Fl_Menu_.cxx
+++ b/src/Fl_Menu_.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Menu_.cxx 9325 2012-04-05 05:12:30Z fabien $"
+// "$Id: Fl_Menu_.cxx 11801 2016-07-09 17:06:46Z AlbrechtS $"
//
// Common menu code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -63,39 +63,68 @@
\see find_item()
*/
int Fl_Menu_::item_pathname(char *name, int namelen, const Fl_Menu_Item *finditem) const {
- int len = 0;
- finditem = finditem ? finditem : mvalue();
- name[0] = '\0';
- for ( int t=0; t<size(); t++ ) {
- const Fl_Menu_Item *m = &(menu()[t]);
- if ( m->submenu() ) { // submenu? descend
- if (*name) SAFE_STRCAT("/");
- if (m->label()) SAFE_STRCAT(m->label());
- 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
- 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] = '\0';
+ return item_pathname_(name, namelen, finditem, menu_);
+}
+
+// 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 len = 0;
+ int level = 0;
+ 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->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();
+ if (m->label()) {
+ if (*name) SAFE_STRCAT("/");
+ SAFE_STRCAT(m->label());
+ }
+ if (item_pathname_(name, len, finditem, submenu) == 0)
+ return 0;
+ name[slen] = 0; // continue from where we were
+ } else {
+ // REGULAR SUBMENU? DESCEND
+ ++level;
+ if (*name) SAFE_STRCAT("/");
+ if (m->label()) SAFE_STRCAT(m->label());
+ 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 ( --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); // item not found
+ }
+ *name = '\0';
+ 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.
+ not submenu pointers (FL_SUBMENU_POINTER).
To get the menu item's index, use find_index(const char*)
@@ -125,10 +154,15 @@ const Fl_Menu_Item * Fl_Menu_::find_item(const char *pathname) {
}
/**
- Find the index the menu array for given \p item.
-
+ Find the index into the menu array for a given \p item.
+
A way to convert a menu item pointer into an index.
+ Does \b not handle items that are in submenu pointers (FL_SUBMENU_POINTER).
+
+ -1 is returned if the item is not in this menu
+ or is part of an FL_SUBMENU_POINTER submenu.
+
Current implementation is fast and not expensive.
\code
@@ -141,7 +175,7 @@ const Fl_Menu_Item * Fl_Menu_::find_item(const char *pathname) {
if ( index == -1 ) { ..error.. }
\endcode
- \param item The *item to be found
+ \param[in] item The item to be found
\returns The index of the item, or -1 if not found.
\see menu()
*/
@@ -155,9 +189,10 @@ 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
- 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.
-
+ \b not submenu pointers (FL_SUBMENU_POINTER). 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 cb Find the first item with this callback
\returns The index of the item with the specific callback, or -1 if not found
\see find_index(const char*)
@@ -173,11 +208,11 @@ 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 not submenu pointers.
+ also traversing submenus, but \b not submenu pointers (FL_SUBMENU_POINTER).
To get the menu item pointer for a pathname, use find_item()
- \param pathname The path and name of the menu item index to find
+ \param[in] pathname The path and name of the menu item to find
\returns The index of the matching item, or -1 if not found.
\see item_pathname()
@@ -219,7 +254,7 @@ int Fl_Menu_::find_index(const char *pathname) const {
internationalisation and a menu item can not be found using its label. This
search is also much faster.
- \param cb find the first item with this callback
+ \param[in] cb find the first item with this callback
\returns The item found, or NULL if not found
\see find_item(const char*)
*/
@@ -254,8 +289,8 @@ const Fl_Menu_Item* Fl_Menu_::picked(const Fl_Menu_Item* v) {
if (v) {
if (v->radio()) {
if (!v->value()) { // they are turning on a radio item
- set_changed();
- ((Fl_Menu_Item*)v)->setonly();
+ set_changed();
+ setonly((Fl_Menu_Item*)v);
}
redraw();
} else if (v->flags & FL_MENU_TOGGLE) {
@@ -276,7 +311,59 @@ const Fl_Menu_Item* Fl_Menu_::picked(const Fl_Menu_Item* v) {
return v;
}
-/** Turns the radio item "on" for the menu item and turns off adjacent radio items set. */
+/* Scans an array of Fl_Menu_Item's that begins at start, searching for item.
+ Returns NULL if item is not found.
+ If item is present, returns start, unless item belongs to an
+ FL_SUBMENU_POINTER-adressed array of items, in which case the first item of this array is returned.
+ */
+static Fl_Menu_Item *first_submenu_item(Fl_Menu_Item *item, Fl_Menu_Item *start)
+{
+ Fl_Menu_Item* m = start;
+ int nest = 0; // will indicate submenu nesting depth
+ while (1) { // loop over all menu items
+ if (!m->text) { // m is a null item
+ if (!nest) return NULL; // item was not found
+ nest--; // m marks the end of a submenu -> decrement submenu nesting depth
+ } else { // a true item
+ if (m == item) return start; // item is found, return menu start item
+ if (m->flags & FL_SUBMENU_POINTER) {
+ // scan the detached submenu which begins at m->user_data()
+ Fl_Menu_Item *first = first_submenu_item(item, (Fl_Menu_Item*)m->user_data());
+ if (first) return first; // if item was found in the submenu, return
+ }
+ else if (m->flags & FL_SUBMENU) { // a direct submenu
+ nest++; // increment submenu nesting depth
+ }
+ }
+ m++; // step to next menu item
+ }
+}
+
+
+/** Turns the radio item "on" for the menu item and turns "off" adjacent radio items of the same group. */
+void Fl_Menu_::setonly(Fl_Menu_Item* item) {
+ // find the first item of the (sub)menu containing item
+ Fl_Menu_Item* first = first_submenu_item(item, menu_);
+ 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
+ if (j->flags & FL_MENU_DIVIDER) break; // stop on divider lines
+ j++;
+ if (!j->text || !j->radio()) break; // stop after group
+ j->clear();
+ }
+ for (j = item-1; j>=first; j--) { // go up
+ //DEBUG printf("GO UP: WORKING ON: item='%s', flags=%x\n", j->text, j->flags);
+ if (!j->text || (j->flags&FL_MENU_DIVIDER) || !j->radio()) break;
+ j->clear();
+ }
+}
+
+/** Turns the radio item "on" for the menu item and turns "off" adjacent radio items set.
+ \deprecated This method is dangerous if radio items are first in the menu.
+ Use Fl_Menu_::setonly(Fl_Menu_Item*) instead.
+ */
void Fl_Menu_Item::setonly() {
flags |= FL_MENU_RADIO | FL_MENU_VALUE;
Fl_Menu_Item* j;
@@ -395,7 +482,7 @@ void Fl_Menu_::clear() {
is done to make a private array.
\warning Since this method can change the internal menu array, any menu
- item pointers or indecies the application may have cached can become
+ item pointers or indices the application may have cached can become
stale, and should be recalculated/refreshed.
\b Example:
@@ -423,5 +510,5 @@ int Fl_Menu_::clear_submenu(int index) {
}
//
-// End of "$Id: Fl_Menu_.cxx 9325 2012-04-05 05:12:30Z fabien $".
+// End of "$Id: Fl_Menu_.cxx 11801 2016-07-09 17:06:46Z AlbrechtS $".
//
diff --git a/src/Fl_Menu_add.cxx b/src/Fl_Menu_add.cxx
index bc5a36b..e1b1423 100644
--- a/src/Fl_Menu_add.cxx
+++ b/src/Fl_Menu_add.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Menu_add.cxx 9325 2012-04-05 05:12:30Z fabien $"
+// "$Id: Fl_Menu_add.cxx 11801 2016-07-09 17:06:46Z AlbrechtS $"
//
// Menu utilities for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -94,10 +94,14 @@ static int compare(const char* a, const char* b) {
}
+/** Adds a menu item.
-/** Adds an item. The text is split at '/' characters to automatically
- produce submenus (actually a totally unnecessary feature as you can
- now add submenu titles directly by setting SUBMENU in the flags):
+ The text is split at '/' characters to automatically
+ produce submenus (actually a totally unnecessary feature as you can
+ now add submenu titles directly by setting FL_SUBMENU in the flags).
+
+ \returns the index into the menu() array, where the entry was added
+ \see Fl_Menu_Item::insert(int, const char*, int, Fl_Callback*, void*, int)
*/
int Fl_Menu_Item::add(
const char *mytext,
@@ -110,7 +114,6 @@ int Fl_Menu_Item::add(
}
-
/**
Inserts an item at position \p index.
@@ -122,12 +125,13 @@ int Fl_Menu_Item::add(
In all other aspects, the behavior of insert() is the same as add().
- \param index insert new items here
- \param mytext new label string, details see above
- \param sc keyboard shortcut for new item
- \param cb callback function for new item
- \param data user data for new item
- \param 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
*/
int Fl_Menu_Item::insert(
@@ -209,30 +213,33 @@ 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
to make a private array.
\par
Since this method can change the internal menu array, any menu item
- pointers or indecies the application may have cached can become stale,
+ pointers or indices the application may have cached can become stale,
and should be recalculated/refreshed.
\par
A menu item's callback must not add() items to its parent menu during the callback.
<B>Detailed Description of Parameters</B>
\par label
- The menu item's label. This option is required.
+ 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 "&" character specifies that the following character is an accelerator and will be underlined.
@@ -273,7 +280,7 @@ int Fl_Menu_Item::insert(
\endverbatim
\par
..where \<ascii_value\> is a decimal value representing an
- ascii character (eg. 97 is the ascii code for 'a'), and the optional
+ ASCII character (eg. 97 is the ascii code for 'a'), and the optional
prefixes enhance the value that follows. Multiple prefixes must
appear in the order below.
\par
@@ -313,6 +320,12 @@ int Fl_Menu_Item::insert(
FL_MENU_DIVIDER // Creates divider line below this item. Also ends a group of radio buttons.
\endcode
+ If FL_SUBMENU is set in an item's flags, then actually two items are added:
+ the first item is the menu item (submenu title), as expected, and the second
+ item is the submenu terminating item with the label and all other members
+ 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.
Dependent on responses to http://fltk.org/newsgroups.php?gfltk.development+v:10086 and results of STR#2344
*/
@@ -321,7 +334,6 @@ int Fl_Menu_::add(const char *label,int shortcut,Fl_Callback *callback,void *use
}
-
/**
Inserts a new menu item at the specified \p index position.
@@ -351,8 +363,8 @@ int Fl_Menu_::add(const char *label,int shortcut,Fl_Callback *callback,void *use
\returns The index into the menu() array, where the entry was added.
\see add()
+*/
- */
int Fl_Menu_::insert(
int index,
const char *label,
@@ -365,7 +377,7 @@ int Fl_Menu_::insert(
if (this != fl_menu_array_owner) {
if (fl_menu_array_owner) {
Fl_Menu_* o = fl_menu_array_owner;
- // the previous owner get's its own correctly-sized array:
+ // the previous owner gets its own correctly-sized array:
int value_offset = (int) (o->value_-local_array);
int n = local_array_size;
Fl_Menu_Item* newMenu = o->menu_ = new Fl_Menu_Item[n];
@@ -484,5 +496,5 @@ void Fl_Menu_::remove(int i) {
}
//
-// End of "$Id: Fl_Menu_add.cxx 9325 2012-04-05 05:12:30Z fabien $".
+// End of "$Id: Fl_Menu_add.cxx 11801 2016-07-09 17:06:46Z AlbrechtS $".
//
diff --git a/src/Fl_Native_File_Chooser_FLTK.cxx b/src/Fl_Native_File_Chooser_FLTK.cxx
index bedd7c7..151fd65 100644
--- a/src/Fl_Native_File_Chooser_FLTK.cxx
+++ b/src/Fl_Native_File_Chooser_FLTK.cxx
@@ -1,4 +1,4 @@
-// "$Id: Fl_Native_File_Chooser_FLTK.cxx 10349 2014-10-01 17:24:55Z manolo $"
+// "$Id: Fl_Native_File_Chooser_FLTK.cxx 11923 2016-09-05 19:28:21Z greg.ercolano $"
//
// FLTK native file chooser widget wrapper for GTK's GtkFileChooserDialog
//
@@ -75,10 +75,12 @@ Fl_Native_File_Chooser::~Fl_Native_File_Chooser() {
Sets the current Fl_Native_File_Chooser::Type of browser.
*/
void Fl_Native_File_Chooser::type(int t) { return _x11_file_chooser->type(t); }
+
/**
Gets the current Fl_Native_File_Chooser::Type of browser.
*/
int Fl_Native_File_Chooser::type() const { return _x11_file_chooser->type(); }
+
/**
Sets the platform specific chooser options to \p val.
\p val is expected to be one or more Fl_Native_File_Chooser::Option flags ORed together.
@@ -90,10 +92,11 @@ int Fl_Native_File_Chooser::type() const { return _x11_file_chooser->type(); }
NEW_FOLDER Shows the 'New Folder' button. Ignored Used Used
PREVIEW Enables the 'Preview' mode by default. Ignored Ignored Used
SAVEAS_CONFIRM Confirm dialog if BROWSE_SAVE_FILE file exists. Used Used Used
- USE_FILTER_EXT Chooser filter pilots the output file extension. Ignored Used Ignored
+ USE_FILTER_EXT Chooser filter pilots the output file extension. Ignored Used Used (GTK)
\endcode
*/
void Fl_Native_File_Chooser::options(int o) { _x11_file_chooser->options(o); }
+
/**
Gets the platform specific Fl_Native_File_Chooser::Option flags.
*/
@@ -105,14 +108,15 @@ int Fl_Native_File_Chooser::options() const { return _x11_file_chooser->options
\b Example:
\code
if ( fnfc->show() == 0 ) {
- // Print all filenames user selected
- for (int n=0; n<fnfc->count(); n++ ) {
- printf("%d) '%s'\n", n, fnfc->filename(n));
- }
+ // Print all filenames user selected
+ for (int n=0; n<fnfc->count(); n++ ) {
+ printf("%d) '%s'\n", n, fnfc->filename(n));
+ }
}
\endcode
*/
int Fl_Native_File_Chooser::count() const { return _x11_file_chooser->count(); }
+
/**
Return the filename the user chose.
Use this if only expecting a single filename.
@@ -120,6 +124,7 @@ int Fl_Native_File_Chooser::count() const { return _x11_file_chooser->count(); }
Return value may be "" if no filename was chosen (eg. user cancelled).
*/
const char *Fl_Native_File_Chooser::filename() const { return _x11_file_chooser->filename(); }
+
/**
Return one of the filenames the user selected.
Use count() to determine how many filenames the user selected.
@@ -127,40 +132,46 @@ const char *Fl_Native_File_Chooser::filename() const { return _x11_file_chooser-
\b Example:
\code
if ( fnfc->show() == 0 ) {
- // Print all filenames user selected
- for (int n=0; n<fnfc->count(); n++ ) {
- printf("%d) '%s'\n", n, fnfc->filename(n));
- }
+ // Print all filenames user selected
+ for (int n=0; n<fnfc->count(); n++ ) {
+ printf("%d) '%s'\n", n, fnfc->filename(n));
+ }
}
\endcode
*/
const char *Fl_Native_File_Chooser::filename(int i) const { return _x11_file_chooser->filename(i); }
+
/**
Preset the directory the browser will show when opened.
If \p val is NULL, or no directory is specified, the chooser will attempt
to use the last non-cancelled folder.
*/
void Fl_Native_File_Chooser::directory(const char *val) { _x11_file_chooser->directory(val); }
+
/**
Returns the current preset directory() value.
*/
const char *Fl_Native_File_Chooser::directory() const { return _x11_file_chooser->directory(); }
+
/**
Set the title of the file chooser's dialog window.
Can be NULL if no title desired.
The default title varies according to the platform, so you are advised to set the title explicitly.
*/
void Fl_Native_File_Chooser::title(const char *t) { _x11_file_chooser->title(t); }
+
/**
Get the title of the file chooser's dialog window.
Return value may be NULL if no title was set.
*/
const char* Fl_Native_File_Chooser::title() const { return _x11_file_chooser->title(); }
+
/**
Returns the filter string last set.
Can be NULL if no filter was set.
*/
const char *Fl_Native_File_Chooser::filter() const { return _x11_file_chooser->filter(); }
+
/**
Sets the filename filters used for browsing.
The default is NULL, which browses all files.
@@ -180,10 +191,12 @@ const char *Fl_Native_File_Chooser::filter() const { return _x11_file_chooser->f
in the file chooser. The 'All Files' option is always available to the user.
*/
void Fl_Native_File_Chooser::filter(const char *f) { _x11_file_chooser->filter(f); }
+
/**
Gets how many filters were available, not including "All Files"
*/
int Fl_Native_File_Chooser::filters() const { return _x11_file_chooser->filters(); }
+
/**
Sets which filter will be initially selected.
@@ -192,11 +205,13 @@ int Fl_Native_File_Chooser::filters() const { return _x11_file_chooser->filters(
If filter_value() > filters(), then a custom filter was set.
*/
void Fl_Native_File_Chooser::filter_value(int i) { _x11_file_chooser->filter_value(i); }
+
/**
Returns which filter value was last selected by the user.
This is only valid if the chooser returns success.
*/
int Fl_Native_File_Chooser::filter_value() const { return _x11_file_chooser->filter_value(); }
+
/**
Sets the default filename for the chooser.
Use directory() to set the default directory.
@@ -204,16 +219,19 @@ int Fl_Native_File_Chooser::filter_value() const { return _x11_file_chooser->fil
and on most platforms can be used for opening files as well.
*/
void Fl_Native_File_Chooser::preset_file(const char* f) { _x11_file_chooser->preset_file(f); }
+
/**
Get the preset filename.
*/
const char* Fl_Native_File_Chooser::preset_file() const { return _x11_file_chooser->preset_file(); }
+
/**
Returns a system dependent error message for the last method that failed.
This message should at least be flagged to the user in a dialog box, or to some kind of error log.
Contents will be valid only for methods that document errmsg() will have info on failures.
*/
const char *Fl_Native_File_Chooser::errmsg() const { return _x11_file_chooser->errmsg(); }
+
/**
Post the chooser's dialog. Blocks until dialog has been completed or cancelled.
\returns
@@ -223,7 +241,6 @@ const char *Fl_Native_File_Chooser::errmsg() const { return _x11_file_chooser->e
*/
int Fl_Native_File_Chooser::show() { return _x11_file_chooser->show(); }
-
Fl_FLTK_File_Chooser::Fl_FLTK_File_Chooser(int val) {
_btype = 0;
_options = 0;
@@ -300,62 +317,62 @@ int Fl_FLTK_File_Chooser::options() const {
int Fl_FLTK_File_Chooser::show() {
// FILTER
- if ( _parsedfilt ) {
- _file_chooser->filter(_parsedfilt);
- }
+ if ( _parsedfilt ) {
+ _file_chooser->filter(_parsedfilt);
+ }
- // FILTER VALUE
- // Set this /after/ setting the filter
- //
- _file_chooser->filter_value(_filtvalue);
+ // FILTER VALUE
+ // Set this /after/ setting the filter
+ //
+ _file_chooser->filter_value(_filtvalue);
- // DIRECTORY
- if ( _directory && _directory[0] ) {
- _file_chooser->directory(_directory);
- } else {
- _file_chooser->directory(_prevvalue);
- }
+ // DIRECTORY
+ if ( _directory && _directory[0] ) {
+ _file_chooser->directory(_directory);
+ } else {
+ _file_chooser->directory(_prevvalue);
+ }
- // PRESET FILE
- if ( _preset_file ) {
- _file_chooser->value(_preset_file);
- }
+ // PRESET FILE
+ if ( _preset_file ) {
+ _file_chooser->value(_preset_file);
+ }
- // OPTIONS: PREVIEW
- _file_chooser->preview( (options() & Fl_Native_File_Chooser::PREVIEW) ? 1 : 0);
+ // OPTIONS: PREVIEW
+ _file_chooser->preview( (options() & Fl_Native_File_Chooser::PREVIEW) ? 1 : 0);
- // OPTIONS: NEW FOLDER
- if ( options() & Fl_Native_File_Chooser::NEW_FOLDER )
- _file_chooser->type(_file_chooser->type() | Fl_File_Chooser::CREATE); // on
+ // OPTIONS: NEW FOLDER
+ if ( options() & Fl_Native_File_Chooser::NEW_FOLDER )
+ _file_chooser->type(_file_chooser->type() | Fl_File_Chooser::CREATE); // on
- // SHOW
- _file_chooser->show();
+ // SHOW
+ _file_chooser->show();
- // BLOCK WHILE BROWSER SHOWN
- while ( _file_chooser->shown() ) {
- Fl::wait();
- }
+ // BLOCK WHILE BROWSER SHOWN
+ while ( _file_chooser->shown() ) {
+ Fl::wait();
+ }
- if ( _file_chooser->value() && _file_chooser->value()[0] ) {
- _prevvalue = strfree(_prevvalue);
- _prevvalue = strnew(_file_chooser->value());
- _filtvalue = _file_chooser->filter_value(); // update filter value
-
- // HANDLE SHOWING 'SaveAs' CONFIRM
- if ( options() & Fl_Native_File_Chooser::SAVEAS_CONFIRM && type() == Fl_Native_File_Chooser::BROWSE_SAVE_FILE ) {
- struct stat buf;
- if ( stat(_file_chooser->value(), &buf) != -1 ) {
- if ( buf.st_mode & S_IFREG ) { // Regular file + exists?
- if ( exist_dialog() == 0 ) {
- return(1);
- }
+ if ( _file_chooser->value() && _file_chooser->value()[0] ) {
+ _prevvalue = strfree(_prevvalue);
+ _prevvalue = strnew(_file_chooser->value());
+ _filtvalue = _file_chooser->filter_value(); // update filter value
+
+ // HANDLE SHOWING 'SaveAs' CONFIRM
+ if ( options() & Fl_Native_File_Chooser::SAVEAS_CONFIRM && type() == Fl_Native_File_Chooser::BROWSE_SAVE_FILE ) {
+ struct stat buf;
+ if ( stat(_file_chooser->value(), &buf) != -1 ) {
+ if ( buf.st_mode & S_IFREG ) { // Regular file + exists?
+ if ( exist_dialog() == 0 ) {
+ return(1);
}
}
}
}
+ }
- if ( _file_chooser->count() ) return(0);
- else return(1);
+ if ( _file_chooser->count() ) return(0);
+ else return(1);
}
const char *Fl_FLTK_File_Chooser::errmsg() const {
@@ -370,8 +387,8 @@ const char* Fl_FLTK_File_Chooser::filename() const {
}
const char* Fl_FLTK_File_Chooser::filename(int i) const {
- if ( i < _file_chooser->count() )
- return(_file_chooser->value(i+1)); // convert fltk 1 based to our 0 based
+ if ( i < _file_chooser->count() )
+ return(_file_chooser->value(i+1)); // convert fltk 1 based to our 0 based
return("");
}
@@ -380,7 +397,7 @@ void Fl_FLTK_File_Chooser::title(const char *val) {
}
const char *Fl_FLTK_File_Chooser::title() const {
- return(_file_chooser->label());
+ return(_file_chooser->label());
}
void Fl_FLTK_File_Chooser::filter(const char *val) {
@@ -505,5 +522,5 @@ int Fl_FLTK_File_Chooser::exist_dialog() {
}
//
-// End of "$Id: Fl_Native_File_Chooser_FLTK.cxx 10349 2014-10-01 17:24:55Z manolo $".
+// End of "$Id: Fl_Native_File_Chooser_FLTK.cxx 11923 2016-09-05 19:28:21Z greg.ercolano $".
//
diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx
index 1b47511..27d7445 100644
--- a/src/Fl_Native_File_Chooser_GTK.cxx
+++ b/src/Fl_Native_File_Chooser_GTK.cxx
@@ -351,7 +351,7 @@ gboolean Fl_GTK_File_Chooser::custom_gtk_filter_function(const GtkFileFilterInfo
p->running->changed_output_type(p->filter);
p->running->previous_filter = p->filter;
}
- return (gboolean)fl_filename_match(info->filename, p->filter);
+ return (gboolean)fl_filename_match(fl_filename_name(info->filename), p->filter);
}
void Fl_GTK_File_Chooser::free_pair(Fl_GTK_File_Chooser::pair *p)
@@ -375,6 +375,7 @@ int Fl_GTK_File_Chooser::show()
char *p;
char *before = NULL;
static char *gtk_wants = NULL;
+ fl_open_display();
// record in before the calling program's current locale
p = setlocale(LC_ALL, NULL);
if (p) before = strdup(p);
diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm
index 518ae02..30a8f2f 100644
--- a/src/Fl_Native_File_Chooser_MAC.mm
+++ b/src/Fl_Native_File_Chooser_MAC.mm
@@ -1,4 +1,4 @@
-// "$Id: Fl_Native_File_Chooser_MAC.mm 10317 2014-09-16 17:34:29Z manolo $"
+// "$Id: Fl_Native_File_Chooser_MAC.mm 12055 2016-10-27 15:43:09Z manolo $"
//
// FLTK native OS file chooser widget
//
@@ -346,7 +346,7 @@ int Fl_Native_File_Chooser::get_saveas_basename(void) {
char *q = strdup( [[[(NSSavePanel*)_panel URL] path] UTF8String] );
if ( !(_options & SAVEAS_CONFIRM) ) {
const char *d = [[[[(NSSavePanel*)_panel URL] path] stringByDeletingLastPathComponent] UTF8String];
- int l = strlen(d) + 1;
+ int l = (int)strlen(d) + 1;
if (strcmp(d, "/") == 0) l = 1;
int lu = strlen(UNLIKELYPREFIX);
// Remove UNLIKELYPREFIX between directory and filename parts
@@ -532,7 +532,7 @@ int Fl_Native_File_Chooser::runmodal()
NSString *dir = nil;
NSString *fname = nil;
NSString *preset = nil;
- int retval;
+ NSInteger retval;
if (_preset_file) {
preset = [[NSString alloc] initWithUTF8String:_preset_file];
if (strchr(_preset_file, '/') != NULL) {
@@ -551,7 +551,7 @@ int Fl_Native_File_Chooser::runmodal()
}
[dir release];
[preset release];
- return retval;
+ return (retval == NSFileHandlingPanelOKButton ? 1 : 0);
}
// POST BROWSER
@@ -568,6 +568,7 @@ int Fl_Native_File_Chooser::post() {
if ( _filt_total == 0 ) { // Make sure they match
_filt_value = 0; // TBD: move to someplace more logical?
}
+ fl_open_display();
NSAutoreleasePool *localPool;
localPool = [[NSAutoreleasePool alloc] init];
switch (_btype) {
@@ -582,8 +583,12 @@ int Fl_Native_File_Chooser::post() {
_panel = [NSSavePanel savePanel];
break;
}
- NSString *nstitle = [NSString stringWithUTF8String: (_title ? _title : "No Title")];
- [(NSSavePanel*)_panel setTitle:nstitle];
+ BOOL is_open_panel = [(NSSavePanel*)_panel isKindOfClass:[NSOpenPanel class]];
+ if (_title) {
+ SEL title_or_message = (is_open_panel && fl_mac_os_version >= 101200) ?
+ @selector(setMessage:) : @selector(setTitle:);
+ [(NSSavePanel*)_panel performSelector:title_or_message withObject:[NSString stringWithUTF8String:_title]];
+ }
switch (_btype) {
case BROWSE_MULTI_FILE:
[(NSOpenPanel*)_panel setAllowsMultipleSelection:YES];
@@ -601,7 +606,6 @@ int Fl_Native_File_Chooser::post() {
// SHOW THE DIALOG
NSWindow *key = [NSApp keyWindow];
- BOOL is_open_panel = [(NSSavePanel*)_panel isKindOfClass:[NSOpenPanel class]];
NSPopUpButton *popup = nil;
if ( is_open_panel ) {
if (_filt_total) {
@@ -609,7 +613,7 @@ int Fl_Native_File_Chooser::post() {
popup = createPopupAccessory((NSSavePanel*)_panel, t, Fl_File_Chooser::show_label, 0);
delete[] t;
[[popup menu] addItem:[NSMenuItem separatorItem]];
- [popup addItemWithTitle:[[NSString alloc] initWithUTF8String:Fl_File_Chooser::all_files_label]];
+ [popup addItemWithTitle:[NSString stringWithUTF8String:Fl_File_Chooser::all_files_label]];
[popup setAction:@selector(validateVisibleColumns)];
[popup setTarget:(NSObject*)_panel];
FLopenDelegate *openDelegate = [[[FLopenDelegate alloc] init] autorelease];
@@ -637,13 +641,13 @@ int Fl_Native_File_Chooser::post() {
}
int retval = runmodal();
if (_filt_total) {
- _filt_value = [popup indexOfSelectedItem];
+ _filt_value = (int)[popup indexOfSelectedItem];
}
- if ( retval == NSOKButton ) {
+ if ( retval == 1 ) {
if (is_open_panel) {
clear_pathnames();
NSArray *array = [(NSOpenPanel*)_panel URLs];
- _tpathnames = [array count];
+ _tpathnames = (int)[array count];
_pathnames = new char*[_tpathnames];
for(int i = 0; i < _tpathnames; i++) {
_pathnames[i] = strnew([[(NSURL*)[array objectAtIndex:i] path] UTF8String]);
@@ -653,11 +657,11 @@ int Fl_Native_File_Chooser::post() {
}
[key makeKeyWindow];
[localPool release];
- return (retval == NSOKButton ? 0 : 1);
+ return (retval == 1 ? 0 : 1);
}
#endif // __APPLE__
//
-// End of "$Id: Fl_Native_File_Chooser_MAC.mm 10317 2014-09-16 17:34:29Z manolo $".
+// End of "$Id: Fl_Native_File_Chooser_MAC.mm 12055 2016-10-27 15:43:09Z manolo $".
//
diff --git a/src/Fl_Native_File_Chooser_WIN32.cxx b/src/Fl_Native_File_Chooser_WIN32.cxx
index 094ea9f..531a2be 100644
--- a/src/Fl_Native_File_Chooser_WIN32.cxx
+++ b/src/Fl_Native_File_Chooser_WIN32.cxx
@@ -1,8 +1,8 @@
-// "$Id: Fl_Native_File_Chooser_WIN32.cxx 10312 2014-09-15 09:35:05Z ossman $"
+// "$Id: Fl_Native_File_Chooser_WIN32.cxx 11920 2016-09-05 16:46:59Z greg.ercolano $"
//
// FLTK native OS file chooser widget
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2014 by Bill Spitzak and others.
// Copyright 2004 Greg Ercolano.
// API changes + filter improvements by Nathan Vander Wilt 2005
//
@@ -22,19 +22,26 @@
//
#ifndef FL_DOXYGEN // PREVENT DOXYGEN'S USE OF THIS FILE
+#include <FL/Enumerations.H>
+
+#if FLTK_ABI_VERSION < 10304
+#define _ofn_ptr (&_ofn)
+#define _binf_ptr (&_binf)
+#endif
+
+# include <stdlib.h> // malloc
+# include <stdio.h> // sprintf
+#include <wchar.h>
-#include <stdio.h> // debugging
-#include <wchar.h> //MG
#include "Fl_Native_File_Chooser_common.cxx" // strnew/strfree/strapp/chrcat
#define FNFC_MAX_PATH 32768 // XXX: MAX_PATH under win32 is 260, too small for modern use
-typedef const wchar_t *LPCWSTR; //MG
-LPCWSTR utf8towchar(const char *in); //MG
-char *wchartoutf8(LPCWSTR in); //MG
-
#include <FL/Fl_Native_File_Chooser.H>
-#include <FL/x.H>
+static LPCWSTR utf8towchar(const char *in);
+static char *wchartoutf8(LPCWSTR in);
+
+#include <FL/x.H> // for fl_open_display
#define LCURLY_CHR '{'
#define RCURLY_CHR '}'
@@ -43,6 +50,7 @@ char *wchartoutf8(LPCWSTR in); //MG
// STATIC: PRINT WINDOWS 'DOUBLE NULL' STRING (DEBUG)
#ifdef DEBUG
+#include <stdio.h>
static void dnullprint(char *wp) {
if ( ! wp ) return;
for ( int t=0; true; t++ ) {
@@ -125,10 +133,15 @@ static void dnullcat(char*&wp, const char *string, int n = -1 ) {
Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
_btype = val;
_options = NO_OPTIONS;
- memset((void*)&_ofn, 0, sizeof(OPENFILENAMEW));
- _ofn.lStructSize = sizeof(OPENFILENAMEW);
- _ofn.hwndOwner = NULL;
- memset((void*)&_binf, 0, sizeof(BROWSEINFO));
+#if FLTK_ABI_VERSION >= 10304
+ _ofn_ptr = new OPENFILENAMEW;
+ _binf_ptr = new BROWSEINFOW;
+ _wpattern = 0;
+#endif
+ memset((void*)_ofn_ptr, 0, sizeof(OPENFILENAMEW));
+ _ofn_ptr->lStructSize = sizeof(OPENFILENAMEW);
+ _ofn_ptr->hwndOwner = NULL;
+ memset((void*)_binf_ptr, 0, sizeof(BROWSEINFOW));
_pathnames = NULL;
_tpathnames = 0;
_directory = NULL;
@@ -155,6 +168,11 @@ Fl_Native_File_Chooser::~Fl_Native_File_Chooser() {
clear_pathnames();
ClearOFN();
ClearBINF();
+#if FLTK_ABI_VERSION >= 10304
+ delete _binf_ptr;
+ delete _ofn_ptr;
+ if ( _wpattern ) delete[] _wpattern;
+#endif
}
// SET TYPE OF BROWSER
@@ -222,7 +240,7 @@ void Fl_Native_File_Chooser::add_pathname(const char *s) {
}
// FREE A PIDL (Pointer to IDentity List)
-void Fl_Native_File_Chooser::FreePIDL(LPITEMIDLIST pidl) {
+static void FreePIDL(LPITEMIDLIST pidl) {
IMalloc *imalloc = NULL;
if ( SUCCEEDED(SHGetMalloc(&imalloc)) ) {
imalloc->Free(pidl);
@@ -233,29 +251,29 @@ void Fl_Native_File_Chooser::FreePIDL(LPITEMIDLIST pidl) {
// CLEAR MICROSOFT OFN (OPEN FILE NAME) CLASS
void Fl_Native_File_Chooser::ClearOFN() {
- // Free any previously allocated lpstrFile before zeroing out _ofn
- if ( _ofn.lpstrFile ) {
- delete[] _ofn.lpstrFile;
- _ofn.lpstrFile = NULL;
+ // Free any previously allocated lpstrFile before zeroing out _ofn_ptr
+ if ( _ofn_ptr->lpstrFile ) {
+ delete[] _ofn_ptr->lpstrFile;
+ _ofn_ptr->lpstrFile = NULL;
}
- if ( _ofn.lpstrInitialDir ) {
- delete[] (TCHAR*) _ofn.lpstrInitialDir; //msvc6 compilation fix
- _ofn.lpstrInitialDir = NULL;
+ if ( _ofn_ptr->lpstrInitialDir ) {
+ delete[] (TCHAR*) _ofn_ptr->lpstrInitialDir; //msvc6 compilation fix
+ _ofn_ptr->lpstrInitialDir = NULL;
}
- _ofn.lpstrFilter = NULL; // (deleted elsewhere)
- int temp = _ofn.nFilterIndex; // keep the filter_value
- memset((void*)&_ofn, 0, sizeof(_ofn));
- _ofn.lStructSize = sizeof(OPENFILENAMEW);
- _ofn.nFilterIndex = temp;
+ _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;
}
// CLEAR MICROSOFT BINF (BROWSER INFO) CLASS
void Fl_Native_File_Chooser::ClearBINF() {
- if ( _binf.pidlRoot ) {
- FreePIDL((ITEMIDLIST*)_binf.pidlRoot);
- _binf.pidlRoot = NULL;
+ if ( _binf_ptr->pidlRoot ) {
+ FreePIDL((ITEMIDLIST*)_binf_ptr->pidlRoot);
+ _binf_ptr->pidlRoot = NULL;
}
- memset((void*)&_binf, 0, sizeof(_binf));
+ memset((void*)_binf_ptr, 0, sizeof(BROWSEINFOW));
}
// CONVERT WINDOWS BACKSLASHES TO UNIX FRONTSLASHES
@@ -270,21 +288,42 @@ void Fl_Native_File_Chooser::Unix2Win(char *s) {
if ( *s == '/' ) *s = '\\';
}
+// SAVE THE CURRENT WORKING DIRECTORY
+// Returns a malloc()ed copy of the cwd that can
+// later be freed with RestoreCWD(). May return 0 on error.
+//
+static char *SaveCWD() {
+ char *thecwd = 0;
+ DWORD thecwdsz = GetCurrentDirectory(0,0);
+ if ( thecwdsz > 0 ) {
+ thecwd = (char*)malloc(thecwdsz);
+ if (GetCurrentDirectory(thecwdsz, thecwd) == 0 ) {
+ free(thecwd); thecwd = 0;
+ }
+ }
+ return thecwd;
+}
+
+// RESTORES THE CWD SAVED BY SaveCWD(), FREES STRING
+// Always returns NULL (string was freed).
+//
+static void RestoreCWD(char *thecwd) {
+ if ( !thecwd ) return;
+ SetCurrentDirectory(thecwd);
+ free(thecwd);
+}
+
// SHOW FILE BROWSER
int Fl_Native_File_Chooser::showfile() {
ClearOFN();
clear_pathnames();
size_t fsize = FNFC_MAX_PATH;
- _ofn.Flags |= OFN_NOVALIDATE; // prevent disabling of front slashes
- _ofn.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.Flags |= OFN_EXPLORER; // use newer explorer windows
- _ofn.Flags |= OFN_ENABLESIZING; // allow window to be resized (hey, why not?)
-
- // XXX: The docs for OFN_NOCHANGEDIR says the flag is 'ineffective' on XP/2K/NT!
- // But let's set it anyway..
- //
- _ofn.Flags |= OFN_NOCHANGEDIR; // prevent dialog for messing up the cwd
+ _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 BROWSE_DIRECTORY:
@@ -294,93 +333,88 @@ int Fl_Native_File_Chooser::showfile() {
case BROWSE_FILE:
break;
case BROWSE_MULTI_FILE:
- _ofn.Flags |= OFN_ALLOWMULTISELECT;
+ _ofn_ptr->Flags |= OFN_ALLOWMULTISELECT;
break;
case BROWSE_SAVE_FILE:
if ( options() & SAVEAS_CONFIRM && type() == BROWSE_SAVE_FILE ) {
- _ofn.Flags |= OFN_OVERWRITEPROMPT;
+ _ofn_ptr->Flags |= OFN_OVERWRITEPROMPT;
}
break;
}
// SPACE FOR RETURNED FILENAME
- _ofn.lpstrFile = new WCHAR[fsize];
- _ofn.nMaxFile = (DWORD) fsize-1;
- _ofn.lpstrFile[0] = 0;
- _ofn.lpstrFile[1] = 0; // dnull
+ _ofn_ptr->lpstrFile = new WCHAR[fsize];
+ _ofn_ptr->nMaxFile = (DWORD) fsize-1;
+ _ofn_ptr->lpstrFile[0] = 0;
+ _ofn_ptr->lpstrFile[1] = 0; // dnull
// PARENT WINDOW
- _ofn.hwndOwner = GetForegroundWindow();
+ _ofn_ptr->hwndOwner = GetForegroundWindow();
// DIALOG TITLE
if (_title) {
static WCHAR wtitle[200];
wcsncpy(wtitle, utf8towchar(_title), 200);
wtitle[200-1] = 0;
- _ofn.lpstrTitle = wtitle;
+ _ofn_ptr->lpstrTitle = wtitle;
} else {
- _ofn.lpstrTitle = NULL;
+ _ofn_ptr->lpstrTitle = NULL;
}
// FILTER
if (_parsedfilt != NULL) { // to convert a null-containing char string into a widechar string
- static WCHAR wpattern[FNFC_MAX_PATH];
+#if FLTK_ABI_VERSION >= 10304
+ // NEW
+ if ( !_wpattern ) _wpattern = new WCHAR[FNFC_MAX_PATH];
+#else
+ // OLD
+ static WCHAR _wpattern[FNFC_MAX_PATH]; // yuck -- replace with managed class member
+#endif
const char *p = _parsedfilt;
while(*(p + strlen(p) + 1) != 0) p += strlen(p) + 1;
p += strlen(p) + 2;
- MultiByteToWideChar(CP_UTF8, 0, _parsedfilt, (int) (p - _parsedfilt), wpattern, FNFC_MAX_PATH);
- _ofn.lpstrFilter = wpattern;
+ MultiByteToWideChar(CP_UTF8, 0, _parsedfilt, (int) (p - _parsedfilt), _wpattern, FNFC_MAX_PATH);
+ _ofn_ptr->lpstrFilter = _wpattern;
} else {
- _ofn.lpstrFilter = NULL;
+ _ofn_ptr->lpstrFilter = NULL;
}
// PRESET FILE
// If set, supercedes _directory. See KB Q86920 for details
+ // XXX: this doesn't preselect the item in the listview.. why?
//
if ( _preset_file ) {
size_t len = strlen(_preset_file);
- if ( len >= _ofn.nMaxFile ) {
+ if ( len >= _ofn_ptr->nMaxFile ) {
char msg[80];
sprintf(msg, "preset_file() filename is too long: %ld is >=%ld", (long)len, (long)fsize);
return(-1);
}
- wcscpy(_ofn.lpstrFile, utf8towchar(_preset_file));
-// Unix2Win(_ofn.lpstrFile);
- len = wcslen(_ofn.lpstrFile);
- _ofn.lpstrFile[len+0] = 0; // multiselect needs dnull
- _ofn.lpstrFile[len+1] = 0;
+ 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+1] = 0;
}
if ( _directory ) {
// PRESET DIR
// XXX: See KB Q86920 for doc bug:
// http://support.microsoft.com/default.aspx?scid=kb;en-us;86920
//
- _ofn.lpstrInitialDir = new WCHAR[FNFC_MAX_PATH];
- wcscpy((WCHAR *)_ofn.lpstrInitialDir, utf8towchar(_directory));
- // Unix2Win((char*)_ofn.lpstrInitialDir);
+ _ofn_ptr->lpstrInitialDir = new WCHAR[FNFC_MAX_PATH];
+ wcscpy((WCHAR *)_ofn_ptr->lpstrInitialDir, utf8towchar(_directory));
+ // Unix2Win((char*)_ofn_ptr->lpstrInitialDir);
}
// SAVE THE CURRENT DIRECTORY
- // XXX: Save the cwd because GetOpenFileName() is probably going to
- // change it, in spite of the OFN_NOCHANGEDIR flag, due to its docs
- // saying the flag is 'ineffective'. %^(
+ // See above warning (XXX) for OFN_NOCHANGEDIR
//
- char *oldcwd = 0;
- DWORD oldcwdsz = GetCurrentDirectory(0,0);
- if ( oldcwdsz > 0 ) {
- oldcwd = (char*)malloc(oldcwdsz);
- if (GetCurrentDirectory(oldcwdsz, oldcwd) == 0 ) {
- free(oldcwd); oldcwd = 0;
- }
- }
+ char *save_cwd = SaveCWD(); // must be freed with RestoreCWD()
// OPEN THE DIALOG WINDOW
int err;
if ( _btype == BROWSE_SAVE_FILE ) {
- err = GetSaveFileNameW(&_ofn);
+ err = GetSaveFileNameW(_ofn_ptr);
} else {
- err = GetOpenFileNameW(&_ofn);
+ err = GetOpenFileNameW(_ofn_ptr);
}
// GET EXTENDED ERROR
int exterr = CommDlgExtendedError();
- // XXX: RESTORE CWD
- if ( oldcwd ) {
- SetCurrentDirectory(oldcwd);
- free(oldcwd); oldcwd = 0;
- }
+ // RESTORE CURRENT DIRECTORY
+ RestoreCWD(save_cwd); save_cwd = 0; // also frees save_cwd
// ERROR OR CANCEL?
if ( err == 0 ) {
if ( exterr == 0 ) return(1); // user hit cancel
@@ -394,12 +428,12 @@ int Fl_Native_File_Chooser::showfile() {
switch ( _btype ) {
case BROWSE_FILE:
case BROWSE_SAVE_FILE:
- set_single_pathname(wchartoutf8(_ofn.lpstrFile));
+ set_single_pathname(wchartoutf8(_ofn_ptr->lpstrFile));
// Win2Unix(_pathnames[_tpathnames-1]);
break;
case BROWSE_MULTI_FILE: {
// EXTRACT MULTIPLE FILENAMES
- const WCHAR *dirname = _ofn.lpstrFile;
+ const WCHAR *dirname = _ofn_ptr->lpstrFile;
size_t dirlen = wcslen(dirname);
if ( dirlen > 0 ) {
// WALK STRING SEARCHING FOR 'DOUBLE-NULL'
@@ -437,7 +471,7 @@ int Fl_Native_File_Chooser::showfile() {
// Ref: Usenet: microsoft.public.vc.mfc, Dec 8 2000, 1:38p David Lowndes
// Subject: How to specify to select an initial folder .."
//
-int CALLBACK Fl_Native_File_Chooser::Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data) {
+static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data) {
switch (msg) {
case BFFM_INITIALIZED:
if (data) ::SendMessageW(win, BFFM_SETSELECTIONW, TRUE, data);
@@ -468,20 +502,20 @@ int Fl_Native_File_Chooser::showdir() {
ClearBINF();
clear_pathnames();
// PARENT WINDOW
- _binf.hwndOwner = GetForegroundWindow();
+ _binf_ptr->hwndOwner = GetForegroundWindow();
// DIALOG TITLE
- //_binf.lpszTitle = _title ? _title : NULL;
+ //_binf_ptr->lpszTitle = _title ? _title : NULL;
if (_title) {
static WCHAR wtitle[256];
wcsncpy(wtitle, utf8towchar(_title), 256);
wtitle[255] = 0;
- _binf.lpszTitle = wtitle;
+ _binf_ptr->lpszTitle = wtitle;
} else {
- _binf.lpszTitle = NULL;
+ _binf_ptr->lpszTitle = NULL;
}
// FLAGS
- _binf.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?)
@@ -499,22 +533,22 @@ int Fl_Native_File_Chooser::showdir() {
// ---
#if defined(BIF_NONEWFOLDERBUTTON) // Version 6.0
- if ( _btype == BROWSE_DIRECTORY ) _binf.ulFlags |= BIF_NONEWFOLDERBUTTON;
- _binf.ulFlags |= BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
+ if ( _btype == BROWSE_DIRECTORY ) _binf_ptr->ulFlags |= BIF_NONEWFOLDERBUTTON;
+ _binf_ptr->ulFlags |= BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
#elif defined(BIF_USENEWUI) // Version 5.0
- if ( _btype == BROWSE_DIRECTORY ) _binf.ulFlags |= BIF_EDITBOX;
- else if ( _btype == BROWSE_SAVE_DIRECTORY ) _binf.ulFlags |= BIF_USENEWUI;
- _binf.ulFlags |= BIF_RETURNONLYFSDIRS;
+ if ( _btype == BROWSE_DIRECTORY ) _binf_ptr->ulFlags |= BIF_EDITBOX;
+ else if ( _btype == BROWSE_SAVE_DIRECTORY ) _binf_ptr->ulFlags |= BIF_USENEWUI;
+ _binf_ptr->ulFlags |= BIF_RETURNONLYFSDIRS;
#elif defined(BIF_EDITBOX) // Version 4.71
- _binf.ulFlags |= BIF_RETURNONLYFSDIRS | BIF_EDITBOX;
+ _binf_ptr->ulFlags |= BIF_RETURNONLYFSDIRS | BIF_EDITBOX;
#else // Version Old
- _binf.ulFlags |= BIF_RETURNONLYFSDIRS;
+ _binf_ptr->ulFlags |= BIF_RETURNONLYFSDIRS;
#endif
// BUFFER
//char displayname[FNFC_MAX_PATH];
WCHAR displayname[FNFC_MAX_PATH];
- _binf.pszDisplayName = displayname;
+ _binf_ptr->pszDisplayName = displayname;
// PRESET DIR
WCHAR presetname[FNFC_MAX_PATH];
@@ -522,12 +556,12 @@ int Fl_Native_File_Chooser::showdir() {
// Unix2Win(presetname);
wcsncpy(presetname, utf8towchar(_directory), FNFC_MAX_PATH);
presetname[FNFC_MAX_PATH-1] = 0;
- _binf.lParam = (LPARAM)presetname;
+ _binf_ptr->lParam = (LPARAM)presetname;
}
- else _binf.lParam = 0;
- _binf.lpfn = Dir_CB;
+ else _binf_ptr->lParam = 0;
+ _binf_ptr->lpfn = Dir_CB;
// OPEN BROWSER
- LPITEMIDLIST pidl = SHBrowseForFolderW(&_binf);
+ LPITEMIDLIST pidl = SHBrowseForFolderW(_binf_ptr);
// CANCEL?
if ( pidl == NULL ) return(1);
@@ -552,13 +586,21 @@ int Fl_Native_File_Chooser::showdir() {
// -1 - failed; errmsg() has reason
//
int Fl_Native_File_Chooser::show() {
+ int retval;
if ( _btype == BROWSE_DIRECTORY ||
_btype == BROWSE_MULTI_DIRECTORY ||
_btype == BROWSE_SAVE_DIRECTORY ) {
- return(showdir());
+ retval = showdir();
} else {
- return(showfile());
+ retval = showfile();
+ }
+ // restore the correct state of mouse buttons and keyboard modifier keys (STR #3221)
+ HWND h = GetForegroundWindow();
+ if (h) {
+ WNDPROC windproc = (WNDPROC)GetWindowLongPtrW(h, GWLP_WNDPROC);
+ CallWindowProc(windproc, h, WM_ACTIVATEAPP, 1, 0);
}
+ return retval;
}
// RETURN ERROR MESSAGE
@@ -736,7 +778,7 @@ static int count_filters(const char *filter) {
//
void Fl_Native_File_Chooser::parse_filter(const char *in) {
clear_filters();
- if ( ! in ) return;
+ 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
@@ -744,9 +786,9 @@ void Fl_Native_File_Chooser::parse_filter(const char *in) {
// whatever input string is, our output won't be much longer in length..
// use double length just for safety.
size_t slen = strlen(in);
- char *wildprefix = new char[slen*2]; wildprefix[0] = 0;
- char *comp = new char[slen*2]; comp[0] = 0;
- char *name = new char[slen*2]; name[0] = 0;
+ char *wildprefix = new char[(slen+1)*2]; wildprefix[0] = 0;
+ char *comp = new char[(slen+1)*2]; comp[0] = 0;
+ char *name = new char[(slen+1)*2]; name[0] = 0;
// Init
int nwildcards = 0;
@@ -754,7 +796,7 @@ void Fl_Native_File_Chooser::parse_filter(const char *in) {
char **wildcards = new char*[maxfilters]; // parsed wildcards (can be several)
int t;
for ( t=0; t<maxfilters; t++ ) {
- wildcards[t] = new char[slen];
+ wildcards[t] = new char[slen+1];
wildcards[t][0] = '\0';
}
@@ -882,12 +924,12 @@ void Fl_Native_File_Chooser::parse_filter(const char *in) {
// SET 'CURRENTLY SELECTED FILTER'
void Fl_Native_File_Chooser::filter_value(int i) {
- _ofn.nFilterIndex = i + 1;
+ _ofn_ptr->nFilterIndex = i + 1;
}
// RETURN VALUE OF 'CURRENTLY SELECTED FILTER'
int Fl_Native_File_Chooser::filter_value() const {
- return(_ofn.nFilterIndex ? _ofn.nFilterIndex-1 : _nfilters+1);
+ return(_ofn_ptr->nFilterIndex ? _ofn_ptr->nFilterIndex-1 : _nfilters+1);
}
// PRESET FILENAME FOR 'SAVE AS' CHOOSER
@@ -905,8 +947,7 @@ int Fl_Native_File_Chooser::filters() const {
return(_nfilters);
}
-char *wchartoutf8(LPCWSTR in)
-{
+static char *wchartoutf8(LPCWSTR in) {
static char *out = NULL;
static int lchar = 0;
if (in == NULL)return NULL;
@@ -919,8 +960,7 @@ char *wchartoutf8(LPCWSTR in)
return out;
}
-LPCWSTR utf8towchar(const char *in)
-{
+static LPCWSTR utf8towchar(const char *in) {
static WCHAR *wout = NULL;
static int lwout = 0;
if (in == NULL)return NULL;
@@ -936,5 +976,5 @@ LPCWSTR utf8towchar(const char *in)
#endif /*!FL_DOXYGEN*/
//
-// End of "$Id: Fl_Native_File_Chooser_WIN32.cxx 10312 2014-09-15 09:35:05Z ossman $".
+// End of "$Id: Fl_Native_File_Chooser_WIN32.cxx 11920 2016-09-05 16:46:59Z greg.ercolano $".
//
diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx
index 67eb3df..0a387ec 100644
--- a/src/Fl_PNG_Image.cxx
+++ b/src/Fl_PNG_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_PNG_Image.cxx 9980 2013-09-21 16:41:23Z greg.ercolano $"
+// "$Id: Fl_PNG_Image.cxx 11535 2016-04-05 21:12:49Z AlbrechtS $"
//
// Fl_PNG_Image routines.
//
@@ -71,18 +71,24 @@ extern "C" {
/**
- The constructor loads the named PNG image from the given png filename.
+ The constructor loads the named PNG image from the given png filename.
- The destructor frees all memory and server resources that are used by
- the image.
+ The destructor frees all memory and server resources that are used by
+ the image.
- \param[in] filename Name of PNG file to read
-*/
+ Use Fl_Image::fail() to check if Fl_PNG_Image failed to load. fail() returns
+ ERR_FILE_ACCESS if the file could not be opened or read, ERR_FORMAT if the
+ 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
+ */
Fl_PNG_Image::Fl_PNG_Image (const char *filename): Fl_RGB_Image(0,0,0)
{
load_png_(filename, NULL, 0);
}
+
/**
\brief Constructor that reads a PNG image from memory.
@@ -101,6 +107,7 @@ Fl_PNG_Image::Fl_PNG_Image (
load_png_(name_png, buffer, maxsize);
}
+
void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_png, int maxsize)
{
#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ)
@@ -108,13 +115,16 @@ void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_p
FILE *fp = NULL; // File pointer
int channels; // Number of color channels
png_structp pp; // PNG read pointer
- png_infop info; // PNG info pointers
+ 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
if (!from_memory) {
- if ((fp = fl_fopen(name_png, "rb")) == NULL) return;
+ if ((fp = fl_fopen(name_png, "rb")) == NULL) {
+ ld(ERR_FILE_ACCESS);
+ return;
+ }
}
const char *display_name = (name_png ? name_png : "In-memory PNG data");
@@ -125,6 +135,7 @@ void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_p
if (pp) png_destroy_read_struct(&pp, NULL, NULL);
if (!from_memory) fclose(fp);
Fl::warning("Cannot allocate memory to read PNG file or data \"%s\".\n", display_name);
+ w(0); h(0); d(0); ld(ERR_FORMAT);
return;
}
@@ -133,6 +144,7 @@ void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_p
png_destroy_read_struct(&pp, &info, NULL);
if (!from_memory) fclose(fp);
Fl::warning("PNG file or data \"%s\" is too large or contains errors!\n", display_name);
+ w(0); h(0); d(0); ld(ERR_FORMAT);
return;
}
@@ -223,5 +235,5 @@ void Fl_PNG_Image::load_png_(const char *name_png, const unsigned char *buffer_p
//
-// End of "$Id: Fl_PNG_Image.cxx 9980 2013-09-21 16:41:23Z greg.ercolano $".
+// End of "$Id: Fl_PNG_Image.cxx 11535 2016-04-05 21:12:49Z AlbrechtS $".
//
diff --git a/src/Fl_PNM_Image.cxx b/src/Fl_PNM_Image.cxx
index 68f7115..1b0cfb0 100644
--- a/src/Fl_PNM_Image.cxx
+++ b/src/Fl_PNM_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_PNM_Image.cxx 9709 2012-11-09 16:02:08Z manolo $"
+// "$Id: Fl_PNM_Image.cxx 10751 2015-06-14 17:07:31Z AlbrechtS $"
//
// Fl_PNM_Image routines.
//
@@ -37,11 +37,18 @@
// 'Fl_PNM_Image::Fl_PNM_Image()' - Load a PNM image...
//
-/**
- The constructor loads the named PNM image.
- <P>The inherited destructor free all memory and server resources that are used by the image.
-*/
+/**
+ The constructor loads the named PNM image.
+
+ The destructor frees all memory and server resources that are used by
+ the image.
+
+ Use Fl_Image::fail() to check if Fl_PNM_Image failed to load. fail() returns
+ ERR_FILE_ACCESS if the file could not be opened or read, ERR_FORMAT if the
+ PNM format could not be decoded, and ERR_NO_IMAGE if the image could not
+ be loaded for another reason.
+ */
Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
: Fl_RGB_Image(0,0,0) {
FILE *fp; // File pointer
@@ -56,7 +63,10 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
maxval; // Maximum pixel value
- if ((fp = fl_fopen(name, "rb")) == NULL) return;
+ if ((fp = fl_fopen(name, "rb")) == NULL) {
+ ld(ERR_FILE_ACCESS);
+ return;
+ }
//
// Read the file header in the format:
@@ -75,6 +85,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
if (!lineptr) {
fclose(fp);
Fl::error("Early end-of-file in PNM file \"%s\"!", name);
+ ld(ERR_FILE_ACCESS);
return;
}
@@ -122,6 +133,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
if (((size_t)w()) * h() * d() > max_size() ) {
Fl::warning("PNM file \"%s\" is too large!\n", name);
fclose(fp);
+ w(0); h(0); d(0); ld(ERR_FORMAT);
return;
}
array = new uchar[w() * h() * d()];
@@ -133,6 +145,10 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
switch (format) {
case 1 :
+ 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);
@@ -147,17 +163,17 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
break;
case 4 :
- for (x = w(), byte = (uchar)getc(fp), bit = 128; x > 0; x --) {
- if (byte & bit) *ptr++ = 255;
- else *ptr++ = 0;
-
- if (bit > 1) bit >>= 1;
- else {
- bit = 128;
- byte = (uchar)getc(fp);
- }
+ 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;
+ if (x > 1) byte = (uchar)getc(fp);
}
- break;
+ }
+ break;
case 5 :
case 6 :
@@ -189,5 +205,5 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
//
-// End of "$Id: Fl_PNM_Image.cxx 9709 2012-11-09 16:02:08Z manolo $".
+// End of "$Id: Fl_PNM_Image.cxx 10751 2015-06-14 17:07:31Z AlbrechtS $".
//
diff --git a/src/Fl_Paged_Device.cxx b/src/Fl_Paged_Device.cxx
index 8cd4cc7..c9a1b41 100644
--- a/src/Fl_Paged_Device.cxx
+++ b/src/Fl_Paged_Device.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Paged_Device.cxx 10116 2014-03-05 12:55:34Z manolo $"
+// "$Id: Fl_Paged_Device.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $"
//
// implementation of Fl_Paged_Device class for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2011 by Bill Spitzak and others.
+// Copyright 2010-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -56,19 +56,21 @@ void Fl_Paged_Device::print_widget(Fl_Widget* widget, int delta_x, int delta_y)
translate(new_x - old_x, new_y - old_y );
}
// if widget is a main window, clip all drawings to the window area
- if (is_window && !widget->window()) fl_push_clip(0, 0, widget->w(), widget->h() );
+ if (is_window && !widget->window()) {
+ fl_push_clip(0, 0, widget->w(), widget->h() );
+#ifdef __APPLE__ // for Mac OS X 10.6 and above, make window with rounded bottom corners
+ if ( fl_mac_os_version >= 100600 && driver()->class_name() == Fl_Quartz_Graphics_Driver::class_id ) {
+ Fl_X::clip_to_rounded_corners(fl_gc, widget->w(), widget->h());
+ }
+#endif
+ }
// we do some trickery to recognize OpenGL windows and draw them via a plugin
int drawn_by_plugin = 0;
if (widget->as_gl_window()) {
Fl_Plugin_Manager pm("fltk:device");
Fl_Device_Plugin *pi = (Fl_Device_Plugin*)pm.plugin("opengl.device.fltk.org");
if (pi) {
- int height = 0;
-#ifdef __APPLE__
- int width;
- this->printable_rect(&width, &height);
-#endif
- drawn_by_plugin = pi->print(widget, 0, 0, height);
+ drawn_by_plugin = pi->print(widget, 0, 0, 0);
}
}
if (!drawn_by_plugin) {
@@ -135,6 +137,9 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
win->make_current();
uchar *image_data;
image_data = fl_read_image(NULL, x, y, w, h);
+#ifdef __APPLE__
+ Fl_X::q_release_context(); // matches make_current() call above
+#endif
if (save_front != win) save_front->show();
current->set_current();
fl_draw_image(image_data, delta_x, delta_y, w, h, 3);
@@ -148,7 +153,7 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
/**
@brief Starts a print job.
- @param[in] pagecount the total number of pages of the job
+ @param[in] pagecount the total number of pages of the job (or 0 if you don't know the number of pages)
@param[out] frompage if non-null, *frompage is set to the first page the user wants printed
@param[out] topage if non-null, *topage is set to the last page the user wants printed
@return 0 if OK, non-zero if any error
@@ -290,5 +295,5 @@ const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS
};
//
-// End of "$Id: Fl_Paged_Device.cxx 10116 2014-03-05 12:55:34Z manolo $".
+// End of "$Id: Fl_Paged_Device.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $".
//
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index 1935e5c..4c9347f 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Pixmap.cxx 9706 2012-11-06 20:46:14Z matt $"
+// "$Id: Fl_Pixmap.cxx 11868 2016-08-09 15:19:46Z AlbrechtS $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2012 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -16,15 +16,6 @@
// http://www.fltk.org/str.php
//
-/** \fn Fl_Pixmap::Fl_Pixmap(const char **data)
- The constructors create a new pixmap from the specified XPM data.*/
-
-/** \fn Fl_Pixmap::Fl_Pixmap(const unsigned char * const *data)
- The constructors create a new pixmap from the specified XPM data.*/
-
-/** \fn Fl_Pixmap::Fl_Pixmap(const unsigned char **data)
- The constructors create a new pixmap from the specified XPM data.*/
-
// Draws X pixmap data, keeping it stashed in a server pixmap so it
// redraws fast.
@@ -32,6 +23,7 @@
// Implemented without using the xpm library (which I can't use because
// it interferes with the color cube used by fl_draw_image).
+#include <config.h>
#include <FL/Fl.H>
#include <FL/fl_draw.H>
#include <FL/x.H>
@@ -40,6 +32,22 @@
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Printer.H>
+#if defined(USE_X11)
+# if HAVE_X11_XREGION_H
+# include <X11/Xregion.h>
+# else // if the X11/Xregion.h header is not available, we assume this is the layout of an X11 Region:
+typedef struct {
+ short x1, x2, y1, y2;
+} BOX;
+struct _XRegion {
+ long size;
+ long numRects;
+ BOX *rects;
+ BOX extents;
+};
+# endif // HAVE_X11_XREGION_H
+#endif // USE_X11
+
#include <stdio.h>
#include "flstring.h"
#include <ctype.h>
@@ -128,14 +136,20 @@ int Fl_Pixmap::prepare(int XP, int YP, int WP, int HP, int &cx, int &cy,
return 0;
}
-#ifdef __APPLE__
+//------------------------------------------------------------------------------
+#ifdef __APPLE__ // Apple, Mac OS X
+//------------------------------------------------------------------------------
+
void Fl_Quartz_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
int X, Y, W, H;
if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
copy_offscreen(X, Y, W, H, (Fl_Offscreen)pxm->id_, cx, cy);
}
-#elif defined(WIN32)
+//------------------------------------------------------------------------------
+#elif defined(WIN32) // Windows GDI
+//------------------------------------------------------------------------------
+
void Fl_GDI_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
int X, Y, W, H;
if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
@@ -172,7 +186,7 @@ void Fl_GDI_Printer_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP
int save = SaveDC(new_gc);
SelectObject(new_gc, (void*)pxm->id_);
// print all of offscreen but its parts in background color
- fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, pxm->w(), pxm->h(), pxm->pixmap_bg_color );
+ fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, W, H, pxm->pixmap_bg_color );
RestoreDC(new_gc,save);
DeleteDC(new_gc);
}
@@ -181,34 +195,54 @@ void Fl_GDI_Printer_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP
}
}
-#else // Xlib
+//------------------------------------------------------------------------------
+#else // X11, Xlib
+//------------------------------------------------------------------------------
+
void Fl_Xlib_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
int X, Y, W, H;
if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
if (pxm->mask_) {
- // I can't figure out how to combine a mask with existing region,
- // so cut the image down to a clipped rectangle:
- int nx, ny; fl_clip_box(X,Y,W,H,nx,ny,W,H);
- cx += nx-X; X = nx;
- cy += ny-Y; Y = ny;
// make X use the bitmap as a mask:
XSetClipMask(fl_display, fl_gc, pxm->mask_);
- int ox = X-cx; if (ox < 0) ox += pxm->w();
- int oy = Y-cy; if (oy < 0) oy += pxm->h();
XSetClipOrigin(fl_display, fl_gc, X-cx, Y-cy);
- }
- copy_offscreen(X, Y, W, H, pxm->id_, cx, cy);
- if (pxm->mask_) {
+ if (clip_region()) {
+ // At this point, XYWH is the bounding box of the intersection between
+ // the current clip region and the (portion of the) pixmap we have to draw.
+ // The current clip region is often a rectangle. But, when a window with rounded
+ // corners is moved above another window, expose events may create a complex clip
+ // region made of several (e.g., 10) rectangles. We have to draw only in the clip
+ // region, and also to mask out the transparent pixels of the image. This can't
+ // be done in a single Xlib call for a multi-rectangle clip region. Thus, we
+ // process each rectangle of the intersection between the clip region and XYWH.
+ // See also STR #3206.
+ Region r = XRectangleRegion(X,Y,W,H);
+ XIntersectRegion(r, clip_region(), r);
+ int X1, Y1, W1, H1;
+ for (int i = 0; i < r->numRects; i++) {
+ X1 = r->rects[i].x1;
+ Y1 = r->rects[i].y1;
+ W1 = r->rects[i].x2 - r->rects[i].x1;
+ H1 = r->rects[i].y2 - r->rects[i].y1;
+ copy_offscreen(X1, Y1, W1, H1, pxm->id_, cx + (X1 - X), cy + (Y1 - Y));
+ }
+ XDestroyRegion(r);
+ } else {
+ copy_offscreen(X, Y, W, H, pxm->id_, cx, cy);
+ }
// put the old clip region back
XSetClipOrigin(fl_display, fl_gc, 0, 0);
- fl_restore_clip();
+ restore_clip();
}
+ else copy_offscreen(X, Y, W, H, pxm->id_, cx, cy);
}
-#endif
+//------------------------------------------------------------------------------
+#endif // (platform-specific)
+//------------------------------------------------------------------------------
/**
- The destructor free all memory and server resources that are used by
+ The destructor frees all memory and server resources that are used by
the pixmap.
*/
Fl_Pixmap::~Fl_Pixmap() {
@@ -321,7 +355,7 @@ Fl_Image *Fl_Pixmap::copy(int W, int H) {
sprintf(new_info, "%d %d %d %d", W, H, ncolors, chars_per_pixel);
- // Figure out Bresenheim step/modulus values...
+ // Figure out Bresenham step/modulus values...
xmod = w() % W;
xstep = (w() / W) * chars_per_pixel;
ymod = h() % H;
@@ -533,5 +567,5 @@ void Fl_Pixmap::desaturate() {
}
//
-// End of "$Id: Fl_Pixmap.cxx 9706 2012-11-06 20:46:14Z matt $".
+// End of "$Id: Fl_Pixmap.cxx 11868 2016-08-09 15:19:46Z AlbrechtS $".
//
diff --git a/src/Fl_PostScript.cxx b/src/Fl_PostScript.cxx
index bff175e..d53f1c5 100644
--- a/src/Fl_PostScript.cxx
+++ b/src/Fl_PostScript.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_PostScript.cxx 10308 2014-09-13 17:51:20Z manolo $"
+// "$Id: Fl_PostScript.cxx 10645 2015-03-21 08:45:42Z manolo $"
//
// PostScript device support for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2011 by Bill Spitzak and others.
+// Copyright 2010-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -236,13 +236,15 @@ static const char * prolog =
"/GL { setgray } bind def\n"
"/SRGB { setrgbcolor } bind def\n"
+"/A85RLE { /ASCII85Decode filter /RunLengthDecode filter } bind def\n" // ASCII85Decode followed by RunLengthDecode filters
+
// color images
"/CI { GS /py exch def /px exch def /sy exch def /sx exch def\n"
"translate \n"
"sx sy scale px py 8 \n"
"[ px 0 0 py neg 0 py ]\n"
-"currentfile /ASCIIHexDecode filter\n false 3"
+"currentfile A85RLE\n false 3"
" colorimage GR\n"
"} bind def\n"
@@ -254,7 +256,7 @@ static const char * prolog =
"[ px 0 0 py neg 0 py ]\n"
-"currentfile /ASCIIHexDecode filter\n"
+"currentfile A85RLE\n"
"image GR\n"
"} bind def\n"
@@ -264,7 +266,7 @@ static const char * prolog =
"translate \n"
"sx sy scale px py true \n"
"[ px 0 0 py neg 0 py ]\n"
-"currentfile /ASCIIHexDecode filter\n"
+"currentfile A85RLE\n"
"imagemask GR\n"
"} bind def\n"
@@ -315,7 +317,7 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1
"/Height py def\n"
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCIIHexDecode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
"/Decode [ 0 1 0 1 0 1 ] def\n"
@@ -335,7 +337,7 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCIIHexDecode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
"/Decode [ 0 1 ] def\n"
@@ -440,7 +442,7 @@ static const char * prolog_2_pixmap = // prolog relevant only if lang_level ==
"pixmap_w pixmap_h scale "
"pixmap_sx pixmap_sy 8 "
"pixmap_mat "
-"currentfile /ASCIIHexDecode filter "
+"currentfile A85RLE "
"false 3 "
"colorimage "
"end "
@@ -458,7 +460,7 @@ static const char * prolog_2_pixmap = // prolog relevant only if lang_level ==
"pixmap_sx pixmap_sy\n"
"true\n"
"pixmap_mat\n"
-"currentfile /ASCIIHexDecode filter\n"
+"currentfile A85RLE\n"
"imagemask\n"
"GR\n"
"} bind def\n"
@@ -480,7 +482,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2
"/Height py def\n"
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCIIHexDecode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
@@ -521,7 +523,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2
"/Height py def\n"
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCIIHexDecode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
@@ -1065,20 +1067,20 @@ static uchar *calc_mask(uchar *img, int w, int h, Fl_Color bg)
}
// write to PostScript a bitmap image of a UTF8 string
-static void transformed_draw_extra(const char* str, int n, double x, double y, int w,
- FILE *output, Fl_PostScript_Graphics_Driver *driver, bool rtl) {
+void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int n, double x, double y, int w, bool rtl)
+{
// scale for bitmask computation
#if defined(USE_X11) && !USE_XFT
float scale = 1; // don't scale because we can't expect to have scalable fonts
#else
float scale = 2;
#endif
- Fl_Fontsize old_size = driver->size();
- Fl_Font fontnum = driver->Fl_Graphics_Driver::font();
+ Fl_Fontsize old_size = size();
+ Fl_Font fontnum = Fl_Graphics_Driver::font();
int w_scaled = (int)(w * (scale + 0.5));
- int h = (int)(driver->height() * scale);
+ int h = (int)(height() * scale);
// create an offscreen image of the string
- Fl_Color text_color = driver->Fl_Graphics_Driver::color();
+ Fl_Color text_color = Fl_Graphics_Driver::color();
Fl_Color bg_color = fl_contrast(FL_WHITE, text_color);
Fl_Offscreen off = fl_create_offscreen(w_scaled, (int)(h+3*scale) );
fl_begin_offscreen(off);
@@ -1099,26 +1101,25 @@ static void transformed_draw_extra(const char* str, int n, double x, double y, i
// read (most of) the offscreen image
uchar *img = fl_read_image(NULL, 1, 1, w2, h, 0);
fl_end_offscreen();
- driver->font(fontnum, old_size);
+ font(fontnum, old_size);
fl_delete_offscreen(off);
// compute the mask of what is not the background
uchar *mask = calc_mask(img, w2, h, bg_color);
delete[] img;
// write the string image to PostScript as a scaled bitmask
scale = w2 / float(w);
- driver->clocale_printf("%g %g %g %g %d %d MI\n", x, y - h*0.77/scale, w2/scale, h/scale, w2, h);
+ clocale_printf("%g %g %g %g %d %d MI\n", x, y - h*0.77/scale, w2/scale, h/scale, w2, h);
uchar *di;
int wmask = (w2+7)/8;
+ void *rle85 = prepare_rle85();
for (int j = h - 1; j >= 0; j--){
di = mask + j * wmask;
for (int i = 0; i < wmask; i++){
- //if (!(i%80)) fprintf(output, "\n"); // don't have lines longer than 255 chars
- fprintf(output, "%2.2x", *di );
+ write_rle85(*di, rle85);
di++;
}
- fprintf(output,"\n");
}
- fprintf(output,">\n");
+ close_rle85(rle85); fputc('\n', output);
delete[] mask;
}
@@ -1152,10 +1153,11 @@ void Fl_PostScript_Graphics_Driver::transformed_draw(const char* str, int n, dou
int w = (int)width(str, n);
if (w == 0) return;
if (Fl_Graphics_Driver::font() >= FL_FREE_FONT) {
- transformed_draw_extra(str, n, x, y, w, output, this, false);
+ transformed_draw_extra(str, n, x, y, w, false);
return;
}
- fprintf(output, "%d <", w);
+ fprintf(output, "%d <~", w);
+ void *data = prepare85();
// transforms UTF8 encoding to our custom PostScript encoding as follows:
// extract each unicode character
// if unicode <= 0x17F, unicode and PostScript codes are identical
@@ -1176,18 +1178,20 @@ void Fl_PostScript_Graphics_Driver::transformed_draw(const char* str, int n, dou
utf = code;
}
else { // unhandled character: draw all string as bitmap image
- fprintf(output, "> pop pop\n"); // close and ignore the opened hex string
- transformed_draw_extra(str, n, x, y, w, output, this, false);
+ fprintf(output, "~> pop pop\n"); // close and ignore the opened hex string
+ transformed_draw_extra(str, n, x, y, w, false);
return;
}
- fprintf(output, "%4.4X", utf);
+ // 2 bytes per character, high-order byte first, encode that to ASCII85
+ uchar c[2]; c[1] = utf & 0xFF; c[0] = (utf & 0xFF00)>>8; write85(data, c, 2);
}
- clocale_printf("> %g %g show_pos_width\n", x, y);
+ close85(data);
+ clocale_printf(" %g %g show_pos_width\n", x, y);
}
void Fl_PostScript_Graphics_Driver::rtl_draw(const char* str, int n, int x, int y) {
int w = (int)width(str, n);
- transformed_draw_extra(str, n, x - w, y, w, output, this, true);
+ transformed_draw_extra(str, n, x - w, y, w, true);
}
void Fl_PostScript_Graphics_Driver::concat(){
@@ -1547,14 +1551,17 @@ void Fl_PostScript_File_Device::end_job (void)
Fl_Display_Device::display_device()->set_current();
}
+#endif // FL_DOXYGEN
+
#if ! (defined(__APPLE__) || defined(WIN32) )
+/** Starts a print job. */
int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) {
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();
- print_load();
+ printing_style style = print_load();
print_selection->deactivate();
print_all->setonly();
print_all->do_callback();
@@ -1628,9 +1635,10 @@ int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) {
// Print: pipe the output into the lp command...
char command[1024];
- 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);
+ 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");
@@ -1645,8 +1653,7 @@ int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) {
#endif // ! (defined(__APPLE__) || defined(WIN32) )
-#endif // FL_DOXYGEN
//
-// End of "$Id: Fl_PostScript.cxx 10308 2014-09-13 17:51:20Z manolo $".
+// End of "$Id: Fl_PostScript.cxx 10645 2015-03-21 08:45:42Z manolo $".
//
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index 3cf501b..1233bb1 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Preferences.cxx 10378 2014-10-14 12:10:18Z ianmacarthur $"
+// "$Id: Fl_Preferences.cxx 10715 2015-04-24 21:25:30Z greg.ercolano $"
//
// Preferences methods for the Fast Light Tool Kit (FLTK).
//
@@ -679,7 +679,7 @@ char Fl_Preferences::get( const char *key, char *text, const char *defaultValue,
}
if ( !v ) v = defaultValue;
if ( v ) strlcpy(text, v, maxSize);
- else text = 0;
+ else *text = 0;
return ( v != defaultValue );
}
@@ -863,17 +863,17 @@ int Fl_Preferences::size( const char *key ) {
database without the \c .prefs extension and located in the same directory.
It then fills the given buffer with the complete path name.
- Exmaple:
+ Example:
\code
Fl_Preferences prefs( USER, "matthiasm.com", "test" );
char path[FL_PATH_MAX];
prefs.getUserdataPath( path );
\endcode
- creates the preferences database in (MS Windows):
+ ..creates the preferences database in (MS Windows):
\code
c:/Documents and Settings/matt/Application Data/matthiasm.com/test.prefs
\endcode
- and returns the userdata path:
+ ..and returns the userdata path:
\code
c:/Documents and Settings/matt/Application Data/matthiasm.com/test/
\endcode
@@ -955,40 +955,6 @@ Fl_Preferences::Name::~Name() {
int Fl_Preferences::Node::lastEntrySet = -1;
-// recursively create a path in the file system
-static char makePath( const char *path ) {
- if (access(path, 0)) {
- const char *s = strrchr( path, '/' );
- if ( !s ) return 0;
- size_t len = s-path;
- char *p = (char*)malloc( len+1 );
- memcpy( p, path, len );
- p[len] = 0;
- makePath( p );
- free( p );
-#if defined(WIN32) && !defined(__CYGWIN__)
- return ( mkdir( path ) == 0 );
-#else
- return ( mkdir( path, 0777 ) == 0 );
-#endif // WIN32 && !__CYGWIN__
- }
- return 1;
-}
-
-#if 0
-// strip the filename and create a path
-static void makePathForFile( const char *path ) {
- const char *s = strrchr( path, '/' );
- if ( !s ) return;
- int len = s-path;
- char *p = (char*)malloc( len+1 );
- memcpy( p, path, len );
- p[len] = 0;
- makePath( p );
- free( p );
-}
-#endif
-
// create the root node
// - construct the name of the file that will hold our preferences
Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char *vendor, const char *application )
@@ -1321,7 +1287,7 @@ int Fl_Preferences::Node::write( FILE *f ) {
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;
}
@@ -1797,5 +1763,5 @@ int Fl_Plugin_Manager::loadAll(const char *filepath, const char *pattern) {
}
//
-// End of "$Id: Fl_Preferences.cxx 10378 2014-10-14 12:10:18Z ianmacarthur $".
+// End of "$Id: Fl_Preferences.cxx 10715 2015-04-24 21:25:30Z greg.ercolano $".
//
diff --git a/src/Fl_Printer.cxx b/src/Fl_Printer.cxx
index 3518d23..0b17d0d 100644
--- a/src/Fl_Printer.cxx
+++ b/src/Fl_Printer.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Printer.cxx 10291 2014-09-08 16:03:52Z manolo $"
+// "$Id: Fl_Printer.cxx 10610 2015-03-09 09:46:28Z manolo $"
//
// Encompasses platform-specific printing-support code and
// PostScript output code for the Fast Light Tool Kit (FLTK).
@@ -98,6 +98,18 @@ Fl_Printer::Fl_Printer(void) {
Fl_Surface_Device::driver(printer->driver());
}
+/**
+ Starts a print job.
+ Opens a platform-specific dialog window allowing the user to set several options including
+ the desired printer and the page orientation. Optionally, the user can also select a range of pages to be
+ printed. This range is returned to the caller that is in charge of sending only these pages
+ for printing.
+
+ @param[in] pagecount the total number of pages of the job (or 0 if you don't know the number of pages)
+ @param[out] frompage if non-null, *frompage is set to the first page the user wants printed
+ @param[out] topage if non-null, *topage is set to the last page the user wants printed
+ @return 0 if OK, non-zero if any error occurred or if the user cancelled the print request.
+ */
int Fl_Printer::start_job(int pagecount, int *frompage, int *topage)
{
return printer->start_job(pagecount, frompage, topage);
@@ -185,5 +197,5 @@ Fl_Printer::~Fl_Printer(void)
//
-// End of "$Id: Fl_Printer.cxx 10291 2014-09-08 16:03:52Z manolo $".
+// End of "$Id: Fl_Printer.cxx 10610 2015-03-09 09:46:28Z manolo $".
//
diff --git a/src/Fl_Quartz_Printer.mm b/src/Fl_Quartz_Printer.mm
index a7cf38e..e390364 100644
--- a/src/Fl_Quartz_Printer.mm
+++ b/src/Fl_Quartz_Printer.mm
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Quartz_Printer.mm 10393 2014-10-26 15:23:03Z manolo $"
+// "$Id: Fl_Quartz_Printer.mm 11943 2016-09-13 11:51:24Z manolo $"
//
// Mac OS X-specific printing support (objective-c++) for the Fast Light Tool Kit (FLTK).
//
@@ -80,14 +80,16 @@ int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage)
PMGetFirstPage(printSettings, &from32);
if (frompage) *frompage = (int)from32;
PMGetLastPage(printSettings, &to32);
- if (topage) *topage = (int)to32;
- if(topage && *topage > pagecount) *topage = pagecount;
+ if (topage) {
+ *topage = (int)to32;
+ if (*topage > pagecount && pagecount > 0) *topage = pagecount;
+ }
status = PMSessionBeginCGDocumentNoDialog(printSession, printSettings, pageFormat);//from 10.4
}
else
#endif
{
-#if !__LP64__
+#if !defined(__LP64__) || !__LP64__
Boolean accepted;
status = PMCreateSession(&printSession);
if (status != noErr) return 1;
@@ -238,13 +240,13 @@ int Fl_System_Printer::start_page (void)
{
OSStatus status = PMSessionBeginPageNoDialog(printSession, pageFormat, NULL);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if ( PMSessionGetCGGraphicsContext != NULL ) {
+ if ( &PMSessionGetCGGraphicsContext != NULL ) {
status = PMSessionGetCGGraphicsContext(printSession, &fl_gc);
}
else
#endif
{
-#if ! __LP64_
+#if !defined(__LP64__) || !__LP64__
PMSessionGetGraphicsContext_type PMSessionGetGraphicsContext =
(PMSessionGetGraphicsContext_type)Fl_X::get_carbon_function("PMSessionGetGraphicsContext");
status = PMSessionGetGraphicsContext(printSession, NULL, (void **)&fl_gc);
@@ -302,7 +304,7 @@ void Fl_System_Printer::end_job (void)
fl_alert ("PM Session error %d", (int)status);
}
PMSessionEndDocumentNoDialog(printSession);
-#if !__LP64__
+#if !defined(__LP64__) || !__LP64__
if (fl_mac_os_version < 100500) {
PMRelease(printSettings);
PMRelease(pageFormat);
@@ -324,11 +326,10 @@ void Fl_System_Printer::print_window_part(Fl_Window *win, int x, int y, int w, i
win->show();
fl_gc = NULL;
Fl::check();
- win->make_current();
CGImageRef img = Fl_X::CGImage_from_window_rect(win, x, y, w, h);
if (save_front != win) save_front->show();
current->set_current();
- CGRect rect = { { delta_x, delta_y }, { w, h } };
+ CGRect rect = CGRectMake(delta_x, delta_y, w, h);
Fl_X::q_begin_image(rect, 0, 0, w, h);
CGContextDrawImage(fl_gc, rect, img);
Fl_X::q_end_image();
@@ -338,5 +339,5 @@ void Fl_System_Printer::print_window_part(Fl_Window *win, int x, int y, int w, i
#endif // __APPLE__
//
-// End of "$Id: Fl_Quartz_Printer.mm 10393 2014-10-26 15:23:03Z manolo $".
+// End of "$Id: Fl_Quartz_Printer.mm 11943 2016-09-13 11:51:24Z manolo $".
//
diff --git a/src/Fl_Return_Button.cxx b/src/Fl_Return_Button.cxx
index df2038a..b43ebab 100644
--- a/src/Fl_Return_Button.cxx
+++ b/src/Fl_Return_Button.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Return_Button.cxx 9637 2012-07-24 04:37:22Z matt $"
+// "$Id: Fl_Return_Button.cxx 10775 2015-06-27 15:20:23Z AlbrechtS $"
//
// Return button widget for the Fast Light Tool Kit (FLTK).
//
@@ -40,12 +40,13 @@ int fl_return_arrow(int x, int y, int w, int h) {
void Fl_Return_Button::draw() {
if (type() == FL_HIDDEN_BUTTON) return;
- draw_box(value() ? (down_box()?down_box():fl_down(box())) : box(),
- value() ? selection_color() : color());
+ Fl_Boxtype bt = value() ? (down_box()?down_box():fl_down(box())) : box();
+ int dx = Fl::box_dx(bt);
+ draw_box(bt, value() ? selection_color() : color());
int W = h();
if (w()/3 < W) W = w()/3;
- fl_return_arrow(x()+w()-W-4, y(), W, h());
- draw_label(x(), y(), w()-W+4, h());
+ fl_return_arrow(x()+w()-(W+dx), y(), W, h());
+ draw_label(x()+dx, y(), w()-(dx+W+dx), h());
if (Fl::focus() == this) draw_focus();
}
@@ -67,5 +68,5 @@ Fl_Return_Button::Fl_Return_Button(int X, int Y, int W, int H,const char *l)
//
-// End of "$Id: Fl_Return_Button.cxx 9637 2012-07-24 04:37:22Z matt $".
+// End of "$Id: Fl_Return_Button.cxx 10775 2015-06-27 15:20:23Z AlbrechtS $".
//
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx
index 9317a11..6b886f0 100644
--- a/src/Fl_Scroll.cxx
+++ b/src/Fl_Scroll.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Scroll.cxx 10221 2014-07-16 18:51:56Z greg.ercolano $"
+// "$Id: Fl_Scroll.cxx 10776 2015-06-28 13:05:29Z AlbrechtS $"
//
// Scroll widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -35,7 +35,7 @@ void Fl_Scroll::clear() {
add(scrollbar);
}
-/** Insure the scrollbars are the last children */
+/** Insure the scrollbars are the last children. */
void Fl_Scroll::fix_scrollbar_order() {
Fl_Widget** a = (Fl_Widget**)array();
if (a[children()-1] != &scrollbar) {
@@ -90,12 +90,14 @@ void Fl_Scroll::draw_clip(void* v,int X, int Y, int W, int H) {
}
/**
- Calculate visibility/size/position of scrollbars, find children's bounding box.
- The \p si paramater will be filled with data from the calculations.
- Derived classes can make use of this call to figure out the scrolling area
- eg. during resize() handling.
- \param[in] si -- ScrollInfo structure
- \returns Structure containing the calculated info.
+ Calculate visibility/size/position of scrollbars, find children's bounding box.
+
+ The \p si parameter will be filled with data from the calculations.
+ Derived classes can make use of this call to figure out the scrolling area
+ eg. during resize() handling.
+
+ \param[in] si -- ScrollInfo structure
+ \returns Structure containing the calculated info.
*/
void Fl_Scroll::recalc_scrollbars(ScrollInfo &si) {
@@ -170,7 +172,7 @@ 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.hscroll.y = (scrollbar.align() & FL_ALIGN_TOP)
? si.innerbox.y
: si.innerbox.y + si.innerbox.h - si.scrollsize;
si.hscroll.w = si.innerchild.w;
@@ -213,10 +215,10 @@ void Fl_Scroll::recalc_scrollbars(ScrollInfo &si) {
/**
Returns the bounding box for the interior of the scrolling area, inside
the scrollbars.
-
+
Currently this is only reliable after draw(), and before any resizing of
the Fl_Scroll or any child widgets occur.
-
+
\todo The visibility of the scrollbars ought to be checked/calculated
outside of the draw() method (STR #1895).
*/
@@ -328,6 +330,30 @@ void Fl_Scroll::draw() {
}
}
+/**
+ Resizes the Fl_Scroll widget and moves its children if necessary.
+
+ The Fl_Scroll widget first resizes itself, and then it moves all its
+ children if (and only if) the Fl_Scroll widget has been moved. The
+ children are moved by the same amount as the Fl_Scroll widget has been
+ moved, hence all children keep their relative positions.
+
+ \note Fl_Scroll::resize() does \b not call Fl_Group::resize(), and
+ child widgets are \b not resized.
+
+ Since children of an Fl_Scroll are not resized, the resizable() widget
+ is ignored (if it is set).
+
+ The scrollbars are moved to their proper positions, as given by
+ Fl_Scroll::scrollbar.align(), and switched on or off as necessary.
+
+ \note Due to current (FLTK 1.3.x) implementation constraints some of this
+ may effectively be postponed until the Fl_Scroll is drawn the next time.
+ This may change in a future release.
+
+ \sa Fl_Group::resizable()
+ \sa Fl_Widget::resize(int,int,int,int)
+*/
void Fl_Scroll::resize(int X, int Y, int W, int H) {
int dx = X-x(), dy = Y-y();
int dw = W-w(), dh = H-h();
@@ -346,12 +372,27 @@ void Fl_Scroll::resize(int X, int Y, int W, int H) {
scrollbar.position(al?X:X+W-scrollbar.w(), (at&&pad)?Y+hscrollbar.h():Y);
hscrollbar.position((al&&pad)?X+scrollbar.w():X, at?Y:Y+H-hscrollbar.h());
} else {
- // FIXME recalculation of scrollbars needs to be moved out fo "draw()" (STR #1895)
+ // FIXME recalculation of scrollbars needs to be moved out of "draw()" (STR #1895)
redraw(); // need full recalculation of scrollbars
}
}
-/** Moves the contents of the scroll group to a new position.*/
+/** Moves the contents of the scroll group to a new position.
+
+ This is like moving the scrollbars of the Fl_Scroll around. For instance:
+ \code
+ Fl_Scroll scroll (10,10,200,200);
+ Fl_Box b1 ( 10, 10,50,50,"b1"); // relative (x,y) = (0,0)
+ Fl_Box b2 ( 60, 60,50,50,"b2"); // relative (x,y) = (50,50)
+ Fl_Box b3 ( 60,110,50,50,"b3"); // relative (x,y) = (50,100)
+ // populate scroll with more children ...
+ scroll.end();
+ scroll.scroll_to(50,100);
+ \endcode
+ will move the logical origin of the internal scroll area to (-50,-100)
+ relative to the origin of the Fl_Scroll (10,10), i.e. Fl_Box b3 will
+ be visible in the top left corner of the scroll area.
+*/
void Fl_Scroll::scroll_to(int X, int Y) {
int dx = xposition_-X;
int dy = yposition_-Y;
@@ -380,15 +421,16 @@ void Fl_Scroll::scrollbar_cb(Fl_Widget* o, void*) {
/**
Creates a new Fl_Scroll widget using the given position,
size, and label string. The default boxtype is FL_NO_BOX.
- <P>The destructor <I>also deletes all the children</I>. This allows a
+
+ The destructor <I>also deletes all the children</I>. This allows a
whole tree to be deleted at once, without having to keep a pointer to
- all the children in the user code. A kludge has been done so the
+ all the children in the user code. A kludge has been done so the
Fl_Scroll and all of its children can be automatic (local)
variables, but you must declare the Fl_Scroll <I>first</I>, so
that it is destroyed last.
*/
Fl_Scroll::Fl_Scroll(int X,int Y,int W,int H,const char* L)
- : Fl_Group(X,Y,W,H,L),
+ : Fl_Group(X,Y,W,H,L),
scrollbar(X+W-Fl::scrollbar_size(),Y,
Fl::scrollbar_size(),H-Fl::scrollbar_size()),
hscrollbar(X,Y+H-Fl::scrollbar_size(),
@@ -408,5 +450,5 @@ int Fl_Scroll::handle(int event) {
}
//
-// End of "$Id: Fl_Scroll.cxx 10221 2014-07-16 18:51:56Z greg.ercolano $".
+// End of "$Id: Fl_Scroll.cxx 10776 2015-06-28 13:05:29Z AlbrechtS $".
//
diff --git a/src/Fl_Scrollbar.cxx b/src/Fl_Scrollbar.cxx
index 2d22d5e..93e2f17 100644
--- a/src/Fl_Scrollbar.cxx
+++ b/src/Fl_Scrollbar.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Scrollbar.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_Scrollbar.cxx 10542 2015-01-29 16:56:12Z AlbrechtS $"
//
// Scroll bar widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -218,7 +218,7 @@ void Fl_Scrollbar::draw() {
int w1 = (H-4)/3; if (w1 < 1) w1 = 1;
int x1 = X+(H-w1-1)/2;
int yy1 = Y+(H-2*w1-1)/2;
- if (Fl::scheme_ && !strcmp(Fl::scheme_, "gtk+")) {
+ 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);
@@ -243,7 +243,7 @@ void Fl_Scrollbar::draw() {
int w1 = (W-4)/3; if (w1 < 1) w1 = 1;
int x1 = X+(W-2*w1-1)/2;
int yy1 = Y+(W-w1-1)/2;
- if (Fl::scheme_ && !strcmp(Fl::scheme_, "gtk+")) {
+ 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);
@@ -279,5 +279,5 @@ Fl_Scrollbar::~Fl_Scrollbar() {
//
-// End of "$Id: Fl_Scrollbar.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_Scrollbar.cxx 10542 2015-01-29 16:56:12Z AlbrechtS $".
//
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx
index 6340753..a4199e0 100644
--- a/src/Fl_Shared_Image.cxx
+++ b/src/Fl_Shared_Image.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Shared_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_Shared_Image.cxx 12002 2016-10-01 22:35:37Z AlbrechtS $"
//
// Shared image code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -25,7 +25,8 @@
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_XBM_Image.H>
#include <FL/Fl_XPM_Image.H>
-
+#include <FL/Fl_Preferences.H>
+#include <FL/fl_draw.H>
//
// Global class vars...
@@ -53,16 +54,49 @@ extern "C" {
Fl_Shared_Image **Fl_Shared_Image::images() {
return images_;
}
+
+
/** Returns the total number of shared images in the array. */
int Fl_Shared_Image::num_images() {
return num_images_;
}
-//
-// 'Fl_Shared_Image::compare()' - Compare two shared images...
-//
+/**
+ Compares two shared images.
+
+ The order of comparison is:
+
+ -# Image name, usually the filename used to load it
+ -# Image width
+ -# Image height
+
+ A special case is considered if the width of one of the images is zero
+ and the other image is marked \p original. In this case the images match,
+ i.e. the comparison returns success (0).
+ An image is marked \p original if it was directly loaded from a file or
+ from memory as opposed to copied and resized images.
+
+ This comparison is used in Fl_Shared_Image::find() to find an image that
+ matches the requested one or to find the position where a new image
+ should be entered into the sorted list of shared images.
+
+ It is usually used in two steps:
+
+ -# search with exact width and height
+ -# if not found, search again with width = 0 (and height = 0)
+
+ The first step will only return a match if the image exists with the
+ 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).
+
+ \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
@@ -76,11 +110,11 @@ Fl_Shared_Image::compare(Fl_Shared_Image **i0, // I - First image
}
-/**
+/**
Creates an empty shared image.
The constructors create a new shared image record in the image cache.
-
- <P>The constructors are protected and cannot be used directly
+
+ The constructors are protected and cannot be used directly
from a program. Use the get() method instead.
*/
Fl_Shared_Image::Fl_Shared_Image() : Fl_Image(0,0,0) {
@@ -89,14 +123,17 @@ Fl_Shared_Image::Fl_Shared_Image() : Fl_Image(0,0,0) {
original_ = 0;
image_ = 0;
alloc_image_ = 0;
+#if FLTK_ABI_VERSION >= 10304
+ scaled_image_= 0;
+#endif
}
-/**
+/**
Creates a shared image from its filename and its corresponding Fl_Image* img.
The constructors create a new shared image record in the image cache.
-
- <P>The constructors are protected and cannot be used directly
+
+ 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
@@ -109,16 +146,23 @@ Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename
image_ = img;
alloc_image_ = !img;
original_ = 1;
+#if FLTK_ABI_VERSION >= 10304
+ scaled_image_= 0;
+#endif
if (!img) reload();
else update();
}
-//
-// 'Fl_Shared_Image::add()' - Add a shared image to the array.
-//
+/**
+ Adds a shared image to the image cache.
+ This \b protected method adds an image to the cache, an ordered list
+ of shared images. The cache is searched for a matching image whenever
+ one is requested, for instance with Fl_Shared_Image::get() or
+ Fl_Shared_Image::find().
+*/
void
Fl_Shared_Image::add() {
Fl_Shared_Image **temp; // New image pointer array...
@@ -162,21 +206,26 @@ Fl_Shared_Image::update() {
}
/**
- The destructor free all memory and server resources that are
- used by the image. The destructor is protected and cannot be
- used directly from a program. Use the Fl_Shared_Image::release() method
- instead.
+ The destructor frees all memory and server resources that are
+ used by the image.
+
+ The destructor is protected and cannot be used directly from a program.
+ Use the Fl_Shared_Image::release() method instead.
*/
Fl_Shared_Image::~Fl_Shared_Image() {
if (name_) delete[] (char *)name_;
if (alloc_image_) delete image_;
+#if FLTK_ABI_VERSION >= 10304
+ delete scaled_image_;
+#endif
}
-//
-/**
- Releases and possibly destroys (if refcount <=0) a shared image.
- In the latter case, it will reorganize the shared image array so that no hole will occur.
+/**
+ Releases and possibly destroys (if refcount <= 0) a shared image.
+
+ In the latter case, it will reorganize the shared image array
+ so that no hole will occur.
*/
void Fl_Shared_Image::release() {
int i; // Looping var...
@@ -207,8 +256,7 @@ void Fl_Shared_Image::release() {
}
-//
-/** Reloads the shared image from disk */
+/** Reloads the shared image from disk. */
void Fl_Shared_Image::reload() {
// Load image from disk...
int i; // Looping var
@@ -261,6 +309,8 @@ void Fl_Shared_Image::reload() {
//
// 'Fl_Shared_Image::copy()' - Copy and resize a shared image...
//
+// Note: intentionally no doxygen docs here.
+// For doxygen docs see Fl_Image::copy().
Fl_Image *
Fl_Shared_Image::copy(int W, int H) {
@@ -317,13 +367,89 @@ Fl_Shared_Image::desaturate() {
//
// 'Fl_Shared_Image::draw()' - Draw a shared image...
//
-
-void
-Fl_Shared_Image::draw(int X, int Y, int W, int H, int cx, int cy) {
+void Fl_Shared_Image::draw(int X, int Y, int W, int H, int cx, int cy) {
+#if FLTK_ABI_VERSION >= 10304
+ if (!image_) {
+ Fl_Image::draw(X, Y, W, H, cx, cy);
+ return;
+ }
+ if (w() == image_->w() && h() == image_->h()) {
+ image_->draw(X, Y, W, H, cx, cy);
+ return;
+ }
+ fl_push_clip(X, Y, W, H);
+ int done = 0;
+ // don't call Fl_Graphics_Driver::draw_scaled(Fl_Image*,...) for an enlarged Fl_Bitmap or Fl_Pixmap
+ if ((d() != 0 && count() < 2) || (w() <= image_->w() && h() <= image_->h())) {
+ done = fl_graphics_driver->draw_scaled(image_, X-cx, Y-cy, w(), h());
+ }
+ if (!done) {
+ if (scaled_image_ && (scaled_image_->w() != w() || scaled_image_->h() != h())) {
+ delete scaled_image_;
+ scaled_image_ = NULL;
+ }
+ if (!scaled_image_) {
+ Fl_RGB_Scaling previous = RGB_scaling();
+ RGB_scaling(scaling_algorithm_); // useless but no harm if image_ is not an Fl_RGB_Image
+ scaled_image_ = image_->copy(w(), h());
+ RGB_scaling(previous);
+ }
+ scaled_image_->draw(X-cx, Y-cy, scaled_image_->w(), scaled_image_->h(), 0, 0);
+ }
+ fl_pop_clip();
+#else
if (image_) image_->draw(X, Y, W, H, cx, cy);
else Fl_Image::draw(X, Y, W, H, cx, cy);
+#endif // FLTK_ABI_VERSION
}
+/** Sets the drawing size of the shared image.
+ This function gives the shared image its own size, independently from the size of the original image
+ that is typically larger.
+ This can be useful to draw a shared image on a drawing surface whose resolution is higher
+ than the drawing unit for this surface: all pixels of the original image become available to fill
+ an area of the drawing surface sized at <tt>width,height</tt>.
+ Examples of such drawing surfaces: laser printers, PostScript files, PDF printers, retina displays on Apple hardware.
+
+ \param width,height maximum width and height (in drawing units) to use when drawing the shared image
+ \param proportional if not null, keep the width and height of the shared image proportional to those of its original image
+ \param can_expand if null, the width and height of the shared image will not exceed those of the original image
+
+ \version 1.3.4 and requires compiling with FLTK_ABI_VERSION = 10304
+
+ Example code: scale an image to fit in a box
+ \code
+ Fl_Box *b = ... // a box
+ Fl_Shared_Image *shared = Fl_Shared_Image::get("/path/to/picture.jpeg"); // read a picture file
+ shared->scale(b->w(), b->h(), 1); // set the drawing size of the shared image to the size of the box
+ b->image(shared); // use the shared image as the box image
+ b->align(FL_ALIGN_INSIDE | FL_ALIGN_CENTER | FL_ALIGN_CLIP); // the image is to be drawn centered in the box
+ \endcode
+ */
+void Fl_Shared_Image::scale(int width, int height, int proportional, int can_expand)
+{
+#if FLTK_ABI_VERSION >= 10304
+ w(width);
+ h(height);
+ if (!image_) return;
+ float fw = image_->w() / float(width);
+ float fh = image_->h() / float(height);
+ if (proportional) {
+ if (fh > fw) fw = fh;
+ else fh = fw;
+ }
+ if (!can_expand) {
+ if (fw < 1) fw = 1;
+ if (fh < 1) fh = 1;
+ }
+ w(int(image_->w() / fw));
+ h(int(image_->h() / fh));
+#endif
+}
+
+
+Fl_RGB_Scaling Fl_Shared_Image::scaling_algorithm_ = FL_RGB_SCALING_BILINEAR;
+
//
// 'Fl_Shared_Image::uncache()' - Uncache the shared image...
@@ -336,15 +462,28 @@ void Fl_Shared_Image::uncache()
-/** Finds a shared image from its named and size specifications */
-Fl_Shared_Image* Fl_Shared_Image::find(const char *n, int W, int H) {
+/** Finds a shared image from its name and size specifications.
+
+ This uses a binary search in the image cache.
+
+ If the image \p name exists with the exact width \p W and height \p H,
+ then it is returned.
+
+ If \p W == 0 and the image \p name exists with another size, then the
+ \b original image with that \p name is returned.
+
+ In either case the refcount of the returned image is increased.
+ The found image should be released with Fl_Shared_Image::release()
+ 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
if (num_images_) {
key = new Fl_Shared_Image();
- key->name_ = new char[strlen(n) + 1];
- strcpy((char *)key->name_, n);
+ key->name_ = new char[strlen(name) + 1];
+ strcpy((char *)key->name_, name);
key->w(W);
key->h(H);
@@ -364,33 +503,48 @@ Fl_Shared_Image* Fl_Shared_Image::find(const char *n, int W, int H) {
}
-/**
- \brief Find or load an image that can be shared by multiple widgets.
-
- Gets a shared image, if it exists already ; it will return it.
- If it does not exist or if it exist but with other size,
- then the existing image is deleted and replaced
- by a new image from the n filename of the proper dimension.
- If n is not a valid image filename, then get() will return NULL.
-
- Shared JPEG and PNG images can also be created from memory by using their
- named memory access constructor.
-
- \param n name of the image
- \param W, H desired size
-
- \see Fl_Shared_Image::find(const char *n, int W, int H)
- \see Fl_Shared_Image::release()
- \see Fl_JPEG_Image::Fl_JPEG_Image(const char *name, const unsigned char *data)
- \see Fl_PNG_Image::Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int maxsize)
+/**
+ Find or load an image that can be shared by multiple widgets.
+
+ If the image exists with the requested size, this image will be returned.
+
+ If the image exists, but only with another size, then a new copy with the
+ requested size (width \p W and height \p H) will be created as a resized
+ copy of the original image. The new image is added to the internal list
+ of shared images.
+
+ If the image does not yet exist, then a new image of the proper
+ dimension is created from the filename \p name. The original image
+ from filename \p name is always added to the list of shared images in
+ its original size. If the requested size differs, then the resized
+ 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.
+
+ Shared JPEG and PNG images can also be created from memory by using their
+ named memory access constructor.
+
+ You should release() the image when you're done with it.
+
+ \param name name of the image
+ \param W, H desired size
+
+ \see Fl_Shared_Image::find(const char *name, int W, int H)
+ \see Fl_Shared_Image::release()
+ \see Fl_JPEG_Image::Fl_JPEG_Image(const char *name, const unsigned char *data)
+ \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 *n, int W, int H) {
+Fl_Shared_Image* Fl_Shared_Image::get(const char *name, int W, int H) {
Fl_Shared_Image *temp; // Image
- if ((temp = find(n, W, H)) != NULL) return temp;
+ if ((temp = find(name, W, H)) != NULL) return temp;
- if ((temp = find(n)) == NULL) {
- temp = new Fl_Shared_Image(n);
+ if ((temp = find(name)) == NULL) {
+ temp = new Fl_Shared_Image(name);
if (!temp->image_) {
delete temp;
@@ -408,9 +562,26 @@ Fl_Shared_Image* Fl_Shared_Image::get(const char *n, int W, int H) {
return temp;
}
+/** 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
+
+ \version 1.3.4
+*/
+Fl_Shared_Image *Fl_Shared_Image::get(Fl_RGB_Image *rgb, int own_it)
+{
+ Fl_Shared_Image *shared = new Fl_Shared_Image(Fl_Preferences::newUUID(), rgb);
+ shared->alloc_image_ = own_it;
+ shared->add();
+ return shared;
+}
-/** Adds a shared image handler, which is basically a test function for adding new formats */
+/** Adds a shared image handler, which is basically a test function
+ 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...
@@ -439,8 +610,7 @@ void Fl_Shared_Image::add_handler(Fl_Shared_Handler f) {
}
-
-/** Removes a shared image handler */
+/** Removes a shared image handler. */
void Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) {
int i; // Looping var...
@@ -463,5 +633,5 @@ void Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) {
//
-// End of "$Id: Fl_Shared_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_Shared_Image.cxx 12002 2016-10-01 22:35:37Z AlbrechtS $".
//
diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx
index 4af5dc0..16d2c68 100644
--- a/src/Fl_Slider.cxx
+++ b/src/Fl_Slider.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Slider.cxx 9637 2012-07-24 04:37:22Z matt $"
+// "$Id: Fl_Slider.cxx 11535 2016-04-05 21:12:49Z AlbrechtS $"
//
// Slider widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -163,8 +163,8 @@ void Fl_Slider::draw(int X, int Y, int W, int H) {
} else {
if (wsl>0 && hsl>0) draw_box(box1, xsl, ysl, wsl, hsl, selection_color());
- if (type()!=FL_HOR_FILL_SLIDER && type() != FL_VERT_FILL_SLIDER &&
- Fl::scheme_ && !strcmp(Fl::scheme_, "gtk+")) {
+ if (type() != FL_HOR_FILL_SLIDER && type() != FL_VERT_FILL_SLIDER &&
+ Fl::is_scheme("gtk+")) {
if (W>H && wsl>(hsl+8)) {
// Draw horizontal grippers
int yy, hh;
@@ -269,7 +269,7 @@ int Fl_Slider::handle(int event, int X, int Y, int W, int H) {
}
int xx = mx-offcenter;
- double v;
+ double v = 0;
char tryAgain = 1;
while (tryAgain)
{
@@ -398,5 +398,5 @@ Fl_Nice_Slider::Fl_Nice_Slider(int X,int Y,int W,int H,const char *L)
//
-// End of "$Id: Fl_Slider.cxx 9637 2012-07-24 04:37:22Z matt $".
+// End of "$Id: Fl_Slider.cxx 11535 2016-04-05 21:12:49Z AlbrechtS $".
//
diff --git a/src/Fl_Sys_Menu_Bar.mm b/src/Fl_Sys_Menu_Bar.mm
index 0b62fa5..fe252b3 100644
--- a/src/Fl_Sys_Menu_Bar.mm
+++ b/src/Fl_Sys_Menu_Bar.mm
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Sys_Menu_Bar.mm 10106 2014-02-19 16:02:56Z manolo $"
+// "$Id: Fl_Sys_Menu_Bar.mm 11786 2016-06-18 00:32:18Z greg.ercolano $"
//
// MacOS system menu bar widget for the Fast Light Tool Kit (FLTK).
//
@@ -40,16 +40,6 @@
#import <Cocoa/Cocoa.h>
-#ifndef NSINTEGER_DEFINED // appears with 10.5 in NSObjCRuntime.h
-#if defined(__LP64__) && __LP64__
-typedef long NSInteger;
-typedef unsigned long NSUInteger;
-#else
-typedef long NSInteger;
-typedef unsigned int NSUInteger;
-#endif
-#endif
-
#include "flstring.h"
#include <stdio.h>
#include <ctype.h>
@@ -58,6 +48,7 @@ typedef unsigned int NSUInteger;
typedef const Fl_Menu_Item *pFl_Menu_Item;
Fl_Sys_Menu_Bar *fl_sys_menu_bar = 0;
+static Fl_Menu_Bar *custom_menu;
static char *remove_ampersand(const char *s);
extern void (*fl_lock_function)();
@@ -65,8 +56,12 @@ extern void (*fl_unlock_function)();
/* Each MacOS system menu item contains a pointer to a record of type sys_menu_item defined below.
The purpose of these records is to associate each MacOS system menu item with a relevant Fl_Menu_Item.
+
+ Note: in the below, 'rank' is similar to an FLTK menu() 'index'.
+ Let's avoid exposing Mac internal terminology like 'rank' to FLTK users; stick with 'index'.
+
If use_rank is YES, the "rank" field is used, and fl_sys_menu_bar->menu() + rank is the address
- of the relevant Fl_Menu_Item;
+ of the relevant Fl_Menu_Item;
Otherwise, the "item" field points to the relevant Fl_Menu_Item.
This allows the MacOS system menu to use the same Fl_Menu_Item's as those used by FLTK menus,
the address of which can be relocated by the FLTK menu logic.
@@ -85,12 +80,14 @@ typedef struct {
@interface FLMenuItem : NSMenuItem {
}
-- (void) doCallback:(id)unused;
-- (void) directCallback:(id)unused;
- (const Fl_Menu_Item*) getFlItem;
+- (void) itemCallback:(Fl_Menu_*)menu;
+- (void) doCallback;
+- (void) customCallback;
+- (void) directCallback;
- (void) setKeyEquivalentModifierMask:(int)value;
- (void) setFltkShortcut:(int)key;
-+ (int) addNewItem:(const Fl_Menu_Item*)mitem menu:(NSMenu*)menu;
++ (int) addNewItem:(const Fl_Menu_Item*)mitem menu:(NSMenu*)menu action:(SEL)selector;
@end
@implementation FLMenuItem
@@ -101,11 +98,10 @@ typedef struct {
if (smi->use_rank) return fl_sys_menu_bar->menu() + smi->rank;
return smi->item;
}
-- (void) doCallback:(id)unused
+- (void) itemCallback:(Fl_Menu_*)menu
{
- fl_lock_function();
const Fl_Menu_Item *item = [self getFlItem];
- fl_sys_menu_bar->picked(item);
+ menu->picked(item);
if ( item->flags & FL_MENU_TOGGLE ) { // update the menu toggle symbol
[self setState:(item->value() ? NSOnState : NSOffState)];
}
@@ -132,9 +128,20 @@ typedef struct {
[nsitem setState:(nsitem != self ? NSOffState : NSOnState)];
}
}
+}
+- (void) doCallback
+{
+ fl_lock_function();
+ [self itemCallback:fl_sys_menu_bar];
fl_unlock_function();
}
-- (void) directCallback:(id)unused
+- (void) customCallback
+{
+ fl_lock_function();
+ [self itemCallback:custom_menu];
+ fl_unlock_function();
+}
+- (void) directCallback
{
fl_lock_function();
Fl_Menu_Item *item = (Fl_Menu_Item *)[(NSData*)[self representedObject] bytes];
@@ -164,22 +171,22 @@ typedef struct {
[self setKeyEquivalent:[NSString stringWithCharacters:&mac_key length:1]];
[self setKeyEquivalentModifierMask:mod];
}
-+ (int) addNewItem:(const Fl_Menu_Item*)mitem menu:(NSMenu*)menu
++ (int) addNewItem:(const Fl_Menu_Item*)mitem menu:(NSMenu*)menu action:(SEL)selector
{
char *name = remove_ampersand(mitem->label());
- CFStringRef cfname = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);
+ NSString *title = NSLocalizedString([NSString stringWithUTF8String:name], nil);
free(name);
- FLMenuItem *item = [[FLMenuItem alloc] initWithTitle:(NSString*)cfname
- action:@selector(doCallback:)
+ FLMenuItem *item = [[FLMenuItem alloc] initWithTitle:title
+ action:selector
keyEquivalent:@""];
sys_menu_item smi;
- smi.rank = fl_sys_menu_bar->find_index(mitem); // ≥ 0 if mitem is in the menu items of fl_sys_menu_bar, -1 if not
+ // >= 0 if mitem is in the menu items of fl_sys_menu_bar, -1 if not
+ smi.rank = (fl_sys_menu_bar ? fl_sys_menu_bar->find_index(mitem) : -1);
smi.use_rank = (smi.rank >= 0);
if (!smi.use_rank) smi.item = mitem;
NSData *pointer = [NSData dataWithBytes:&smi length:sizeof(smi)];
[item setRepresentedObject:pointer];
[menu addItem:item];
- CFRelease(cfname);
[item setTarget:item];
int retval = [menu indexOfItem:item];
[item release];
@@ -200,7 +207,7 @@ void fl_mac_set_about( Fl_Callback *cb, void *user_data, int shortcut)
CFStringRef cfname = CFStringCreateCopy(NULL, (CFStringRef)[[appleMenu itemAtIndex:0] title]);
[appleMenu removeItemAtIndex:0];
FLMenuItem *item = [[[FLMenuItem alloc] initWithTitle:(NSString*)cfname
- action:@selector(directCallback:)
+ action:@selector(directCallback)
keyEquivalent:@""] autorelease];
if (aboutItem.shortcut())
[item setFltkShortcut:aboutItem.shortcut()];
@@ -267,36 +274,36 @@ static char *remove_ampersand(const char *s)
/*
* create a sub menu for a specific menu handle
*/
-static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *mitem)
+static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *mitem, SEL selector)
{
NSMenu *submenu;
int miCnt, flags;
- NSMenuItem *menuItem;
- char *ts = remove_ampersand(mitem->text);
- CFStringRef title = CFStringCreateWithCString(NULL, ts, kCFStringEncodingUTF8);
- free(ts);
- submenu = [[NSMenu alloc] initWithTitle:(NSString*)title];
- CFRelease(title);
- [submenu setAutoenablesItems:NO];
-
- int cnt;
- cnt = [mh numberOfItems];
- cnt--;
- menuItem = [mh itemAtIndex:cnt];
- [menuItem setSubmenu:submenu];
- [submenu release];
+ if (mitem) {
+ NSMenuItem *menuItem;
+ char *ts = remove_ampersand(mitem->text);
+ NSString *title = NSLocalizedString([NSString stringWithUTF8String:ts], nil);
+ free(ts);
+ submenu = [[NSMenu alloc] initWithTitle:(NSString*)title];
+ [submenu setAutoenablesItems:NO];
+
+ int cnt;
+ cnt = [mh numberOfItems];
+ cnt--;
+ menuItem = [mh itemAtIndex:cnt];
+ [menuItem setSubmenu:submenu];
+ [submenu release];
+ } else submenu = mh;
- while ( mm->text )
- {
+ while ( mm->text ) {
if (!mm->visible() ) { // skip invisible items and submenus
mm = mm->next(0);
continue;
}
- miCnt = [FLMenuItem addNewItem:mm menu:submenu];
+ miCnt = [FLMenuItem addNewItem:mm menu:submenu action:selector];
setMenuFlags( submenu, miCnt, mm );
setMenuShortcut( submenu, miCnt, mm );
- if ( mm->flags & FL_MENU_INACTIVE || mitem->flags & FL_MENU_INACTIVE) {
+ if ( mm->flags & FL_MENU_INACTIVE || (mitem && (mitem->flags & FL_MENU_INACTIVE))) {
NSMenuItem *item = [submenu itemAtIndex:miCnt];
[item setEnabled:NO];
}
@@ -304,12 +311,12 @@ static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *m
if ( mm->flags & FL_SUBMENU )
{
mm++;
- createSubMenu( submenu, mm, mm - 1 );
+ createSubMenu( submenu, mm, mm - 1, selector);
}
else if ( mm->flags & FL_SUBMENU_POINTER )
{
const Fl_Menu_Item *smm = (Fl_Menu_Item*)mm->user_data_;
- createSubMenu( submenu, smm, mm);
+ createSubMenu( submenu, smm, mm, selector);
}
if ( flags & FL_MENU_DIVIDER ) {
[submenu addItem:[NSMenuItem separatorItem]];
@@ -326,33 +333,12 @@ static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *m
static void convertToMenuBar(const Fl_Menu_Item *mm)
{
NSMenu *fl_system_menu = [NSApp mainMenu];
- int rank;
int count;//first, delete all existing system menus
count = [fl_system_menu numberOfItems];
for(int i = count - 1; i > 0; i--) {
[fl_system_menu removeItem:[fl_system_menu itemAtIndex:i]];
}
- //now convert FLTK stuff into MacOS menus
- for (;;)
- {
- if ( !mm || !mm->text )
- break;
- if (!mm->visible() ) { // skip invisible menus
- mm = mm->next(0);
- continue;
- }
- rank = [FLMenuItem addNewItem:mm menu:fl_system_menu];
-
- if ( mm->flags & FL_SUBMENU ) {
- mm++;
- createSubMenu(fl_system_menu, mm, mm - 1);
- }
- else if ( mm->flags & FL_SUBMENU_POINTER ) {
- const Fl_Menu_Item *smm = (Fl_Menu_Item*)mm->user_data_;
- createSubMenu(fl_system_menu, smm, mm);
- }
- mm++;
- }
+ if (mm) createSubMenu(fl_system_menu, mm, NULL, @selector(doCallback));
}
@@ -372,10 +358,15 @@ void Fl_Sys_Menu_Bar::menu(const Fl_Menu_Item *m)
/**
- * @brief add to the system menu bar a new menu item
+ * @brief Add a new menu item to the system menu bar.
*
- * add to the system menu bar a new menu item, with a title string, shortcut int,
- * callback, argument to the callback, and flags.
+ * @param label - new menu item's label
+ * @param shortcut - new menu item's integer shortcut (can be 0 for none, or e.g. FL_ALT+'x')
+ * @param cb - callback to be invoked when item selected (can be 0 for none, in which case the menubar's callback() can be used instead)
+ * @param user_data - argument to the callback
+ * @param flags - item's flags, e.g. ::FL_MENU_TOGGLE, etc.
+ *
+ * \returns the index into the menu() array, where the entry was added
*
* @see Fl_Menu_::add(const char* label, int shortcut, Fl_Callback *cb, void *user_data, int flags)
*/
@@ -389,7 +380,8 @@ int Fl_Sys_Menu_Bar::add(const char* label, int shortcut, Fl_Callback *cb, void
/**
* Forms-compatible procedure to add items to the system menu bar
-*
+ *
+ * \returns the index into the menu() array, where the entry was added
* @see Fl_Menu_::add(const char* str)
*/
int Fl_Sys_Menu_Bar::add(const char* str)
@@ -403,9 +395,10 @@ int Fl_Sys_Menu_Bar::add(const char* str)
/**
* @brief insert in the system menu bar a new menu item
*
- * insert in the system menu bar a new menu item, with a title string, shortcut int,
+ * Insert in the system menu bar a new menu item, with a title string, shortcut int,
* callback, argument to the callback, and flags.
*
+ * \returns the index into the menu() array, where the entry was inserted
* @see Fl_Menu_::insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data, int flags)
*/
int Fl_Sys_Menu_Bar::insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data, int flags)
@@ -432,11 +425,11 @@ int Fl_Sys_Menu_Bar::clear_submenu(int index)
/**
* @brief remove an item from the system menu bar
*
- * @param rank the rank of the item to remove
+ * @param index the index of the item to remove
*/
-void Fl_Sys_Menu_Bar::remove(int rank)
+void Fl_Sys_Menu_Bar::remove(int index)
{
- Fl_Menu_::remove(rank);
+ Fl_Menu_::remove(index);
update();
}
@@ -444,12 +437,12 @@ void Fl_Sys_Menu_Bar::remove(int rank)
/**
* @brief rename an item from the system menu bar
*
- * @param rank the rank of the item to rename
+ * @param index the index of the item to rename
* @param name the new item name as a UTF8 string
*/
-void Fl_Sys_Menu_Bar::replace(int rank, const char *name)
+void Fl_Sys_Menu_Bar::replace(int index, const char *name)
{
- Fl_Menu_::replace(rank, name);
+ Fl_Menu_::replace(index, name); // index
update();
}
@@ -489,6 +482,7 @@ Fl_Sys_Menu_Bar::Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l)
: Fl_Menu_Bar(x,y,w,h,l)
{
deactivate(); // don't let the old area take events
+ if (fl_sys_menu_bar) delete fl_sys_menu_bar;
fl_sys_menu_bar = this;
Fl::add_handler(process_sys_menu_shortcuts);
}
@@ -501,8 +495,48 @@ Fl_Sys_Menu_Bar::~Fl_Sys_Menu_Bar()
Fl::remove_handler(process_sys_menu_shortcuts);
}
+/** \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:
+ \verbatim
+ Fl_Mac_App_Menu::print = "Imprimer la fenêtre";
+ \endverbatim
+ \see \ref osissues_macos for another way to localization.
+ */
+
+
+/** Adds custom menu item(s) to the application menu of the system menu bar.
+ They are positioned after the "Print Front Window" item, or at its place
+ if it was removed with <tt>Fl_Mac_App_Menu::print = ""</tt>.
+ \param m zero-ending array of Fl_Menu_Item 's.
+ */
+void Fl_Mac_App_Menu::custom_application_menu_items(const Fl_Menu_Item *m)
+{
+ fl_open_display(); // create the system menu, if needed
+ custom_menu = new Fl_Menu_Bar(0,0,0,0);
+ custom_menu->menu(m);
+ NSMenu *menu = [[[NSApp mainMenu] itemAtIndex:0] submenu]; // the application menu
+ NSInteger to_rank;
+ if ([[menu itemAtIndex:2] action] != @selector(printPanel)) { // the 'Print' item was removed
+ [menu insertItem:[NSMenuItem separatorItem] atIndex:1];
+ to_rank = 2;
+ } else to_rank = 3; // after the "Print Front Window" item
+ NSInteger count = [menu numberOfItems];
+ createSubMenu(menu, m, NULL, @selector(customCallback)); // add new items at end of application menu
+ NSInteger count2 = [menu numberOfItems];
+ for (NSInteger i = count; i < count2; i++) { // move new items to their desired position in application menu
+ NSMenuItem *item = [menu itemAtIndex:i];
+ [item retain];
+ [menu removeItemAtIndex:i];
+ [menu insertItem:item atIndex:to_rank++];
+ [item release];
+ }
+}
#endif /* __APPLE__ */
//
-// End of "$Id: Fl_Sys_Menu_Bar.mm 10106 2014-02-19 16:02:56Z manolo $".
+// End of "$Id: Fl_Sys_Menu_Bar.mm 11786 2016-06-18 00:32:18Z greg.ercolano $".
//
diff --git a/src/Fl_Table.cxx b/src/Fl_Table.cxx
index 7e42b2e..76f794e 100644
--- a/src/Fl_Table.cxx
+++ b/src/Fl_Table.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Table.cxx 10225 2014-08-03 16:40:58Z greg.ercolano $"
+// "$Id: Fl_Table.cxx 11849 2016-07-29 09:23:44Z AlbrechtS $"
//
// Fl_Table -- A table widget
//
@@ -491,14 +491,14 @@ void Fl_Table::recalc_dimensions() {
int scrollsize = Fl::scrollbar_size();
#endif
// Second pass: Check for interference
- if ( !hideh & hidev ) { hidev = (( table_h - tih + scrollsize ) <= 0 ); }
- if ( !hidev & hideh ) { hideh = (( table_w - tiw + scrollsize ) <= 0 ); }
+ 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();
@@ -1289,8 +1289,8 @@ void Fl_Table::draw() {
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_UPFRAME) and hscrollbar hidden,
+ // 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(),
@@ -1314,5 +1314,5 @@ void Fl_Table::draw() {
}
//
-// End of "$Id: Fl_Table.cxx 10225 2014-08-03 16:40:58Z greg.ercolano $".
+// End of "$Id: Fl_Table.cxx 11849 2016-07-29 09:23:44Z AlbrechtS $".
//
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index 75d4458..1cebbbb 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Tabs.cxx 10122 2014-03-24 18:24:59Z greg.ercolano $"
+// "$Id: Fl_Tabs.cxx 11970 2016-09-23 14:03:40Z AlbrechtS $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -16,7 +16,6 @@
// http://www.fltk.org/str.php
//
-
// This is the "file card tabs" interface to allow you to put lots and lots
// of buttons and switches in a panel, as popularized by many toolkits.
@@ -42,7 +41,7 @@
// Return value is the index of the selected item.
int Fl_Tabs::tab_positions() {
- int nc = children();
+ const int nc = children();
if (nc != tab_count) {
clear_tab_positions();
if (nc) {
@@ -87,7 +86,7 @@ int Fl_Tabs::tab_positions() {
for (i = 0; i<nc; i++) {
if (tab_pos[i] >= i*EXTRASPACE) break;
tab_pos[i] = i*EXTRASPACE;
- int W = w()-1-EXTRASPACE*(children()-i) - tab_pos[i];
+ int W = w()-1-EXTRASPACE*(nc-i) - tab_pos[i];
if (tab_width[i] > W) tab_width[i] = W;
}
// adjust edges according to visiblity:
@@ -131,7 +130,7 @@ Fl_Widget *Fl_Tabs::which(int event_x, int event_y) {
}
if (event_x < x()) return 0;
Fl_Widget *ret = 0L;
- int nc = children();
+ const int nc = children();
tab_positions();
for (int i=0; i<nc; i++) {
if (event_x < x()+tab_pos[i+1]) {
@@ -174,7 +173,7 @@ int Fl_Tabs::handle(int event) {
o = which(Fl::event_x(), Fl::event_y());
if (event == FL_RELEASE) {
push(0);
- if (o && Fl::visible_focus() && Fl::focus()!=this) {
+ if (o && Fl::visible_focus() && Fl::focus()!=this) {
Fl::focus(this);
redraw_tabs();
}
@@ -201,7 +200,7 @@ int Fl_Tabs::handle(int event) {
return ret;
else if ( (H<0) && (Fl::event_y() < y()+h()+H) )
return ret;
- else {
+ else {
n = which(Fl::event_x(), Fl::event_y());
if (!n) n = this;
}
@@ -224,7 +223,8 @@ int Fl_Tabs::handle(int event) {
case FL_KEYBOARD:
switch (Fl::event_key()) {
case FL_Left:
- if (child(0)->visible()) 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));
@@ -232,7 +232,8 @@ int Fl_Tabs::handle(int event) {
do_callback();
return 1;
case FL_Right:
- if (child(children() - 1)->visible()) 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));
@@ -285,12 +286,13 @@ int Fl_Tabs::push(Fl_Widget *o) {
return 1;
}
-/**
- Gets the currently visible widget/tab.
- The value() is the first visible child (or the last child if none
- are visible) and this also hides any other children.
- This allows the tabs to be deleted, moved to other groups, and
- show()/hide() called without it screwing up.
+/**
+ Gets the currently visible widget/tab.
+
+ The value() is the first visible child (or the last child if none
+ are visible) and this also hides any other children.
+ This allows the tabs to be deleted, moved to other groups, and
+ show()/hide() called without it screwing up.
*/
Fl_Widget* Fl_Tabs::value() {
Fl_Widget* v = 0;
@@ -350,7 +352,7 @@ void Fl_Tabs::draw() {
if (v) update_child(*v);
}
if (damage() & (FL_DAMAGE_SCROLL|FL_DAMAGE_ALL)) {
- int nc = children();
+ const int nc = children();
int selected = tab_positions();
int i;
Fl_Widget*const* a = array();
@@ -396,7 +398,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
Fl_Color oc = o->labelcolor();
// Draw the label using the current color...
- o->labelcolor(sel ? labelcolor() : o->labelcolor());
+ o->labelcolor(sel ? labelcolor() : o->labelcolor());
o->draw_label(x1, y() + yofs, W, H - yofs, FL_ALIGN_CENTER);
// Restore the original label color...
@@ -437,30 +439,36 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
}
/**
- Creates a new Fl_Tabs widget using the given position, size,
- and label string. The default boxtype is FL_THIN_UP_BOX.
-
- Use add(Fl_Widget*) to add each child, which are usually
- Fl_Group widgets. The children should be sized to stay
- away from the top or bottom edge of the Fl_Tabs widget,
- which is where the tabs will be drawn.
-
- All children of Fl_Tabs should have the same size and exactly fit on top of
- each other. They should only leave space above or below where that tabs will
- go, but not on the sides. If the first child of Fl_Tabs is set to
- "resizable()", the riders will not resize when the tabs are resized.
-
- The destructor <I>also deletes all the children</I>. This
- allows a whole tree to be deleted at once, without having to
- keep a pointer to all the children in the user code. A kludge
- has been done so the Fl_Tabs and all of its children
- can be automatic (local) variables, but you must declare the
- Fl_Tabs widget <I>first</I> so that it is destroyed last.
+ Creates a new Fl_Tabs widget using the given position, size,
+ and label string. The default boxtype is FL_THIN_UP_BOX.
+
+ Use add(Fl_Widget*) to add each child, which are usually
+ Fl_Group widgets. The children should be sized to stay
+ away from the top or bottom edge of the Fl_Tabs widget,
+ which is where the tabs will be drawn.
+
+ All children of Fl_Tabs should have the same size and exactly fit on top of
+ each other. They should only leave space above or below where the tabs will
+ go, but not on the sides. If the first child of Fl_Tabs is set to
+ "resizable()", the riders will not resize when the tabs are resized.
+
+ The destructor <I>also deletes all the children</I>. This
+ allows a whole tree to be deleted at once, without having to
+ keep a pointer to all the children in the user code. A kludge
+ has been done so the Fl_Tabs and all of its children
+ can be automatic (local) variables, but you must declare the
+ Fl_Tabs widget <I>first</I> so that it is destroyed last.
*/
Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
Fl_Group(X,Y,W,H,l)
{
box(FL_THIN_UP_BOX);
+#if FLTK_ABI_VERSION >= 10304
+ // NEW (nothing)
+#else
+ // OLD (init to prevent 'unused' warnings) -- STR #3169
+ value_ = 0; // NOTE: this member unused -- STR #3169
+#endif
push_ = 0;
tab_pos = 0;
tab_width = 0;
@@ -472,27 +480,27 @@ Fl_Tabs::~Fl_Tabs() {
}
/**
- Returns the position and size available to be used by its children.
+ Returns the position and size available to be used by its children.
- If there isn't any child yet the \p tabh parameter will be used to
- calculate the return values. This assumes that the children's labelsize
- is the same as the Fl_Tabs' labelsize and adds a small border.
+ If there isn't any child yet the \p tabh parameter will be used to
+ calculate the return values. This assumes that the children's labelsize
+ is the same as the Fl_Tabs' labelsize and adds a small border.
- If there are already children, the values of child(0) are returned, and
- \p tabh is ignored.
+ If there are already children, the values of child(0) are returned, and
+ \p tabh is ignored.
- \note Children should always use the same positions and sizes.
+ \note Children should always use the same positions and sizes.
- \p tabh can be one of
- \li 0: calculate label size, tabs on top
- \li -1: calculate label size, tabs on bottom
- \li > 0: use given \p tabh value, tabs on top (height = tabh)
- \li < -1: use given \p tabh value, tabs on bottom (height = -tabh)
+ \p tabh can be one of
+ \li 0: calculate label size, tabs on top
+ \li -1: calculate label size, tabs on bottom
+ \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) {
@@ -540,5 +548,5 @@ void Fl_Tabs::clear_tab_positions() {
}
//
-// End of "$Id: Fl_Tabs.cxx 10122 2014-03-24 18:24:59Z greg.ercolano $".
+// End of "$Id: Fl_Tabs.cxx 11970 2016-09-23 14:03:40Z AlbrechtS $".
//
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 0255fe8..3ec4e57 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -1,7 +1,7 @@
//
-// "$Id: Fl_Text_Display.cxx 10416 2014-10-30 12:35:36Z AlbrechtS $"
+// "$Id: Fl_Text_Display.cxx 12000 2016-10-01 21:20:18Z greg.ercolano $"
//
-// Copyright 2001-2014 by Bill Spitzak and others.
+// Copyright 2001-2016 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
@@ -30,11 +30,23 @@
#include <FL/Fl_Text_Buffer.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Window.H>
-#include <FL/Fl_Printer.H>
#undef min
#undef max
+// #define DEBUG
+// #define DEBUG2
+
+#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.
+// If not defined and the vertical scrollbar is aligned left, then the
+// scrollbar is positioned at the left border and the line numbers are
+// drawn between the scrollbar (left) and the text area (right).
+// If the vertical scrollbar is aligned right, then the line number
+// position is not affected by this definition.
+
// Text area margins. Left & right margins should be at least 3 so that
// there is some room for the overhanging parts of the cursor!
#define TOP_MARGIN 1
@@ -193,7 +205,7 @@ Fl_Text_Display::~Fl_Text_Display() {
/**
Set width of screen area for line numbers.
Use to also enable/disable line numbers.
- A value of 0 disables line numbering, values >0 enables them.
+ 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)
*/
@@ -466,55 +478,96 @@ int Fl_Text_Display::longest_vline() const {
\param X, Y, W, H new position and size of this widget
*/
void Fl_Text_Display::resize(int X, int Y, int W, int H) {
-#ifdef DEBUG
+
+#ifdef DEBUG2
+ printf("\n");
printf("Fl_Text_Display::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
-#endif // DEBUG
- const int oldWidth = w();
-#ifdef DEBUG
- printf(" oldWidth=%d, mContinuousWrap=%d, mWrapMarginPix=%d\n", oldWidth, mContinuousWrap, mWrapMarginPix);
-#endif // DEBUG
+ 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()));
+ 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);
+ printf(" mContinuousWrap=%d, mWrapMarginPix=%d\n",
+ mContinuousWrap, mWrapMarginPix);
+ fflush(stdout);
+#endif // DEBUG2
+
Fl_Widget::resize(X,Y,W,H);
if (!buffer()) return;
+
+ // did we have scrollbars initially?
+ unsigned int hscrollbarvisible = mHScrollBar->visible();
+ unsigned int vscrollbarvisible = mVScrollBar->visible();
+
+ int oldTAWidth = text_area.w;
+
X += Fl::box_dx(box());
Y += Fl::box_dy(box());
W -= Fl::box_dw(box());
H -= Fl::box_dh(box());
- text_area.x = X+LEFT_MARGIN;
- text_area.y = Y+TOP_MARGIN;
- text_area.w = W-LEFT_MARGIN-RIGHT_MARGIN;
- text_area.h = H-TOP_MARGIN-BOTTOM_MARGIN;
- const int oldTAWidth = text_area.w;
- int i;
+ text_area.x = X + LEFT_MARGIN + mLineNumWidth;
+ text_area.y = Y + TOP_MARGIN;
+ text_area.w = W - LEFT_MARGIN - RIGHT_MARGIN - mLineNumWidth;
+ text_area.h = H - TOP_MARGIN - BOTTOM_MARGIN;
- /* Find the new maximum font height for this text display */
+ // Find the new maximum font height for this text display
+ int i;
for (i = 0, mMaxsize = fl_height(textfont(), textsize()); i < mNStyles; i++)
mMaxsize = max(mMaxsize, fl_height(mStyleTable[i].font, mStyleTable[i].size));
- // did we have scrollbars initially?
- unsigned int hscrollbarvisible = mHScrollBar->visible();
- unsigned int vscrollbarvisible = mVScrollBar->visible();
-
// try without scrollbars first
mVScrollBar->clear_visible();
mHScrollBar->clear_visible();
+#if (1) // optimization (experimental - seems to work well)
+
+ // Optimization: if the number of lines in the buffer does not fit in
+ // the display area, then we need a vertical scrollbar regardless of
+ // word wrapping. If we switch it on here, this saves one line counting
+ // run in wrap mode in the loop below ("... again ..."). This is important
+ // for large buffers that suffer from slow calculations of character width
+ // to determine line wrapping.
+
+ if (mContinuousWrap && !mWrapMarginPix) {
+
+ int nvlines = (text_area.h + mMaxsize - 1) / mMaxsize;
+ int nlines = buffer()->count_lines(0,buffer()->length());
+ if (nvlines < 1) nvlines = 1;
+ if (nlines >= nvlines-1) {
+ mVScrollBar->set_visible(); // we need a vertical scrollbar
+ text_area.w -= scrollbar_width();
+ }
+ }
+
+#endif // optimization
+
for (int again = 1; again;) {
again = 0;
/* In continuous wrap mode, a change in width affects the total number of
lines in the buffer, and can leave the top line number incorrect, and
the top character no longer pointing at a valid line start */
- if (mContinuousWrap && !mWrapMarginPix && (W!=oldWidth || text_area.w!=oldTAWidth)) {
+
+#ifdef DEBUG2
+ printf("*** again ... text_area.w = %d, oldTAWidth = %d, diff = %d\n",
+ text_area.w, oldTAWidth, text_area.w - oldTAWidth);
+#endif // DEBUG2
+
+ if (mContinuousWrap && !mWrapMarginPix && text_area.w != oldTAWidth) {
+
int oldFirstChar = mFirstChar;
mNBufferLines = count_lines(0, buffer()->length(), true);
mFirstChar = line_start(mFirstChar);
mTopLineNum = count_lines(0, mFirstChar, true)+1;
absolute_top_line_number(oldFirstChar);
-#ifdef DEBUG
+#ifdef DEBUG2
printf(" mNBufferLines=%d\n", mNBufferLines);
-#endif // DEBUG
+#endif // DEBUG2
+
}
+ oldTAWidth = text_area.w;
+
/* reallocate and update the line starts array, which may have changed
size and / or contents. */
int nvlines = (text_area.h + mMaxsize - 1) / mMaxsize;
@@ -530,25 +583,16 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
// figure the scrollbars
if (scrollbar_width()) {
+
/* Decide if the vertical scrollbar needs to be visible */
- uchar vbvis = mVScrollBar->visible();
- if (scrollbar_align() & (FL_ALIGN_LEFT|FL_ALIGN_RIGHT) &&
- mNBufferLines >= mNVisibleLines - 1)
+ if (!mVScrollBar->visible() &&
+ scrollbar_align() & (FL_ALIGN_LEFT|FL_ALIGN_RIGHT) &&
+ mNBufferLines >= mNVisibleLines-1)
{
- mVScrollBar->set_visible();
- if (scrollbar_align() & FL_ALIGN_LEFT) {
- text_area.x = X+scrollbar_width()+LEFT_MARGIN;
- text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN;
- mVScrollBar->resize(X, text_area.y-TOP_MARGIN, scrollbar_width(),
- text_area.h+TOP_MARGIN+BOTTOM_MARGIN);
- } else {
- text_area.x = X+LEFT_MARGIN;
- text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN;
- mVScrollBar->resize(X+W-scrollbar_width(), text_area.y-TOP_MARGIN,
- scrollbar_width(), text_area.h+TOP_MARGIN+BOTTOM_MARGIN);
- }
+ mVScrollBar->set_visible();
+ text_area.w -= scrollbar_width();
+ again = 1;
}
- if (vbvis != mVScrollBar->visible()) again = 1;
/*
Decide if the horizontal scrollbar needs to be visible. If the text
@@ -572,35 +616,66 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
/* WAS: Suggestion: Try turning the horizontal scrollbar on when
you first see a line that is too wide in the window, but then
don't turn it off (ie mix both of your solutions). */
- if (scrollbar_align() & (FL_ALIGN_TOP|FL_ALIGN_BOTTOM) &&
+
+ if (!mHScrollBar->visible() &&
+ scrollbar_align() & (FL_ALIGN_TOP|FL_ALIGN_BOTTOM) &&
(mVScrollBar->visible() || longest_vline() > text_area.w))
{
char wrap_at_bounds = mContinuousWrap && (mWrapMarginPix<text_area.w);
- if (!mHScrollBar->visible() && !wrap_at_bounds) {
+ if (!wrap_at_bounds) {
mHScrollBar->set_visible();
+ text_area.h -= scrollbar_width();
again = 1; // loop again to see if we now need vert. & recalc sizes
}
- if (scrollbar_align() & FL_ALIGN_TOP) {
- text_area.y = Y + scrollbar_width()+TOP_MARGIN;
- text_area.h = H - (wrap_at_bounds?0:scrollbar_width())-TOP_MARGIN-BOTTOM_MARGIN;
- mHScrollBar->resize(text_area.x-LEFT_MARGIN, Y,
- text_area.w+LEFT_MARGIN+RIGHT_MARGIN, scrollbar_width());
- } else {
- text_area.y = Y+TOP_MARGIN;
- text_area.h = H - (wrap_at_bounds?0:scrollbar_width())-TOP_MARGIN-BOTTOM_MARGIN;
- mHScrollBar->resize(text_area.x-LEFT_MARGIN, Y+H-scrollbar_width(),
- text_area.w+LEFT_MARGIN+RIGHT_MARGIN, scrollbar_width());
- }
}
}
+ } // (... again ...)
+
+ // Calculate text area position, dependent on scrollbars and line numbers.
+ // Note: width and height have been calculated above.
+ text_area.x = X + mLineNumWidth + LEFT_MARGIN;
+ if (mVScrollBar->visible() && scrollbar_align() & FL_ALIGN_LEFT)
+ text_area.x += scrollbar_width();
+
+ text_area.y = Y + TOP_MARGIN;
+ if (mHScrollBar->visible() &&
+ scrollbar_align() & FL_ALIGN_TOP)
+ text_area.y += scrollbar_width();
+
+ // position and resize scrollbars
+ if (mVScrollBar->visible()) {
+ if (scrollbar_align() & FL_ALIGN_LEFT) {
+#ifdef LINENUM_LEFT_OF_VSCROLL
+ mVScrollBar->resize(text_area.x - LEFT_MARGIN - scrollbar_width(),
+#else
+ mVScrollBar->resize(X,
+#endif
+ text_area.y - TOP_MARGIN,
+ scrollbar_width(),
+ text_area.h + TOP_MARGIN + BOTTOM_MARGIN);
+ } else {
+ mVScrollBar->resize(X+W-scrollbar_width(),
+ text_area.y - TOP_MARGIN,
+ scrollbar_width(),
+ text_area.h + TOP_MARGIN + BOTTOM_MARGIN);
+ }
}
- // add linenum width to the text area - LZA / STR#2621
- if (mLineNumWidth > 0) {
- text_area.x += mLineNumWidth;
- text_area.w -= mLineNumWidth;
+ if (mHScrollBar->visible()) {
+ if (scrollbar_align() & FL_ALIGN_TOP) {
+ mHScrollBar->resize(text_area.x - LEFT_MARGIN,
+ Y,
+ text_area.w + LEFT_MARGIN + RIGHT_MARGIN,
+ scrollbar_width());
+ } else {
+ mHScrollBar->resize(text_area.x - LEFT_MARGIN,
+ Y + H - scrollbar_width(),
+ text_area.w + LEFT_MARGIN + RIGHT_MARGIN,
+ scrollbar_width());
+ }
}
+
// user request to change viewport
if (mTopLineNumHint != mTopLineNum || mHorizOffsetHint != mHorizOffset)
scroll_(mTopLineNumHint, mHorizOffsetHint);
@@ -1002,7 +1077,9 @@ int Fl_Text_Display::position_to_xy( int pos, int* X, int* Y ) const {
int lineStartPos, fontHeight;
int visLineNum;
/* If position is not displayed, return false */
- if (pos < mFirstChar || (pos > mLastChar && !empty_vlines())) {
+ if ((pos < mFirstChar) ||
+ (pos > mLastChar && !empty_vlines()) ||
+ (pos > buffer()->length()) ) { // STR #3231
return (*X=*Y=0); // make sure X & Y are set when it is out of view
}
@@ -1317,10 +1394,10 @@ int Fl_Text_Display::move_down() {
/**
\brief Count the number of lines between two positions.
- Same as BufCountLines, but takes into account wrapping if wrapping is
- turned on. If the caller knows that \p startPos is at a line start, it
- can pass \p startPosIsLineStart as True to make the call more efficient
- by avoiding the additional step of scanning back to the last newline.
+ Same as Fl_Text_Buffer::count_lines(), but takes into account wrapping if
+ wrapping is turned on. If the caller knows that \p startPos is at a line
+ start, it can pass \p startPosIsLineStart as True to make the call more
+ efficient by avoiding the additional step of scanning back to the last newline.
\param startPos index to first character
\param endPos index after last character
@@ -1339,7 +1416,7 @@ int Fl_Text_Display::count_lines(int startPos, int endPos,
startPos, endPos, startPosIsLineStart);
#endif // DEBUG
- /* If we're not wrapping use simple (and more efficient) BufCountLines */
+ /* If we're not wrapping use simple (and more efficient) Fl_Text_Buffer::count_lines() */
if (!mContinuousWrap)
return buffer()->count_lines(startPos, endPos);
@@ -2150,7 +2227,7 @@ void Fl_Text_Display::draw_string(int style,
if (Fl::focus() == (Fl_Widget*)this) background = fl_color_average(color(), selection_color(), 0.5f);
else background = fl_color_average(color(), selection_color(), 0.6f);
} else background = color();
- foreground = fl_contrast(styleRec->color, background);
+ foreground = (style & PRIMARY_MASK) ? fl_contrast(styleRec->color, background) : styleRec->color;
} else if (style & PRIMARY_MASK) {
if (Fl::focus() == (Fl_Widget*)this) background = selection_color();
else background = fl_color_average(color(), selection_color(), 0.4f);
@@ -2164,6 +2241,11 @@ void Fl_Text_Display::draw_string(int style,
background = color();
}
+ if ( !active_r() ) {
+ foreground = fl_inactive(foreground);
+ background = fl_inactive(background);
+ }
+
if (!(style & TEXT_ONLY_MASK)) {
fl_color( background );
fl_rectf( X, Y, toX - X, mMaxsize );
@@ -2222,21 +2304,23 @@ void Fl_Text_Display::clear_rect(int style,
if ( width == 0 )
return;
+ Fl_Color c;
if (style & PRIMARY_MASK) {
if (Fl::focus()==(Fl_Widget*)this) {
- fl_color(selection_color());
+ c = selection_color();
} else {
- fl_color(fl_color_average(color(), selection_color(), 0.4f));
+ c = fl_color_average(color(), selection_color(), 0.4f);
}
} else if (style & HIGHLIGHT_MASK) {
if (Fl::focus()==(Fl_Widget*)this) {
- fl_color(fl_color_average(color(), selection_color(), 0.5f));
+ c = fl_color_average(color(), selection_color(), 0.5f);
} else {
- fl_color(fl_color_average(color(), selection_color(), 0.6f));
+ c = fl_color_average(color(), selection_color(), 0.6f);
}
} else {
- fl_color( color() );
+ c = color();
}
+ fl_color(active_r() ? c : fl_inactive(c));
fl_rectf( X, Y, width, height );
}
@@ -2790,7 +2874,7 @@ int Fl_Text_Display::scroll_(int topLineNum, int horizOffset) {
\brief Update vertical scrollbar.
Update the minimum, maximum, slider size, page increment, and value
- for vertical scrollbar.
+ for the vertical scrollbar.
*/
void Fl_Text_Display::update_v_scrollbar() {
/* The vertical scrollbar value and slider size directly represent the top
@@ -2809,7 +2893,7 @@ void Fl_Text_Display::update_v_scrollbar() {
/**
- \brief Update vertical scrollbar.
+ \brief Update horizontal scrollbar.
Update the minimum, maximum, slider size, page increment, and value
for the horizontal scrollbar.
@@ -2822,7 +2906,7 @@ void Fl_Text_Display::update_h_scrollbar() {
/**
- \brief Callbacks for drag or valueChanged on scrollbars.
+ \brief Callbacks for drag or valueChanged on vertical scrollbar.
*/
void Fl_Text_Display::v_scrollbar_cb(Fl_Scrollbar* b, Fl_Text_Display* textD) {
if (b->value() == textD->mTopLineNum) return;
@@ -2832,7 +2916,7 @@ void Fl_Text_Display::v_scrollbar_cb(Fl_Scrollbar* b, Fl_Text_Display* textD) {
/**
- \brief Callbacks for drag or valueChanged on scrollbars.
+ \brief Callbacks for drag or valueChanged on horizontal scrollbar.
*/
void Fl_Text_Display::h_scrollbar_cb(Fl_Scrollbar* b, Fl_Text_Display* textD) {
if (b->value() == textD->mHorizOffset) return;
@@ -2857,26 +2941,36 @@ void Fl_Text_Display::draw_line_numbers(bool /*clearAll*/) {
int Y, line, visLine, lineStart;
char lineNumString[16];
int lineHeight = mMaxsize;
+ int isactive = active_r() ? 1 : 0;
// Don't draw if lineNumWidth == 0 (line numbers are hidden),
// or widget is not yet realized
if (mLineNumWidth <= 0 || !visible_r())
return;
- // Make sure we reset clipping range for line number's GC;
- // it may be shared (e.g. if line numbers and text have same color)
- // and therefore clipping ranges may be invalid.
- int xoff = Fl::box_dx(box());
+ // Make sure we set the correct clipping range for line numbers.
+ // Take scrollbars and positions into account.
int hscroll_h = mHScrollBar->visible() ? mHScrollBar->h() : 0;
+ int xoff = Fl::box_dx(box());
+ int yoff = Fl::box_dy(box()) + ((scrollbar_align()&FL_ALIGN_TOP)?hscroll_h:0);
+
+#ifndef LINENUM_LEFT_OF_VSCROLL
+ int vscroll_w = mVScrollBar->visible() ? mVScrollBar->w() : 0;
+ if (scrollbar_align()&FL_ALIGN_LEFT)
+ xoff += vscroll_w;
+#endif
+
+ Fl_Color fgcolor = isactive ? linenumber_fgcolor() : fl_inactive(linenumber_fgcolor());
+ Fl_Color bgcolor = isactive ? linenumber_bgcolor() : fl_inactive(linenumber_bgcolor());
fl_push_clip(x() + xoff,
- y() + Fl::box_dy(box()),
- mLineNumWidth - xoff,
- h() - Fl::box_dh(box()) - hscroll_h);
+ y() + yoff,
+ mLineNumWidth,
+ h() - Fl::box_dw(box()) - hscroll_h);
{
// Set background color for line number area -- LZA / STR# 2621
// Erase background
- fl_color(linenumber_bgcolor());
- fl_rectf(x(), y(), mLineNumWidth, h());
+ fl_color(bgcolor);
+ fl_rectf(x()+xoff, y(), mLineNumWidth, h());
// Draw separator line
//fl_color(180,180,180);
@@ -2885,18 +2979,18 @@ void Fl_Text_Display::draw_line_numbers(bool /*clearAll*/) {
// Draw line number text
fl_font(linenumber_font(), linenumber_size());
- Y = y();
+ Y = y() + yoff;
line = get_absolute_top_line_number();
// set font color for line numbers
- fl_color(linenumber_fgcolor());
+ fl_color(fgcolor);
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 + 3,
- ww = mLineNumWidth - xoff - (3*2),
+ ww = mLineNumWidth - (3*2),
hh = lineHeight;
fl_draw(lineNumString, xx, yy, ww, hh, linenumber_align(), 0, 0);
//DEBUG fl_rect(xx, yy, ww, hh);
@@ -3588,16 +3682,19 @@ void Fl_Text_Display::draw(void) {
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());
+
// draw the non-text, non-scrollbar areas.
if (damage() & FL_DAMAGE_ALL) {
// printf("drawing all (box = %d)\n", box());
if (Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) {
// if to printer, draw the background
- fl_rectf(text_area.x, text_area.y, text_area.w, text_area.h, color() );
+ fl_rectf(text_area.x, text_area.y, text_area.w, text_area.h, bgcolor);
}
// draw the box()
int W = w(), H = h();
- draw_box(box(), x(), y(), W, H, color());
+ draw_box(box(), x(), y(), W, H, bgcolor);
if (mHScrollBar->visible())
W -= scrollbar_width();
@@ -3607,20 +3704,20 @@ void Fl_Text_Display::draw(void) {
// left margin
fl_rectf(text_area.x-LEFT_MARGIN, text_area.y-TOP_MARGIN,
LEFT_MARGIN, text_area.h+TOP_MARGIN+BOTTOM_MARGIN,
- color());
+ bgcolor);
// right margin
fl_rectf(text_area.x+text_area.w, text_area.y-TOP_MARGIN,
RIGHT_MARGIN, text_area.h+TOP_MARGIN+BOTTOM_MARGIN,
- color());
+ bgcolor);
// top margin
fl_rectf(text_area.x, text_area.y-TOP_MARGIN,
- text_area.w, TOP_MARGIN, color());
+ text_area.w, TOP_MARGIN, bgcolor);
// bottom margin
fl_rectf(text_area.x, text_area.y+text_area.h,
- text_area.w, BOTTOM_MARGIN, color());
+ text_area.w, BOTTOM_MARGIN, bgcolor);
// draw that little box in the corner of the scrollbars
if (mVScrollBar->visible() && mHScrollBar->visible())
@@ -3637,9 +3734,9 @@ void Fl_Text_Display::draw(void) {
text_area.w+LEFT_MARGIN+RIGHT_MARGIN,
text_area.h);
fl_rectf(text_area.x-LEFT_MARGIN, mCursorOldY,
- LEFT_MARGIN, mMaxsize, color());
+ LEFT_MARGIN, mMaxsize, bgcolor);
fl_rectf(text_area.x+text_area.w, mCursorOldY,
- RIGHT_MARGIN, mMaxsize, color());
+ RIGHT_MARGIN, mMaxsize, bgcolor);
fl_pop_clip();
}
@@ -3695,7 +3792,7 @@ void Fl_Text_Display::draw(void) {
text_area.w+LEFT_MARGIN+RIGHT_MARGIN,
text_area.h);
- int X, Y;
+ int X = 0, Y = 0;
if (position_to_xy(mCursorPos, &X, &Y)) {
draw_cursor(X, Y);
mCursorOldY = Y;
@@ -3863,7 +3960,11 @@ int Fl_Text_Display::handle(int event) {
if (dragType==DRAG_START_DND) {
if (!Fl::event_is_click() && Fl::dnd_text_ops()) {
const char* copy = buffer()->selection_text();
+#ifdef __APPLE__
+ Fl_X::dnd(1);
+#else
Fl::dnd();
+#endif
free((void*)copy);
}
return 1;
@@ -4030,8 +4131,6 @@ double Fl_Text_Display::col_to_x(double col) const
}
-
-
//
-// End of "$Id: Fl_Text_Display.cxx 10416 2014-10-30 12:35:36Z AlbrechtS $".
+// End of "$Id: Fl_Text_Display.cxx 12000 2016-10-01 21:20:18Z greg.ercolano $".
//
diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx
index 721b31a..595a2d0 100644
--- a/src/Fl_Text_Editor.cxx
+++ b/src/Fl_Text_Editor.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Text_Editor.cxx 10031 2013-12-13 16:28:38Z manolo $"
+// "$Id: Fl_Text_Editor.cxx 11808 2016-07-14 18:48:43Z greg.ercolano $"
//
// Copyright 2001-2010 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@@ -172,7 +172,14 @@ void Fl_Text_Editor::add_default_key_bindings(Key_Binding** list) {
}
/** Returns the function associated with a key binding.*/
-Fl_Text_Editor::Key_Func Fl_Text_Editor::bound_key_function(int key, int state, Key_Binding* list) {
+#if FLTK_ABI_VERSION < 10304
+// OLD - non-const
+Fl_Text_Editor::Key_Func Fl_Text_Editor::bound_key_function(int key, int state, Key_Binding* list)
+#else
+// NEW - const (STR#3306)
+Fl_Text_Editor::Key_Func Fl_Text_Editor::bound_key_function(int key, int state, Key_Binding* list) const
+#endif
+{
Key_Binding* cur;
for (cur = list; cur; cur = cur->next)
if (cur->key == key)
@@ -192,7 +199,13 @@ void Fl_Text_Editor::remove_all_key_bindings(Key_Binding** list) {
*list = 0;
}
-/** Removes the key binding associated with the key "key" of state "state" */
+/** Removes the key binding associated with the key \p key of state \p state
+ from the Key_Binding list \p list.
+
+ This can be used in derived classes to remove global key bindings
+ by using the global (static) Key_Binding list
+ Fl_Text_Editor::global_key_bindings.
+*/
void Fl_Text_Editor::remove_key_binding(int key, int state, Key_Binding** list) {
Key_Binding *cur, *last = 0;
for (cur = *list; cur; last = cur, cur = cur->next)
@@ -202,7 +215,14 @@ void Fl_Text_Editor::remove_key_binding(int key, int state, Key_Binding** list)
else *list = cur->next;
delete cur;
}
-/** Adds a key of state "state" with the function "function" */
+
+/** Adds a \p key of state \p state with the function \p function to an
+ arbitrary key binding list \p list.
+
+ This can be used in derived classes to add global key bindings
+ by using the global (static) Key_Binding list
+ Fl_Text_Editor::global_key_bindings.
+*/
void Fl_Text_Editor::add_key_binding(int key, int state, Key_Func function,
Key_Binding** list) {
Key_Binding* kb = new Key_Binding;
@@ -222,7 +242,9 @@ static void kill_selection(Fl_Text_Editor* e) {
}
}
-/** Inserts the text associated with the key */
+/** Inserts the text associated with key \p 'c' in editor \p 'e'.
+ Honors the current selection and insert/overstrike mode.
+*/
int Fl_Text_Editor::kf_default(int c, Fl_Text_Editor* e) {
// FIXME: this function is a mess! Fix this!
if (!c || (!isprint(c) && c != '\t')) return 0;
@@ -237,11 +259,22 @@ int Fl_Text_Editor::kf_default(int c, Fl_Text_Editor* e) {
return 1;
}
-/** Ignores the keypress */
+/** Ignores the key \p 'c' in editor \p 'e'.
+ This method can be used as a keyboard binding to disable a key
+ that might otherwise be handled or entered as text.
+
+ An example would be disabling FL_Escape, so that it isn't added
+ to the buffer when invoked by the user.
+*/
int Fl_Text_Editor::kf_ignore(int, Fl_Text_Editor*) {
return 0; // don't handle
}
-/** Does a backspace in the current buffer.*/
+
+/** Does a backspace for key \p 'c' in the current buffer of editor \p 'e'.
+ Any current selection is deleted.
+ Otherwise, the character left is deleted and the cursor moved.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_backspace(int, Fl_Text_Editor* e) {
if (!e->buffer()->selected() && e->move_left()) {
int p1 = e->insert_position();
@@ -255,7 +288,9 @@ int Fl_Text_Editor::kf_backspace(int, Fl_Text_Editor* e) {
return 1;
}
-/** Inserts a newline at the current cursor position */
+/** Inserts a newline for key \p 'c' at the current cursor position in editor \p 'e'.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_enter(int, Fl_Text_Editor* e) {
kill_selection(e);
e->insert("\n");
@@ -266,7 +301,19 @@ int Fl_Text_Editor::kf_enter(int, Fl_Text_Editor* e) {
}
extern void fl_text_drag_me(int pos, Fl_Text_Display* d);
-/** Moves the text cursor in the direction indicated by key c.*/
+/** Moves the text cursor in the direction indicated by key \p 'c' in editor \p 'e'.
+ Supported values for 'c' are currently:
+ \code
+ FL_Home -- moves the cursor to the beginning of the current line
+ FL_End -- moves the cursor to the end of the current line
+ FL_Left -- moves the cursor left one character
+ FL_Right -- moves the cursor right one character
+ FL_Up -- moves the cursor up one line
+ FL_Down -- moves the cursor down one line
+ FL_Page_Up -- moves the cursor up one page
+ FL_Page_Down -- moves the cursor down one page
+ \endcode
+*/
int Fl_Text_Editor::kf_move(int c, Fl_Text_Editor* e) {
int i;
int selected = e->buffer()->selected();
@@ -304,7 +351,9 @@ int Fl_Text_Editor::kf_move(int c, Fl_Text_Editor* e) {
return 1;
}
-/** Extends the current selection in the direction of key c.*/
+/** Extends the current selection in the direction of key \p 'c' in editor \p 'e'.
+ \see kf_move()
+*/
int Fl_Text_Editor::kf_shift_move(int c, Fl_Text_Editor* e) {
kf_move(c, e);
fl_text_drag_me(e->insert_position(), e);
@@ -315,7 +364,20 @@ int Fl_Text_Editor::kf_shift_move(int c, Fl_Text_Editor* e) {
}
return 1;
}
-/** Moves the current text cursor in the direction indicated by control key */
+
+/** Moves the current text cursor in the direction indicated by control key \p 'c' in editor \p 'e'.
+ Supported values for 'c' are currently:
+ \code
+ FL_Home -- moves the cursor to the beginning of the document
+ FL_End -- moves the cursor to the end of the document
+ FL_Left -- moves the cursor left one word
+ FL_Right -- moves the cursor right one word
+ FL_Up -- scrolls up one line, without moving cursor
+ FL_Down -- scrolls down one line, without moving cursor
+ FL_Page_Up -- moves the cursor to the beginning of the top line on the current page
+ FL_Page_Down -- moves the cursor to the beginning of the last line on the current page
+ \endcode
+*/
int Fl_Text_Editor::kf_ctrl_move(int c, Fl_Text_Editor* e) {
if (!e->buffer()->selected())
e->dragPos = e->insert_position();
@@ -355,7 +417,15 @@ int Fl_Text_Editor::kf_ctrl_move(int c, Fl_Text_Editor* e) {
return 1;
}
-/** Moves the current text cursor in the direction indicated by meta key */
+/** Moves the current text cursor in the direction indicated by meta key \p 'c' in editor \p 'e'.
+ Supported values for 'c' are currently:
+ \code
+ FL_Up -- moves cursor to the beginning of the current document
+ FL_Down -- moves cursor to the end of the current document
+ FL_Left -- moves the cursor to the beginning of the current line
+ FL_Right -- moves the cursor to the end of the current line
+ \endcode
+*/
int Fl_Text_Editor::kf_meta_move(int c, Fl_Text_Editor* e) {
if (!e->buffer()->selected())
e->dragPos = e->insert_position();
@@ -383,65 +453,99 @@ int Fl_Text_Editor::kf_meta_move(int c, Fl_Text_Editor* e) {
return 1;
}
-/** Extends the current selection in the direction indicated by meta key c. */
+/** Extends the current selection in the direction indicated by meta key \p 'c' in editor \p 'e'.
+ \see kf_meta_move().
+*/
int Fl_Text_Editor::kf_m_s_move(int c, Fl_Text_Editor* e) {
kf_meta_move(c, e);
fl_text_drag_me(e->insert_position(), e);
return 1;
}
-/** Extends the current selection in the direction indicated by control key c. */
+/** Extends the current selection in the direction indicated by control key \p 'c' in editor \p 'e'.
+ \see kf_ctrl_move().
+*/
int Fl_Text_Editor::kf_c_s_move(int c, Fl_Text_Editor* e) {
kf_ctrl_move(c, e);
fl_text_drag_me(e->insert_position(), e);
return 1;
}
-/** Moves the text cursor to the beginning of the current line.*/
+/** Moves the text cursor to the beginning of the current line in editor \p 'e'.
+ Same as kf_move(FL_Home, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_home(int, Fl_Text_Editor* e) {
return kf_move(FL_Home, e);
}
-/** Moves the text cursor to the end of the current line.*/
+/** Moves the text cursor to the end of the current line in editor \p 'e'.
+ Same as kf_move(FL_End, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_end(int, Fl_Text_Editor* e) {
return kf_move(FL_End, e);
}
-/** Moves the text cursor one character to the left.*/
+/** Moves the text cursor one character to the left in editor \p 'e'.
+ Same as kf_move(FL_Left, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_left(int, Fl_Text_Editor* e) {
return kf_move(FL_Left, e);
}
-/** Moves the text cursor one line up.*/
+/** Moves the text cursor one line up for editor \p 'e'.
+ Same as kf_move(FL_Up, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_up(int, Fl_Text_Editor* e) {
return kf_move(FL_Up, e);
}
-/** Moves the text cursor one character to the right.*/
+/** Moves the text cursor one character to the right for editor \p 'e'.
+ Same as kf_move(FL_Right, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_right(int, Fl_Text_Editor* e) {
return kf_move(FL_Right, e);
}
-/** Moves the text cursor one line down.*/
+
+/** Moves the text cursor one line down for editor \p 'e'.
+ Same as kf_move(FL_Down, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_down(int, Fl_Text_Editor* e) {
return kf_move(FL_Down, e);
}
-/** Moves the text cursor up one page.*/
+/** Moves the text cursor up one page for editor \p 'e'.
+ Same as kf_move(FL_Page_Up, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_page_up(int, Fl_Text_Editor* e) {
return kf_move(FL_Page_Up, e);
}
-/** Moves the text cursor down one page.*/
+/** Moves the text cursor down one page for editor \p 'e'.
+ Same as kf_move(FL_Page_Down, e).
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_page_down(int, Fl_Text_Editor* e) {
return kf_move(FL_Page_Down, e);
}
-/** Toggles the insert mode in the text editor.*/
+
+/** Toggles the insert mode for editor \p 'e'.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_insert(int, Fl_Text_Editor* e) {
e->insert_mode(e->insert_mode() ? 0 : 1);
return 1;
}
-/** Does a delete of selected text or the current character in the current buffer.*/
+/** Does a delete of selected text or the current character in the current buffer of editor \p 'e'.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_delete(int, Fl_Text_Editor* e) {
if (!e->buffer()->selected()) {
int p1 = e->insert_position();
@@ -456,7 +560,9 @@ int Fl_Text_Editor::kf_delete(int, Fl_Text_Editor* e) {
return 1;
}
-/** Does a copy of selected text or the current character in the current buffer.*/
+/** Does a copy of selected text or the current character in the current buffer of editor \p 'e'.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_copy(int, Fl_Text_Editor* e) {
if (!e->buffer()->selected()) return 1;
const char *copy = e->buffer()->selection_text();
@@ -466,7 +572,9 @@ int Fl_Text_Editor::kf_copy(int, Fl_Text_Editor* e) {
return 1;
}
-/** Does a cut of selected text in the current buffer.*/
+/** Does a cut of selected text in the current buffer of editor \p 'e'.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_cut(int c, Fl_Text_Editor* e) {
kf_copy(c, e);
kill_selection(e);
@@ -475,7 +583,10 @@ int Fl_Text_Editor::kf_cut(int c, Fl_Text_Editor* e) {
return 1;
}
-/** Does a paste of selected text in the current buffer.*/
+/** Does a paste of selected text in the current buffer of editor \p 'e'.
+ Any current selection is replaced with the pasted content.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_paste(int, Fl_Text_Editor* e) {
kill_selection(e);
Fl::paste(*e, 1);
@@ -485,7 +596,9 @@ int Fl_Text_Editor::kf_paste(int, Fl_Text_Editor* e) {
return 1;
}
-/** Selects all text in the current buffer.*/
+/** Selects all text in the current buffer in editor \p 'e'.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_select_all(int, Fl_Text_Editor* e) {
e->buffer()->select(0, e->buffer()->length());
const char *copy = e->buffer()->selection_text();
@@ -493,7 +606,11 @@ int Fl_Text_Editor::kf_select_all(int, Fl_Text_Editor* e) {
free((void*)copy);
return 1;
}
-/** Undo last edit in the current buffer. Also deselect previous selection. */
+
+/** Undo last edit in the current buffer of editor \p 'e'.
+ Also deselects previous selection.
+ The key value \p 'c' is currently unused.
+*/
int Fl_Text_Editor::kf_undo(int , Fl_Text_Editor* e) {
e->buffer()->unselect();
Fl::copy("", 0, 0);
@@ -653,6 +770,57 @@ int Fl_Text_Editor::handle(int event) {
return Fl_Text_Display::handle(event);
}
+#if FLTK_ABI_VERSION >= 10304
+/**
+Enables or disables Tab key focus navigation.
+
+When disabled (default), tab characters are inserted into
+Fl_Text_Editor. Only the mouse can change focus. This behavior is
+desireable when Fl_Text_Editor is used, e.g. in a source code editor.
+
+When enabled, Tab navigates focus to the next widget, and Shift-Tab
+navigates focus to the previous widget. This behavior is desireable
+when Fl_Text_Editor is used e.g. in a database input form.
+
+Currently, this method is implemented as a convenience method
+that adjusts the key bindings for the Tab key. This implementation
+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.
+
+\see tab_nav(), Fl::OPTION_ARROW_FOCUS.
+\version 1.3.4 ABI feature
+*/
+void Fl_Text_Editor::tab_nav(int val) {
+ if ( val )
+ add_key_binding(FL_Tab, 0, kf_ignore);
+ else
+ remove_key_binding(FL_Tab, 0);
+}
+
+/**
+Check if Tab focus navigation is enabled.
+
+If disabled (default), hitting Tab inserts a tab character into the
+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.
+
+\see tab_nav(int), Fl::OPTION_ARROW_FOCUS.
+\version 1.3.4 ABI feature
+*/
+int Fl_Text_Editor::tab_nav() const {
+ return (bound_key_function(FL_Tab,0)==kf_ignore) ? 1 : 0;
+}
+#endif
+
//
-// End of "$Id: Fl_Text_Editor.cxx 10031 2013-12-13 16:28:38Z manolo $".
+// End of "$Id: Fl_Text_Editor.cxx 11808 2016-07-14 18:48:43Z greg.ercolano $".
//
diff --git a/src/Fl_Tile.cxx b/src/Fl_Tile.cxx
index dfe215f..76ad1af 100644
--- a/src/Fl_Tile.cxx
+++ b/src/Fl_Tile.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Tile.cxx 10385 2014-10-19 14:17:47Z AlbrechtS $"
+// "$Id: Fl_Tile.cxx 11726 2016-05-09 11:25:57Z AlbrechtS $"
//
// Tile widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -58,8 +58,13 @@
Fl_Tile widget is resized, the resizable() widget will keep its border
distance to all borders the same (this is normal resize behavior), so
that you can effectively set a border width that will never change.
+ To ensure correct event delivery to all child widgets the resizable()
+ widget must be the first child of the Fl_Tile widget group. Otherwise
+ some events (e.g. FL_MOVE and FL_ENTER) might be consumed by the resizable()
+ widget so that they are lost for widgets covered (overlapped) by the
+ resizable() widget.
- <b>Note:</b>
+ \note
You can still resize widgets \b inside the resizable() to zero width and/or
height, i.e. box \b 2b above to zero width and box \b 3a to zero height.
@@ -69,10 +74,10 @@
\code
int dx = 20, dy = dx;
Fl_Tile tile(50,50,300,300);
- // ... create widgets inside tile (see test/tile.cxx) ...
- // create resizable() box
+ // create resizable() box first
Fl_Box r(tile.x()+dx,tile.y()+dy,tile.w()-2*dx,tile.h()-2*dy);
tile.resizable(r);
+ // ... create widgets inside tile (see test/tile.cxx) ...
tile.end();
\endcode
@@ -289,12 +294,12 @@ int Fl_Tile::handle(int event) {
\see class Fl_Group
*/
-Fl_Tile::Fl_Tile(int X,int Y,int W,int H,const char*l)
-: Fl_Group(X,Y,W,H,l)
+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: Fl_Tile.cxx 10385 2014-10-19 14:17:47Z AlbrechtS $".
+// End of "$Id: Fl_Tile.cxx 11726 2016-05-09 11:25:57Z AlbrechtS $".
//
diff --git a/src/Fl_Tiled_Image.cxx b/src/Fl_Tiled_Image.cxx
index 2f459ea..d4954b2 100644
--- a/src/Fl_Tiled_Image.cxx
+++ b/src/Fl_Tiled_Image.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Tiled_Image.cxx 10218 2014-07-10 12:28:00Z manolo $"
+// "$Id: Fl_Tiled_Image.cxx 10602 2015-03-02 10:23:20Z AlbrechtS $"
//
// Tiled image code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -25,6 +25,34 @@
/**
The constructors create a new tiled image containing the specified image.
Use a width and height of 0 to tile the whole window/widget.
+
+ \note Due to implementation constraints in FLTK 1.3.3 and later width
+ and height of 0 may not work as expected when used as background image
+ in widgets other than windows. You may need to center and clip the
+ image (label) and set the label type to FL_NORMAL_LABEL. Doing so will
+ let the tiled image fill the whole widget as its background image.
+ Other combinations of label flags may or may not work.
+
+ \code
+ #include "bg.xpm"
+ Fl_Pixmap *bg_xpm = new Fl_Pixmap(bg_xpm);
+ Fl_Tiled_Image *bg_tiled = new Fl_Tiled_Image(bg_xpm,0,0);
+
+ Fl_Box *box = new Fl_Box(40,40,300,100,"");
+ box->box(FL_UP_BOX);
+ box->labeltype(FL_NORMAL_LABEL);
+ box->align(FL_ALIGN_INSIDE | FL_ALIGN_CENTER | FL_ALIGN_CLIP);
+ box->image(bg_tiled);
+ \endcode
+
+ \note Setting an image (label) for a window may not work as expected due
+ to implementation constraints in FLTK 1.3.x and maybe later. The reason
+ is the way Fl::scheme() initializes the window's label type and image.
+ A possible workaround is to use another Fl_Group as the only child widget
+ and to set the background image for this group as described above.
+
+ \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
@@ -32,10 +60,11 @@ Fl_Tiled_Image::Fl_Tiled_Image(Fl_Image *i, // I - Image to tile
Fl_Image(W,H,0) {
image_ = i;
alloc_image_ = 0;
- // giving to the tiled image the screen size may fail with multiscreen configurations
- // so we leave it with w = h = 0 (STR #3106)
- /* if (W == 0) w(Fl::w());
- if (H == 0) h(Fl::h());*/
+
+ // giving to the tiled image the screen size may fail with multiscreen
+ // configurations, so we leave it with w = h = 0 (STR #3106)
+ // if (W == 0) w(Fl::w());
+ // if (H == 0) h(Fl::h());
}
/**
The destructor frees all memory and server resources that are used by
@@ -90,9 +119,36 @@ Fl_Tiled_Image::desaturate() {
//
-// 'Fl_Tiled_Image::draw()' - Draw a shared image...
+// 'Fl_Tiled_Image::draw()' - Draw a tiled image.
//
+/**
+ Draws a tiled image.
+
+ Tiled images can be used as background images for widgets and windows.
+ However, due to implementation constraints, you must take care when
+ setting label types and alignment flags. Only certain combinations work as
+ expected, others may yield unexpected results and undefined behavior.
+
+ This draw method can draw multiple copies of one image in an area given
+ by \p X, \p Y, \p W, \p H.
+ The optional arguments \p cx and \p cy can be used to crop the image
+ starting at offsets (cx, cy). \p cx and \p cy must be \>= 0 (negative values
+ are ignored). If one of the values is greater than the image width or height
+ resp. (\p cx \>= image()->w() or \p cy \>= image()->h()) nothing is drawn,
+ because the resulting image would be empty.
+
+ After calculating the resulting image size the image is drawn as often
+ as necessary to fill the given area, starting at the top left corner.
+
+ If both \p W and \p H are 0 the image is repeated as often as necessary
+ to fill the entire window, unless there is a valid clip region. If you
+ want to fill only one particular widget's background, then you should
+ either set a clip region in your draw() method or use the label alignment
+ flags \p FL_ALIGN_INSIDE|FL_ALIGN_CLIP to make sure the image is clipped.
+
+ 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
@@ -100,32 +156,47 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position
int H, // I - Height of area to be filled
int cx, // I - "Source" X position
int cy) { // I - "Source" Y position
- if (!image_->w() || !image_->h()) return;
- if (W == 0 && H == 0 && Fl_Window::current()) { // W and H null means the image is potentially as large as the current window
+
+ 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 (cy < 0) cy = 0;
+
+ // W and H null means the image is potentially as large as the current window
+ // or widget. The latter can not be checked here, hence we use the whole
+ // window as well and rely on appropriate clipping. See comments above.
+ // This should be fixed! (AlbrechtS, 01 Mar 2015)
+
+ if (W == 0 && H == 0 && Fl_Window::current()) {
W = Fl_Window::current()->w();
H = Fl_Window::current()->h();
X = Y = 0;
}
- fl_push_clip(X, Y, W, H);
-
- X += cx;
- Y += cy;
-
- X = X - (X % image_->w());
- Y = Y - (Y % image_->h());
-
- W += X;
- H += Y;
+ if (W == 0 || H == 0) return;
- for (int yy = Y; yy < H; yy += image_->h())
- for (int xx = X; xx < W; xx += image_->w())
- image_->draw(xx, yy);
+ fl_push_clip(X, Y, W, H);
+ 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);
+ }
+ }
+ }
+ }
fl_pop_clip();
}
//
-// End of "$Id: Fl_Tiled_Image.cxx 10218 2014-07-10 12:28:00Z manolo $".
+// End of "$Id: Fl_Tiled_Image.cxx 10602 2015-03-02 10:23:20Z AlbrechtS $".
//
diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx
index 7dd6ee6..b84c8c4 100644
--- a/src/Fl_Tooltip.cxx
+++ b/src/Fl_Tooltip.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Tooltip.cxx 9706 2012-11-06 20:46:14Z matt $"
+// "$Id: Fl_Tooltip.cxx 10850 2015-09-01 14:27:45Z AlbrechtS $"
//
// Tooltip source file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -38,6 +38,10 @@ int Fl_Tooltip::wrap_width_ = 400;
#endif
static const char* tip;
+
+// FIXME: this should be a static class variable: Fl_Tooltip::draw_symbols_
+static const int draw_symbols_ = 1; // 1 = draw @-symbols in tooltips, 0 = no
+
/**
This widget creates a tooltip box window, with no caption.
*/
@@ -57,6 +61,14 @@ public:
Fl_Menu_Window::show();
}
+
+ int handle(int e) {
+ if (e == FL_PUSH || e == FL_KEYDOWN) {
+ hide();
+ return 1;
+ }
+ return Fl_Menu_Window::handle(e);
+ }
};
Fl_Widget* Fl_Tooltip::widget_ = 0;
@@ -74,8 +86,8 @@ Fl_Window *Fl_Tooltip::current_window(void)
void Fl_TooltipBox::layout() {
fl_font(Fl_Tooltip::font(), Fl_Tooltip::size());
int ww = Fl_Tooltip::wrap_width();
- int hh;
- fl_measure(tip, ww, hh, FL_ALIGN_LEFT|FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
+ int hh = 0;
+ fl_measure(tip, ww, hh, draw_symbols_);
ww += (Fl_Tooltip::margin_width() * 2);
hh += (Fl_Tooltip::margin_height() * 2);
@@ -108,7 +120,7 @@ void Fl_TooltipBox::draw() {
int Y = Fl_Tooltip::margin_height();
int W = w() - (Fl_Tooltip::margin_width()*2);
int H = h() - (Fl_Tooltip::margin_height()*2);
- fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP));
+ fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP), 0, draw_symbols_);
}
static char recent_tooltip;
@@ -123,6 +135,15 @@ static void recent_timeout(void*) {
static char recursion;
+// Is top level window iconified?
+static int top_win_iconified_() {
+ Fl_Widget *w = Fl_Tooltip::current();
+ if ( !w ) return 0;
+ Fl_Window *topwin = w->top_window();
+ if ( !topwin ) return 0;
+ return !topwin->visible() ? 1 : 0;
+}
+
static void tooltip_timeout(void*) {
#ifdef DEBUG
puts("tooltip_timeout();");
@@ -130,22 +151,24 @@ static void tooltip_timeout(void*) {
if (recursion) return;
recursion = 1;
- if (!tip || !*tip) {
- if (window) window->hide();
- } else {
- int condition = 1;
+ if (!top_win_iconified_()) { // no tooltip if top win iconified (STR #3157)
+ if (!tip || !*tip) {
+ if (window) window->hide();
+ } else {
+ int condition = 1;
#if !(defined(__APPLE__) || defined(WIN32))
- condition = (Fl::grab() == NULL);
+ condition = (Fl::grab() == NULL);
#endif
- if ( condition ) {
- if (!window) window = new Fl_TooltipBox;
- // this cast bypasses the normal Fl_Window label() code:
- ((Fl_Widget*)window)->label(tip);
- window->layout();
- window->redraw();
- // printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n",
- // window, tip ? tip : "(null)");
- window->show();
+ if ( condition ) {
+ if (!window) window = new Fl_TooltipBox;
+ // this cast bypasses the normal Fl_Window label() code:
+ ((Fl_Widget*)window)->label(tip);
+ window->layout();
+ window->redraw();
+ // printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n",
+ // window, tip ? tip : "(null)");
+ window->show();
+ }
}
}
@@ -168,7 +191,13 @@ void Fl_Tooltip::enter_(Fl_Widget* w) {
printf("Fl_Tooltip::enter_(w=%p)\n", w);
printf(" window=%p\n", window);
#endif // DEBUG
-
+ if (w && w->as_window() && ((Fl_Window*)w)->tooltip_window()) {
+ // Fix STR #2650: if there's no better place for a tooltip window, don't move it.
+ int oldx = w->x();
+ int oldy = w->y();
+ ((Fl_TooltipBox*)w)->layout();
+ if (w->x() == oldx && w->y() == oldy) return;
+ }
// find the enclosing group with a tooltip:
Fl_Widget* tw = w;
for (;;) {
@@ -346,5 +375,5 @@ void Fl_Widget::copy_tooltip(const char *text) {
}
//
-// End of "$Id: Fl_Tooltip.cxx 9706 2012-11-06 20:46:14Z matt $".
+// End of "$Id: Fl_Tooltip.cxx 10850 2015-09-01 14:27:45Z AlbrechtS $".
//
diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx
index 1a513d1..c8671c4 100644
--- a/src/Fl_Tree.cxx
+++ b/src/Fl_Tree.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tree.cxx 10275 2014-09-05 12:04:28Z cand $"
+// "$Id: Fl_Tree.cxx 11986 2016-09-26 19:29:03Z greg.ercolano $"
//
#include <stdio.h>
@@ -62,6 +62,7 @@ static void free_path(char **arr) {
}
}
+#if 0 /* unused code -- STR #3169 */
// INTERNAL: Recursively descend 'item's tree hierarchy
// accumulating total child 'count'
//
@@ -72,6 +73,7 @@ static int find_total_children(Fl_Tree_Item *item, int count=0) {
}
return(count);
}
+#endif
/// Constructor.
Fl_Tree::Fl_Tree(int X, int Y, int W, int H, const char *L) : Fl_Group(X,Y,W,H,L) {
@@ -190,7 +192,7 @@ int Fl_Tree::extend_selection_dir(Fl_Tree_Item *from, Fl_Tree_Item *to,
int Fl_Tree::extend_selection(Fl_Tree_Item *from, Fl_Tree_Item *to,
int val, bool visible) {
#else
-/// \notes Made public in 1.3.3 ABI
+/// \note Made public in 1.3.3 ABI
// Adding overload if not at least one overload breaks ABI, so avoid
// by making a private function until ABI can change..
int Fl_Tree::extend_selection__(Fl_Tree_Item *from, Fl_Tree_Item *to,
@@ -265,7 +267,7 @@ int Fl_Tree::handle(int e) {
// NEW: data inside Fl_Tree
#else /*FLTK_ABI_VERSION*/
// OLD:
- static Fl_Tree_Item *_lastselect = 0;
+ static Fl_Tree_Item *_lastselect = 0; // used to extend selections
#endif /*FLTK_ABI_VERSION*/
// Developer note: Fl_Browser_::handle() used for reference here..
// #include <FL/names.h> // for event debugging
@@ -693,9 +695,9 @@ void Fl_Tree::calc_dimensions() {
}
}
-/// Recalculuates the tree's sizes and scrollbar visibility,
+/// Recalculates the tree's sizes and scrollbar visibility,
/// normally managed automatically.
-///
+///
/// On return:
///
/// - _tree_w will be the overall pixel width of the entire viewable tree
@@ -715,7 +717,7 @@ void Fl_Tree::calc_dimensions() {
/// open/closed, label contents or font sizes changed, margins changed, etc.
///
/// This calculation involves walking the *entire* tree from top to bottom,
-/// a potentially a slow calculation if the tree has many items (potentially
+/// potentially a slow calculation if the tree has many items (potentially
/// hundreds of thousands), and should therefore be called sparingly.
///
/// For this reason, recalc_tree() is used as a way to /schedule/
@@ -825,12 +827,7 @@ void Fl_Tree::draw() {
fl_color(FL_BLACK);
- int tgt;
- if (before) {
- tgt = item->y();
- } else {
- tgt = item->y() + item->h();
- }
+ int tgt = item->y() + (before ? 0 : item->h());
fl_line(item->x(), tgt, item->x() + item->w(), tgt);
}
}
@@ -873,12 +870,7 @@ void Fl_Tree::draw() {
fl_color(FL_BLACK);
- int tgt;
- if (before) {
- tgt = item->y();
- } else {
- tgt = item->y() + item->h();
- }
+ int tgt = item->y() + (before ? 0 : item->h());
fl_line(item->x(), tgt, item->x() + item->w(), tgt);
}
}
@@ -984,7 +976,7 @@ Fl_Tree_Item* Fl_Tree::root() {
/// Sets the root item to \p 'newitem'.
///
-/// If a root item already exists, clear() is first to clear it
+/// If a root item already exists, clear() is called first to clear it
/// before replacing it with newitem.
///
#if FLTK_ABI_VERSION >= 10303
@@ -1008,10 +1000,10 @@ void Fl_Tree::root(Fl_Tree_Item *newitem) {
/// To specify items or submenus that contain slashes ('/' or '\')
/// use an escape character to protect them, e.g.
/// \code
-/// tree->add("/Holidays/Photos/12\\/25\\2010"); // Adds item "12/25/2010"
+/// tree->add("/Holidays/Photos/12\\/25\\/2010"); // Adds item "12/25/2010"
/// tree->add("/Pathnames/c:\\\\Program Files\\\\MyApp"); // Adds item "c:\Program Files\MyApp"
/// \endcode
-/// \param[in] path The path to the item, e.g. "Flintsone/Fred".
+/// \param[in] path The path to the item, e.g. "Flintstone/Fred".
/// \param[in] item The new item to be added.
/// If NULL, a new item is created with
/// a name that is the last element in \p 'path'.
@@ -1041,7 +1033,7 @@ Fl_Tree_Item* Fl_Tree::add(const char *path, Fl_Tree_Item *item) {
#else
/// Adds a new item given a menu style \p 'path'.
/// Same as calling add(path, NULL);
-/// \param[in] path The path to the item to be created, e.g. "Flintsone/Fred".
+/// \param[in] path The path to the item to be created, e.g. "Flintstone/Fred".
/// \returns The new item added, or 0 on error.
/// \see add(const char*,Fl_Tree_Item*)
/// \version 1.3.0 release
@@ -1116,6 +1108,9 @@ Fl_Tree_Item* Fl_Tree::insert(Fl_Tree_Item *item, const char *name, int pos) {
int Fl_Tree::remove(Fl_Tree_Item *item) {
// Item being removed is focus item? zero focus
if ( item == _item_focus ) _item_focus = 0;
+#if FLTK_ABI_VERSION >= 10301
+ if ( item == _lastselect ) _lastselect = 0;
+#endif /*FLTK_ABI_VERSION*/
if ( item == _root ) {
clear();
} else {
@@ -1133,6 +1128,10 @@ void Fl_Tree::clear() {
if ( ! _root ) return;
_root->clear_children();
delete _root; _root = 0;
+ _item_focus = 0;
+#if FLTK_ABI_VERSION >= 10301
+ _lastselect = 0;
+#endif /*FLTK_ABI_VERSION*/
}
/// Clear all the children for \p 'item'.
@@ -1154,7 +1153,7 @@ void Fl_Tree::clear_children(Fl_Tree_Item *item) {
/// use an escape character to protect them, e.g.
///
/// \code
-/// tree->add("/Holidays/Photos/12\\/25\\2010"); // Adds item "12/25/2010"
+/// tree->add("/Holidays/Photos/12\\/25\\/2010"); // Adds item "12/25/2010"
/// tree->add("/Pathnames/c:\\\\Program Files\\\\MyApp"); // Adds item "c:\Program Files\MyApp"
/// \endcode
///
@@ -1189,7 +1188,7 @@ Fl_Tree_Item *Fl_Tree::find_item(const char *path) {
/// Return \p 'pathname' of size \p 'pathnamelen' for the specified \p 'item'.
///
/// If \p 'item' is NULL, root() is used.<br>
-/// The tree's root will be included in the pathname of showroot() is on.<br>
+/// The tree's root will be included in the pathname if showroot() is on.<br>
/// Menu items or submenus that contain slashes ('/' or '\') in their names
/// will be escaped with a backslash. This is symmetrical with the add()
/// function which uses the same escape pattern to set names.
@@ -1226,7 +1225,7 @@ int Fl_Tree::item_pathname(char *pathname, int pathnamelen, const Fl_Tree_Item *
SAFE_RCAT('/'); // rcat leading slash
item = item->parent(); // move up tree (NULL==root)
}
- if ( *(++s) == '/' ) ++s; // leave off leading slash from pathname
+ if ( *(++s) == '/' ) { ++s; --slen; } // leave off leading slash from pathname
if ( s != pathname ) memmove(pathname, s, slen); // Shift down right-aligned string
return(0);
}
@@ -1313,8 +1312,8 @@ Fl_Tree_Item* Fl_Tree::item_clicked() {
/// Returns next open(), visible item above (\p dir==FL_Up)
/// or below (\p dir==FL_Down) the specified \p 'item', or 0 if no more items.
///
-/// If \p 'item' is 0, returns first() if \p 'dir' is FL_Up,
-/// or last() if \p dir is FL_Down.
+/// If \p 'item' is 0, returns last() if \p 'dir' is FL_Up,
+/// or first() if \p dir is FL_Down.
///
/// \code
/// // Walk down the tree (forwards)
@@ -1525,8 +1524,8 @@ Fl_Tree_Item *Fl_Tree::last_selected_item() {
/// <PRE>
/// visible=true visible=false
/// ------------------- -------------
-/// dir=Fl_Up: last_visible_item() last()
-/// dir=Fl_Down: first_visible_item() first()
+/// dir=FL_Up: last_visible_item() last()
+/// dir=FL_Down: first_visible_item() first()
/// </PRE>
///
/// \par Example use:
@@ -1673,7 +1672,7 @@ int Fl_Tree::get_selected_items(Fl_Tree_Item_Array &ret_items) {
/// \param[in] item -- the item to be opened. Must not be NULL.
/// \param[in] docallback -- A flag that determines if the callback() is invoked or not:
/// - 0 - callback() is not invoked
-/// - 1 - callback() is invoked if item changed, (default)
+/// - 1 - callback() is invoked if item changed (default),
/// callback_reason() will be FL_TREE_REASON_OPENED
/// \returns
/// - 1 -- item was opened
@@ -1699,7 +1698,7 @@ int Fl_Tree::open(Fl_Tree_Item *item, int docallback) {
/// Handles calling redraw() if anything changed.
///
/// Items or submenus that themselves contain slashes ('/' or '\')
-/// should be escaped, e.g. open("Holidays/12\\/25\//2010").
+/// should be escaped, e.g. open("Holidays/12\\/25\\/2010").
///
/// The callback can use callback_item() and callback_reason() respectively to determine
/// the item changed and the reason the callback was called.
@@ -1782,7 +1781,7 @@ int Fl_Tree::close(Fl_Tree_Item *item, int docallback) {
/// Handles calling redraw() if anything changed.
///
/// Items or submenus that themselves contain slashes ('/' or '\')
-/// should be escaped, e.g. close("Holidays/12\\/25\//2010").
+/// should be escaped, e.g. close("Holidays/12\\/25\\/2010").
///
/// The callback can use callback_item() and callback_reason() respectively to determine
/// the item changed and the reason the callback was called.
@@ -1821,7 +1820,7 @@ int Fl_Tree::is_open(Fl_Tree_Item *item) const {
/// See if item specified by \p 'path' is open.
///
/// Items or submenus that themselves contain slashes ('/' or '\')
-/// should be escaped, e.g. is_open("Holidays/12\\/25\//2010").
+/// should be escaped, e.g. is_open("Holidays/12\\/25\\/2010").
///
/// Items that are 'open' are themselves not necessarily visible;
/// one of the item's parents might be closed.
@@ -1843,8 +1842,8 @@ int Fl_Tree::is_open(const char *path) const {
///
/// \param[in] item -- the item to be tested. Must not be NULL.
/// \returns
-/// - 1 : item is open
-/// - 0 : item is closed
+/// - 1 : item is closed
+/// - 0 : item is open
///
int Fl_Tree::is_close(Fl_Tree_Item *item) const {
return(item->is_close());
@@ -1853,7 +1852,7 @@ int Fl_Tree::is_close(Fl_Tree_Item *item) const {
/// See if item specified by \p 'path' is closed.
///
/// Items or submenus that themselves contain slashes ('/' or '\')
-/// should be escaped, e.g. is_close("Holidays/12\\/25\//2010").
+/// should be escaped, e.g. is_close("Holidays/12\\/25\\/2010").
///
/// \param[in] path -- the tree item's pathname (e.g. "Flintstones/Fred")
/// \returns
@@ -1867,7 +1866,7 @@ int Fl_Tree::is_close(const char *path) const {
return(item->is_close()?1:0);
}
-/// Select the specified \p 'item'. Use 'deselect()' to de-select it.
+/// Select the specified \p 'item'. Use 'deselect()' to deselect it.
///
/// Invokes the callback depending on the value of optional parameter \p docallback.<br>
/// Handles calling redraw() if anything changed.
@@ -1913,7 +1912,7 @@ int Fl_Tree::select(Fl_Tree_Item *item, int docallback) {
/// Handles calling redraw() if anything changed.
///
/// Items or submenus that themselves contain slashes ('/' or '\')
-/// should be escaped, e.g. select("Holidays/12\\/25\//2010").
+/// should be escaped, e.g. select("Holidays/12\\/25\\/2010").
///
/// The callback can use callback_item() and callback_reason() respectively to determine
/// the item changed and the reason the callback was called.
@@ -1959,7 +1958,7 @@ void Fl_Tree::select_toggle(Fl_Tree_Item *item, int docallback) {
redraw();
}
-/// De-select the specified \p item.
+/// Deselect the specified \p item.
///
/// Invokes the callback depending on the value of optional
/// parameter \p 'docallback'.<br>
@@ -1968,7 +1967,7 @@ void Fl_Tree::select_toggle(Fl_Tree_Item *item, int docallback) {
/// 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.
+/// \param[in] item -- the item to be deselected. Must not be NULL.
/// \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 if item changed state (default),
@@ -1997,7 +1996,7 @@ int Fl_Tree::deselect(Fl_Tree_Item *item, int docallback) {
/// Handles calling redraw() if anything changed.
///
/// Items or submenus that themselves contain slashes ('/' or '\')
-/// should be escaped, e.g. deselect("Holidays/12\\/25\//2010").
+/// should be escaped, e.g. deselect("Holidays/12\\/25\\/2010").
///
/// The callback can use callback_item() and callback_reason() respectively to determine
/// the item changed and the reason the callback was called.
@@ -2051,9 +2050,9 @@ int Fl_Tree::deselect_all(Fl_Tree_Item *item, int docallback) {
return(count);
}
-/// Select only the specified \p 'item', deselecting all others that might be selected.
+/// Select only the specified item, deselecting all others that might be selected.
///
-/// If item is 0, first() is used.<br>
+/// If \p 'selitem' is 0, first() is used.<br>
/// Invokes the callback depending on the value of optional
/// parameter \p 'docallback'.<br>
/// Handles calling redraw() if anything changed.
@@ -2086,7 +2085,7 @@ int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) {
#if FLTK_ABI_VERSION >= 10301
// Should we 'reselect' item if already selected?
if ( selitem->is_selected() && (item_reselect_mode()==FL_TREE_SELECTABLE_ALWAYS) ) {
- // Selection unchanged, so no ++change
+ // Selection unchanged, so no ++changed
select(selitem, docallback); // do callback with reason=reselect
} else if ( !selitem->is_selected() ) {
// Item was not already selected, select and indicate changed
@@ -2169,7 +2168,7 @@ int Fl_Tree::is_selected(Fl_Tree_Item *item) const {
/// See if item specified by \p 'path' is selected.
///
/// Items or submenus that themselves contain slashes ('/' or '\')
-/// should be escaped, e.g. is_selected("Holidays/12\\/25\//2010").
+/// should be escaped, e.g. is_selected("Holidays/12\\/25\\/2010").
///
/// \param[in] path -- the tree item's pathname (e.g. "Flintstones/Fred")
/// \returns
@@ -2447,6 +2446,7 @@ void Fl_Tree::closeicon(Fl_Image *val) {
}
/// Returns 1 if the collapse icon is enabled, 0 if not.
+/// \see showcollapse(int)
int Fl_Tree::showcollapse() const {
return(_prefs.showcollapse());
}
@@ -2524,6 +2524,8 @@ void Fl_Tree::selectbox(Fl_Boxtype val) {
}
/// Gets the tree's current selection mode.
+/// See ::Fl_Tree_Select for possible values.
+///
Fl_Tree_Select Fl_Tree::selectmode() const {
return(_prefs.selectmode());
}
@@ -2543,7 +2545,7 @@ Fl_Tree_Item_Reselect_Mode Fl_Tree::item_reselect_mode() const {
return(_prefs.item_reselect_mode());
}
-/// Sets the item re/selection mode
+/// Sets the item re/selection mode.
/// See ::Fl_Tree_Item_Reselect_Mode for possible values.
/// \version 1.3.1 ABI feature
///
@@ -2551,7 +2553,7 @@ void Fl_Tree::item_reselect_mode(Fl_Tree_Item_Reselect_Mode mode) {
_prefs.item_reselect_mode(mode);
}
-/// Get the 'item draw mode' used for the tree
+/// Get the 'item draw mode' used for the tree.
/// \version 1.3.1 ABI feature
///
Fl_Tree_Item_Draw_Mode Fl_Tree::item_draw_mode() const {
@@ -2597,7 +2599,7 @@ int Fl_Tree::displayed(Fl_Tree_Item *item) {
return( (item->y() >= y()) && (item->y() <= (y()+h()-item->h())) ? 1 : 0);
}
-/// Adjust the vertical scroll bar so that \p 'item' is visible
+/// Adjust the vertical scrollbar so that \p 'item' is visible
/// \p 'yoff' pixels from the top of the Fl_Tree widget's display.
///
/// For instance, yoff=0 will position the item at the top.
@@ -2621,8 +2623,8 @@ void Fl_Tree::show_item(Fl_Tree_Item *item, int yoff) {
redraw();
}
-/// Adjust the vertical scroll bar to show \p 'item' at the top
-/// of the display IF it is currently off-screen (e.g. show_item_top()).
+/// Adjust the vertical scrollbar to show \p 'item' at the top
+/// of the display IF it is currently off-screen (for instance show_item_top()).
/// If it is already on-screen, no change is made.
///
/// \param[in] item The item to be shown. If NULL, first() is used.
@@ -2682,7 +2684,7 @@ void Fl_Tree::display(Fl_Tree_Item *item) {
/// Returns the vertical scroll position as a pixel offset.
/// The position returned is how many pixels of the tree are scrolled off the top edge
/// of the screen.
-/// \see vposition(), hposition()
+/// \see vposition(int), hposition(), hposition(int)
///
int Fl_Tree::vposition() const {
return((int)_vscroll->value());
@@ -2691,7 +2693,8 @@ 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.
-/// \param[in] pos The vertical position (in pixels) to scroll the browser to.
+/// \param[in] pos The vertical position (in pixels) to scroll the tree to.
+/// \see vposition(), hposition(), hposition(int)
///
void Fl_Tree::vposition(int pos) {
if (pos < 0) pos = 0;
@@ -2704,7 +2707,7 @@ void Fl_Tree::vposition(int pos) {
/// Returns the horizontal scroll position as a pixel offset.
/// The position returned is how many pixels of the tree are scrolled off the left edge
/// of the screen.
-/// \see vposition(), hposition()
+/// \see hposition(int), vposition(), vposition(int)
/// \note Must be using FLTK ABI 1.3.3 or higher for this to be effective.
///
int Fl_Tree::hposition() const {
@@ -2718,7 +2721,8 @@ 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.
-/// \param[in] pos The vertical position (in pixels) to scroll the browser to.
+/// \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.
///
void Fl_Tree::hposition(int pos) {
@@ -2735,8 +2739,8 @@ void Fl_Tree::hposition(int pos) {
/// Use this to skip over the scrollbars when walking the child() array. Example:
/// \code
/// for ( int i=0; i<tree->children(); i++ ) { // walk children
-/// Fl_Widget *w= tree->child(i);
-/// if ( brow->is_scrollbar(w) ) continue; // skip scrollbars
+/// Fl_Widget *w = tree->child(i);
+/// if ( tree->is_scrollbar(w) ) continue; // skip scrollbars
/// ..do work here..
/// }
/// \endcode
@@ -2758,7 +2762,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::scrollsize() is being used.
+/// \returns Scrollbar size in pixels, or 0 if the global Fl::scrollbar_size() is being used.
/// \see Fl::scrollbar_size(int)
///
int Fl_Tree::scrollbar_size() const {
@@ -2950,5 +2954,5 @@ void Fl_Tree::recalc_tree() {
}
//
-// End of "$Id: Fl_Tree.cxx 10275 2014-09-05 12:04:28Z cand $".
+// End of "$Id: Fl_Tree.cxx 11986 2016-09-26 19:29:03Z greg.ercolano $".
//
diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx
index d08494e..455c6a8 100644
--- a/src/Fl_Tree_Item.cxx
+++ b/src/Fl_Tree_Item.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tree_Item.cxx 10272 2014-09-05 02:59:00Z greg.ercolano $"
+// "$Id: Fl_Tree_Item.cxx 11840 2016-07-21 00:35:06Z greg.ercolano $"
//
#include <stdio.h>
@@ -78,6 +78,9 @@ void Fl_Tree_Item::_Init(const Fl_Tree_Prefs &prefs, Fl_Tree *tree) {
_label_xywh[2] = 0;
_label_xywh[3] = 0;
_usericon = 0;
+#if FLTK_ABI_VERSION >= 10304
+ _userdeicon = 0;
+#endif
_userdata = 0;
_parent = 0;
#if FLTK_ABI_VERSION >= 10303
@@ -111,6 +114,14 @@ Fl_Tree_Item::~Fl_Tree_Item() {
}
_widget = 0; // Fl_Group will handle destruction
_usericon = 0; // user handled allocation
+#if FLTK_ABI_VERSION >= 10304
+ _userdeicon = 0; // user handled allocation
+#endif
+#if FLTK_ABI_VERSION >= 10303
+ // focus item? set to null
+ if ( _tree && this == _tree->_item_focus )
+ { _tree->_item_focus = 0; }
+#endif
//_children.clear(); // array's destructor handles itself
}
@@ -254,7 +265,7 @@ const Fl_Tree_Item *Fl_Tree_Item::find_child_item(char **arr) const {
if ( child(t)->label() ) {
if ( strcmp(child(t)->label(), *arr) == 0 ) { // match?
if ( *(arr+1) ) { // more in arr? descend
- return(_children[t]->find_item(arr+1));
+ return(_children[t]->find_child_item(arr+1));
} else { // end of arr? done
return(_children[t]);
}
@@ -476,7 +487,7 @@ Fl_Tree_Item* Fl_Tree_Item::deparent(int pos) {
///
/// \returns
/// - 0: on success
-/// - -1: on error (e.g. if \p 'pos' out of range)
+/// - -1: on error (e.g. if \p 'pos' out of range) with no changes made.
///
int Fl_Tree_Item::reparent(Fl_Tree_Item *newchild, int pos) {
int ret;
@@ -485,7 +496,7 @@ int Fl_Tree_Item::reparent(Fl_Tree_Item *newchild, int pos) {
return 0;
}
-/// Move the item 'to' to sibling position of 'from'.
+/// Move the item 'from' to sibling position of 'to'.
///
/// \returns
/// - 0: Success
@@ -549,7 +560,7 @@ int Fl_Tree_Item::move(Fl_Tree_Item *item, int op, int pos) {
} else { // different parent?
if ( to > to_parent->children() ) // try to prevent a reparent() error
return -4;
- if ( from_parent->deparent(from) < 0 ) // 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
@@ -732,13 +743,14 @@ void Fl_Tree_Item::draw_horizontal_connector(int x1, int x2, int y, const Fl_Tre
fl_line(x1,y,x2,y);
return;
case FL_TREE_CONNECTOR_DOTTED:
- {
- y |= 1; // force alignment w/dot pattern
- for ( int xx=x1; xx<=x2; xx++ ) {
- if ( !(xx & 1) ) fl_point(xx, y);
- }
- }
+ {
+ y |= 1; // force alignment w/dot pattern
+ x1 |= 1;
+ for ( int xx=x1; xx<=x2; xx+=2 ) {
+ fl_point(xx, y);
+ }
return;
+ }
case FL_TREE_CONNECTOR_NONE:
return;
}
@@ -759,14 +771,14 @@ void Fl_Tree_Item::draw_vertical_connector(int x, int y1, int y2, const Fl_Tree_
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
- for ( int yy=y1; yy<=y2; yy++ ) {
- if ( yy & 1 ) fl_point(x, yy);
- }
- }
- return;
+ {
+ 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);
+ }
+ return;
+ }
case FL_TREE_CONNECTOR_NONE:
return;
}
@@ -927,8 +939,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() ? _labelfgcolor
- : fl_inactive(_labelfgcolor);
+ : (is_active() && tree()->active_r()) ? _labelfgcolor
+ : fl_inactive(_labelfgcolor);
}
/// Returns the recommended background color used for drawing this item.
@@ -937,8 +949,8 @@ 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()->selection_color()
- : fl_inactive(tree()->selection_color())
+ return is_selected() ? is_active() && tree()->active_r() ? tree()->selection_color()
+ : fl_inactive(tree()->selection_color())
: _labelbgcolor == unspecified ? tree()->color()
: _labelbgcolor;
}
@@ -1141,6 +1153,9 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus,
}
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 FLTK_ABI_VERSION >= 10304
+ char active = (is_active() && tree()->active_r()) ? 1 : 0;
+#endif
char drawthis = ( is_root() && prefs.showroot() == 0 ) ? 0 : 1;
if ( !clipped ) {
Fl_Color fg = drawfgcolor();
@@ -1169,13 +1184,36 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus,
// Draw collapse icon
if ( render && has_children() && prefs.showcollapse() ) {
// Draw icon image
+#if FLTK_ABI_VERSION >= 10304
+ 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);
+ }
+#else
if ( is_open() ) {
prefs.closeicon()->draw(icon_x,icon_y);
} else {
prefs.openicon()->draw(icon_x,icon_y);
}
+#endif
}
// Draw user icon (if any)
+#if FLTK_ABI_VERSION >= 10304
+ 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);
+ }
+#else
if ( render && usericon() ) {
// Item has user icon? Use it
int uicon_y = item_y_center - (usericon()->h() >> 1);
@@ -1185,6 +1223,7 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus,
int uicon_y = item_y_center - (prefs.usericon()->h() >> 1);
prefs.usericon()->draw(uicon_x,uicon_y);
}
+#endif
// Draw item's content
xmax = draw_item_content(render);
} // end non-child damage
@@ -1335,13 +1374,15 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
}
char clipped = ((Y+H) < tree_top) || (Y>tree_bot) ? 1 : 0;
char drawthis = ( is_root() && prefs.showroot() == 0 ) ? 0 : 1;
+ char active = (is_active() && tree->active_r()) ? 1 : 0;
if ( !clipped ) {
const Fl_Color unspecified = 0xffffffff;
+
Fl_Color fg = is_selected() ? fl_contrast(_labelfgcolor, tree->selection_color())
- : is_active() ? _labelfgcolor
- : fl_inactive(_labelfgcolor);
- Fl_Color bg = is_selected() ? is_active() ? tree->selection_color()
- : fl_inactive(tree->selection_color())
+ : active ? _labelfgcolor
+ : fl_inactive(_labelfgcolor);
+ Fl_Color bg = is_selected() ? active ? tree->selection_color()
+ : fl_inactive(tree->selection_color())
: _labelbgcolor == unspecified ? tree->color()
: _labelbgcolor;
// See if we should draw this item
@@ -1368,11 +1409,21 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
// Draw collapse icon
if ( has_children() && prefs.showcollapse() ) {
// Draw icon image
+#if FLTK_ABI_VERSION >= 10304
+ 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);
+ }
+#else
if ( is_open() ) {
prefs.closeicon()->draw(icon_x,icon_y);
} else {
prefs.openicon()->draw(icon_x,icon_y);
}
+#endif
}
// Draw background for the item.. only if different from tree's bg color
if ( bg != tree->color() || is_selected() ) {
@@ -1385,6 +1436,19 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
if ( widget() ) widget()->damage(FL_DAMAGE_ALL); // if there's a child widget, we just damaged it
}
// Draw user icon (if any)
+#if FLTK_ABI_VERSION >= 10304
+ if ( 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 ( 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 ( userdeicon() ) prefs.userdeicon()->draw(uicon_x,uicon_y);
+ }
+#else
if ( usericon() ) {
// Item has user icon? Use it
int uicon_y = item_y_center - (usericon()->h() >> 1);
@@ -1394,6 +1458,7 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
int uicon_y = item_y_center - (prefs.usericon()->h() >> 1);
prefs.usericon()->draw(uicon_x,uicon_y);
}
+#endif
// Draw label
#if FLTK_ABI_VERSION >= 10301
if ( _label &&
@@ -1774,5 +1839,5 @@ void Fl_Tree_Item::recalc_tree() {
}
//
-// End of "$Id: Fl_Tree_Item.cxx 10272 2014-09-05 02:59:00Z greg.ercolano $".
+// End of "$Id: Fl_Tree_Item.cxx 11840 2016-07-21 00:35:06Z greg.ercolano $".
//
diff --git a/src/Fl_Tree_Prefs.cxx b/src/Fl_Tree_Prefs.cxx
index 322caee..555ce36 100644
--- a/src/Fl_Tree_Prefs.cxx
+++ b/src/Fl_Tree_Prefs.cxx
@@ -1,11 +1,10 @@
//
-// "$Id: Fl_Tree_Prefs.cxx 10233 2014-08-21 12:16:40Z cand $"
+// "$Id: Fl_Tree_Prefs.cxx 10723 2015-04-28 19:39:53Z greg.ercolano $"
//
#include <FL/Fl.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Tree_Prefs.H>
-#include <string.h> // strcmp
//////////////////////
// Fl_Tree_Prefs.cxx
@@ -108,6 +107,16 @@ static Fl_Pixmap L_closepixmap(L_close_xpm);
///
void Fl_Tree_Prefs::openicon(Fl_Image *val) {
_openimage = val ? val : &L_openpixmap;
+#if FLTK_ABI_VERSION >= 10304
+ // Update deactivated version of icon..
+ if ( _opendeimage ) delete _opendeimage;
+ if ( _openimage ) {
+ _opendeimage = _openimage->copy();
+ _opendeimage->inactive();
+ } else {
+ _opendeimage = 0;
+ }
+#endif
}
/// Sets the icon to be used as the 'close' icon.
@@ -117,6 +126,16 @@ void Fl_Tree_Prefs::openicon(Fl_Image *val) {
///
void Fl_Tree_Prefs::closeicon(Fl_Image *val) {
_closeimage = val ? val : &L_closepixmap;
+#if FLTK_ABI_VERSION >= 10304
+ // Update deactivated version of icon..
+ if ( _closedeimage ) delete _closedeimage;
+ if ( _closeimage ) {
+ _closedeimage = _closeimage->copy();
+ _closedeimage->inactive();
+ } else {
+ _closedeimage = 0;
+ }
+#endif
}
/// Fl_Tree_Prefs constructor
@@ -146,6 +165,13 @@ Fl_Tree_Prefs::Fl_Tree_Prefs() {
_openimage = &L_openpixmap;
_closeimage = &L_closepixmap;
_userimage = 0;
+#if FLTK_ABI_VERSION >= 10304
+ _opendeimage = _openimage->copy();
+ _opendeimage->inactive();
+ _closedeimage = _closeimage->copy();
+ _closedeimage->inactive();
+ _userdeimage = 0;
+#endif
_showcollapse = 1;
_showroot = 1;
_connectorwidth = 17;
@@ -161,15 +187,22 @@ Fl_Tree_Prefs::Fl_Tree_Prefs() {
_itemdrawuserdata = 0;
#endif
// Let fltk's current 'scheme' affect defaults
- if ( Fl::scheme() ) {
- if ( strcmp(Fl::scheme(), "gtk+") == 0 ) {
- _selectbox = _FL_GTK_THIN_UP_BOX;
- } else if ( strcmp(Fl::scheme(), "plastic") == 0 ) {
- _selectbox = _FL_PLASTIC_THIN_UP_BOX;
- }
+ if (Fl::is_scheme("gtk+")) {
+ _selectbox = _FL_GTK_THIN_UP_BOX;
+ } else if (Fl::is_scheme("plastic")) {
+ _selectbox = _FL_PLASTIC_THIN_UP_BOX;
}
}
+#if FLTK_ABI_VERSION >= 10304
+/// Fl_Tree_Prefs destructor
+Fl_Tree_Prefs::~Fl_Tree_Prefs() {
+ if ( _opendeimage ) delete _opendeimage;
+ if ( _closedeimage ) delete _closedeimage;
+ if ( _userdeimage ) delete _userdeimage;
+}
+#endif
+
//
-// End of "$Id: Fl_Tree_Prefs.cxx 10233 2014-08-21 12:16:40Z cand $".
+// End of "$Id: Fl_Tree_Prefs.cxx 10723 2015-04-28 19:39:53Z greg.ercolano $".
//
diff --git a/src/Fl_Valuator.cxx b/src/Fl_Valuator.cxx
index b96fa33..d4dabe6 100644
--- a/src/Fl_Valuator.cxx
+++ b/src/Fl_Valuator.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Valuator.cxx 9325 2012-04-05 05:12:30Z fabien $"
+// "$Id: Fl_Valuator.cxx 11316 2016-03-08 13:42:59Z AlbrechtS $"
//
// Valuator widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -51,21 +51,32 @@ void Fl_Valuator::step(double s) {
while (fabs(s-A/B) > epsilon && B<=(0x7fffffff/10)) {B *= 10; A = rint(s*B);}
}
-/** Sets the step value to 1/10<SUP>digits</SUP>.*/
-void Fl_Valuator::precision(int p) {
+/** Sets the step value to 1.0 / 10<SUP>digits</SUP>.
+
+ Precision \p digits is limited to 0...9 to avoid internal overflow errors.
+ Values outside this range are clamped.
+
+ \note For negative values of \p digits the step value is set to
+ \p A = 1.0 and \p B = 1, i.e. 1.0/1 = 1.
+*/
+void Fl_Valuator::precision(int digits) {
+ if (digits > 9) digits = 9;
+ else if (digits < 0) digits = 0;
A = 1.0;
- for (B = 1; p--;) B *= 10;
+ for (B = 1; digits--;) B *= 10;
}
-/** Asks for partial redraw */
+
+/** Asks for partial redraw */
void Fl_Valuator::value_damage() {damage(FL_DAMAGE_EXPOSE);} // by default do partial-redraw
/**
- Sets the current value. The new value is <I>not</I>
+ Sets the current value. The new value is \e not
clamped or otherwise changed before storing it. Use
clamp() or round() to modify the value before
calling value(). The widget is redrawn if the new value
is different than the current one. The initial value is zero.
- <P>changed() will return true if the user has moved the slider,
+
+ changed() will return true if the user has moved the slider,
but it will be turned off by value(x) and just before doing a callback
(the callback can turn it back on if desired).
*/
@@ -138,23 +149,23 @@ 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.</P>
+ the character array pointed to by the passed parameter.
- <P>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,
+ 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,
where the precision is calculated to show sufficient digits
for the current step value. An integer step value, such as 1
or 1.0, gives a precision of 0, so the formatted value will
- appear as an integer.</P>
-
- <P>This method is used by the Fl_Value_... group of widgets to
- format the current value into a text string.
+ appear as an integer.
+
+ This method is used by the Fl_Valuator_... group of widgets to
+ format the current value into a text string.
The return value is the length of the formatted text.
- The formatted value is written into in <i>buffer</i>.
- <i>buffer</i> should have space for at least 128 bytes.</P>
-
- <P>You may override this function to create your own text formatting.
+ The formatted value is written into \p buffer.
+ \p buffer should have space for at least 128 bytes.
+
+ You may override this function to create your own text formatting.
*/
int Fl_Valuator::format(char* buffer) {
double v = value();
@@ -183,5 +194,5 @@ int Fl_Valuator::format(char* buffer) {
}
//
-// End of "$Id: Fl_Valuator.cxx 9325 2012-04-05 05:12:30Z fabien $".
+// End of "$Id: Fl_Valuator.cxx 11316 2016-03-08 13:42:59Z AlbrechtS $".
//
diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx
index 2600dd3..e33c532 100644
--- a/src/Fl_Widget.cxx
+++ b/src/Fl_Widget.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Widget.cxx 9452 2012-05-07 07:18:11Z AlbrechtS $"
+// "$Id: Fl_Widget.cxx 11811 2016-07-15 19:23:16Z AlbrechtS $"
//
// Base widget class for the Fast Light Tool Kit (FLTK).
//
@@ -54,9 +54,24 @@ void Fl_Widget::default_callback(Fl_Widget *o, void * /*v*/) {
}
}
/**
- All Fl_Widgets that don't have a callback defined use a
- default callback that puts a pointer to the widget in this queue,
- and this method reads the oldest widget out of this queue.
+ Reads the default callback queue and returns the first widget.
+
+ All Fl_Widgets that don't have a callback defined use the default
+ callback \p static Fl_Widget::default_callback() that puts a pointer
+ to the widget in a queue. This method reads the oldest widget out
+ of this queue.
+
+ The queue (FIFO) is limited (currently 20 items). If the queue
+ overflows, the oldest entry (Fl_Widget *) is discarded.
+
+ Relying on the default callback and reading the callback queue with
+ Fl::readqueue() is not recommended. If you need a callback, you should
+ set one with Fl_Widget::callback(Fl_Callback *cb, void *data)
+ or one of its variants.
+
+ \see Fl_Widget::callback()
+ \see Fl_Widget::callback(Fl_Callback *cb, void *data)
+ \see Fl_Widget::default_callback()
*/
Fl_Widget *Fl::readqueue() {
if (obj_tail==obj_head) return 0;
@@ -126,6 +141,10 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) {
parent_ = 0;
if (Fl_Group::current()) Fl_Group::current()->add(this);
+ if (!fl_graphics_driver) {
+ // Make sure fl_graphics_driver is initialized. Important if we are called by a static initializer.
+ Fl_Display_Device::display_device();
+ }
}
void Fl_Widget::resize(int X, int Y, int W, int H) {
@@ -324,6 +343,7 @@ Fl_Widget::copy_label(const char *a) {
*/
void
Fl_Widget::do_callback(Fl_Widget* o,void* arg) {
+ if (!callback_) return;
Fl_Widget_Tracker wp(this);
callback_(o,arg);
if (wp.deleted()) return;
@@ -332,5 +352,5 @@ Fl_Widget::do_callback(Fl_Widget* o,void* arg) {
}
//
-// End of "$Id: Fl_Widget.cxx 9452 2012-05-07 07:18:11Z AlbrechtS $".
+// End of "$Id: Fl_Widget.cxx 11811 2016-07-15 19:23:16Z AlbrechtS $".
//
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index a0dca45..1ee52cf 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Window.cxx 10405 2014-10-29 15:53:52Z manolo $"
+// "$Id: Fl_Window.cxx 11881 2016-08-20 17:08:27Z AlbrechtS $"
//
// Window widget class for the Fast Light Tool Kit (FLTK).
//
@@ -53,12 +53,21 @@ void Fl_Window::_Fl_Window() {
size_range_set = 0;
minw = maxw = minh = maxh = 0;
shape_data_ = NULL;
+
#if FLTK_ABI_VERSION >= 10301
no_fullscreen_x = 0;
no_fullscreen_y = 0;
no_fullscreen_w = w();
no_fullscreen_h = h();
#endif
+
+#if FLTK_ABI_VERSION >= 10303
+ fullscreen_screen_top = -1;
+ fullscreen_screen_bottom = -1;
+ fullscreen_screen_left = -1;
+ fullscreen_screen_right = -1;
+#endif
+
callback((Fl_Callback*)default_callback);
}
@@ -286,14 +295,19 @@ const char *Fl_Window::xclass() const
/** Sets a single default window icon.
- \param[in] icon default icon for all windows subsequently created
+ If \p icon is NULL the current default icons are removed.
+
+ \param[in] icon default icon for all windows subsequently created or NULL
\see Fl_Window::default_icons(const Fl_RGB_Image *[], int)
\see Fl_Window::icon(const Fl_RGB_Image *)
\see Fl_Window::icons(const Fl_RGB_Image *[], int)
*/
void Fl_Window::default_icon(const Fl_RGB_Image *icon) {
- default_icons(&icon, 1);
+ if (icon)
+ default_icons(&icon, 1);
+ else
+ default_icons(&icon, 0);
}
/** Sets the default window icons.
@@ -307,7 +321,7 @@ void Fl_Window::default_icon(const Fl_RGB_Image *icon) {
variable or free the images immediately after this call.
\param[in] icons default icons for all windows subsequently created
- \param[in] count number of images in \p icons. set to 0 to remove
+ \param[in] count number of images in \p icons. Set to 0 to remove
the current default icons
\see Fl_Window::default_icon(const Fl_RGB_Image *)
@@ -318,25 +332,45 @@ void Fl_Window::default_icons(const Fl_RGB_Image *icons[], int count) {
Fl_X::set_default_icons(icons, count);
}
-/** Sets a single window icon.
+/** Sets or resets a single window icon.
+
+ A window icon \e can be changed while the window is shown, but this
+ \e may be platform and/or window manager dependent. To be sure that
+ the window displays the correct window icon you should always set the
+ icon before the window is shown.
+
+ If a window icon has not been set for a particular window, then the
+ default window icon (see links below) or the system default icon will
+ be used.
- \param[in] icon icon for this window
+ \param[in] icon icon for this window, NULL to reset window icon.
\see Fl_Window::default_icon(const Fl_RGB_Image *)
\see Fl_Window::default_icons(const Fl_RGB_Image *[], int)
\see Fl_Window::icons(const Fl_RGB_Image *[], int)
*/
void Fl_Window::icon(const Fl_RGB_Image *icon) {
- icons(&icon, 1);
+ if (icon)
+ icons(&icon, 1);
+ else
+ icons(&icon, 0);
}
/** Sets the window icons.
+ You may set multiple window icons with different sizes. Dependent on
+ the platform and system settings the best (or the first) icon will be
+ chosen.
+
The given images in \p icons are copied. You can use a local
variable or free the images immediately after this call.
+ If \p count is zero, current icons are removed. If \p count is greater than
+ zero (must not be negative), then \p icons[] must contain at least \p count
+ valid image pointers (not NULL). Otherwise the behavior is undefined.
+
\param[in] icons icons for this window
- \param[in] count number of images in \p icons. set to 0 to remove
+ \param[in] count number of images in \p icons. Set to 0 to remove
the current icons
\see Fl_Window::default_icon(const Fl_RGB_Image *)
@@ -401,29 +435,47 @@ void Fl_Window::free_icons() {
#endif
}
+
+#ifndef __APPLE__
/**
- Waits for the window to be fully displayed after calling show().
+ Waits for the window to be displayed after calling show().
Fl_Window::show() is not guaranteed to show and draw the window on
all platforms immediately. Instead this is done in the background;
- particularly on X11 this will take a few messages (client server
- roundtrips) to display the window.
-
- Usually this small delay doesn't matter, but in some cases you may
- want to have the window instantiated and displayed synchronously.
-
- Currently (as of FLTK 1.3.3) this method only has an effect on X11.
- On Windows and Mac OS X show() is always synchronous. If you want to
- write portable code and need this synchronous show() feature, add
- win->wait_for_expose() on all platforms, FLTK will just do the
+ particularly on X11 it will take a few messages (client server
+ roundtrips) to display the window. Usually this small delay doesn't
+ matter, but in some cases you may want to have the window instantiated
+ and displayed synchronously.
+
+ Currently (as of FLTK 1.3.4) this method has an effect on X11 and Mac OS.
+ On Windows, show() is always synchronous. The effect of show() varies with
+ versions of Mac OS X: early versions have the window appear on the screen
+ when show() returns, later versions don't.
+ If you want to write portable code and need this synchronous show() feature,
+ add win->wait_for_expose() on all platforms, and FLTK will just do the
right thing.
This method can be used for displaying splash screens before
calling Fl::run() or for having exact control over which window
- has focus after calling show().
+ has the focus after calling show().
If the window is not shown(), this method does nothing.
+ \note Depending on the platform and window manager wait_for_expose()
+ may not guarantee that the window is fully drawn when it is called.
+ Under X11 it may only make sure that the window is \b mapped, i.e.
+ the internal (OS dependent) window object was created (and maybe
+ shown on the desktop as an empty frame or something like that).
+ You may need to call Fl::flush() after wait_for_expose() to make
+ sure the window and all its widgets are drawn and thus visible.
+
+ \note FLTK does the best it can do to make sure that all widgets
+ get drawn if you call wait_for_expose() and Fl::flush(). However,
+ dependent on the window manager it can not be guaranteed that this
+ does always happen synchronously. The only guaranteed behavior that
+ all widgets are eventually drawn is if the FLTK event loop is run
+ continuously, for instance with Fl::run().
+
\see virtual void Fl_Window::show()
Example code for displaying a window before calling Fl::run()
@@ -433,13 +485,13 @@ void Fl_Window::free_icons() {
// do more window initialization here ...
- win->show(); // show window
- win->wait_for_expose(); // wait, until displayed
- Fl::flush(); // make sure everything gets drawn
+ win->show(); // show window
+ win->wait_for_expose(); // wait, until displayed
+ Fl::flush(); // make sure everything gets drawn
// do more initialization work that needs some time here ...
- Fl::run(); // start FLTK event loop
+ Fl::run(); // start FLTK event loop
\endcode
Note that the window will not be responsive until the event loop
@@ -452,7 +504,8 @@ void Fl_Window::wait_for_expose() {
Fl::wait();
}
}
+#endif // ! __APPLE__
//
-// End of "$Id: Fl_Window.cxx 10405 2014-10-29 15:53:52Z manolo $".
+// End of "$Id: Fl_Window.cxx 11881 2016-08-20 17:08:27Z AlbrechtS $".
//
diff --git a/src/Fl_Window_fullscreen.cxx b/src/Fl_Window_fullscreen.cxx
index 2808f29..2b79509 100644
--- a/src/Fl_Window_fullscreen.cxx
+++ b/src/Fl_Window_fullscreen.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Window_fullscreen.cxx 10189 2014-06-11 09:10:53Z ossman $"
+// "$Id: Fl_Window_fullscreen.cxx 10652 2015-03-25 19:15:19Z AlbrechtS $"
//
// Fullscreen window support for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -36,6 +36,9 @@ int Fl_Window::no_fullscreen_x = 0;
int Fl_Window::no_fullscreen_y = 0;
int Fl_Window::no_fullscreen_w = 0;
int Fl_Window::no_fullscreen_h = 0;
+#endif
+
+#if FLTK_ABI_VERSION < 10303
int Fl_Window::fullscreen_screen_top = -1;
int Fl_Window::fullscreen_screen_bottom = -1;
int Fl_Window::fullscreen_screen_left = -1;
@@ -118,5 +121,5 @@ void Fl_Window::fullscreen_screens(int top, int bottom, int left, int right) {
//
-// End of "$Id: Fl_Window_fullscreen.cxx 10189 2014-06-11 09:10:53Z ossman $".
+// End of "$Id: Fl_Window_fullscreen.cxx 10652 2015-03-25 19:15:19Z AlbrechtS $".
//
diff --git a/src/Fl_Window_shape.cxx b/src/Fl_Window_shape.cxx
index 3204944..b763a10 100644
--- a/src/Fl_Window_shape.cxx
+++ b/src/Fl_Window_shape.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Window_shape.cxx 10348 2014-10-01 16:37:13Z manolo $"
+// "$Id: Fl_Window_shape.cxx 10809 2015-07-22 11:26:27Z manolo $"
//
-// implementation of Fl_Window::shape(Fl_Image*) for the Fast Light Tool Kit (FLTK).
+// Implementation of Fl_Window::shape(Fl_Image*) for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2014 by Bill Spitzak and others.
+// Copyright 2010-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -54,7 +54,7 @@ static inline uchar swap_byte(const uchar b) {
static inline BYTE bit(int x) { return (BYTE)(1 << (x%8)); }
-static HRGN bitmap2region(Fl_Bitmap* image) {
+static HRGN bitmap2region(Fl_Image* image) {
HRGN hRgn = 0;
/* Does this need to be dynamically determined, perhaps? */
const int ALLOC_UNIT = 100;
@@ -67,7 +67,7 @@ static HRGN bitmap2region(Fl_Bitmap* image) {
SetRect(&pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0);
const int bytesPerLine = (image->w() + 7)/8;
- BYTE* p, *data = (BYTE*)image->array;
+ BYTE* p, *data = (BYTE*)*image->data();
for (int y = 0; y < image->h(); y++) {
// each row, left to right
for (int x = 0; x < image->w(); x++) {
@@ -155,9 +155,9 @@ void Fl_Window::combine_mask()
if (!XShapeCombineMask_f) return;
shape_data_->lw_ = w();
shape_data_->lh_ = h();
- Fl_Bitmap* temp = (Fl_Bitmap*)shape_data_->shape_->copy(shape_data_->lw_, shape_data_->lh_);
- Pixmap pbitmap = XCreateBitmapFromData(fl_display, fl_xid(this),
- (const char*)temp->array,
+ Fl_Image* temp = shape_data_->shape_->copy(shape_data_->lw_, shape_data_->lh_);
+ Pixmap pbitmap = XCreateBitmapFromData(fl_display, fl_xid(this),
+ (const char*)*temp->data(),
temp->w(), temp->h());
XShapeCombineMask_f(fl_display, fl_xid(this), ShapeBounding, 0, 0, pbitmap, ShapeSet);
if (pbitmap != None) XFreePixmap(fl_display, pbitmap);
@@ -168,7 +168,7 @@ void Fl_Window::combine_mask()
#endif // __APPLE__
-void Fl_Window::shape_bitmap_(Fl_Bitmap* b) {
+void Fl_Window::shape_bitmap_(Fl_Image* b) {
shape_data_->shape_ = b;
#if defined(__APPLE__)
if (b) {
@@ -176,7 +176,7 @@ void Fl_Window::shape_bitmap_(Fl_Bitmap* b) {
int bytes_per_row = (b->w() + 7)/8;
uchar *from = new uchar[bytes_per_row * b->h()];
for (int i = 0; i < b->h(); i++) {
- uchar *p = (uchar*)b->array + bytes_per_row * i;
+ uchar *p = (uchar*)(*b->data()) + bytes_per_row * i;
uchar *last = p + bytes_per_row;
uchar *q = from + (b->h() - 1 - i) * bytes_per_row;
while (p < last) {
@@ -195,7 +195,7 @@ void Fl_Window::shape_bitmap_(Fl_Bitmap* b) {
/* the image can be of any depth
offset gives the byte offset from the pixel start to the byte used to construct the shape
*/
-void Fl_Window::shape_alpha_(Fl_RGB_Image* img, int offset) {
+void Fl_Window::shape_alpha_(Fl_Image* img, int offset) {
int i, d = img->d(), w = img->w(), h = img->h();
shape_data_->shape_ = img;
if (shape_data_->shape_) {
@@ -203,7 +203,7 @@ void Fl_Window::shape_alpha_(Fl_RGB_Image* img, int offset) {
int bytes_per_row = w * d;
uchar *from = new uchar[w * h];
for ( i = 0; i < h; i++) {
- uchar *p = (uchar*)img->array + bytes_per_row * i + offset;
+ uchar *p = (uchar*)(*img->data()) + bytes_per_row * i + offset;
uchar *last = p + bytes_per_row;
uchar *q = from + (h - 1 - i) * w;
while (p < last) {
@@ -230,13 +230,13 @@ void Fl_Window::shape_alpha_(Fl_RGB_Image* img, int offset) {
/* the img image can be of any depth
offset gives the byte offset from the pixel start to the byte used to construct the shape
*/
-void Fl_Window::shape_alpha_(Fl_RGB_Image* img, int offset) {
+void Fl_Window::shape_alpha_(Fl_Image* img, int offset) {
int i, j, d = img->d(), w = img->w(), h = img->h(), bytesperrow = (w+7)/8;
unsigned u;
uchar byte, onebit;
// build an Fl_Bitmap covering the non-fully transparent/black part of the image
const uchar* bits = new uchar[h*bytesperrow]; // to store the bitmap
- const uchar* alpha = img->array + offset; // points to alpha value of rgba pixels
+ const uchar* alpha = (const uchar*)*img->data() + offset; // points to alpha value of rgba pixels
for (i = 0; i < h; i++) {
uchar *p = (uchar*)bits + i * bytesperrow;
byte = 0;
@@ -269,8 +269,8 @@ void Fl_Window::shape_alpha_(Fl_RGB_Image* img, int offset) {
#endif
-void Fl_Window::shape_pixmap_(Fl_Pixmap* pixmap) {
- Fl_RGB_Image* rgba = new Fl_RGB_Image(pixmap);
+void Fl_Window::shape_pixmap_(Fl_Image* pixmap) {
+ Fl_RGB_Image* rgba = new Fl_RGB_Image((Fl_Pixmap*)pixmap);
shape_alpha_(rgba, 3);
delete rgba;
}
@@ -287,12 +287,14 @@ Fl_Window::shape_data_type* Fl_Window::shape_data_ = NULL;
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 or Fl_RGB_Image:
+ 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.
\li With an Fl_RGB_Image with an alpha channel (depths 2 or 4), the shaped window covers the image part
that is not fully transparent.
\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_Shared_Image::scale().
Platform details:
\li On the unix/linux platform, the SHAPE extension of the X server is required.
@@ -311,7 +313,7 @@ Fl_Window::shape_data_type* Fl_Window::shape_data_ = NULL;
A usage example is found at example/shapedwindow.cxx.
- \version 1.3.3 (and requires compilation with -DFLTK_ABI_VERSION = 10303)
+ \version 1.3.3 (and requires compilation with FLTK_ABI_VERSION >= 10303)
*/
void Fl_Window::shape(const Fl_Image* img) {
#if FLTK_ABI_VERSION >= 10303
@@ -327,17 +329,17 @@ void Fl_Window::shape(const Fl_Image* img) {
memset(shape_data_, 0, sizeof(shape_data_type));
border(false);
int d = img->d();
- if (d && img->count() >= 2) shape_pixmap_((Fl_Pixmap*)img);
- else if (d == 0) shape_bitmap_((Fl_Bitmap*)img);
- else if (d == 2 || d == 4) shape_alpha_((Fl_RGB_Image*)img, d - 1);
- else if ((d == 1 || d == 3) && img->count() == 1) shape_alpha_((Fl_RGB_Image*)img, 0);
+ if (d && img->count() >= 2) shape_pixmap_((Fl_Image*)img);
+ else if (d == 0) shape_bitmap_((Fl_Image*)img);
+ else if (d == 2 || d == 4) shape_alpha_((Fl_Image*)img, d - 1);
+ else if ((d == 1 || d == 3) && img->count() == 1) shape_alpha_((Fl_Image*)img, 0);
#endif
}
void Fl_Window::draw() {
if (shape_data_) {
# if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if (shape_data_->mask && (CGContextClipToMask != NULL)) {
+ if (shape_data_->mask && (&CGContextClipToMask != NULL)) {
CGContextClipToMask(fl_gc, CGRectMake(0,0,w(),h()), shape_data_->mask); // requires Mac OS 10.4
}
CGContextSaveGState(fl_gc);
@@ -346,7 +348,7 @@ void Fl_Window::draw() {
// size of window has changed since last time
shape_data_->lw_ = w();
shape_data_->lh_ = h();
- Fl_Bitmap* temp = (Fl_Bitmap*)shape_data_->shape_->copy(shape_data_->lw_, shape_data_->lh_);
+ Fl_Image* temp = shape_data_->shape_->copy(shape_data_->lw_, shape_data_->lh_);
HRGN region = bitmap2region(temp);
SetWindowRgn(fl_xid(this), region, TRUE); // the system deletes the region when it's no longer needed
delete temp;
@@ -358,16 +360,32 @@ void Fl_Window::draw() {
}
# endif
}
-
+
// The following is similar to Fl_Group::draw(), but ...
- // - we draw the box with x=0 and y=0 instead of x() and y()
- // - we don't draw a label
-
+ //
+ // - draws the box at (0,0), i.e. with x=0 and y=0 instead of x() and y()
+ // - does NOT draw the label (text)
+ // - draws the image only if FL_ALIGN_INSIDE is set
+ //
+ // Note: The label (text) of top level windows is drawn in the title bar.
+ // 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
draw_box(box(),0,0,w(),h(),color()); // draw box with x/y = 0
+
+ if (image() && (align() & FL_ALIGN_INSIDE)) { // draw the image only
+ Fl_Label l1;
+ memset(&l1,0,sizeof(l1));
+ l1.align_ = align();
+ l1.image = image();
+ if (!active_r() && l1.image && l1.deimage) l1.image = l1.deimage;
+ l1.type = labeltype();
+ l1.draw(0,0,w(),h(),align());
+ }
}
draw_children();
-
+
#ifdef __APPLE_QUARTZ__
// on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right
// corner. This code draws a little ribbed triangle for dragging.
@@ -403,5 +421,5 @@ void Fl_Window::draw() {
//
-// End of "$Id: Fl_Window_shape.cxx 10348 2014-10-01 16:37:13Z manolo $".
+// End of "$Id: Fl_Window_shape.cxx 10809 2015-07-22 11:26:27Z manolo $".
//
diff --git a/src/Fl_XBM_Image.cxx b/src/Fl_XBM_Image.cxx
index 95c1817..8ed73c6 100644
--- a/src/Fl_XBM_Image.cxx
+++ b/src/Fl_XBM_Image.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_XBM_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_XBM_Image.cxx 12026 2016-10-14 14:33:14Z AlbrechtS $"
//
// Fl_XBM_Image routines.
//
-// Copyright 1997-2010 by Bill Spitzak and others.
+// Copyright 1997-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -37,7 +37,8 @@
/**
The constructor loads the named XBM file from the given name filename.
- <P>The destructor free all memory and server resources that are used by
+
+ 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) {
@@ -90,7 +91,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
*ptr++ = (uchar)t;
i ++;
}
- while (*a && *a++ != ',');
+ while (*a && *a++ != ',') {/*empty*/}
}
}
@@ -99,5 +100,5 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
//
-// End of "$Id: Fl_XBM_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_XBM_Image.cxx 12026 2016-10-14 14:33:14Z AlbrechtS $".
//
diff --git a/src/Fl_XPM_Image.cxx b/src/Fl_XPM_Image.cxx
index 580d5fe..f251800 100644
--- a/src/Fl_XPM_Image.cxx
+++ b/src/Fl_XPM_Image.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_XPM_Image.cxx 10156 2014-05-22 12:11:17Z manolo $"
+// "$Id: Fl_XPM_Image.cxx 12026 2016-10-14 14:33:14Z AlbrechtS $"
//
// Fl_XPM_Image routines.
//
-// Copyright 1997-2010 by Bill Spitzak and others.
+// Copyright 1997-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -46,7 +46,8 @@ static int hexdigit(int x) { // I - Hex digit...
#define INITIALLINES 256
/**
The constructor loads the XPM image from the name filename.
- <P>The destructor free all memory and server resources that are used by
+
+ The destructor frees all memory and server resources that are used by
the image.
*/
Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) {
@@ -140,5 +141,5 @@ bad_data:
//
-// End of "$Id: Fl_XPM_Image.cxx 10156 2014-05-22 12:11:17Z manolo $".
+// End of "$Id: Fl_XPM_Image.cxx 12026 2016-10-14 14:33:14Z AlbrechtS $".
//
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 6f5b8b1..243f2e1 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_cocoa.mm 10427 2014-11-02 21:06:07Z manolo $"
+// "$Id: Fl_cocoa.mm 12089 2016-11-09 20:19:10Z manolo $"
//
// MacOS-Cocoa specific code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -42,30 +42,18 @@ extern "C" {
#include <FL/Fl_Window.H>
#include <FL/Fl_Tooltip.H>
#include <FL/Fl_Printer.H>
-#include <FL/Fl_Input_.H>
-#include <FL/Fl_Text_Display.H>
+#include <FL/Fl_Copy_Surface.H>
#include <stdio.h>
#include <stdlib.h>
-#include "flstring.h"
#include <unistd.h>
#include <stdarg.h>
#include <math.h>
#include <limits.h>
#include <dlfcn.h>
+#include <string.h>
#import <Cocoa/Cocoa.h>
-#ifndef NSINTEGER_DEFINED // appears with 10.5 in NSObjCRuntime.h
-#if defined(__LP64__) && __LP64__
-typedef long NSInteger;
-typedef unsigned long NSUInteger;
-#else
-typedef long NSInteger;
-typedef unsigned int NSUInteger;
-#endif
-#endif
-
-
// #define DEBUG_SELECT // UNCOMMENT FOR SELECT()/THREAD DEBUGGING
#ifdef DEBUG_SELECT
#include <stdio.h> // testing
@@ -87,16 +75,12 @@ extern int fl_send_system_handlers(void *e);
// converting cr lf converter function
static void convert_crlf(char * string, size_t len);
static void createAppleMenu(void);
-static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h);
static void cocoaMouseHandler(NSEvent *theEvent);
-static int calc_mac_os_version();
static void clipboard_check(void);
-static NSString *calc_utf8_format(void);
-static void im_update(void);
static unsigned make_current_counts = 0; // if > 0, then Fl_Window::make_current() can be called only once
-static Fl_X *fl_x_to_redraw = NULL; // set by Fl_X::flush() to the Fl_X object of the window to be redrawn
+static NSBitmapImageRep* rect_to_NSBitmapImageRep(Fl_Window *win, int x, int y, int w, int h);
-Fl_Display_Device *Fl_Display_Device::_display = new Fl_Display_Device(new Fl_Quartz_Graphics_Driver); // the platform display
+int fl_mac_os_version = Fl_X::calc_mac_os_version(); // the version number of the running Mac OS X (e.g., 100604 for 10.6.4)
// public variables
CGContextRef fl_gc = 0;
@@ -105,10 +89,6 @@ bool fl_show_iconic; // true if called from iconize() - shows
//int fl_disable_transient_for; // secret method of removing TRANSIENT_FOR
Window fl_window;
Fl_Window *Fl_Window::current_;
-int fl_mac_os_version = calc_mac_os_version(); // the version number of the running Mac OS X (e.g., 100604 for 10.6.4)
-static SEL inputContextSEL = (fl_mac_os_version >= 100600 ? @selector(inputContext) : @selector(FLinputContext));
-Fl_Fontdesc* fl_fonts = Fl_X::calc_fl_fonts();
-static NSString *utf8_format = calc_utf8_format();
// forward declarations of variables in this file
static int got_events = 0;
@@ -117,7 +97,19 @@ static int main_screen_height; // height of menubar-containing screen used to co
// 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;
+// through_Fl_X_flush = YES means Fl_X::flush() was called
+static BOOL through_Fl_X_flush = NO;
static int im_enabled = -1;
+// OS version-dependent pasteboard type names
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#define NSPasteboardTypeTIFF @"public.tiff"
+#define NSPasteboardTypePDF @"com.adobe.pdf"
+#define NSPasteboardTypeString @"public.utf8-plain-text"
+#endif
+static NSString *TIFF_pasteboard_type = (fl_mac_os_version >= 100600 ? NSPasteboardTypeTIFF : NSTIFFPboardType);
+static NSString *PDF_pasteboard_type = (fl_mac_os_version >= 100600 ? NSPasteboardTypePDF : NSPDFPboardType);
+static NSString *PICT_pasteboard_type = (fl_mac_os_version >= 100600 ? @"com.apple.pict" : NSPICTPboardType);
+static NSString *UTF8_pasteboard_type = (fl_mac_os_version >= 100600 ? NSPasteboardTypeString : NSStringPboardType);
#if CONSOLIDATE_MOTION
static Fl_Window* send_motion;
@@ -166,7 +158,7 @@ void fl_set_status(int x, int y, int w, int h)
/*
* Mac keyboard lookup table
*/
-static unsigned short* macKeyLookUp = fl_compute_macKeyLookUp();
+static unsigned short* macKeyLookUp = NULL;
/*
* convert the current mouse chord into the FLTK modifier state
@@ -389,15 +381,14 @@ void* DataReady::DataReadyThread(void *o)
if (FD_ISSET(cancelpipe, &r) || FD_ISSET(cancelpipe, &x)) // cancel?
{ return(NULL); } // just exit
DEBUGMSG("CHILD THREAD: DATA IS READY\n");
- NSPoint pt={0,0};
- NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
- NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:pt
- modifierFlags:0
+ NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
+ NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
+ location:NSMakePoint(0,0)
+ modifierFlags:0
timestamp:0
- windowNumber:0 context:NULL
- subtype:FLTKDataReadyEvent data1:0 data2:0];
+ windowNumber:0 context:NULL subtype:FLTKDataReadyEvent data1:0 data2:0];
[NSApp postEvent:event atStart:NO];
- [localPool release];
+ [localPool release];
return(NULL); // done with thread
}
}
@@ -495,12 +486,9 @@ static void processFLTKEvent(void) {
*/
static void breakMacEventLoop()
{
- NSPoint pt={0,0};
- NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:pt
- modifierFlags:0
- timestamp:0
- windowNumber:0 context:NULL
- subtype:FLTKTimerEvent data1:0 data2:0];
+ NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0,0)
+ modifierFlags:0 timestamp:0
+ windowNumber:0 context:NULL subtype:FLTKTimerEvent data1:0 data2:0];
[NSApp postEvent:event atStart:NO];
}
@@ -653,19 +641,16 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data)
@interface FLWindow : NSWindow {
Fl_Window *w;
- BOOL containsGLsubwindow;
}
- (FLWindow*)initWithFl_W:(Fl_Window *)flw
contentRect:(NSRect)rect
styleMask:(NSUInteger)windowStyle;
- (Fl_Window *)getFl_Window;
-/* These two functions allow to check if a window contains OpenGL-subwindows.
- This is useful only for Mac OS < 10.7 to repair a problem apparent with the "cube" test program:
- if the cube window is moved around rapidly (with OS < 10.7), the GL pixels leak away from where they should be.
- The repair is performed by [FLWindowDelegate windowDidMove:], only if OS < 10.7.
- */
-- (BOOL)containsGLsubwindow;
-- (void)containsGLsubwindow:(BOOL)contains;
+- (void)recursivelySendToSubwindows:(SEL)sel;
+- (void)setSubwindowFrame;
+- (void)checkSubwindowFrame;
+- (void)waitForExpose;
+- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- (NSPoint)convertBaseToScreen:(NSPoint)aPoint;
#endif
@@ -682,7 +667,7 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data)
else {
// replaces return [super convertBaseToScreen:aPoint] that may trigger a compiler warning
typedef NSPoint (*convertIMP)(id, SEL, NSPoint);
- convertIMP addr = (convertIMP)[NSWindow instanceMethodForSelector:@selector(convertBaseToScreen:)];
+ static convertIMP addr = (convertIMP)[NSWindow instanceMethodForSelector:@selector(convertBaseToScreen:)];
return addr(self, @selector(convertBaseToScreen:), aPoint);
}
}
@@ -695,11 +680,10 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data)
self = [super initWithContentRect:rect styleMask:windowStyle backing:NSBackingStoreBuffered defer:NO];
if (self) {
w = flw;
- containsGLsubwindow = NO;
if (fl_mac_os_version >= 100700) {
// replaces [self setRestorable:NO] that may trigger a compiler warning
typedef void (*setIMP)(id, SEL, BOOL);
- setIMP addr = (setIMP)[self methodForSelector:@selector(setRestorable:)];
+ static setIMP addr = (setIMP)[NSWindow instanceMethodForSelector:@selector(setRestorable:)];
addr(self, @selector(setRestorable:), NO);
}
}
@@ -709,22 +693,13 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data)
{
return w;
}
-- (BOOL)containsGLsubwindow
-{
- return containsGLsubwindow;
-}
-- (void)containsGLsubwindow:(BOOL)contains
-{
- containsGLsubwindow = contains;
-}
- (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 !(w->tooltip_window() || w->menu_window());
+ return !(w->tooltip_window() || w->menu_window() || w->parent());
}
- (BOOL)canBecomeMainWindow
@@ -733,9 +708,88 @@ void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data)
return NO; // prevent the caption to be redrawn as active on click
// when another modal window is currently the key win
- return !(w->tooltip_window() || w->menu_window());
+ return !(w->tooltip_window() || w->menu_window() || w->parent());
+}
+
+- (void)recursivelySendToSubwindows:(SEL)sel
+{
+ [self performSelector:sel];
+ NSEnumerator *enumerator = [[self childWindows] objectEnumerator];
+ id child;
+ while ((child = [enumerator nextObject]) != nil) {
+ if ([child isKindOfClass:[FLWindow class]]) [child recursivelySendToSubwindows:sel];
+ }
+}
+
+- (void)setSubwindowFrame { // maps a subwindow at its correct position/size
+ Fl_Window *parent = w->window();
+ if (!parent) return;
+ FLWindow *pxid = fl_xid(parent);
+ if (!pxid) return;
+ int bx = w->x(); int by = w->y();
+ while (parent) {
+ bx += parent->x();
+ by += parent->y();
+ parent = parent->window();
+ }
+ NSRect rp = NSMakeRect(bx, main_screen_height - (by + w->h()), w->w(), w->h());
+ if (!NSEqualRects(rp, [self frame])) {
+ [self setFrame:rp display:YES];
+ }
+ if (![self parentWindow]) {
+ [pxid addChildWindow:self ordered:NSWindowAbove]; // needs OS X 10.2
+ [self orderWindow:NSWindowAbove relativeTo:[pxid windowNumber]]; // necessary under 10.3
+ }
+}
+
+- (void)checkSubwindowFrame {
+ if (![self parentWindow]) return;
+ // make sure this subwindow doesn't leak out of its parent window
+ Fl_Window *from = w, *parent;
+ CGRect full = CGRectMake(0, 0, w->w(), w->h()); // full subwindow area
+ CGRect srect = full; // will become new subwindow clip
+ int fromx = 0, fromy = 0;
+ while ((parent = from->window()) != NULL) { // loop over all parent windows
+ fromx -= from->x(); // parent origin in subwindow's coordinates
+ fromy -= from->y();
+ CGRect prect = CGRectMake(fromx, fromy, parent->w(), parent->h());
+ srect = CGRectIntersection(prect, srect); // area of subwindow inside its parent
+ from = parent;
+ }
+ CGRect *r = Fl_X::i(w)->subRect();
+ CGRect current_clip = (r ? *r : full); // current subwindow clip
+ if (!CGRectEqualToRect(srect, current_clip)) { // if new clip differs from current clip
+ delete r;
+ [[Fl_X::i(w)->xid contentView] setNeedsDisplay:YES]; // subwindow needs redrawn
+ if (CGRectEqualToRect(srect, full)) r = NULL;
+ else {
+ r = new CGRect(srect);
+ if (r->size.width == 0 && r->size.height == 0) r->origin.x = r->origin.y = 0;
+ }
+ Fl_X::i(w)->subRect(r);
+ }
+}
+
+-(void)waitForExpose
+{
+ if ([self getFl_Window]->shown()) {
+ // this makes freshly created windows appear on the screen, if they are not there already
+ NSModalSession session = [NSApp beginModalSessionForWindow:self];
+ [NSApp runModalSession:session];
+ [NSApp endModalSession:session];
+ }
}
+/* With Mac OS 10.11 the green window button makes window fullscreen (covers system menu bar and dock).
+ When there are subwindows, they are by default constrained not to cover the menu bar
+ (this is arguably a Mac OS bug).
+ Overriding the constrainFrameRect:toScreen: method removes this constraint.
+ */
+- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
+{
+ if ([self parentWindow]) return frameRect; // do not constrain subwindows
+ return [super constrainFrameRect:frameRect toScreen:screen]; // will prevent a window from going above the menu bar
+}
@end
@interface FLApplication : NSObject
@@ -809,14 +863,15 @@ double fl_mac_flush_and_wait(double time_to_wait) {
// the idle function may turn off idle, we can then wait:
if (Fl::idle) time_to_wait = 0.0;
}
+ NSDisableScreenUpdates(); // 10.3 Makes updates to all windows appear as a single event
Fl::flush();
+ NSEnableScreenUpdates(); // 10.3
if (Fl::idle && !in_idle) // 'idle' may have been set within flush()
time_to_wait = 0.0;
double retval = fl_wait(time_to_wait);
if (fl_gc) {
- CGContextFlush(fl_gc);
- fl_gc = 0;
- }
+ Fl_X::q_release_context();
+ }
[pool release];
return retval;
}
@@ -935,6 +990,7 @@ static void update_e_xy_and_e_xy_root(NSWindow *nsw)
Fl::e_y_root = int(main_screen_height - pt.y);
}
+
/*
* Cocoa Mousewheel handler
*/
@@ -976,13 +1032,38 @@ static void cocoaMouseWheelHandler(NSEvent *theEvent)
}
/*
+ * Cocoa Magnify Gesture Handler
+ */
+static void cocoaMagnifyHandler(NSEvent *theEvent)
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+ fl_lock_function();
+ Fl_Window *window = (Fl_Window*)[(FLWindow*)[theEvent window] getFl_Window];
+ if ( !window->shown() ) {
+ fl_unlock_function();
+ return;
+ }
+ Fl::first_window(window);
+ Fl::e_dy = [theEvent magnification]*1000; // 10.5.2
+ if ( Fl::e_dy) {
+ NSPoint pos = [theEvent locationInWindow];
+ pos.y = window->h() - pos.y;
+ NSUInteger mods = [theEvent modifierFlags];
+ mods_to_e_state( mods );
+ update_e_xy_and_e_xy_root([theEvent window]);
+ Fl::handle( FL_ZOOM_GESTURE, window );
+ }
+ fl_unlock_function();
+#endif
+}
+
+/*
* Cocoa Mouse Button Handler
*/
static void cocoaMouseHandler(NSEvent *theEvent)
{
static int keysym[] = { 0, FL_Button+1, FL_Button+3, FL_Button+2 };
static int px, py;
- static char suppressed = 0;
fl_lock_function();
@@ -1015,7 +1096,6 @@ static void cocoaMouseHandler(NSEvent *theEvent)
case NSLeftMouseDown:
case NSRightMouseDown:
case NSOtherMouseDown:
- suppressed = 0;
sendEvent = FL_PUSH;
Fl::e_is_click = 1;
px = (int)pos.x; py = (int)pos.y;
@@ -1027,10 +1107,6 @@ static void cocoaMouseHandler(NSEvent *theEvent)
case NSLeftMouseUp:
case NSRightMouseUp:
case NSOtherMouseUp:
- if (suppressed) {
- suppressed = 0;
- break;
- }
if ( !window ) break;
if ( !sendEvent ) {
sendEvent = FL_RELEASE;
@@ -1038,15 +1114,13 @@ static void cocoaMouseHandler(NSEvent *theEvent)
Fl::e_keysym = keysym[ btn ];
// fall through
case NSMouseMoved:
- suppressed = 0;
- if ( !sendEvent ) {
+ if ( !sendEvent ) {
sendEvent = FL_MOVE;
}
// fall through
case NSLeftMouseDragged:
case NSRightMouseDragged:
case NSOtherMouseDragged: {
- if (suppressed) break;
if ( !sendEvent ) {
sendEvent = FL_MOVE; // Fl::handle will convert into FL_DRAG
if (fabs(pos.x-px)>5 || fabs(pos.y-py)>5)
@@ -1070,11 +1144,21 @@ static void cocoaMouseHandler(NSEvent *theEvent)
{
BOOL isActive;
}
++ (void)initialize;
++ (FLTextView*)singleInstance;
- (void)insertText:(id)aString;
- (void)doCommandBySelector:(SEL)aSelector;
- (void)setActive:(BOOL)a;
@end
+static FLTextView *fltextview_instance = nil;
@implementation FLTextView
++ (void)initialize {
+ NSRect rect={{0,0},{20,20}};
+ fltextview_instance = [[FLTextView alloc] initWithFrame:rect];
+}
++ (FLTextView*)singleInstance {
+ return fltextview_instance;
+}
- (void)insertText:(id)aString
{
if (isActive) [[[NSApp keyWindow] contentView] insertText:aString];
@@ -1094,60 +1178,203 @@ static void cocoaMouseHandler(NSEvent *theEvent)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
<NSWindowDelegate>
#endif
-+ (FLWindowDelegate*)createOnce;
++ (void)initialize;
++ (FLWindowDelegate*)singleInstance;
- (void)windowDidMove:(NSNotification *)notif;
- (void)windowDidResize:(NSNotification *)notif;
- (void)windowDidResignKey:(NSNotification *)notif;
- (void)windowDidBecomeKey:(NSNotification *)notif;
- (void)windowDidBecomeMain:(NSNotification *)notif;
+- (void)windowWillMiniaturize:(NSNotification *)notif;
- (void)windowDidDeminiaturize:(NSNotification *)notif;
- (void)windowDidMiniaturize:(NSNotification *)notif;
- (BOOL)windowShouldClose:(id)fl;
-- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client;
- (void)anyWindowWillClose:(NSNotification *)notif;
+- (void)doNothing:(id)unused;
@end
+
+
+/* make subwindows re-appear after appl unhide or window deminiaturize
+ (not necessary with 10.5 and above)
+ */
+static void orderfront_subwindows(FLWindow *xid)
+{
+ NSArray *children = [xid childWindows]; // 10.2
+ NSEnumerator *enumerator = [children objectEnumerator];
+ id child;
+ while ((child = [enumerator nextObject]) != nil) { // this undo-redo seems necessary under 10.3
+ [xid removeChildWindow:child];
+ [xid addChildWindow:child ordered:NSWindowAbove];
+ [child orderWindow:NSWindowAbove relativeTo:[xid windowNumber]];
+ orderfront_subwindows(child);
+ }
+}
+
+#if FLTK_ABI_VERSION >= 10304
+static const unsigned windowDidResize_mask = 1;
+#else
+static const unsigned long windowDidResize_mask = 1;
+#endif
+
+bool Fl_X::in_windowDidResize() {
+#if FLTK_ABI_VERSION >= 10304
+ return mapped_to_retina_ & windowDidResize_mask;
+#else
+ return (unsigned long)xidChildren & windowDidResize_mask;
+#endif
+}
+
+void Fl_X::in_windowDidResize(bool b) {
+#if FLTK_ABI_VERSION >= 10304
+ if (b) mapped_to_retina_ |= windowDidResize_mask;
+ else mapped_to_retina_ &= ~windowDidResize_mask;
+#else
+ if (b) xidChildren = (Fl_X*)((unsigned long)xidChildren | windowDidResize_mask);
+ else xidChildren = (Fl_X*)((unsigned long)xidChildren & ~windowDidResize_mask);
+#endif
+}
+
+#if FLTK_ABI_VERSION >= 10304
+static const unsigned mapped_mask = 2;
+static const unsigned changed_mask = 4;
+#else
+static const unsigned long mapped_mask = 2; // sizeof(unsigned long) = sizeof(Fl_X*)
+static const unsigned long changed_mask = 4;
+#endif
+
+bool Fl_X::mapped_to_retina() {
+#if FLTK_ABI_VERSION >= 10304
+ return mapped_to_retina_ & mapped_mask;
+#else
+ return (unsigned long)xidChildren & mapped_mask;
+#endif
+}
+
+void Fl_X::mapped_to_retina(bool b) {
+#if FLTK_ABI_VERSION >= 10304
+ if (b) mapped_to_retina_ |= mapped_mask;
+ else mapped_to_retina_ &= ~mapped_mask;
+#else
+ if (b) xidChildren = (Fl_X*)((unsigned long)xidChildren | mapped_mask);
+ else xidChildren = (Fl_X*)((unsigned long)xidChildren & ~mapped_mask);
+#endif
+}
+
+bool Fl_X::changed_resolution() {
+#if FLTK_ABI_VERSION >= 10304
+ return mapped_to_retina_ & changed_mask;
+#else
+ return (unsigned long)xidChildren & changed_mask;
+#endif
+}
+
+void Fl_X::changed_resolution(bool b) {
+#if FLTK_ABI_VERSION >= 10304
+ if (b) mapped_to_retina_ |= changed_mask;
+ else mapped_to_retina_ &= ~changed_mask;
+#else
+ if (b) xidChildren = (Fl_X*)((unsigned long)xidChildren | changed_mask);
+ else xidChildren = (Fl_X*)((unsigned long)xidChildren & ~changed_mask);
+#endif
+}
+
+
+@interface FLWindowDelegateBefore10_6 : FLWindowDelegate
+- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client;
+@end
+@implementation FLWindowDelegateBefore10_6
+- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client
+{
+ return [FLTextView singleInstance];
+}
+@end
+
+@interface FLWindowDelegateBefore10_5 : FLWindowDelegateBefore10_6
+-(void)windowDidDeminiaturize:(NSNotification *)notif;
+-(void)windowWillMiniaturize:(NSNotification *)notif;
+@end
+@implementation FLWindowDelegateBefore10_5
+-(void)windowDidDeminiaturize:(NSNotification *)notif
+{
+ [super windowDidDeminiaturize:notif];
+ fl_lock_function();
+ orderfront_subwindows([notif object]);
+ fl_unlock_function();
+}
+-(void)windowWillMiniaturize:(NSNotification *)notif
+{
+ [super windowWillMiniaturize:notif];
+ NSArray *children = [(NSWindow*)[notif object] childWindows]; // 10.2
+ NSEnumerator *enumerator = [children objectEnumerator];
+ id child;
+ while ((child = [enumerator nextObject]) != nil) [child orderOut:self];
+}
+@end
+
+static FLWindowDelegate *flwindowdelegate_instance = nil;
@implementation FLWindowDelegate
-+ (FLWindowDelegate*)createOnce
++ (void)initialize
{
- static FLWindowDelegate* delegate = nil;
- if (!delegate) {
- delegate = [[FLWindowDelegate alloc] init];
- }
- return delegate;
+ if (self == [FLWindowDelegate self]) {
+ if (fl_mac_os_version < 100500) flwindowdelegate_instance = [FLWindowDelegateBefore10_5 alloc];
+ else if (fl_mac_os_version < 100600) flwindowdelegate_instance = [FLWindowDelegateBefore10_6 alloc];
+ else flwindowdelegate_instance = [FLWindowDelegate alloc];
+ flwindowdelegate_instance = [flwindowdelegate_instance init];
+ }
+}
++ (FLWindowDelegate*)singleInstance {
+ return flwindowdelegate_instance;
}
- (void)windowDidMove:(NSNotification *)notif
{
fl_lock_function();
FLWindow *nsw = (FLWindow*)[notif object];
Fl_Window *window = [nsw getFl_Window];
- NSPoint pt, pt2;
- pt.x = 0;
- pt.y = [[nsw contentView] frame].size.height;
- pt2 = [nsw convertBaseToScreen:pt];
- update_e_xy_and_e_xy_root(nsw);
resize_from_system = window;
- window->position((int)pt2.x, (int)(main_screen_height - pt2.y));
- if ([nsw containsGLsubwindow] && fl_mac_os_version < 100700) {
- [nsw display];// with OS < 10.7, redraw window after moving if it contains OpenGL subwindows
+ NSPoint pt2;
+ pt2 = [nsw convertBaseToScreen:NSMakePoint(0, [[nsw contentView] frame].size.height)];
+ update_e_xy_and_e_xy_root(nsw);
+ pt2.y = main_screen_height - pt2.y;
+ Fl_Window *parent = window->window();
+ while (parent) {
+ pt2.x -= parent->x();
+ pt2.y -= parent->y();
+ parent = parent->window();
}
+ window->position((int)pt2.x, (int)pt2.y);
+ if (fl_mac_os_version < 100700) { // after move, redraw parent and children of GL windows
+ parent = window->window();
+ if (parent && parent->as_gl_window()) window->redraw();
+ if (parent && window->as_gl_window()) parent->redraw();
+ }
+ resize_from_system = NULL;
+ [nsw recursivelySendToSubwindows:@selector(setSubwindowFrame)];
+ [nsw checkSubwindowFrame];
fl_unlock_function();
}
- (void)windowDidResize:(NSNotification *)notif
{
- fl_lock_function();
FLWindow *nsw = (FLWindow*)[notif object];
+ if (![nsw isVisible]) return;
+ fl_lock_function();
Fl_Window *window = [nsw getFl_Window];
- NSRect r = [[nsw contentView] frame];
- NSPoint pt, pt2;
- pt.x = 0;
- pt.y = [[nsw contentView] frame].size.height;
- pt2 = [nsw convertBaseToScreen:pt];
+ NSRect r; NSPoint pt2;
+ r = [[nsw contentView] frame];
+ pt2 = [nsw convertBaseToScreen:NSMakePoint(0, r.size.height)];
+ pt2.y = main_screen_height - pt2.y;
+ Fl_Window *parent = window->window();
+ while (parent) {
+ pt2.x -= parent->x();
+ pt2.y -= parent->y();
+ parent = parent->window();
+ }
resize_from_system = window;
+ if (window->as_gl_window() && Fl_X::i(window)) Fl_X::i(window)->in_windowDidResize(true);
update_e_xy_and_e_xy_root(nsw);
- window->resize((int)pt2.x,
- (int)(main_screen_height - pt2.y),
- (int)r.size.width,
- (int)r.size.height);
+ window->resize((int)pt2.x, (int)pt2.y, (int)r.size.width, (int)r.size.height);
+ [nsw recursivelySendToSubwindows:@selector(setSubwindowFrame)];
+ [nsw recursivelySendToSubwindows:@selector(checkSubwindowFrame)];
+ if (window->as_gl_window() && Fl_X::i(window)) Fl_X::i(window)->in_windowDidResize(false);
fl_unlock_function();
}
- (void)windowDidResignKey:(NSNotification *)notif
@@ -1156,8 +1383,9 @@ static void cocoaMouseHandler(NSEvent *theEvent)
FLWindow *nsw = (FLWindow*)[notif object];
Fl_Window *window = [nsw getFl_Window];
/* Fullscreen windows obscure all other windows so we need to return
- to a "normal" level when the user switches to another window */
- if (window->fullscreen_active()) {
+ to a "normal" level when the user switches to another window,
+ unless this other window is above the fullscreen window */
+ if (window->fullscreen_active() && [NSApp keyWindow] && [[NSApp keyWindow] level] <= [nsw level]) {
[nsw setLevel:NSNormalWindowLevel];
fixup_window_levels();
}
@@ -1174,7 +1402,7 @@ static void cocoaMouseHandler(NSEvent *theEvent)
[nsw setLevel:NSStatusWindowLevel];
fixup_window_levels();
}
- if ( w->border() || (!w->modal() && !w->tooltip_window()) ) Fl::handle( FL_FOCUS, w);
+ Fl::handle( FL_FOCUS, w);
fl_unlock_function();
}
- (void)windowDidBecomeMain:(NSNotification *)notif
@@ -1190,9 +1418,27 @@ static void cocoaMouseHandler(NSEvent *theEvent)
{
fl_lock_function();
FLWindow *nsw = (FLWindow*)[notif object];
+ if ([nsw miniwindowImage]) { [nsw setMiniwindowImage:nil]; }
Fl_Window *window = [nsw getFl_Window];
Fl::handle(FL_SHOW, window);
update_e_xy_and_e_xy_root(nsw);
+ Fl::flush(); // Process redraws set by FL_SHOW.
+ fl_unlock_function();
+}
+- (void)windowWillMiniaturize:(NSNotification *)notif
+{
+ // subwindows are not captured in system-built miniature window image
+ fl_lock_function();
+ FLWindow *nsw = (FLWindow*)[notif object];
+ if ([[nsw childWindows] count]) {
+ // capture the window and its subwindows and use as miniature window image
+ Fl_Window *window = [nsw getFl_Window];
+ NSBitmapImageRep *bitmap = rect_to_NSBitmapImageRep(window, 0, 0, window->w(), window->h());
+ NSImage *img = [[[NSImage alloc] initWithSize:NSMakeSize([bitmap pixelsWide], [bitmap pixelsHigh])] autorelease];
+ [img addRepresentation:bitmap];
+ [bitmap release];
+ [nsw setMiniwindowImage:img];
+ }
fl_unlock_function();
}
- (void)windowDidMiniaturize:(NSNotification *)notif
@@ -1211,18 +1457,6 @@ static void cocoaMouseHandler(NSEvent *theEvent)
// the system doesn't need to send [fl close] because FLTK does it when needed
return NO;
}
-- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client
-{
- if (fl_mac_os_version < 100600) {
- static FLTextView *view = nil;
- if (!view) {
- NSRect rect={{0,0},{20,20}};
- view = [[FLTextView alloc] initWithFrame:rect];
- }
- return view;
- }
- return nil;
-}
- (void)anyWindowWillClose:(NSNotification *)notif
{
fl_lock_function();
@@ -1239,6 +1473,10 @@ static void cocoaMouseHandler(NSEvent *theEvent)
}
fl_unlock_function();
}
+- (void)doNothing:(id)unused
+{
+ return;
+}
@end
@interface FLAppDelegate : NSObject
@@ -1247,6 +1485,7 @@ static void cocoaMouseHandler(NSEvent *theEvent)
#endif
{
void (*open_cb)(const char*);
+ @public
TSMDocumentID currentDoc;
}
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender;
@@ -1265,11 +1504,12 @@ static void cocoaMouseHandler(NSEvent *theEvent)
fl_lock_function();
NSApplicationTerminateReply reply = NSTerminateNow;
while ( Fl_X::first ) {
- Fl_X *x = Fl_X::first;
- Fl::handle( FL_CLOSE, x->w );
- Fl::do_widget_deletion();
- if ( Fl_X::first == x ) {
- reply = NSTerminateCancel; // FLTK has not closed all windows, so we return to the main program now
+ Fl_Window *win = Fl::first_window();
+ if (win->parent()) win = win->top_window();
+ Fl_Widget_Tracker wt(win); // track the window object
+ Fl::handle(FL_CLOSE, win);
+ if (wt.exists() && win->shown()) { // the user didn't close win
+ reply = NSTerminateCancel; // so we return to the main program now
break;
}
}
@@ -1303,7 +1543,7 @@ static void cocoaMouseHandler(NSEvent *theEvent)
int count = [windows count];
for (int i = 0; i < count; i++) {
NSWindow *win = [windows objectAtIndex:i];
- if ([win isKindOfClass:[FLWindow class]]) {
+ if ([win isKindOfClass:[FLWindow class]] && ![win parentWindow] && [win isVisible]) {
[[NSNotificationCenter defaultCenter] postNotificationName:NSWindowDidMoveNotification object:win];
}
}
@@ -1312,8 +1552,7 @@ static void cocoaMouseHandler(NSEvent *theEvent)
}
- (void)applicationDidUpdate:(NSNotification *)aNotification
{
- if ((fl_mac_os_version >= 100500) && (im_enabled != -1) &&
- (TSMGetActiveDocument != NULL)) {
+ if (im_enabled != -1) {
TSMDocumentID newDoc;
// It is extremely unclear when Cocoa decides to create/update
// the input context, but debugging reveals that it is done
@@ -1322,8 +1561,21 @@ static void cocoaMouseHandler(NSEvent *theEvent)
// input methods status.
newDoc = TSMGetActiveDocument();
if (newDoc != currentDoc) {
- im_update();
- currentDoc = newDoc;
+ TSMDocumentID doc;
+
+ doc = TSMGetActiveDocument();
+
+ if (im_enabled)
+ TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag);
+ else {
+ CFArrayRef inputSources;
+
+ inputSources = TISCreateASCIICapableInputSourceList();
+ TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag,
+ sizeof(CFArrayRef), &inputSources);
+ CFRelease(inputSources);
+ }
+ currentDoc = newDoc;
}
}
}
@@ -1381,23 +1633,24 @@ static void cocoaMouseHandler(NSEvent *theEvent)
- (void)applicationWillUnhide:(NSNotification *)notify
{
fl_lock_function();
- Fl_X *x;
- for (x = Fl_X::first;x;x = x->next) {
+ for (Fl_X *x = Fl_X::first;x;x = x->next) {
Fl_Window *w = x->w;
if ( !w->parent() && ![x->xid isMiniaturized]) {
- Fl::handle( FL_SHOW, w);
+ Fl::handle(FL_SHOW, w);
}
}
fl_unlock_function();
}
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
- // without the next statement, the opening of the 1st window is delayed by several seconds
+ // without the next two statements, the opening of the 1st window is delayed by several seconds
// under Mac OS ≥ 10.8 when a file is dragged on the application icon
- [[theApplication mainWindow] orderFront:self];
+ Fl_Window *firstw = Fl::first_window();
+ if (firstw) firstw->wait_for_expose();
if (open_cb) {
fl_lock_function();
(*open_cb)([filename UTF8String]);
+ Fl::flush(); // useful for AppleScript that does not break the event loop
fl_unlock_function();
return YES;
}
@@ -1409,6 +1662,26 @@ static void cocoaMouseHandler(NSEvent *theEvent)
}
@end
+@interface FLAppDelegateBefore10_5 : FLAppDelegate
+- (void)applicationDidUnhide:(NSNotification *)notify;
+- (void)applicationDidUpdate:(NSNotification *)aNotification;
+@end
+@implementation FLAppDelegateBefore10_5
+- (void)applicationDidUnhide:(NSNotification *)notify
+{ // before 10.5, subwindows are lost when application is unhidden
+ fl_lock_function();
+ for (Fl_X *x = Fl_X::first; x; x = x->next) {
+ if (![x->xid parentWindow]) {
+ orderfront_subwindows(x->xid);
+ }
+ }
+ fl_unlock_function();
+}
+- (void)applicationDidUpdate:(NSNotification *)aNotification
+{
+}
+@end
+
/*
* Install an open documents event handler...
*/
@@ -1464,19 +1737,13 @@ void fl_open_display() {
static char beenHereDoneThat = 0;
if ( !beenHereDoneThat ) {
beenHereDoneThat = 1;
-
- TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument");
- TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty");
- TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty");
- TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_X::get_carbon_function("TISCreateASCIICapableInputSourceList");
-
- KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript");
BOOL need_new_nsapp = (NSApp == nil);
if (need_new_nsapp) [NSApplication sharedApplication];
NSAutoreleasePool *localPool;
localPool = [[NSAutoreleasePool alloc] init]; // never released
- [(NSApplication*)NSApp setDelegate:[[FLAppDelegate alloc] init]];
+ FLAppDelegate *delegate = (fl_mac_os_version < 100500 ? [FLAppDelegateBefore10_5 alloc] : [FLAppDelegate alloc]);
+ [(NSApplication*)NSApp setDelegate:[delegate init]];
if (need_new_nsapp) [NSApp finishLaunching];
// empty the event queue but keep system events for drag&drop of files at launch
@@ -1523,18 +1790,21 @@ void fl_open_display() {
/* support of Mac OS 10.2 or earlier used this undocumented call instead
err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
*/
- [NSApp activateIgnoringOtherApps:YES];
}
+ [NSApp activateIgnoringOtherApps:YES];
}
if (![NSApp servicesMenu]) createAppleMenu();
main_screen_height = [[[NSScreen screens] objectAtIndex:0] frame].size.height;
- [[NSNotificationCenter defaultCenter] addObserver:[FLWindowDelegate createOnce]
+ [[NSNotificationCenter defaultCenter] addObserver:[FLWindowDelegate singleInstance]
selector:@selector(anyWindowWillClose:)
name:NSWindowWillCloseNotification
object:nil];
- // necessary for secondary pthreads to be allowed to use cocoa,
- // especially to create an NSAutoreleasePool.
- [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil];
+ if (![NSThread isMultiThreaded]) {
+ // With old OS X versions, it is necessary to create one thread for secondary pthreads to be
+ // allowed to use cocoa, especially to create an NSAutoreleasePool.
+ // We create a thread that does nothing so it completes very fast:
+ [NSThread detachNewThreadSelector:@selector(doNothing:) toTarget:[FLWindowDelegate singleInstance] withObject:nil];
+ }
}
}
@@ -1550,59 +1820,49 @@ void fl_close_display() {
// (see nsTSMManager::SyncKeyScript in Mozilla and enableSecureTextInput
// in Safari/Webcore). Should be good enough for us then...
-static void im_update(void) {
- if (fl_mac_os_version >= 100500) {
- TSMDocumentID doc;
-
- if ((TSMGetActiveDocument == NULL) ||
- (TSMSetDocumentProperty == NULL) ||
- (TSMRemoveDocumentProperty == NULL) ||
- (TISCreateASCIICapableInputSourceList == NULL))
- return;
-
- doc = TSMGetActiveDocument();
-
- if (im_enabled)
- TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag);
- else {
- CFArrayRef inputSources;
-
- inputSources = TISCreateASCIICapableInputSourceList();
- TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag,
- sizeof(CFArrayRef), &inputSources);
- CFRelease(inputSources);
+static int input_method_startup()
+{
+ static int retval = -1; // -1: not initialized, 0: not usable, 1: ready for use
+ if (retval == -1) {
+ fl_open_display();
+ if (fl_mac_os_version >= 100500) {
+ TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument");
+ TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty");
+ TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty");
+ TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_X::get_carbon_function("TISCreateASCIICapableInputSourceList");
+ retval = (TSMGetActiveDocument && TSMSetDocumentProperty && TSMRemoveDocumentProperty && TISCreateASCIICapableInputSourceList ? 1 : 0);
+ } else {
+ KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript");
+ retval = (KeyScript? 1 : 0);
}
- } else {
- if (KeyScript == NULL)
- return;
-
- if (im_enabled)
- KeyScript(smKeyEnableKybds);
- else
- KeyScript(smEnableRomanKybdsOnly);
}
+ return retval;
}
void Fl::enable_im() {
- fl_open_display();
+ if (!input_method_startup()) return;
im_enabled = 1;
- if (fl_mac_os_version >= 100500)
- [NSApp updateWindows];
+ if (fl_mac_os_version >= 100500) {
+ ((FLAppDelegate*)[NSApp delegate])->currentDoc = NULL;
+ [NSApp updateWindows]; // triggers [FLAppDelegate applicationDidUpdate]
+ }
else
- im_update();
+ KeyScript(smKeyEnableKybds);
}
void Fl::disable_im() {
- fl_open_display();
+ if (!input_method_startup()) return;
im_enabled = 0;
- if (fl_mac_os_version >= 100500)
- [NSApp updateWindows];
+ if (fl_mac_os_version >= 100500) {
+ ((FLAppDelegate*)[NSApp delegate])->currentDoc = NULL;
+ [NSApp updateWindows]; // triggers [FLAppDelegate applicationDidUpdate]
+ }
else
- im_update();
+ KeyScript(smEnableRomanKybdsOnly);
}
@@ -1612,12 +1872,13 @@ static void get_window_frame_sizes(int &bx, int &by, int &bt) {
static int top, left, bottom;
if (first) {
first = false;
- if (NSApp == nil) fl_open_display();
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSRect inside = { {20,20}, {100,100} };
NSRect outside = [NSWindow frameRectForContentRect:inside styleMask:NSTitledWindowMask];
left = int(outside.origin.x - inside.origin.x);
bottom = int(outside.origin.y - inside.origin.y);
top = int(outside.size.height - inside.size.height) - bottom;
+ [pool release];
}
bx = left;
by = bottom;
@@ -1681,31 +1942,29 @@ void Fl::get_mouse(int &x, int &y)
/*
- * Gets called when a window is created, resized, or deminiaturized
+ * Gets called when a window is created or resized, or moved into/out a retina display
+ * (with Mac OS 10.11 also when deminiaturized)
*/
static void handleUpdateEvent( Fl_Window *window )
{
if ( !window ) return;
Fl_X *i = Fl_X::i( window );
+ if (fl_mac_os_version >= 100700) { // determine whether window is mapped to a retina display
+ bool previous = i->mapped_to_retina();
+ // rewrite next call that requires 10.7 and therefore triggers a compiler warning on old SDKs
+ //NSSize s = [[i->xid contentView] convertSizeToBacking:NSMakeSize(10, 10)];
+ typedef NSSize (*convertSizeIMP)(id, SEL, NSSize);
+ static convertSizeIMP addr = (convertSizeIMP)[NSView instanceMethodForSelector:@selector(convertSizeToBacking:)];
+ NSSize s = addr([i->xid contentView], @selector(convertSizeToBacking:), NSMakeSize(10, 10));
+ i->mapped_to_retina( int(s.width + 0.5) > 10 );
+ if (i->wait_for_expose == 0 && previous != i->mapped_to_retina()) i->changed_resolution(true);
+ }
i->wait_for_expose = 0;
if ( i->region ) {
XDestroyRegion(i->region);
i->region = 0;
}
-
- for ( Fl_X *cx = i->xidChildren; cx; cx = cx->xidNext ) {
- if ( cx->region ) {
- XDestroyRegion(cx->region);
- cx->region = 0;
- }
- cx->w->clear_damage(FL_DAMAGE_ALL);
- CGContextRef gc = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
- CGContextSaveGState(gc); // save original context
- cx->flush();
- CGContextRestoreGState(gc); // restore original context
- cx->w->clear_damage();
- }
window->clear_damage(FL_DAMAGE_ALL);
i->flush();
window->clear_damage();
@@ -1733,6 +1992,8 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by)
W = w->w()+dx;
H = w->h()+dy;
+ if (w->parent()) return 0;
+
// 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
@@ -1850,10 +2111,11 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi
Keyboard input sends keyDown: and performKeyEquivalent: messages to myview. The latter occurs for keys such as
ForwardDelete, arrows and F1, and when the Ctrl or Cmd modifiers are used. Other key presses send keyDown: messages.
- The keyDown: method calls [[myview inputContext] handleEvent:theEvent] that triggers system
- processing of keyboard events. The performKeyEquivalent: method directly calls Fl::handle(FL_KEYBOARD, focus-window)
+ The keyDown: method calls [myview process_keydown:theEvent] that is equivalent to
+ [[myview inputContext] handleEvent:theEvent], and triggers system processing of keyboard events.
+ 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
+ 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:
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,
@@ -1884,16 +2146,11 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi
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 crucial call [[myview inputContext] handleEvent:theEvent] is not possible because neither the
- inputContext nor the handleEvent: methods are implemented. This call is re-written:
- static SEL inputContextSEL = (fl_mac_os_version >= 100600 ? @selector(inputContext) : @selector(FLinputContext));
- [[myview performSelector:inputContextSEL] handleEvent:theEvent];
- that replaces the 10.6 inputContext message by the FLinputContext message. This message and two FLTK-defined classes,
- FLTextInputContext and FLTextView, are used to emulate with OS <= 10.5 what's possible with OS >= 10.6.
- Method -(FLTextInputContext*)[FLView FLinputContext] returns an instance of class FLTextInputContext that possesses
- a handleEvent: method. FLView's FLinputContext method also calls [[self window] fieldEditor:YES forObject:nil] which
- returns the so-called view's "field editor". This editor is an instance of the FLTextView class allocated by the
- -(id)[FLWindowDelegate windowWillReturnFieldEditor: toObject:] method.
+ With OS <= 10.5, the NSView class does not implement the inputContext message. [myview process_keydown:theEvent] is
+ equivalent to [[FLTextInputContext singleInstance] handleEvent:theEvent].
+ Method +[FLTextInputContext singleInstance] returns an instance of class FLTextInputContext that possesses
+ a handleEvent: method. The class FLTextView implements the so-called view's "field editor". This editor is an instance
+ 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.
@@ -1928,6 +2185,7 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
// printf("%08x %08x %08x\n", keyCode, mods, key);
maskedKeyCode = keyCode & 0x7f;
mods_to_e_state( mods ); // process modifier keys
+ if (!macKeyLookUp) macKeyLookUp = fl_compute_macKeyLookUp();
sym = macKeyLookUp[maskedKeyCode];
if (sym < 0xff00) { // a "simple" key
// find the result of this key without modifier
@@ -1946,17 +2204,24 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
Fl::e_text = (char*)"";
}
-@interface FLTextInputContext : NSObject { // "emulates" NSTextInputContext before OS 10.6
-@public
- FLTextView *edit;
-}
+@interface FLTextInputContext : NSObject // "emulates" NSTextInputContext before OS 10.6
++ (void)initialize;
++ (FLTextInputContext*)singleInstance;
-(BOOL)handleEvent:(NSEvent*)theEvent;
@end
+static FLTextInputContext* fltextinputcontext_instance = nil;
@implementation FLTextInputContext
++ (void)initialize {
+ fltextinputcontext_instance = [[FLTextInputContext alloc] init];
+}
++ (FLTextInputContext*)singleInstance {
+ return fltextinputcontext_instance;
+}
-(BOOL)handleEvent:(NSEvent*)theEvent {
- [self->edit setActive:YES];
- [self->edit interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
- [self->edit setActive:YES];
+ FLTextView *edit = [FLTextView singleInstance];
+ [edit setActive:YES];
+ [edit interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
+ [edit setActive:YES];
return YES;
}
@end
@@ -1973,7 +2238,8 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
}
+ (void)prepareEtext:(NSString*)aString;
+ (void)concatEtext:(NSString*)aString;
-- (id)init;
+- (BOOL)process_keydown:(NSEvent*)theEvent;
+- (id)initWithFrame:(NSRect)frameRect;
- (void)drawRect:(NSRect)rect;
- (BOOL)acceptsFirstResponder;
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent;
@@ -1990,6 +2256,7 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
- (void)rightMouseDragged:(NSEvent *)theEvent;
- (void)otherMouseDragged:(NSEvent *)theEvent;
- (void)scrollWheel:(NSEvent *)theEvent;
+- (void)magnifyWithEvent:(NSEvent *)theEvent;
- (void)keyDown:(NSEvent *)theEvent;
- (void)keyUp:(NSEvent *)theEvent;
- (void)flagsChanged:(NSEvent *)theEvent;
@@ -1998,7 +2265,6 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
- (void)draggingExited:(id < NSDraggingInfo >)sender;
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal;
-- (FLTextInputContext*)FLinputContext;
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
- (void)setMarkedText:(id)aString selectedRange:(NSRange)newSelection replacementRange:(NSRange)replacementRange;
@@ -2009,10 +2275,15 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
@end
@implementation FLView
-- (id)init
+- (BOOL)process_keydown:(NSEvent*)theEvent
+{
+ id o = fl_mac_os_version >= 100600 ? [self performSelector:@selector(inputContext)] : [FLTextInputContext singleInstance];
+ return [o handleEvent:theEvent];
+}
+- (id)initWithFrame:(NSRect)frameRect
{
static NSInteger counter = 0;
- self = [super init];
+ self = [super initWithFrame:frameRect];
if (self) {
in_key_event = NO;
identifier = ++counter;
@@ -2022,18 +2293,17 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
- (void)drawRect:(NSRect)rect
{
fl_lock_function();
- through_drawRect = YES;
FLWindow *cw = (FLWindow*)[self window];
Fl_Window *w = [cw getFl_Window];
- if (fl_x_to_redraw) fl_x_to_redraw->flush();
- else handleUpdateEvent(w);
+ through_drawRect = YES;
+ handleUpdateEvent(w);
through_drawRect = NO;
fl_unlock_function();
}
- (BOOL)acceptsFirstResponder
{
- return YES;
+ return [[self window] parentWindow] ? NO : YES; // 10.2
}
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent
{
@@ -2042,6 +2312,7 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
cocoaKeyboardHandler(theEvent);
BOOL handled;
NSUInteger mods = [theEvent modifierFlags];
+ Fl_Window *w = [(FLWindow*)[theEvent window] getFl_Window];
if ( (mods & NSControlKeyMask) || (mods & NSCommandKeyMask) ) {
NSString *s = [theEvent characters];
if ( (mods & NSShiftKeyMask) && (mods & NSCommandKeyMask) ) {
@@ -2049,13 +2320,13 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
}
[FLView prepareEtext:s];
Fl::compose_state = 0;
- handled = Fl::handle(FL_KEYBOARD, [(FLWindow*)[theEvent window] getFl_Window]);
+ handled = Fl::handle(FL_KEYBOARD, w);
}
else {
in_key_event = YES;
need_handle = NO;
- handled = [[self performSelector:inputContextSEL] handleEvent:theEvent];
- if (need_handle) handled = Fl::handle(FL_KEYBOARD, [(FLWindow*)[theEvent window] getFl_Window]);
+ handled = [self process_keydown:theEvent];
+ if (need_handle) handled = Fl::handle(FL_KEYBOARD, w);
in_key_event = NO;
}
fl_unlock_function();
@@ -2111,6 +2382,9 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
- (void)scrollWheel:(NSEvent *)theEvent {
cocoaMouseWheelHandler(theEvent);
}
+- (void)magnifyWithEvent:(NSEvent *)theEvent {
+ cocoaMagnifyHandler(theEvent);
+}
- (void)keyDown:(NSEvent *)theEvent {
//NSLog(@"keyDown:%@",[theEvent characters]);
fl_lock_function();
@@ -2118,8 +2392,14 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
Fl::first_window(window);
cocoaKeyboardHandler(theEvent);
in_key_event = YES;
- need_handle = NO;
- [[self performSelector:inputContextSEL] handleEvent:theEvent];
+ Fl_Widget *f = Fl::focus();
+ if (f && f->as_gl_window()) { // ignore text input methods for GL windows
+ need_handle = YES;
+ [FLView prepareEtext:[theEvent characters]];
+ } else {
+ need_handle = NO;
+ [self process_keydown:theEvent];
+ }
if (need_handle) Fl::handle(FL_KEYBOARD, window);
in_key_event = NO;
fl_unlock_function();
@@ -2146,6 +2426,7 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
if ( tMods )
{
unsigned short keycode = [theEvent keyCode];
+ if (!macKeyLookUp) macKeyLookUp = fl_compute_macKeyLookUp();
Fl::e_keysym = Fl::e_original_keysym = macKeyLookUp[keycode & 0x7f];
if ( Fl::e_keysym )
sendEvent = ( prevMods<mods ) ? FL_KEYBOARD : FL_KEYUP;
@@ -2154,7 +2435,6 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
prevMods = mods;
}
mods_to_e_state( mods );
- while (window->parent()) window = window->window();
if (sendEvent) Fl::handle(sendEvent,window);
fl_unlock_function();
}
@@ -2209,8 +2489,8 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
CFStringGetCString(all, DragData, l + 1, kCFStringEncodingUTF8);
CFRelease(all);
}
- else if ( [[pboard types] containsObject:utf8_format] ) {
- NSData *data = [pboard dataForType:utf8_format];
+ else if ( [[pboard types] containsObject:UTF8_pasteboard_type] ) {
+ NSData *data = [pboard dataForType:UTF8_pasteboard_type];
DragData = (char *)malloc([data length] + 1);
[data getBytes:DragData];
DragData[[data length]] = 0;
@@ -2248,15 +2528,6 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
return NSDragOperationGeneric;
}
-- (FLTextInputContext*)FLinputContext { // used only if OS < 10.6 to replace [NSView inputContext]
- static FLTextInputContext *context = NULL;
- if (!context) {
- context = [[FLTextInputContext alloc] init];
- }
- context->edit = (FLTextView*)[[self window] fieldEditor:YES forObject:nil];
- return context;
-}
-
+ (void)prepareEtext:(NSString*)aString {
// fills Fl::e_text with UTF-8 encoded aString using an adequate memory allocation
static char *received_utf8 = NULL;
@@ -2339,7 +2610,7 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
// for some reason, with the palette, the window does not redraw until the next mouse move or button push
// sending a 'redraw()' or 'awake()' does not solve the issue!
if (palette) Fl::flush();
- if (fl_mac_os_version < 100600) [(FLTextView*)[[self window] fieldEditor:YES forObject:nil] setActive:NO];
+ if (fl_mac_os_version < 100600) [[FLTextView singleInstance] setActive:NO];
fl_unlock_function();
}
@@ -2466,12 +2737,148 @@ static void cocoaKeyboardHandler(NSEvent *theEvent)
return [[self window] level];
}
-- (NSInteger)conversationIdentifier {
+- (
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ NSInteger
+#else
+ long
+#endif
+)conversationIdentifier {
return identifier;
}
-
@end
+
+NSOpenGLPixelFormat* Fl_X::mode_to_NSOpenGLPixelFormat(int m, const int *alistp)
+{
+ NSOpenGLPixelFormatAttribute attribs[32];
+ int n = 0;
+ // AGL-style code remains commented out for comparison
+ if (!alistp) {
+ if (m & FL_INDEX) {
+ //list[n++] = AGL_BUFFER_SIZE; list[n++] = 8;
+ } else {
+ //list[n++] = AGL_RGBA;
+ //list[n++] = AGL_GREEN_SIZE;
+ //list[n++] = (m & FL_RGB8) ? 8 : 1;
+ attribs[n++] = NSOpenGLPFAColorSize;
+ attribs[n++] = (NSOpenGLPixelFormatAttribute)((m & FL_RGB8) ? 32 : 1);
+ if (m & FL_ALPHA) {
+ //list[n++] = AGL_ALPHA_SIZE;
+ attribs[n++] = NSOpenGLPFAAlphaSize;
+ attribs[n++] = (NSOpenGLPixelFormatAttribute)((m & FL_RGB8) ? 8 : 1);
+ }
+ if (m & FL_ACCUM) {
+ //list[n++] = AGL_ACCUM_GREEN_SIZE; list[n++] = 1;
+ attribs[n++] = NSOpenGLPFAAccumSize;
+ attribs[n++] = (NSOpenGLPixelFormatAttribute)1;
+ if (m & FL_ALPHA) {
+ //list[n++] = AGL_ACCUM_ALPHA_SIZE; list[n++] = 1;
+ }
+ }
+ }
+ if (m & FL_DOUBLE) {
+ //list[n++] = AGL_DOUBLEBUFFER;
+ attribs[n++] = NSOpenGLPFADoubleBuffer;
+ }
+ if (m & FL_DEPTH) {
+ //list[n++] = AGL_DEPTH_SIZE; list[n++] = 24;
+ attribs[n++] = NSOpenGLPFADepthSize;
+ attribs[n++] = (NSOpenGLPixelFormatAttribute)24;
+ }
+ if (m & FL_STENCIL) {
+ //list[n++] = AGL_STENCIL_SIZE; list[n++] = 1;
+ attribs[n++] = NSOpenGLPFAStencilSize;
+ attribs[n++] = (NSOpenGLPixelFormatAttribute)1;
+ }
+ if (m & FL_STEREO) {
+ //list[n++] = AGL_STEREO;
+ attribs[n++] = NSOpenGLPFAStereo;
+ }
+ if ((m & FL_MULTISAMPLE) && fl_mac_os_version >= 100400) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ attribs[n++] = NSOpenGLPFAMultisample, // 10.4
+#endif
+ attribs[n++] = NSOpenGLPFASampleBuffers; attribs[n++] = (NSOpenGLPixelFormatAttribute)1;
+ attribs[n++] = NSOpenGLPFASamples; attribs[n++] = (NSOpenGLPixelFormatAttribute)4;
+ }
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+#define NSOpenGLPFAOpenGLProfile (NSOpenGLPixelFormatAttribute)99
+#define kCGLPFAOpenGLProfile NSOpenGLPFAOpenGLProfile
+#define NSOpenGLProfileVersionLegacy (NSOpenGLPixelFormatAttribute)0x1000
+#define NSOpenGLProfileVersion3_2Core (NSOpenGLPixelFormatAttribute)0x3200
+#define kCGLOGLPVersion_Legacy NSOpenGLProfileVersionLegacy
+#endif
+ if (fl_mac_os_version >= 100700) {
+ attribs[n++] = NSOpenGLPFAOpenGLProfile;
+ attribs[n++] = (m & FL_OPENGL3) ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy;
+ }
+ } else {
+ while (alistp[n] && n < 30) {
+ if (alistp[n] == kCGLPFAOpenGLProfile) {
+ if (fl_mac_os_version < 100700) {
+ if (alistp[n+1] != kCGLOGLPVersion_Legacy) return nil;
+ n += 2;
+ continue;
+ }
+ }
+ attribs[n] = (NSOpenGLPixelFormatAttribute)alistp[n];
+ n++;
+ }
+ }
+ attribs[n] = (NSOpenGLPixelFormatAttribute)0;
+ NSOpenGLPixelFormat *pixform = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
+ /*GLint color,alpha,accum,depth;
+ [pixform getValues:&color forAttribute:NSOpenGLPFAColorSize forVirtualScreen:0];
+ [pixform getValues:&alpha forAttribute:NSOpenGLPFAAlphaSize forVirtualScreen:0];
+ [pixform getValues:&accum forAttribute:NSOpenGLPFAAccumSize forVirtualScreen:0];
+ [pixform getValues:&depth forAttribute:NSOpenGLPFADepthSize forVirtualScreen:0];
+ NSLog(@"color=%d alpha=%d accum=%d depth=%d",color,alpha,accum,depth);*/
+ return pixform;
+}
+
+NSOpenGLContext* Fl_X::create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat,
+ NSOpenGLContext *shared_ctx, Fl_Window *window)
+{
+ NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelformat shareContext:shared_ctx];
+ if (context) {
+ NSView *view = [fl_xid(window) contentView];
+ if (fl_mac_os_version >= 100700 && Fl::use_high_res_GL()) {
+ //replaces [view setWantsBestResolutionOpenGLSurface:YES] without compiler warning
+ typedef void (*bestResolutionIMP)(id, SEL, BOOL);
+ static bestResolutionIMP addr = (bestResolutionIMP)[NSView instanceMethodForSelector:@selector(setWantsBestResolutionOpenGLSurface:)];
+ addr(view, @selector(setWantsBestResolutionOpenGLSurface:), YES);
+ }
+ [context setView:view];
+ }
+ return context;
+}
+
+void Fl_X::GLcontext_update(NSOpenGLContext* ctxt)
+{
+ [ctxt update];
+}
+
+void Fl_X::GLcontext_flushbuffer(NSOpenGLContext* ctxt)
+{
+ [ctxt flushBuffer];
+}
+
+void Fl_X::GLcontext_release(NSOpenGLContext* ctxt)
+{
+ [ctxt release];
+}
+
+void Fl_X::GL_cleardrawable(void)
+{
+ [[NSOpenGLContext currentContext] clearDrawable];
+}
+
+void Fl_X::GLcontext_makecurrent(NSOpenGLContext* ctxt)
+{
+ [ctxt makeCurrentContext];
+}
+
void Fl_Window::fullscreen_x() {
_set_fullscreen();
/* On OS X < 10.6, it is necessary to recreate the window. This is done
@@ -2494,72 +2901,42 @@ void Fl_Window::fullscreen_off_x(int X, int Y, int W, int H) {
*/
void Fl_X::flush()
{
- if (through_drawRect || w->as_gl_window()) {
+ if (w->as_gl_window()) {
+ w->flush();
+ } else {
make_current_counts = 1;
+ if (!through_drawRect) [[xid contentView] lockFocus];
+ through_Fl_X_flush = YES;
w->flush();
+ through_Fl_X_flush = NO;
+ if (!through_drawRect) [[xid contentView] unlockFocus];
make_current_counts = 0;
Fl_X::q_release_context();
- return;
}
- // have Cocoa immediately redraw the window's view
- FLView *view = (FLView*)[fl_xid(w) contentView];
- fl_x_to_redraw = this;
- [view setNeedsDisplay:YES];
- // will send the drawRect: message to the window's view after having prepared the adequate NSGraphicsContext
- [view displayIfNeededIgnoringOpacity];
- fl_x_to_redraw = NULL;
}
-//bool Fl_X::make_shaped = false;
-
/*
* go ahead, create that (sub)window
*/
void Fl_X::make(Fl_Window* w)
{
- if ( w->parent() ) { // create a subwindow
- Fl_Group::current(0);
- // our subwindow needs this structure to know about its clipping.
- Fl_X* x = new Fl_X;
- x->subwindow = true;
- x->other_xid = 0;
- x->region = 0;
- x->subRegion = 0;
- x->cursor = NULL;
- x->gc = 0; // stay 0 for Quickdraw; fill with CGContext for Quartz
- w->set_visible();
- Fl_Window *win = w->window();
- Fl_X *xo = Fl_X::i(win);
- if (xo) {
- x->xidNext = xo->xidChildren;
- x->xidChildren = 0L;
- xo->xidChildren = x;
- x->xid = win->i->xid;
- x->w = w; w->i = x;
- x->wait_for_expose = 0;
- {
- Fl_X *z = xo->next; // we don't want a subwindow in Fl_X::first
- xo->next = x;
- x->next = z;
- }
- int old_event = Fl::e_number;
- w->handle(Fl::e_number = FL_SHOW);
- Fl::e_number = old_event;
- w->redraw(); // force draw to happen
- }
- if (w->as_gl_window()) { // if creating a sub-GL-window
- while (win->window()) win = win->window();
- [Fl_X::i(win)->xid containsGLsubwindow:YES];
- }
- fl_show_iconic = 0;
- }
- else { // create a desktop window
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Fl_Group::current(0);
fl_open_display();
NSInteger winlevel = NSNormalWindowLevel;
NSUInteger winstyle;
+ if (w->parent()) {
+ w->border(0);
+ fl_show_iconic = 0;
+ }
if (w->border()) winstyle = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask;
else winstyle = NSBorderlessWindowMask;
+ if (fl_show_iconic && !w->parent()) { // prevent window from being out of work area when created iconized
+ int sx, sy, sw, sh;
+ Fl::screen_work_area (sx, sy, sw, sh, w->x(), w->y());
+ if (w->x() < sx) w->x(sx);
+ if (w->y() < sy) w->y(sy);
+ }
int xp = w->x();
int yp = w->y();
int wp = w->w();
@@ -2574,7 +2951,7 @@ void Fl_X::make(Fl_Window* w)
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);
- if (w->border()) winstyle |= NSResizableWindowMask;
+ if (w->border()) winstyle |= NSResizableWindowMask;
} else {
w->size_range(w->w(), w->h(), w->w(), w->h());
}
@@ -2586,11 +2963,9 @@ void Fl_X::make(Fl_Window* w)
if (w->modal()||w->tooltip_window()) {
winlevel = modal_window_level();
}
- //winstyle = NSBorderlessWindowMask;
- }
+ }
if (w->modal()) {
winstyle &= ~NSMiniaturizableWindowMask;
- // winstyle &= ~(NSResizableWindowMask | NSMiniaturizableWindowMask);
winlevel = modal_window_level();
}
else if (w->non_modal()) {
@@ -2609,23 +2984,17 @@ void Fl_X::make(Fl_Window* w)
xp -= bx;
yp -= by+bt;
}
-
- if (w->non_modal() && Fl_X::first /*&& !fl_disable_transient_for*/) {
- // find some other window to be "transient for":
- Fl_Window* w = Fl_X::first->w;
- while (w->parent()) w = w->window(); // todo: this code does not make any sense! (w!=w??)
- }
-
+
Fl_X* x = new Fl_X;
- x->subwindow = false;
x->other_xid = 0; // room for doublebuffering image map. On OS X this is only used by overlay windows
x->region = 0;
- x->subRegion = 0;
+ x->subRect(0);
x->cursor = NULL;
- x->xidChildren = 0;
- x->xidNext = 0;
x->gc = 0;
-
+ x->mapped_to_retina(false);
+ x->changed_resolution(false);
+ x->in_windowDidResize(false);
+
NSRect crect;
if (w->fullscreen_active()) {
int top, bottom, left, right;
@@ -2657,7 +3026,7 @@ void Fl_X::make(Fl_Window* w)
winstyle = NSBorderlessWindowMask;
winlevel = NSStatusWindowLevel;
}
- crect.origin.x = w->x();
+ crect.origin.x = w->x(); // correct origin set later for subwindows
crect.origin.y = main_screen_height - (w->y() + w->h());
crect.size.width=w->w();
crect.size.height=w->h();
@@ -2665,8 +3034,10 @@ void Fl_X::make(Fl_Window* w)
contentRect:crect
styleMask:winstyle];
[cw setFrameOrigin:crect.origin];
- [cw setHasShadow:YES];
- [cw setAcceptsMouseMovedEvents:YES];
+ if (!w->parent()) {
+ [cw setHasShadow:YES];
+ [cw setAcceptsMouseMovedEvents:YES];
+ }
if (w->shape_data_) {
[cw setOpaque:NO]; // shaped windows must be non opaque
[cw setBackgroundColor:[NSColor clearColor]]; // and with transparent background color
@@ -2674,9 +3045,18 @@ void Fl_X::make(Fl_Window* w)
x->xid = cw;
x->w = w; w->i = x;
x->wait_for_expose = 1;
- x->next = Fl_X::first;
- Fl_X::first = x;
- FLView *myview = [[FLView alloc] init];
+ if (!w->parent()) {
+ x->next = Fl_X::first;
+ Fl_X::first = x;
+ } else if (Fl_X::first) {
+ x->next = Fl_X::first->next;
+ Fl_X::first->next = x;
+ }
+ else {
+ x->next = NULL;
+ Fl_X::first = x;
+ }
+ FLView *myview = [[FLView alloc] initWithFrame:crect];
[cw setContentView:myview];
[myview release];
[cw setLevel:winlevel];
@@ -2691,17 +3071,16 @@ void Fl_X::make(Fl_Window* w)
static NSPoint delta = NSZeroPoint;
delta = [cw cascadeTopLeftFromPoint:delta];
}
+ crect = [cw frame]; // synchronize FLTK's and the system's window coordinates
+ w->x(int(crect.origin.x));
+ w->y(int(main_screen_height - (crect.origin.y + w->h())));
}
if(w->menu_window()) { // make menu windows slightly transparent
[cw setAlphaValue:0.97];
}
// Install DnD handlers
- [myview registerForDraggedTypes:[NSArray arrayWithObjects:utf8_format, NSFilenamesPboardType, nil]];
- if ( ! Fl_X::first->next ) {
- // if this is the first window, we need to bring the application to the front
- [NSApp activateIgnoringOtherApps:YES];
- }
-
+ [myview registerForDraggedTypes:[NSArray arrayWithObjects:UTF8_pasteboard_type, NSFilenamesPboardType, nil]];
+
if (w->size_range_set) w->size_range_();
if ( w->border() || (!w->modal() && !w->tooltip_window()) ) {
@@ -2712,28 +3091,31 @@ void Fl_X::make(Fl_Window* w)
w->set_visible();
if ( w->border() || (!w->modal() && !w->tooltip_window()) ) Fl::handle(FL_FOCUS, w);
- Fl::first_window(w);
- [cw setDelegate:[FLWindowDelegate createOnce]];
- if (fl_show_iconic) {
- fl_show_iconic = 0;
- [cw miniaturize:nil];
- } else {
- [cw makeKeyAndOrderFront:nil];
- }
-
- crect = [[cw contentView] frame];
- w->w(int(crect.size.width));
- w->h(int(crect.size.height));
- crect = [cw frame];
- w->x(int(crect.origin.x));
- w->y(int(main_screen_height - (crect.origin.y + w->h())));
-
+ [cw setDelegate:[FLWindowDelegate singleInstance]];
+ if (fl_show_iconic) {
+ fl_show_iconic = 0;
+ w->handle(FL_SHOW); // create subwindows if any
+ [cw recursivelySendToSubwindows:@selector(display)]; // draw the window and its subwindows before its icon is computed
+ [cw miniaturize:nil];
+ } else if (w->parent()) { // a subwindow
+ [cw setIgnoresMouseEvents:YES]; // needs OS X 10.2
+ // next 2 statements so a subwindow doesn't leak out of its parent window
+ [cw setOpaque:NO];
+ [cw setBackgroundColor:[NSColor clearColor]]; // transparent background color
+ [cw setSubwindowFrame];
+ // needed if top window was first displayed miniaturized
+ FLWindow *pxid = fl_xid(w->top_window());
+ [pxid makeFirstResponder:[pxid contentView]];
+ } else { // a top-level window
+ [cw makeKeyAndOrderFront:nil];
+ }
+
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];
}
@@ -2744,14 +3126,18 @@ void Fl_Window::size_range_() {
int bx, by, bt;
get_window_frame_sizes(bx, by, bt);
size_range_set = 1;
- NSSize minSize = { minw, minh + bt };
- NSSize maxSize = { maxw?maxw:32000, maxh?maxh + bt:32000 };
+ NSSize minSize = NSMakeSize(minw, minh + bt);
+ NSSize maxSize = NSMakeSize(maxw?maxw:32000, maxh?maxh + bt:32000);
if (i && i->xid) {
[i->xid setMinSize:minSize];
[i->xid setMaxSize:maxSize];
}
}
+void Fl_Window::wait_for_expose()
+{
+ [fl_xid(this) recursivelySendToSubwindows:@selector(waitForExpose)];
+}
/*
* returns pointer to the filename, or null if name ends with ':'
@@ -2798,18 +3184,21 @@ void Fl_Window::show() {
labeltype(FL_NO_LABEL);
}
Fl_Tooltip::exit(this);
- if (!shown()) {
+ Fl_X *top = NULL;
+ if (parent()) top = top_window()->i;
+ if (!shown() && (!parent() || (top && ![top->xid isMiniaturized]))) {
Fl_X::make(this);
} else {
if ( !parent() ) {
if ([i->xid isMiniaturized]) {
- i->w->redraw();
- [i->xid deminiaturize:nil];
+ i->w->redraw();
+ [i->xid deminiaturize:nil];
}
if (!fl_capture) {
- [i->xid makeKeyAndOrderFront:nil];
+ [i->xid makeKeyAndOrderFront:nil];
}
}
+ else set_visible();
}
}
@@ -2818,6 +3207,8 @@ void Fl_Window::show() {
* resize a window
*/
void Fl_Window::resize(int X,int Y,int W,int H) {
+ int bx, by, bt;
+ Fl_Window *parent;
if (W<=0) W = 1; // OS X does not like zero width windows
if (H<=0) H = 1;
int is_a_resize = (W != w() || H != h());
@@ -2828,7 +3219,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
resize_from_system = 0;
return;
}
- if ( (resize_from_system!=this) && (!parent()) && shown()) {
+ if ( (resize_from_system!=this) && shown()) {
if (is_a_resize) {
if (resizable()) {
if (W<minw) minw = W; // user request for resize takes priority
@@ -2839,31 +3230,40 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
} else {
size_range(W, H, W, H);
}
- int bx, by, bt;
- if ( ! this->border() ) bt = 0;
- else get_window_frame_sizes(bx, by, bt);
- NSRect dim;
- dim.origin.x = X;
- dim.origin.y = main_screen_height - (Y + H);
- dim.size.width = W;
- dim.size.height = H + bt;
- [i->xid setFrame:dim display:YES]; // calls windowDidResize
+ Fl_Group::resize(X,Y,W,H);
+ // transmit changes in FLTK coords to cocoa
+ get_window_frame_sizes(bx, by, bt);
+ bx = X; by = Y;
+ parent = window();
+ while (parent) {
+ bx += parent->x();
+ by += parent->y();
+ parent = parent->window();
+ }
+ NSRect r = NSMakeRect(bx, main_screen_height - (by + H), W, H + (border()?bt:0));
+ if (visible_r()) [fl_xid(this) setFrame:r display:YES];
} else {
- NSPoint pt;
- pt.x = X;
- pt.y = main_screen_height - (Y + h());
- [i->xid setFrameOrigin:pt]; // calls windowDidMove
+ bx = X; by = Y;
+ parent = window();
+ while (parent) {
+ bx += parent->x();
+ by += parent->y();
+ parent = parent->window();
+ }
+ NSPoint pt = NSMakePoint(bx, main_screen_height - (by + H));
+ if (visible_r()) [fl_xid(this) setFrameOrigin:pt]; // set cocoa coords to FLTK position
}
- return;
}
- resize_from_system = 0;
- if (is_a_resize) {
- Fl_Group::resize(X,Y,W,H);
- if (shown()) {
- redraw();
+ else {
+ resize_from_system = 0;
+ if (is_a_resize) {
+ Fl_Group::resize(X,Y,W,H);
+ if (shown()) {
+ redraw();
+ }
+ } else {
+ x(X); y(Y);
}
- } else {
- x(X); y(Y);
}
}
@@ -2873,26 +3273,25 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
This can be called in 3 different instances:
- 1) When a window is created, resized, or deminiaturized.
- The system sends the drawRect: message to the window's view after having prepared the current graphics context
- to draw to this view. Variable through_drawRect is YES, and fl_x_to_redraw is NULL. Processing of drawRect: calls
- handleUpdateEvent() that calls Fl_X::flush() for the window and its subwindows. Fl_X::flush() calls
- Fl_Window::flush() that calls Fl_Window::make_current() that only needs to identify the graphics port of the
- current graphics context. The window's draw() function is then executed.
+ 1) When a window is created or resized.
+ The system sends the drawRect: message to the window's view after having prepared the current
+ graphics context to draw to this view. Processing of drawRect: sets variable through_drawRect
+ to YES and calls handleUpdateEvent() that calls Fl_X::flush(). Fl_X::flush() sets through_Fl_X_flush
+ to YES and calls Fl_Window::flush() that calls Fl_Window::make_current() that
+ uses the window's graphics context. The window's draw() function is then executed.
2) At each round of the FLTK event loop.
- Fl::flush() is called, that calls Fl_X::flush() on each window that needs drawing. Fl_X::flush() sets
- fl_x_to_redraw to this and sends the displayIfNeededIgnoringOpacity message to the window's view.
- This message makes the system prepare the current graphics context adequately for drawing to this view, and
- send it the drawRect: message which sets through_drawRect to YES. Processing of the drawRect: message calls
- Fl_X::flush() for the window which proceeds as in 1) above.
+ Fl::flush() is called, that calls Fl_X::flush() on each window that needs drawing. Variable
+ through_Fl_X_flush is set to YES. Fl_X::flush() locks the focus to the view and calls Fl_Window::flush()
+ that calls Fl_Window::make_current() which uses the window's graphics context.
+ Fl_Window::flush() then runs the window's draw() function.
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. Variable through_drawRect is NO,
- so Fl_Window::make_current() creates a new graphics context adequate for the window.
- Subsequent drawing requests go to this window. 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.
-
+ This occurs for instance in the idle callback function of the mandelbrot test program. Variable
+ through_Fl_X_flush is NO. Under Mac OS 10.4 and higher, the window's graphics context is obtained.
+ Under Mac OS 10.3 a new graphics context adequate for the window is created.
+ Subsequent drawing requests go to this window. 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.
*/
void Fl_Window::make_current()
{
@@ -2900,31 +3299,19 @@ void Fl_Window::make_current()
if (make_current_counts) make_current_counts++;
Fl_X::q_release_context();
fl_window = i->xid;
+ Fl_X::set_high_resolution( i->mapped_to_retina() );
current_ = this;
- int xp = 0, yp = 0;
- Fl_Window *win = this;
- while ( win ) {
- if ( !win->window() )
- break;
- xp += win->x();
- yp += win->y();
- win = (Fl_Window*)win->window();
- }
- NSGraphicsContext *nsgc = through_drawRect ? [NSGraphicsContext currentContext] :
- [NSGraphicsContext graphicsContextWithWindow:fl_window];
+ NSGraphicsContext *nsgc;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ if (fl_mac_os_version >= 100400)
+ nsgc = [fl_window graphicsContext]; // 10.4
+ else
+#endif
+ nsgc = through_Fl_X_flush ? [NSGraphicsContext currentContext] : [NSGraphicsContext graphicsContextWithWindow:fl_window];
i->gc = (CGContextRef)[nsgc graphicsPort];
fl_gc = i->gc;
- Fl_Region fl_window_region = XRectangleRegion(0,0,w(),h());
- if ( ! this->window() ) {
- for ( Fl_X *cx = i->xidChildren; cx; cx = cx->xidNext ) { // clip-out all sub-windows
- Fl_Window *cw = cx->w;
- Fl_Region from = fl_window_region;
- fl_window_region = MacRegionMinusRect(from, cw->x(), cw->y(), cw->w(), cw->h() );
- XDestroyRegion(from);
- }
- }
-
+ CGContextSaveGState(fl_gc); // native context
// antialiasing must be deactivated because it applies to rectangles too
// and escapes even clipping!!!
// it gets activated when needed (e.g., draw text)
@@ -2932,16 +3319,12 @@ void Fl_Window::make_current()
CGFloat hgt = [[fl_window contentView] frame].size.height;
CGContextTranslateCTM(fl_gc, 0.5, hgt-0.5f);
CGContextScaleCTM(fl_gc, 1.0f, -1.0f); // now 0,0 is top-left point of the window
- win = this;
- while(win && win->window()) { // translate to subwindow origin if this is a subwindow context
- CGContextTranslateCTM(fl_gc, win->x(), win->y());
- win = win->window();
- }
- //apply window's clip
- CGContextClipToRects(fl_gc, fl_window_region->rects, fl_window_region->count );
- XDestroyRegion(fl_window_region);
-// this is the context with origin at top left of (sub)window clipped out of its subwindows if any
- CGContextSaveGState(fl_gc);
+ // for subwindows, limit drawing to inside of parent window
+ // half pixel offset is necessary for clipping as done by fl_cgrectmake_cocoa()
+ if (i->subRect()) CGContextClipToRect(fl_gc, CGRectOffset(*(i->subRect()), -0.5, -0.5));
+
+// this is the context with origin at top left of (sub)window
+ CGContextSaveGState(fl_gc);
#if defined(FLTK_USE_CAIRO)
if (Fl::cairo_autolink_context()) Fl::cairo_make_current(this); // capture gc changes automatically to update the cairo context adequately
#endif
@@ -2961,8 +3344,14 @@ extern void fl_quartz_restore_line_style_();
void Fl_X::q_fill_context() {
if (!fl_gc) return;
if ( ! fl_window) { // a bitmap context
- size_t hgt = CGBitmapContextGetHeight(fl_gc);
- CGContextTranslateCTM(fl_gc, 0.5, hgt-0.5f);
+ CGFloat hgt = CGBitmapContextGetHeight(fl_gc);
+ CGAffineTransform at = CGContextGetCTM(fl_gc);
+ CGFloat offset = 0.5;
+ if (at.a != 1 && at.a == at.d && at.b == 0 && at.c == 0) {
+ hgt /= at.a;
+ offset /= at.a;
+ }
+ CGContextTranslateCTM(fl_gc, offset, hgt-offset);
CGContextScaleCTM(fl_gc, 1.0f, -1.0f); // now 0,0 is top-left point of the context
}
fl_color(fl_graphics_driver->color());
@@ -2981,7 +3370,9 @@ void Fl_X::q_clear_clipping() {
void Fl_X::q_release_context(Fl_X *x) {
if (x && x->gc!=fl_gc) return;
if (!fl_gc) return;
- CGContextRestoreGState(fl_gc); // KEEP IT: matches the CGContextSaveGState of make_current
+ CGContextRestoreGState(fl_gc); // match the CGContextSaveGState's of make_current
+ CGContextRestoreGState(fl_gc);
+ Fl_X::set_high_resolution(false);
CGContextFlush(fl_gc);
fl_gc = 0;
#if defined(FLTK_USE_CAIRO)
@@ -2995,9 +3386,31 @@ void Fl_X::q_begin_image(CGRect &rect, int cx, int cy, int w, int h) {
r2.origin.x -= 0.5f;
r2.origin.y -= 0.5f;
CGContextClipToRect(fl_gc, r2);
- // move graphics context to origin of vertically reversed image
+ // move graphics context to origin of vertically reversed image
+ // The 0.5 here cancels the 0.5 offset present in Quartz graphics contexts.
+ // Thus, image and surface pixels are in phase if there's no scaling.
+ // Below, we handle x2 and /2 scalings that occur when drawing to
+ // a double-resolution bitmap, and when drawing a double-resolution bitmap to display.
CGContextTranslateCTM(fl_gc, rect.origin.x - cx - 0.5, rect.origin.y - cy + h - 0.5);
CGContextScaleCTM(fl_gc, 1, -1);
+ CGAffineTransform at = CGContextGetCTM(fl_gc);
+ if (at.a == at.d && at.b == 0 && at.c == 0) { // proportional scaling, no rotation
+ // phase image with display pixels
+ CGFloat deltax = 0, deltay = 0;
+ if (at.a == 2) { // make .tx and .ty have even values
+ deltax = (at.tx/2 - round(at.tx/2));
+ deltay = (at.ty/2 - round(at.ty/2));
+ } else if (at.a == 0.5) {
+ if (Fl_Display_Device::high_resolution()) { // make .tx and .ty have int or half-int values
+ deltax = -(at.tx*2 - round(at.tx*2));
+ deltay = (at.ty*2 - round(at.ty*2));
+ } else { // make .tx and .ty have integral values
+ deltax = (at.tx - round(at.tx))*2;
+ deltay = (at.ty - round(at.ty))*2;
+ }
+ }
+ CGContextTranslateCTM(fl_gc, -deltax, -deltay);
+ }
rect.origin.x = rect.origin.y = 0;
rect.size.width = w;
rect.size.height = h;
@@ -3007,6 +3420,25 @@ void Fl_X::q_end_image() {
CGContextRestoreGState(fl_gc);
}
+void Fl_X::set_high_resolution(bool new_val)
+{
+ Fl_Display_Device::high_res_window_ = new_val;
+}
+
+void Fl_Copy_Surface::complete_copy_pdf_and_tiff()
+{
+ CGContextRestoreGState(gc);
+ CGContextEndPage(gc);
+ CGContextRelease(gc);
+ NSPasteboard *clip = [NSPasteboard generalPasteboard];
+ [clip declareTypes:[NSArray arrayWithObjects:PDF_pasteboard_type, TIFF_pasteboard_type, nil] owner:nil];
+ [clip setData:(NSData*)pdfdata forType:PDF_pasteboard_type];
+ //second, transform this PDF to a bitmap image and put it as tiff in clipboard
+ NSImage *image = [[NSImage alloc] initWithData:(NSData*)pdfdata];
+ CFRelease(pdfdata);
+ [clip setData:[image TIFFRepresentation] forType:TIFF_pasteboard_type];
+ [image release];
+}
////////////////////////////////////////////////////////////////
// Copy & Paste fltk implementation.
@@ -3018,29 +3450,11 @@ static void convert_crlf(char * s, size_t len)
for (size_t x = 0; x < len; x++) if (s[x] == '\r') s[x] = '\n';
}
-// fltk 1.3 clipboard support constant definitions:
-static NSString *calc_utf8_format(void)
-{
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
-#define NSPasteboardTypeString @"public.utf8-plain-text"
-#endif
- if (fl_mac_os_version >= 100600) return NSPasteboardTypeString;
- return NSStringPboardType;
-}
-
// clipboard variables definitions :
char *fl_selection_buffer[2] = {NULL, NULL};
int fl_selection_length[2] = {0, 0};
static int fl_selection_buffer_length[2];
-static PasteboardRef allocatePasteboard(void)
-{
- PasteboardRef clip;
- PasteboardCreate(kPasteboardClipboard, &clip); // requires Mac OS 10.3
- return clip;
-}
-static PasteboardRef myPasteboard = allocatePasteboard();
-
extern void fl_trigger_clipboard_notify(int source);
void fl_clipboard_notify_change() {
@@ -3049,16 +3463,19 @@ void fl_clipboard_notify_change() {
static void clipboard_check(void)
{
- PasteboardSyncFlags flags;
-
- flags = PasteboardSynchronize(myPasteboard); // requires Mac OS 10.3
+ static NSInteger oldcount = -1;
+ NSInteger newcount = [[NSPasteboard generalPasteboard] changeCount];
+ if (newcount == oldcount) return;
+ oldcount = newcount;
+ fl_trigger_clipboard_notify(1);
+}
- if (!(flags & kPasteboardModified))
+static void resize_selection_buffer(int len, int clipboard) {
+ if (len <= fl_selection_buffer_length[clipboard])
return;
- if (flags & kPasteboardClientIsOwner)
- return;
-
- fl_trigger_clipboard_notify(1);
+ delete[] fl_selection_buffer[clipboard];
+ fl_selection_buffer[clipboard] = new char[len+100];
+ fl_selection_buffer_length[clipboard] = len+100;
}
/*
@@ -3069,11 +3486,10 @@ static void clipboard_check(void)
*/
void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
if (!stuff || len<0) return;
- if (len+1 > fl_selection_buffer_length[clipboard]) {
- delete[] fl_selection_buffer[clipboard];
- fl_selection_buffer[clipboard] = new char[len+100];
- fl_selection_buffer_length[clipboard] = len+100;
- }
+ if (clipboard >= 2)
+ clipboard = 1; // Only on X11 do multiple clipboards make sense.
+
+ resize_selection_buffer(len+1, clipboard);
memcpy(fl_selection_buffer[clipboard], stuff, len);
fl_selection_buffer[clipboard][len] = 0; // needed for direct paste
fl_selection_length[clipboard] = len;
@@ -3081,23 +3497,23 @@ void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
CFDataRef text = CFDataCreate(kCFAllocatorDefault, (UInt8*)fl_selection_buffer[1], len);
if (text==NULL) return; // there was a pb creating the object, abort.
NSPasteboard *clip = [NSPasteboard generalPasteboard];
- [clip declareTypes:[NSArray arrayWithObject:utf8_format] owner:nil];
- [clip setData:(NSData*)text forType:utf8_format];
+ [clip declareTypes:[NSArray arrayWithObject:UTF8_pasteboard_type] owner:nil];
+ [clip setData:(NSData*)text forType:UTF8_pasteboard_type];
CFRelease(text);
}
}
-static int get_plain_text_from_clipboard(char **buffer, int previous_length)
+static int get_plain_text_from_clipboard(int clipboard)
{
NSInteger length = 0;
NSPasteboard *clip = [NSPasteboard generalPasteboard];
- NSString *found = [clip availableTypeFromArray:[NSArray arrayWithObjects:utf8_format, @"public.utf16-plain-text", @"com.apple.traditional-mac-plain-text", nil]];
+ NSString *found = [clip availableTypeFromArray:[NSArray arrayWithObjects:UTF8_pasteboard_type, @"public.utf16-plain-text", @"com.apple.traditional-mac-plain-text", nil]];
if (found) {
NSData *data = [clip dataForType:found];
if (data) {
NSInteger len;
char *aux_c = NULL;
- if (![found isEqualToString:utf8_format]) {
+ if (![found isEqualToString:UTF8_pasteboard_type]) {
NSString *auxstring;
auxstring = (NSString *)CFStringCreateWithBytes(NULL,
(const UInt8*)[data bytes],
@@ -3109,106 +3525,64 @@ static int get_plain_text_from_clipboard(char **buffer, int previous_length)
len = strlen(aux_c) + 1;
}
else len = [data length] + 1;
- if ( len >= previous_length ) {
- length = len;
- delete[] *buffer;
- *buffer = new char[len];
- }
- if (![found isEqualToString:utf8_format]) {
- strcpy(*buffer, aux_c);
- free(aux_c);
+ resize_selection_buffer(len, clipboard);
+ if (![found isEqualToString:UTF8_pasteboard_type]) {
+ strcpy(fl_selection_buffer[clipboard], aux_c);
+ free(aux_c);
}
else {
- [data getBytes:*buffer];
+ [data getBytes:fl_selection_buffer[clipboard]];
}
- (*buffer)[len - 1] = 0;
+ fl_selection_buffer[clipboard][len - 1] = 0;
length = len - 1;
- convert_crlf(*buffer, len - 1); // turn all \r characters into \n:
+ convert_crlf(fl_selection_buffer[clipboard], len - 1); // turn all \r characters into \n:
Fl::e_clipboard_type = Fl::clipboard_plain_text;
}
}
return length;
}
-static Fl_Image* get_image_from_clipboard()
+static Fl_Image* get_image_from_clipboard(Fl_Widget *receiver)
{
- Fl_RGB_Image *image = NULL;
- uchar *imagedata;
- NSBitmapImageRep *bitmap;
NSPasteboard *clip = [NSPasteboard generalPasteboard];
NSArray *present = [clip types]; // types in pasteboard in order of decreasing preference
- NSArray *possible = [NSArray arrayWithObjects:@"com.adobe.pdf", @"public.tiff", @"com.apple.pict", nil];
+ NSArray *possible = [NSArray arrayWithObjects:TIFF_pasteboard_type, PDF_pasteboard_type, PICT_pasteboard_type, nil];
NSString *found = nil;
NSUInteger rank;
- for (rank = 0; rank < [present count]; rank++) { // find first of possible types present in pasteboard
- for (NSUInteger i = 0; i < [possible count]; i++) {
+ for (NSUInteger i = 0; (!found) && i < [possible count]; i++) {
+ for (rank = 0; rank < [present count]; rank++) { // find first of possible types present in pasteboard
if ([[present objectAtIndex:rank] isEqualToString:[possible objectAtIndex:i]]) {
- found = [present objectAtIndex:rank];
- goto after_loop;
+ found = [present objectAtIndex:rank];
+ break;
}
}
}
-after_loop:
- if (found) {
- NSData *data = [clip dataForType:found];
- if (data) {
- if ([found isEqualToString:@"public.tiff"]) {
- bitmap = [NSBitmapImageRep imageRepWithData:data];
- int bpp = [bitmap bytesPerPlane];
- int bpr = [bitmap bytesPerRow];
- int depth = [bitmap samplesPerPixel], w = bpr/depth, h = bpp/bpr;
- imagedata = new uchar[w * h * depth];
- memcpy(imagedata, [bitmap bitmapData], w * h * depth);
- image = new Fl_RGB_Image(imagedata, w, h, depth);
- image->alloc_array = 1;
- }
- else if ([found isEqualToString:@"com.adobe.pdf"] || [found isEqualToString:@"com.apple.pict"]) {
- NSRect rect;
- NSImageRep *vectorial;
- NSAffineTransform *dilate = [NSAffineTransform transform];
- if ([found isEqualToString:@"com.adobe.pdf"] ) {
- vectorial = [NSPDFImageRep imageRepWithData:data];
- rect = [(NSPDFImageRep*)vectorial bounds]; // in points = 1/72 inch
- Fl_Window *win = Fl::first_window();
- int screen_num = win ? Fl::screen_num(win->x(), win->y(), win->w(), win->h()) : 0;
- float hr, vr;
- Fl::screen_dpi(hr, vr, screen_num); // 1 inch = hr pixels = 72 points -> hr/72 pixel/point
- CGFloat scale = hr/72;
- [dilate scaleBy:scale];
- rect.size.width *= scale;
- rect.size.height *= scale;
- rect = NSIntegralRect(rect);
- }
- else {
- vectorial = [NSPICTImageRep imageRepWithData:data];
- rect = [(NSPICTImageRep*)vectorial boundingBox]; // in pixel, no scaling required
- }
- imagedata = new uchar[(int)(rect.size.width * rect.size.height) * 4];
- memset(imagedata, -1, (int)(rect.size.width * rect.size.height) * 4);
- bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&imagedata
- pixelsWide:rect.size.width
- pixelsHigh:rect.size.height
- bitsPerSample:8
- samplesPerPixel:3
- hasAlpha:NO
- isPlanar:NO
- colorSpaceName:NSDeviceRGBColorSpace
- bytesPerRow:rect.size.width*4
- bitsPerPixel:32];
- NSDictionary *dict = [NSDictionary dictionaryWithObject:bitmap
- forKey:NSGraphicsContextDestinationAttributeName];
- NSGraphicsContext *oldgc = [NSGraphicsContext currentContext];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithAttributes:dict]];
- [dilate concat];
- [vectorial draw];
- [NSGraphicsContext setCurrentContext:oldgc];
- [bitmap release];
- image = new Fl_RGB_Image(imagedata, rect.size.width, rect.size.height, 4);
- image->alloc_array = 1;
- }
- Fl::e_clipboard_type = Fl::clipboard_image;
- }
+ if (!found) return NULL;
+ NSData *data = [clip dataForType:found];
+ if (!data) return NULL;
+ NSBitmapImageRep *bitmap = nil;
+ if ([found isEqualToString:TIFF_pasteboard_type]) {
+ bitmap = [[NSBitmapImageRep alloc] initWithData:data];
}
+ else if ([found isEqualToString:PDF_pasteboard_type] || [found isEqualToString:PICT_pasteboard_type]) {
+ NSImage *nsimg = [[NSImage alloc] initWithData:data];
+ [nsimg lockFocus];
+ bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0, 0, [nsimg size].width, [nsimg size].height)];
+ [nsimg unlockFocus];
+ [nsimg release];
+ }
+ if (!bitmap) return NULL;
+ int bytesPerPixel([bitmap bitsPerPixel]/8);
+ int bpr([bitmap bytesPerRow]);
+ int bpp([bitmap bytesPerPlane]);
+ int hh(bpp/bpr);
+ int ww(bpr/bytesPerPixel);
+ uchar *imagedata = new uchar[bpr * hh];
+ memcpy(imagedata, [bitmap bitmapData], bpr * hh);
+ Fl_RGB_Image *image = new Fl_RGB_Image(imagedata, ww, hh, bytesPerPixel);
+ image->alloc_array = 1;
+ [bitmap release];
+ Fl::e_clipboard_type = Fl::clipboard_image;
return image;
}
@@ -3217,21 +3591,21 @@ void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) {
if (type[0] == 0) type = Fl::clipboard_plain_text;
if (clipboard) {
Fl::e_clipboard_type = "";
- if (strcmp(type, Fl::clipboard_plain_text) == 0) {
- fl_selection_length[1] = get_plain_text_from_clipboard( &fl_selection_buffer[1], fl_selection_length[1]);
- }
+ if (strcmp(type, Fl::clipboard_plain_text) == 0) {
+ fl_selection_length[1] = get_plain_text_from_clipboard(1);
+ }
else if (strcmp(type, Fl::clipboard_image) == 0) {
- Fl::e_clipboard_data = get_image_from_clipboard( );
+ Fl::e_clipboard_data = get_image_from_clipboard(&receiver);
if (Fl::e_clipboard_data) {
- int done = receiver.handle(FL_PASTE);
- Fl::e_clipboard_type = "";
- if (done == 0) {
- delete (Fl_Image*)Fl::e_clipboard_data;
- Fl::e_clipboard_data = NULL;
- }
+ int done = receiver.handle(FL_PASTE);
+ Fl::e_clipboard_type = "";
+ if (done == 0) {
+ delete (Fl_Image*)Fl::e_clipboard_data;
+ Fl::e_clipboard_data = NULL;
+ }
}
return;
- }
+ }
else
fl_selection_length[1] = 0;
}
@@ -3244,69 +3618,25 @@ void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) {
int Fl::clipboard_contains(const char *type) {
NSString *found = nil;
if (strcmp(type, Fl::clipboard_plain_text) == 0) {
- found = [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:utf8_format, @"public.utf16-plain-text", @"com.apple.traditional-mac-plain-text", nil]];
+ found = [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:UTF8_pasteboard_type, @"public.utf16-plain-text", @"com.apple.traditional-mac-plain-text", nil]];
}
else if (strcmp(type, Fl::clipboard_image) == 0) {
- found = [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:@"public.tiff", @"com.adobe.pdf", @"com.apple.pict", nil]];
+ found = [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:TIFF_pasteboard_type, PDF_pasteboard_type, PICT_pasteboard_type, nil]];
}
return found != nil;
}
-int Fl_X::unlink(Fl_X *start) {
- if (start) {
- Fl_X *pc = start;
- while (pc) {
- if (pc->xidNext == this) {
- pc->xidNext = xidNext;
- return 1;
- }
- if (pc->xidChildren) {
- if (pc->xidChildren == this) {
- pc->xidChildren = xidNext;
- return 1;
- }
- if (unlink(pc->xidChildren))
- return 1;
- }
- pc = pc->xidNext;
- }
- } else {
- for ( Fl_X *pc = Fl_X::first; pc; pc = pc->next ) {
- if (unlink(pc))
- return 1;
- }
- }
- return 0;
-}
-
-void Fl_X::relink(Fl_Window *w, Fl_Window *wp) {
- Fl_X *x = Fl_X::i(w);
- Fl_X *p = Fl_X::i(wp);
- if (!x || !p) return;
- // first, check if 'x' is already registered as a child of 'p'
- for (Fl_X *i = p->xidChildren; i; i=i->xidNext) {
- if (i == x) return;
- }
- // now add 'x' as the first child of 'p'
- x->xidNext = p->xidChildren;
- p->xidChildren = x;
-}
-
void Fl_X::destroy() {
- // subwindows share their xid with their parent window, so should not close it
- if (!subwindow && w && !w->parent() && xid) {
+ if (xid) {
[xid close];
}
+ delete subRect();
}
void Fl_X::map() {
- if (w && xid) {
- [xid orderFront:nil];
- }
- //+ link to window list
- if (w && w->parent()) {
- Fl_X::relink(w, w->window() );
- w->redraw();
+ if (w && xid && ![xid parentWindow]) { // 10.2
+ // after a subwindow has been unmapped, it has lost its parent window and its frame may be wrong
+ [xid setSubwindowFrame];
}
if (cursor) {
[(NSCursor*)cursor release];
@@ -3315,58 +3645,10 @@ void Fl_X::map() {
}
void Fl_X::unmap() {
- if (w && !w->parent() && xid) {
+ if (w && xid) {
+ if (w->parent()) [[xid parentWindow] removeChildWindow:xid]; // necessary with at least 10.5
[xid orderOut:nil];
}
- if (w && Fl_X::i(w))
- Fl_X::i(w)->unlink();
-}
-
-
-// removes x,y,w,h rectangle from region r and returns result as a new Fl_Region
-static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h)
-{
- Fl_Region outr = (Fl_Region)malloc(sizeof(*outr));
- outr->rects = (CGRect*)malloc(4 * r->count * sizeof(CGRect));
- outr->count = 0;
- CGRect rect = fl_cgrectmake_cocoa(x, y, w, h);
- for( int i = 0; i < r->count; i++) {
- CGRect A = r->rects[i];
- CGRect test = CGRectIntersection(A, rect);
- if (CGRectIsEmpty(test)) {
- outr->rects[(outr->count)++] = A;
- }
- else {
- const CGFloat verylarge = 100000.;
- CGRect side = CGRectMake(0,0,rect.origin.x,verylarge);// W side
- test = CGRectIntersection(A, side);
- if ( ! CGRectIsEmpty(test)) {
- outr->rects[(outr->count)++] = test;
- }
- side = CGRectMake(0,rect.origin.y + rect.size.height,verylarge,verylarge);// N side
- test = CGRectIntersection(A, side);
- if ( ! CGRectIsEmpty(test)) {
- outr->rects[(outr->count)++] = test;
- }
- side = CGRectMake(rect.origin.x + rect.size.width, 0, verylarge, verylarge);// E side
- test = CGRectIntersection(A, side);
- if ( ! CGRectIsEmpty(test)) {
- outr->rects[(outr->count)++] = test;
- }
- side = CGRectMake(0, 0, verylarge, rect.origin.y);// S side
- test = CGRectIntersection(A, side);
- if ( ! CGRectIsEmpty(test)) {
- outr->rects[(outr->count)++] = test;
- }
- }
- }
- if (outr->count == 0) {
- free(outr->rects);
- free(outr);
- outr = XRectangleRegion(0,0,0,0);
- }
- else outr->rects = (CGRect*)realloc(outr->rects, outr->count * sizeof(CGRect));
- return outr;
}
// intersects current and x,y,w,h rectangle and returns result as a new Fl_Region
@@ -3410,8 +3692,7 @@ static NSImage *CGBitmapContextToNSImage(CGContextRef c)
else
#endif
{
- unsigned char *pdata = (unsigned char *)CGBitmapContextGetData(c);
- NSBitmapImageRep *imagerep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&pdata
+ NSBitmapImageRep *imagerep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:CGBitmapContextGetWidth(c)
pixelsHigh:CGBitmapContextGetHeight(c)
bitsPerSample:8
@@ -3421,31 +3702,14 @@ static NSImage *CGBitmapContextToNSImage(CGContextRef c)
colorSpaceName:NSDeviceRGBColorSpace
bytesPerRow:CGBitmapContextGetBytesPerRow(c)
bitsPerPixel:CGBitmapContextGetBitsPerPixel(c)];
- image = [[NSImage alloc] initWithData: [imagerep TIFFRepresentation]];
+ memcpy([imagerep bitmapData], CGBitmapContextGetData(c), [imagerep bytesPerRow] * [imagerep pixelsHigh]);
+ image = [[NSImage alloc] initWithSize:NSMakeSize([imagerep pixelsWide], [imagerep pixelsHigh])];
+ [image addRepresentation:imagerep];
[imagerep release];
}
return [image autorelease];
}
-
-CFDataRef Fl_X::CGBitmapContextToTIFF(CGContextRef c)
-{ // the returned value is autoreleased
- unsigned char *pdata = (unsigned char *)CGBitmapContextGetData(c);
- NSBitmapImageRep *imagerep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&pdata
- pixelsWide:CGBitmapContextGetWidth(c)
- pixelsHigh:CGBitmapContextGetHeight(c)
- bitsPerSample:8
- samplesPerPixel:3
- hasAlpha:NO
- isPlanar:NO
- colorSpaceName:NSDeviceRGBColorSpace
- bytesPerRow:CGBitmapContextGetBytesPerRow(c)
- bitsPerPixel:CGBitmapContextGetBitsPerPixel(c)];
- NSData* tiff = [imagerep TIFFRepresentation];
- [imagerep release];
- return (CFDataRef)tiff;
-}
-
int Fl_X::set_cursor(Fl_Cursor c)
{
if (cursor) {
@@ -3505,6 +3769,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
// Alpha needs to be premultiplied for this format
const uchar *i = (const uchar*)*image->data();
+ const int extra_data = image->ld() ? (image->ld() - image->w() * image->d()) : 0;
unsigned char *o = [bitmap bitmapData];
for (int y = 0;y < image->h();y++) {
if (!(image->d() & 1)) {
@@ -3528,7 +3793,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
o += len;
i += len;
}
- i += image->ld();
+ i += extra_data;
}
NSImage *nsimage = [[NSImage alloc]
@@ -3551,10 +3816,17 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
@interface FLaboutItemTarget : NSObject
{
}
+- (BOOL)validateMenuItem:(NSMenuItem *)item;
- (void)showPanel;
- (void)printPanel;
+- (void)terminate:(id)sender;
@end
@implementation FLaboutItemTarget
+- (BOOL)validateMenuItem:(NSMenuItem *)item
+{ // invalidate the Quit item of the application menu when running modal
+ if (!Fl::modal() || [item action] != @selector(terminate:)) return YES;
+ return NO;
+}
- (void)showPanel
{
NSDictionary *options;
@@ -3573,6 +3845,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
int w, h, ww, wh;
Fl_Window *win = Fl::first_window();
if(!win) return;
+ if (win->parent()) win = win->top_window();
if( printer.start_job(1) ) return;
if( printer.start_page() ) return;
fl_lock_function();
@@ -3597,12 +3870,18 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
printer.origin(w/2, h/2);
#endif
printer.print_window(win, -ww/2, -wh/2);
+ //printer.print_window_part(win,0,0,win->w(),win->h(), -ww/2, -wh/2);
printer.end_page();
printer.end_job();
fl_unlock_function();
}
+- (void)terminate:(id)sender
+{
+ [NSApp terminate:sender];
+}
@end
+
static void createAppleMenu(void)
{
static BOOL donethat = NO;
@@ -3631,13 +3910,12 @@ static void createAppleMenu(void)
action:@selector(printPanel)
keyEquivalent:@""];
[menuItem setTarget:about];
- [appleMenu setAutoenablesItems:NO];
[menuItem setEnabled:YES];
[appleMenu addItem:[NSMenuItem separatorItem]];
}
if (fl_mac_os_version >= 100400) { // services+hide+quit already in menu in OS 10.3
// Services Menu
- services = [[NSMenu alloc] init];
+ services = [[NSMenu alloc] initWithTitle:@""];
menuItem = [appleMenu
addItemWithTitle:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::services], nil)
action:nil
@@ -3662,9 +3940,10 @@ static void createAppleMenu(void)
// Quit AppName
title = [NSString stringWithFormat:NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::quit] , nil),
nsappname];
- [appleMenu addItemWithTitle:title
- action:@selector(terminate:)
- keyEquivalent:@"q"];
+ menuItem = [appleMenu addItemWithTitle:title
+ action:@selector(terminate:)
+ keyEquivalent:@"q"];
+ [menuItem setTarget:about];
}
/* Put menu into the menubar */
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
@@ -3772,15 +4051,20 @@ static NSImage *defaultDragImage(int *pwidth, int *pheight)
return image;
}
-int Fl::dnd(void)
+int Fl::dnd()
+{
+ return Fl_X::dnd(0);
+}
+
+int Fl_X::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];
NSPasteboard *mypasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
- [mypasteboard declareTypes:[NSArray arrayWithObject:utf8_format] owner:nil];
- [mypasteboard setData:(NSData*)text forType:utf8_format];
+ [mypasteboard declareTypes:[NSArray arrayWithObject:UTF8_pasteboard_type] owner:nil];
+ [mypasteboard setData:(NSData*)text forType:UTF8_pasteboard_type];
CFRelease(text);
Fl_Widget *w = Fl::pushed();
Fl_Window *win = w->top_window();
@@ -3789,7 +4073,7 @@ int Fl::dnd(void)
int width, height;
NSImage *image;
- if ( dynamic_cast<Fl_Input_*>(w) != NULL || dynamic_cast<Fl_Text_Display*>(w) != NULL) {
+ if (use_selection) {
fl_selection_buffer[0][ fl_selection_length[0] ] = 0;
image = imageFromText(fl_selection_buffer[0], &width, &height);
} else {
@@ -3813,37 +4097,182 @@ int Fl::dnd(void)
return true;
}
+// rescales an NSBitmapImageRep
+static NSBitmapImageRep *scale_nsbitmapimagerep(NSBitmapImageRep *img, float scale)
+{
+ int w = [img pixelsWide];
+ int h = [img pixelsHigh];
+ int scaled_w = int(scale * w + 0.5);
+ int scaled_h = int(scale * h + 0.5);
+ NSBitmapImageRep *scaled = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
+ pixelsWide:scaled_w
+ pixelsHigh:scaled_h
+ bitsPerSample:8
+ samplesPerPixel:4
+ hasAlpha:YES
+ isPlanar:NO
+ colorSpaceName:NSDeviceRGBColorSpace
+ bytesPerRow:scaled_w*4
+ bitsPerPixel:32];
+ NSDictionary *dict = [NSDictionary dictionaryWithObject:scaled
+ forKey:NSGraphicsContextDestinationAttributeName];
+ NSGraphicsContext *oldgc = [NSGraphicsContext currentContext];
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithAttributes:dict]];
+ [[NSColor clearColor] set];
+ NSRect r = NSMakeRect(0, 0, scaled_w, scaled_h);
+ NSRectFill(r);
+ [img drawInRect:r];
+ [NSGraphicsContext setCurrentContext:oldgc];
+ [img release];
+ return scaled;
+}
+
+static void write_bitmap_inside(NSBitmapImageRep *to, int to_width, NSBitmapImageRep *from,
+ int to_x, int to_y)
+/* Copies in bitmap "to" the bitmap "from" with its top-left angle at coordinates to_x, to_y
+ On retina displays both bitmaps have double width and height
+ to_width is the width in screen units of "to". On retina, its pixel width is twice that.
+ */
+{
+ const uchar *from_data = [from bitmapData];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ if (fl_mac_os_version >= 100400) { // 10.4 required by the bitmapFormat message
+ if (([to bitmapFormat] & NSAlphaFirstBitmapFormat) && !([from bitmapFormat] & NSAlphaFirstBitmapFormat) ) {
+ // "to" is ARGB and "from" is RGBA --> convert "from" to ARGB
+ // it is enough to read "from" starting one byte earlier, because A is always 0xFF:
+ // RGBARGBA becomes (A)RGBARGB
+ from_data--;
+ } else if ( !([to bitmapFormat] & NSAlphaFirstBitmapFormat) && ([from bitmapFormat] & NSAlphaFirstBitmapFormat) ) {
+ // "from" is ARGB and "to" is RGBA --> convert "from" to RGBA
+ // it is enough to offset reading by one byte because A is always 0xFF
+ // so ARGBARGB becomes RGBARGB(A) as needed
+ from_data++;
+ }
+ }
+#endif
+ int to_w = (int)[to pixelsWide]; // pixel width of "to"
+ int from_w = (int)[from pixelsWide]; // pixel width of "from"
+ int from_h = [from pixelsHigh]; // pixel height of "from"
+ int to_depth = [to samplesPerPixel], from_depth = [from samplesPerPixel];
+ int depth = 0;
+ if (to_depth > from_depth) depth = from_depth;
+ else if (from_depth > to_depth) depth = to_depth;
+ float factor = to_w / (float)to_width; // scaling factor is 1 for classic displays and 2 for retina
+ to_x = factor*to_x; // transform offset from screen unit to pixels
+ to_y = factor*to_y;
+ // perform the copy
+ uchar *tobytes = [to bitmapData] + to_y * to_w * to_depth + to_x * to_depth;
+ const uchar *frombytes = from_data;
+ for (int i = 0; i < from_h; i++) {
+ if (depth == 0) { // depth is always 0 in case of RGBA <-> ARGB conversion
+ if (i == 0 && from_data < [from bitmapData]) {
+ memcpy(tobytes+1, frombytes+1, from_w * from_depth-1); // avoid reading before [from bitmapData]
+ *tobytes = 0xFF; // set the very first A byte
+ } else if (i == from_h - 1 && from_data > [from bitmapData]) {
+ memcpy(tobytes, frombytes, from_w * from_depth - 1); // avoid reading after end of [from bitmapData]
+ *(tobytes + from_w * from_depth - 1) = 0xFF; // set the very last A byte
+ } else {
+ memcpy(tobytes, frombytes, from_w * from_depth);
+ }
+ } else {
+ for (int j = 0; j < from_w; j++) {
+ memcpy(tobytes + j * to_depth, frombytes + j * from_depth, depth);
+ }
+ }
+ tobytes += to_w * to_depth;
+ frombytes += from_w * from_depth;
+ }
+}
+
+
+static NSBitmapImageRep* GL_rect_to_nsbitmap(Fl_Window *win, int x, int y, int w, int h)
+// captures a rectangle from a GL window and returns it as an allocated NSBitmapImageRep
+// the capture has high res on retina
+{
+ Fl_Plugin_Manager pm("fltk:device");
+ Fl_Device_Plugin *pi = (Fl_Device_Plugin*)pm.plugin("opengl.device.fltk.org");
+ if (!pi) return nil;
+ Fl_RGB_Image *img = pi->rectangle_capture(win, x, y, w, h);
+ NSBitmapImageRep* bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:img->w() pixelsHigh:img->h() bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:4*img->w() bitsPerPixel:32];
+ memset([bitmap bitmapData], 0xFF, [bitmap bytesPerPlane]);
+ const uchar *from = img->array;
+ for (int r = img->h() - 1; r >= 0; r--) {
+ uchar *to = [bitmap bitmapData] + r * [bitmap bytesPerRow];
+ for (int c = 0; c < img->w(); c++) {
+ memcpy(to, from, 3);
+ from += 3;
+ to += 4;
+ }
+ }
+ delete img;
+ return bitmap;
+}
+
static NSBitmapImageRep* rect_to_NSBitmapImageRep(Fl_Window *win, int x, int y, int w, int h)
-// the returned value is autoreleased
+/* Captures a rectangle from a mapped window.
+ On retina displays, the resulting bitmap has 2 pixels per screen unit.
+ The returned value is to be released after use
+ */
{
+ NSBitmapImageRep *bitmap = nil;
NSRect rect;
- NSView *winview = nil;
- while (win->window()) {
- x += win->x();
- y += win->y();
- win = win->window();
- }
- if ( through_drawRect ) {
- CGFloat epsilon = 0;
- if (fl_mac_os_version >= 100600) epsilon = 0.5; // STR #2887
- rect = NSMakeRect(x - epsilon, y - epsilon, w, h);
+ if (win->as_gl_window() && y >= 0) {
+ bitmap = GL_rect_to_nsbitmap(win, x, y, w, h);
+ } else {
+ NSView *winview = nil;
+ if ( through_Fl_X_flush && Fl_Window::current() == win ) {
+ rect = NSMakeRect(x - 0.5, y - 0.5, w, h);
}
- else {
- rect = NSMakeRect(x, win->h()-(y+h), w, h);
- // lock focus to win's view
- winview = [fl_xid(win) contentView];
- [winview lockFocus];
+ else {
+ rect = NSMakeRect(x, win->h()-(y+h), w, h);
+ // lock focus to win's view
+ winview = [fl_xid(win) contentView];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ if (fl_mac_os_version >= 101100) [[fl_xid(win) graphicsContext] saveGraphicsState]; // necessary under 10.11
+#endif
+ [winview lockFocus];
+ }
+ // The image depth is 3 until 10.5 and 4 with 10.6 and above
+ bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect:rect];
+ if ( !( through_Fl_X_flush && Fl_Window::current() == win) ) {
+ [winview unlockFocus];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ if (fl_mac_os_version >= 101100) [[fl_xid(win) graphicsContext] restoreGraphicsState];
+#endif
+ }
+ if (!bitmap) return nil;
+ }
+
+ // capture also subwindows
+ NSArray *children = [fl_xid(win) childWindows]; // 10.2
+ NSEnumerator *enumerator = [children objectEnumerator];
+ id child;
+ while ((child = [enumerator nextObject]) != nil) {
+ if (![child isKindOfClass:[FLWindow class]]) continue;
+ Fl_Window *sub = [(FLWindow*)child getFl_Window];
+ CGRect rsub = CGRectMake(sub->x(), win->h() -(sub->y()+sub->h()), sub->w(), sub->h());
+ CGRect clip = CGRectMake(x, win->h()-(y+h), w, h);
+ clip = CGRectIntersection(rsub, clip);
+ if (CGRectIsNull(clip)) continue;
+ NSBitmapImageRep *childbitmap = rect_to_NSBitmapImageRep(sub, clip.origin.x - sub->x(),
+ win->h() - clip.origin.y - sub->y() - clip.size.height, clip.size.width, clip.size.height);
+ if (childbitmap) {
+ // if bitmap is high res and childbitmap is not, childbitmap must be rescaled
+ if ([bitmap pixelsWide] > w && [childbitmap pixelsWide] == clip.size.width) childbitmap = scale_nsbitmapimagerep(childbitmap, 2);
+ write_bitmap_inside(bitmap, w, childbitmap,
+ clip.origin.x - x, win->h() - clip.origin.y - clip.size.height - y );
}
- NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:rect] autorelease];
- if ( !through_drawRect ) [winview unlockFocus];
+ [childbitmap release];
+ }
return bitmap;
}
+
unsigned char *Fl_X::bitmap_from_window_rect(Fl_Window *win, int x, int y, int w, int h, int *bytesPerPixel)
/* Returns a capture of a rectangle of a mapped window as a pre-multiplied RGBA array of bytes.
Alpha values are always 1 (except for the angles of a window title bar)
- so pre-multiplication can be ignored.
- *bytesPerPixel is always set to the value 4 upon return.
+ so pre-multiplication can be ignored.
+ *bytesPerPixel is set to the value 3 or 4 upon return.
delete[] the returned pointer after use
*/
{
@@ -3854,9 +4283,29 @@ unsigned char *Fl_X::bitmap_from_window_rect(Fl_Window *win, int x, int y, int w
int bpr = (int)[bitmap bytesPerRow];
int hh = bpp/bpr; // sometimes hh = h-1 for unclear reason, and hh = 2*h with retina
int ww = bpr/(*bytesPerPixel); // sometimes ww = w-1, and ww = 2*w with retina
+ const uchar *start = [bitmap bitmapData]; // start of the bitmap data
+ bool convert = false;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+ if (fl_mac_os_version >= 100400 && ([bitmap bitmapFormat] & NSAlphaFirstBitmapFormat)) {
+ // bitmap is ARGB --> convert it to RGBA (ARGB happens with Mac OS 10.11)
+ // it is enough to offset reading by one byte because A is always 0xFF
+ // so ARGBARGB becomes RGBARGBA as needed
+ start++;
+ convert = true;
+ }
+#endif
unsigned char *data;
- if (ww > w) { // with a retina display
- Fl_RGB_Image *rgb = new Fl_RGB_Image([bitmap bitmapData], ww, hh, 4);
+ size_t tocopy;
+ if (ww > w) { // with a retina display, we have to scale the image by a factor of 2
+ uchar *data2 = [bitmap bitmapData];
+ if (convert) { // duplicate the NSBitmapImageRep data taking care not to access beyond its end
+ tocopy = ww*hh*4;
+ data2 = new uchar[tocopy];
+ memcpy(data2, start, --tocopy);
+ data2[tocopy] = 0xFF; // set the last A byte
+ }
+ Fl_RGB_Image *rgb = new Fl_RGB_Image(data2, ww, hh, 4);
+ rgb->alloc_array = (convert ? 1 : 0);
Fl_RGB_Scaling save_scaling = Fl_Image::RGB_scaling();
Fl_Image::RGB_scaling(FL_RGB_SCALING_BILINEAR);
Fl_RGB_Image *rgb2 = (Fl_RGB_Image*)rgb->copy(w, h);
@@ -3868,51 +4317,62 @@ unsigned char *Fl_X::bitmap_from_window_rect(Fl_Window *win, int x, int y, int w
}
else {
data = new unsigned char[w * h * *bytesPerPixel];
- if (w == ww) {
- memcpy(data, [bitmap bitmapData], w * hh * *bytesPerPixel);
- } else {
- unsigned char *p = [bitmap bitmapData];
+ if (w == ww) { // the NSBitmapImageRep data can be copied in one step
+ tocopy = w * hh * (*bytesPerPixel);
+ if (convert) { // take care not to access beyond the image end
+ data[--tocopy] = 0xFF; // set the last A byte
+ }
+ memcpy(data, start, tocopy);
+ } else { // copy the NSBitmapImageRep data line by line
+ const uchar *p = start;
unsigned char *q = data;
- for(int i = 0;i < hh; i++) {
- memcpy(q, p, *bytesPerPixel * ww);
+ tocopy = bpr;
+ for (int i = 0; i < hh; i++) {
+ if (i == hh-1 && convert) tocopy--; // take care not to access beyond the image end
+ memcpy(q, p, tocopy);
p += bpr;
- q += w * *bytesPerPixel;
+ q += w * (*bytesPerPixel);
}
}
}
+ [bitmap release];
return data;
}
-static void imgProviderReleaseData (void *info, const void *data, size_t size)
+
+static void nsbitmapProviderReleaseData (void *info, const void *data, size_t size)
{
- delete[] (unsigned char *)data;
+ [(NSBitmapImageRep*)info release];
}
CGImageRef Fl_X::CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h)
-// CFRelease the returned CGImageRef after use
+/* Returns a capture of a rectangle of a mapped window as a CGImage.
+ With retina displays, the returned image has twice the width and height.
+ CFRelease the returned CGImageRef after use
+ */
{
CGImageRef img;
+ NSBitmapImageRep *bitmap = rect_to_NSBitmapImageRep(win, x, y, w, h);
if (fl_mac_os_version >= 100500) {
- NSBitmapImageRep *bitmap = rect_to_NSBitmapImageRep(win, x, y, w, h);
img = (CGImageRef)[bitmap performSelector:@selector(CGImage)]; // requires Mac OS 10.5
CGImageRetain(img);
- }
- else {
- int bpp;
- unsigned char *bitmap = bitmap_from_window_rect(win, x, y, w, h, &bpp);
- if (!bitmap) return NULL;
- CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
- CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, bitmap, w*h*bpp, imgProviderReleaseData);
- img = CGImageCreate(w, h, 8, 8*bpp, w*bpp, lut,
- bpp == 3 ? kCGImageAlphaNone : kCGImageAlphaPremultipliedLast,
- provider, NULL, false, kCGRenderingIntentDefault);
- CGColorSpaceRelease(lut);
+ [bitmap release];
+ } else {
+ CGColorSpaceRef cspace = CGColorSpaceCreateDeviceRGB();
+ CGDataProviderRef provider = CGDataProviderCreateWithData(bitmap, [bitmap bitmapData],
+ [bitmap bytesPerRow]*[bitmap pixelsHigh],
+ nsbitmapProviderReleaseData);
+ img = CGImageCreate([bitmap pixelsWide], [bitmap pixelsHigh], 8, [bitmap bitsPerPixel], [bitmap bytesPerRow],
+ cspace,
+ [bitmap bitsPerPixel] == 32 ? kCGImageAlphaPremultipliedLast : kCGImageAlphaNone,
+ provider, NULL, false, kCGRenderingIntentDefault);
+ CGColorSpaceRelease(cspace);
CGDataProviderRelease(provider);
- }
+ }
return img;
}
-WindowRef Fl_X::window_ref()
+WindowRef Fl_X::window_ref() // useless with cocoa GL windows
{
return (WindowRef)[xid windowRef];
}
@@ -3944,33 +4404,83 @@ int Fl_Window::decorated_h()
return h() + bt + by;
}
+// clip the graphics context to rounded corners
+void Fl_X::clip_to_rounded_corners(CGContextRef gc, int w, int h) {
+ const CGFloat radius = 5;
+ CGContextMoveToPoint(gc, 0, 0);
+ CGContextAddLineToPoint(gc, 0, h - radius);
+ CGContextAddArcToPoint(gc, 0, h, radius, h, radius);
+ CGContextAddLineToPoint(gc, w - radius, h);
+ CGContextAddArcToPoint(gc, w, h, w, h - radius, radius);
+ CGContextAddLineToPoint(gc, w, 0);
+ CGContextClip(gc);
+}
+
+
+void *Fl_X::get_titlebar_layer(Fl_Window *win)
+{
+ // a compilation warning appears with SDK 10.5, so we require SDK 10.6 instead
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+ return fl_mac_os_version >= 101000 ? [[[fl_xid(win) standardWindowButton:NSWindowCloseButton] superview] layer] : nil; // 10.5
+#else
+ return nil;
+#endif
+}
+
+
+void Fl_X::draw_layer_to_context(void *layer, CGContextRef gc, int w, int h)
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+ Fl_X::clip_to_rounded_corners(gc, w, h);
+ CGContextSetRGBFillColor(gc, .79, .79, .79, 1.); // equiv. to FL_DARK1
+ CGContextFillRect(gc, CGRectMake(0, 0, w, h));
+ CGContextSaveGState(gc);
+ CGContextSetShouldAntialias(gc, true);
+ [(CALayer*)layer renderInContext:gc]; // 10.5
+ CGContextRestoreGState(gc);
+#endif
+}
+
void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
{
- NSButton *close = nil, *miniaturize = nil, *zoom = nil;
if (!win->shown() || win->parent() || !win->border() || !win->visible()) {
this->print_widget(win, x_offset, y_offset);
return;
}
int bx, by, bt, bpp;
get_window_frame_sizes(bx, by, bt);
+ BOOL to_quartz = (this->driver()->class_name() == Fl_Quartz_Graphics_Driver::class_id);
+ void *layer = Fl_X::get_titlebar_layer(win);
+ if (layer) { // if title bar uses a layer
+ if (to_quartz) { // to Quartz printer
+ CGContextSaveGState(fl_gc);
+ CGContextTranslateCTM(fl_gc, x_offset - 0.5, y_offset + bt - 0.5);
+ CGContextScaleCTM(fl_gc, 1, -1);
+ Fl_X::draw_layer_to_context(layer, fl_gc, win->w(), bt);
+ CGContextRestoreGState(fl_gc);
+ }
+ else { // to PostScript
+ CGColorSpaceRef cspace = CGColorSpaceCreateDeviceRGB ();
+ CGContextRef gc = CGBitmapContextCreate(NULL, win->w(), bt, 8, 0, cspace, kCGImageAlphaPremultipliedLast);
+ CGColorSpaceRelease(cspace);
+ CGContextClearRect(gc, CGRectMake(0, 0, win->w(), bt));
+ Fl_X::draw_layer_to_context(layer, gc, win->w(), bt);
+ Fl_RGB_Image *image = new Fl_RGB_Image((const uchar*)CGBitmapContextGetData(gc), win->w(), bt, 4,
+ CGBitmapContextGetBytesPerRow(gc)); // 10.2
+ image->draw(x_offset, y_offset); // draw title bar to PostScript
+ delete image;
+ CGContextRelease(gc);
+ }
+ this->print_widget(win, x_offset, y_offset + bt);
+ return;
+ }
Fl_Display_Device::display_device()->set_current(); // send win to front and make it current
- const char *title = win->label();
- win->label(""); // temporarily set a void window title
+ NSString *title = [fl_xid(win) title];
+ [title retain];
+ [fl_xid(win) setTitle:@""]; // temporarily set a void window title
win->show();
- if (fl_mac_os_version >= 101000) {
- // if linked for OS 10.10, capture of title bar does not capture the title bar buttons
- // so we draw them in FLTK
- NSWindow *xid = fl_xid(win);
- close = [xid standardWindowButton:NSWindowCloseButton]; // 10.2
- miniaturize = [xid standardWindowButton:NSWindowMiniaturizeButton];
- zoom = [xid standardWindowButton:NSWindowZoomButton];
- [close setHidden:YES]; // 10.3
- [miniaturize setHidden:YES];
- [zoom setHidden:YES];
- }
fl_gc = NULL;
Fl::check();
- BOOL to_quartz = dynamic_cast<Fl_Printer*>(this) != NULL;
// capture the window title bar with no title
CGImageRef img = NULL;
unsigned char *bitmap = NULL;
@@ -3978,10 +4488,10 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
img = Fl_X::CGImage_from_window_rect(win, 0, -bt, win->w(), bt);
else
bitmap = Fl_X::bitmap_from_window_rect(win, 0, -bt, win->w(), bt, &bpp);
- win->label(title); // put back the window title
+ [fl_xid(win) setTitle:title]; // put back the window title
this->set_current(); // back to the Fl_Paged_Device
if (img && to_quartz) { // print the title bar
- CGRect rect = { { x_offset, y_offset }, { win->w(), bt } };
+ CGRect rect = CGRectMake(x_offset, y_offset, win->w(), bt);
Fl_X::q_begin_image(rect, 0, 0, win->w(), bt);
CGContextDrawImage(fl_gc, rect, img);
Fl_X::q_end_image();
@@ -3993,30 +4503,7 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
delete rgb;
delete[] bitmap;
}
- if (fl_mac_os_version >= 101000) { // print the title bar buttons
- Fl_Color inactive = fl_rgb_color((uchar)0xCE, (uchar)0xCE, (uchar)0xCE); // inactive button color
- Fl_Color redish, yellowish, greenish;
- if ([[NSUserDefaults standardUserDefaults] integerForKey:@"AppleAquaColorVariant"] == 6) { // graphite appearance
- redish = yellowish = greenish = fl_rgb_color((uchar)0x8C, (uchar)0x8C, (uchar)0x8C);
- }
- else {
- redish = fl_rgb_color((uchar)0xFF, (uchar)0x63, (uchar)0x5A);
- yellowish = fl_rgb_color((uchar)0xFF, (uchar)0xC6, (uchar)0x42);
- greenish = fl_rgb_color((uchar)0x29, (uchar)0xD6, (uchar)0x52);
- }
-
- if (![close isEnabled]) fl_color(inactive); else fl_color(redish);
- fl_pie(x_offset+8, y_offset+5, 12, 12, 0, 360);
- if (![miniaturize isEnabled]) fl_color(inactive); else fl_color(yellowish);
- fl_pie(x_offset+28, y_offset+5, 12, 12, 0, 360);
- if (![zoom isEnabled]) fl_color(inactive); else fl_color(greenish);
- fl_pie(x_offset+48, y_offset+5, 12, 12, 0, 360);
-
- [close setHidden:NO]; // 10.3
- [miniaturize setHidden:NO];
- [zoom setHidden:NO];
- }
- if (title) { // print the window title
+ if (win->label()) { // print the window title
const int skip = 65; // approx width of the zone of the 3 window control buttons
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (fl_mac_os_version >= 100400 && to_quartz) { // use Cocoa string drawing with exact title bar font
@@ -4025,13 +4512,12 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:fl_gc flipped:YES]];//10.4
NSDictionary *attr = [NSDictionary dictionaryWithObject:[NSFont titleBarFontOfSize:0]
forKey:NSFontAttributeName];
- NSString *title_s = [fl_xid(win) title];
- NSSize size = [title_s sizeWithAttributes:attr];
+ NSSize size = [title sizeWithAttributes:attr];
int x = x_offset + win->w()/2 - size.width/2;
if (x < x_offset+skip) x = x_offset+skip;
- NSRect r = {{x, y_offset+bt/2+4}, {win->w() - skip, bt}};
+ NSRect r = NSMakeRect(x, y_offset+bt/2+4, win->w() - skip, bt);
[[NSGraphicsContext currentContext] setShouldAntialias:YES];
- [title_s drawWithRect:r options:(NSStringDrawingOptions)0 attributes:attr]; // 10.4
+ [title drawWithRect:r options:(NSStringDrawingOptions)0 attributes:attr]; // 10.4
[[NSGraphicsContext currentContext] setShouldAntialias:NO];
[NSGraphicsContext setCurrentContext:current];
}
@@ -4040,13 +4526,14 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
{
fl_font(FL_HELVETICA, 14);
fl_color(FL_BLACK);
- int x = x_offset + win->w()/2 - fl_width(title)/2;
+ int x = x_offset + win->w()/2 - fl_width(win->label())/2;
if (x < x_offset+skip) x = x_offset+skip;
fl_push_clip(x_offset, y_offset, win->w(), bt);
- fl_draw(title, x, y_offset+bt/2+4);
+ fl_draw(win->label(), x, y_offset+bt/2+4);
fl_pop_clip();
}
}
+ [title release];
this->print_widget(win, x_offset, y_offset + bt); // print the window inner part
}
@@ -4055,23 +4542,16 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
Supports old Mac OS X versions that may use a couple of Carbon calls:
GetKeys used by OS X 10.3 or before (in Fl::get_key())
PMSessionPageSetupDialog and PMSessionPrintDialog used by 10.4 or before (in Fl_Printer::start_job())
- GetWindowPort used by 10.4 or before (in Fl_Gl_Choice.cxx)
*/
void *Fl_X::get_carbon_function(const char *function_name) {
- static void *carbon = NULL;
- void *f = NULL;
- if (!carbon) {
- carbon = dlopen("/System/Library/Frameworks/Carbon.framework/Carbon", RTLD_LAZY);
- }
- if (carbon) {
- f = dlsym(carbon, function_name);
- }
- return f;
+ static void *carbon = dlopen("/System/Library/Frameworks/Carbon.framework/Carbon", RTLD_LAZY);
+ return (carbon ? dlsym(carbon, function_name) : NULL);
}
/* Returns the version of the running Mac OS as an int such as 100802 for 10.8.2
*/
-static int calc_mac_os_version() {
+int Fl_X::calc_mac_os_version() {
+ if (fl_mac_os_version) return fl_mac_os_version;
int M, m, b = 0;
NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
@@ -4095,5 +4575,5 @@ static int calc_mac_os_version() {
#endif // __APPLE__
//
-// End of "$Id: Fl_cocoa.mm 10427 2014-11-02 21:06:07Z manolo $".
+// End of "$Id: Fl_cocoa.mm 12089 2016-11-09 20:19:10Z manolo $".
//
diff --git a/src/Fl_get_key_mac.cxx b/src/Fl_get_key_mac.cxx
index a59df4a..b1126ba 100644
--- a/src/Fl_get_key_mac.cxx
+++ b/src/Fl_get_key_mac.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_get_key_mac.cxx 9952 2013-07-23 16:02:44Z manolo $"
+// "$Id: Fl_get_key_mac.cxx 10747 2015-06-10 10:53:25Z manolo $"
//
// MacOS keyboard state routines for the Fast Light Tool Kit (FLTK).
//
@@ -244,7 +244,7 @@ int Fl::event_key(int k) {
//: returns true, if that key is pressed right now
int Fl::get_key(int k) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if(CGEventSourceKeyState != NULL) {
+ if (&CGEventSourceKeyState != NULL) {
return (int)CGEventSourceKeyState(kCGEventSourceStateCombinedSessionState, fltk2mac(k) );
}
else
@@ -275,5 +275,5 @@ int Fl::get_key(int k) {
}
//
-// End of "$Id: Fl_get_key_mac.cxx 9952 2013-07-23 16:02:44Z manolo $".
+// End of "$Id: Fl_get_key_mac.cxx 10747 2015-06-10 10:53:25Z manolo $".
//
diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx
index b728b76..63a5c43 100644
--- a/src/Fl_get_system_colors.cxx
+++ b/src/Fl_get_system_colors.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_get_system_colors.cxx 10126 2014-04-19 14:55:15Z greg.ercolano $"
+// "$Id: Fl_get_system_colors.cxx 10598 2015-03-01 20:16:56Z AlbrechtS $"
//
// System color support for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -130,19 +130,23 @@ int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) {
} else return 0;
}
#endif // WIN32 || __APPLE__
+
+
/** \fn Fl::get_system_colors()
Read the user preference colors from the system and use them to call
- Fl::foreground(), Fl::background(), and
- Fl::background2(). This is done by
- Fl_Window::show(argc,argv) before applying the -fg and -bg
- switches.
+ Fl::foreground(), Fl::background(), and Fl::background2().
+
+ This is done by Fl_Window::show(argc,argv) before applying
+ the -fg and -bg switches.
- <P>On X this reads some common values from the Xdefaults database.
+ 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
style to other X programs" switch in their control panel.
*/
-#if defined(WIN32)
+
+#if defined(WIN32) // --- WIN32 ---
+
static void
getsyscolor(int what, const char* arg, void (*func)(uchar,uchar,uchar))
{
@@ -165,7 +169,8 @@ void Fl::get_system_colors() {
getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color);
}
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // --- APPLE ---
+
// MacOS X currently supports two color schemes - Blue and Graphite.
// Since we aren't emulating the Aqua interface (even if Apple would
// let us), we use some defaults that are similar to both. The
@@ -194,7 +199,8 @@ void Fl::get_system_colors()
set_selection_color(0x00, 0x00, 0x80);
#endif
}
-#else
+
+#else // --- X11 ---
// Read colors that KDE writes to the xrdb database.
@@ -231,7 +237,7 @@ void Fl::get_system_colors()
getsyscolor("Text", "selectBackground", 0, "#000080", set_selection_color);
}
-#endif
+#endif // --- WIN32 | APPLE | X11 ---
//// Simple implementation of 2.0 Fl::scheme() interface...
@@ -280,6 +286,8 @@ static Fl_Pixmap tile(tile_xpm);
If the resulting scheme name is not defined, the default scheme will
be used and Fl::scheme() will return NULL.
+
+ \see Fl::is_scheme()
*/
int Fl::scheme(const char *s) {
if (!s) {
@@ -347,7 +355,7 @@ int Fl::reload_scheme() {
tile.uncache();
- if (!scheme_bg_) scheme_bg_ = new Fl_Tiled_Image(&tile, w(), h());
+ if (!scheme_bg_) scheme_bg_ = new Fl_Tiled_Image(&tile, 0, 0);
// Load plastic buttons, etc...
set_boxtype(FL_UP_FRAME, FL_PLASTIC_UP_FRAME);
@@ -430,6 +438,14 @@ int Fl::reload_scheme() {
}
// Set (or clear) the background tile for all windows...
+
+ // FIXME: This makes it impossible to assign a background image
+ // and/or a label to a window. IMHO we should be able to assign a
+ // background image to a window. Currently (as of FLTK 1.3.3) there
+ // is the workaround to use a group inside the window to achieve this.
+ // See also STR #3075.
+ // AlbrechtS, 01 Mar 2015
+
for (win = first_window(); win; win = next_window(win)) {
win->labeltype(scheme_bg_ ? FL_NORMAL_LABEL : FL_NO_LABEL);
win->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
@@ -442,5 +458,5 @@ int Fl::reload_scheme() {
//
-// End of "$Id: Fl_get_system_colors.cxx 10126 2014-04-19 14:55:15Z greg.ercolano $".
+// End of "$Id: Fl_get_system_colors.cxx 10598 2015-03-01 20:16:56Z AlbrechtS $".
//
diff --git a/src/Fl_grab.cxx b/src/Fl_grab.cxx
index 20e13f1..ecf6aea 100644
--- a/src/Fl_grab.cxx
+++ b/src/Fl_grab.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_grab.cxx 9299 2012-03-23 16:47:53Z manolo $"
+// "$Id: Fl_grab.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $"
//
// Grab/release code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -42,7 +42,7 @@ extern void *fl_capture;
#endif
void Fl::grab(Fl_Window* win) {
-#if USE_X11
+#ifdef USE_X11
Fl_Window *fullscreen_win = NULL;
for (Fl_Window *W = Fl::first_window(); W; W = Fl::next_window(W)) {
if (W->fullscreen_active()) {
@@ -104,5 +104,5 @@ void Fl::grab(Fl_Window* win) {
}
//
-// End of "$Id: Fl_grab.cxx 9299 2012-03-23 16:47:53Z manolo $".
+// End of "$Id: Fl_grab.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $".
//
diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx
index db9965a..c613936 100644
--- a/src/Fl_lock.cxx
+++ b/src/Fl_lock.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_lock.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_lock.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $"
//
// Multi-threading support code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -70,7 +70,6 @@ static const int AWAKE_RING_SIZE = 1024;
static void lock_ring();
static void unlock_ring();
-
/** Adds an awake handler for use in awake(). */
int Fl::add_awake_handler_(Fl_Awake_Handler func, void *data)
{
@@ -80,33 +79,43 @@ int Fl::add_awake_handler_(Fl_Awake_Handler func, void *data)
awake_ring_size_ = AWAKE_RING_SIZE;
awake_ring_ = (Fl_Awake_Handler*)malloc(awake_ring_size_*sizeof(Fl_Awake_Handler));
awake_data_ = (void**)malloc(awake_ring_size_*sizeof(void*));
+ // explicitly initialize the head and tail indices
+ awake_ring_head_= awake_ring_tail_ = 0;
+ }
+ // The next head index we will want (not the current index):
+ // We use this to check if the ring-buffer is full or not
+ // (and to update awake_ring_head_ if we do use the current index.)
+ int next_head = awake_ring_head_ + 1;
+ if (next_head >= awake_ring_size_) {
+ next_head = 0;
}
- if (awake_ring_head_==awake_ring_tail_-1 || awake_ring_head_+1==awake_ring_tail_) {
- // ring is full. Return -1 as an error indicator.
+ // check that the ring buffer is not full, and that it exists
+ if ((!awake_ring_) || (next_head == awake_ring_tail_)) {
+ // ring is non-existent or full. Return -1 as an error indicator.
ret = -1;
} else {
awake_ring_[awake_ring_head_] = func;
awake_data_[awake_ring_head_] = data;
- ++awake_ring_head_;
- if (awake_ring_head_ == awake_ring_size_)
- awake_ring_head_ = 0;
+ awake_ring_head_ = next_head;
}
unlock_ring();
return ret;
}
+
/** Gets the last stored awake handler for use in awake(). */
int Fl::get_awake_handler_(Fl_Awake_Handler &func, void *&data)
{
int ret = 0;
lock_ring();
- if (!awake_ring_ || awake_ring_head_ == awake_ring_tail_) {
+ if ((!awake_ring_) || (awake_ring_head_ == awake_ring_tail_)) {
ret = -1;
} else {
func = awake_ring_[awake_ring_tail_];
data = awake_data_[awake_ring_tail_];
++awake_ring_tail_;
- if (awake_ring_tail_ == awake_ring_size_)
+ if (awake_ring_tail_ >= awake_ring_size_) {
awake_ring_tail_ = 0;
+ }
}
unlock_ring();
return ret;
@@ -246,7 +255,7 @@ void Fl::awake(void* msg) {
////////////////////////////////////////////////////////////////
// POSIX threading...
-#elif HAVE_PTHREAD
+#elif defined(HAVE_PTHREAD)
# include <unistd.h>
# include <fcntl.h>
# include <pthread.h>
@@ -405,5 +414,5 @@ void* Fl::thread_message() {
#endif // WIN32
//
-// End of "$Id: Fl_lock.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_lock.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $".
//
diff --git a/src/Fl_own_colormap.cxx b/src/Fl_own_colormap.cxx
index 0e7da97..b7bd89b 100644
--- a/src/Fl_own_colormap.cxx
+++ b/src/Fl_own_colormap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_own_colormap.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: Fl_own_colormap.cxx 11757 2016-05-28 15:39:05Z greg.ercolano $"
//
// Private colormap support for the Fast Light Tool Kit (FLTK).
//
@@ -29,7 +29,7 @@
#include <FL/x.H>
/** \fn Fl::own_colormap()
- Makes FLTK use its own colormap. This may make FLTK display better
+ 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.
@@ -77,5 +77,5 @@ void Fl::own_colormap() {
#endif
//
-// End of "$Id: Fl_own_colormap.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: Fl_own_colormap.cxx 11757 2016-05-28 15:39:05Z greg.ercolano $".
//
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 23f1422..e0127cb 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_win32.cxx 10387 2014-10-20 15:14:12Z ossman $"
+// "$Id: Fl_win32.cxx 12028 2016-10-14 16:35:44Z AlbrechtS $"
//
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2012 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -48,7 +48,7 @@
// that makes fltk use easier as only fltk libs are now requested
// This idea could be extended to fltk libs themselves,
// implementer should then care about DLL linkage flags ...
-# if (_MSC_VER>=1310)
+# if defined(_MSC_VER) && (_MSC_VER>=1310)
# pragma comment (lib, "comctl32.lib")
# endif
#endif
@@ -87,10 +87,6 @@ static void fl_clipboard_notify_target(HWND wnd);
static void fl_clipboard_notify_untarget(HWND wnd);
// Internal variables
-static Fl_GDI_Graphics_Driver fl_gdi_driver;
-static Fl_Display_Device fl_gdi_display(&fl_gdi_driver);
-Fl_Display_Device *Fl_Display_Device::_display = &fl_gdi_display; // the platform display
-
static HWND clipboard_wnd = 0;
static HWND next_clipboard_wnd = 0;
@@ -350,6 +346,16 @@ extern int fl_send_system_handlers(void *e);
MSG fl_msg;
+// A local helper function to flush any pending callback requests
+// from the awake ring-buffer
+static void process_awake_handler_requests(void) {
+ Fl_Awake_Handler func;
+ void *data;
+ while (Fl::get_awake_handler_(func, data) == 0) {
+ func(data);
+ }
+}
+
// This is never called with time_to_wait < 0.0.
// It *should* return negative on error, 0 if nothing happens before
// timeout, and >0 if any callbacks were done. This version only
@@ -423,15 +429,37 @@ int fl_wait(double time_to_wait) {
if (fl_msg.message == fl_wake_msg) {
// Used for awaking wait() from another thread
thread_message_ = (void*)fl_msg.wParam;
- Fl_Awake_Handler func;
- void *data;
- while (Fl::get_awake_handler_(func, data)==0)
- func(data);
+ process_awake_handler_requests();
}
TranslateMessage(&fl_msg);
DispatchMessageW(&fl_msg);
}
+
+ // The following conditional test:
+ // (Fl::awake_ring_head_ != Fl::awake_ring_tail_)
+ // is a workaround / fix for STR #3143. This works, but a better solution
+ // would be to understand why the PostThreadMessage() messages are not
+ // seen by the main window if it is being dragged/ resized at the time.
+ // If a worker thread posts an awake callback to the ring buffer
+ // whilst the main window is unresponsive (if a drag or resize operation
+ // is in progress) we may miss the PostThreadMessage(). So here, we check if
+ // there is anything pending in the awake ring buffer and if so process
+ // it. This is not strictly thread safe (for speed it compares the head
+ // and tail indices without first locking the ring buffer) but is intended
+ // only as a fall-back recovery mechanism if the awake processing stalls.
+ // If the test erroneously returns true (may happen if we test the indices
+ // whilst they are being modified) we will call process_awake_handler_requests()
+ // unnecessarily, but this has no harmful consequences so is safe to do.
+ // Note also that if we miss the PostThreadMessage(), then thread_message_
+ // will not be updated, so this is not a perfect solution, but it does
+ // recover and process any pending awake callbacks.
+ // Normally the ring buffer head and tail indices will match and this
+ // comparison will do nothing. Addresses STR #3143
+ if (Fl::awake_ring_head_ != Fl::awake_ring_tail_) {
+ process_awake_handler_requests();
+ }
+
Fl::flush();
// This should return 0 if only timer events were handled:
@@ -574,9 +602,9 @@ public:
char *o;
int lencount;
// Predict size of \r\n conversion buffer
- for ( i=in, lencount = inlen; lencount--; ) {
- if ( *i == '\r' && *(i+1) == '\n' ) // leave \r\n untranslated
- { i+=2; outlen+=2; }
+ 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--; }
else if ( *i == '\n' ) // \n by itself? leave room to insert \r
{ i++; outlen+=2; }
else
@@ -585,9 +613,9 @@ public:
// Alloc conversion buffer + NULL
out = new char[outlen+1];
// Handle \n -> \r\n conversion
- for ( i=in, o=out, lencount = inlen; lencount--; ) {
- if ( *i == '\r' && *(i+1) == '\n' ) // leave \r\n untranslated
- { *o++ = *i++; *o++ = *i++; }
+ 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--; }
else if ( *i == '\n' ) // \n by itself? insert \r
{ *o++ = '\r'; *o++ = *i++; }
else
@@ -636,6 +664,8 @@ void fl_update_clipboard(void) {
// call this when you create a selection:
void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
if (!stuff || len<0) return;
+ if (clipboard >= 2)
+ clipboard = 1; // Only on X11 do multiple clipboards make sense.
// Convert \n -> \r\n (for old apps like Notepad, DOS)
Lf2CrlfConvert buf(stuff, len);
@@ -705,7 +735,7 @@ void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) {
}
else if (strcmp(type, Fl::clipboard_image) == 0) { // we want an image from clipboard
uchar *rgb = NULL;
- int width, height, depth;
+ int width = 0, height = 0, depth = 0;
if ( (h = GetClipboardData(CF_DIB)) ) { // if there's a DIB in clipboard
LPBITMAPINFO lpBI = (LPBITMAPINFO)GlobalLock(h) ;
width = lpBI->bmiHeader.biWidth; // bitmap width & height
@@ -754,12 +784,12 @@ void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) {
HDC hdc = GetDC(NULL); // get unit correspondance between .01 mm and screen pixels
int hmm = GetDeviceCaps(hdc, HORZSIZE);
int hdots = GetDeviceCaps(hdc, HORZRES);
- int vmm = GetDeviceCaps(hdc, VERTSIZE);
- int vdots = GetDeviceCaps(hdc, VERTRES);
+ int dhr = GetDeviceCaps(hdc, DESKTOPHORZRES); // true number of pixels on display
ReleaseDC(NULL, hdc);
- float factorw = (100. * hmm) / hdots;
- float factorh = (100. * vmm) / vdots + 0.5;
- width /= factorw; height /= factorh; // convert to screen pixel unit
+ // Global display scaling factor: 1, 1.25, 1.5, 1.75, etc...
+ float scaling = dhr/float(hdots);
+ float factor = (100.f * hmm) / hdots;
+ width = (int)(width*scaling/factor); height = (int)(height*scaling/factor); // convert to screen pixel unit
RECT rect = {0, 0, width, height};
Fl_Offscreen off = fl_create_offscreen(width, height);
fl_begin_offscreen(off);
@@ -1124,6 +1154,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
R = CreateRectRgn(0,0,0,0);
int r = GetUpdateRgn(hWnd,R,0);
if (r==NULLREGION && !redraw_whole_window) {
+ XDestroyRegion(R);
break;
}
@@ -1482,42 +1513,46 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
// 1 | fix | yes
// 2 | size | yes
-int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) {
- int W, H, xoff, yoff, dx, dy;
+static int fake_X_wm_style(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by, DWORD style, DWORD styleEx,
+ int w_maxw, int w_minw, int w_maxh, int w_minh, uchar w_size_range_set) {
+ int W = 0, H = 0, xoff = 0, yoff = 0, dx = 0, dy = 0;
int ret = bx = by = bt = 0;
int fallback = 1;
if (!w->parent()) {
- HWND hwnd = fl_xid(w);
- if (hwnd) {
+ if (fl_xid(w) || style) {
// The block below calculates the window borders by requesting the
// required decorated window rectangle for a desired client rectangle.
// If any part of the function above fails, we will drop to a
// fallback to get the best guess which is always available.
- HWND hwnd = fl_xid(w);
- // request the style flags of this window, as WIN32 sees them
- LONG style = GetWindowLong(hwnd, GWL_STYLE);
- LONG exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
+
+ if (!style) {
+ HWND hwnd = fl_xid(w);
+ // request the style flags of this window, as WIN32 sees them
+ style = GetWindowLong(hwnd, GWL_STYLE);
+ styleEx = GetWindowLong(hwnd, GWL_EXSTYLE);
+ }
+
RECT r;
r.left = w->x();
r.top = w->y();
r.right = w->x()+w->w();
r.bottom = w->y()+w->h();
// get the decoration rectangle for the desired client rectangle
- BOOL ok = AdjustWindowRectEx(&r, style, FALSE, exstyle);
+ BOOL 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() - r.left;
- by = r.bottom - w->y() - w->h(); // height of the bootm frame
+ by = r.bottom - w->y() - w->h(); // height of the bottom frame
bt = w->y() - r.top - by; // height of top caption bar
xoff = bx;
yoff = by + bt;
dx = W - w->w();
dy = H - w->h();
- if (w->size_range_set && (w->maxw != w->minw || w->maxh != w->minh))
+ if (w_size_range_set && (w_maxw != w_minw || w_maxh != w_minh))
ret = 2;
else
ret = 1;
@@ -1528,7 +1563,7 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by)
// This is the original (pre 1.1.7) routine to calculate window border sizes.
if (fallback) {
if (w->border() && !w->parent()) {
- if (w->size_range_set && (w->maxw != w->minw || w->maxh != w->minh)) {
+ if (w_size_range_set && (w_maxw != w_minw || w_maxh != w_minh)) {
ret = 2;
bx = GetSystemMetrics(SM_CXSIZEFRAME);
by = GetSystemMetrics(SM_CYSIZEFRAME);
@@ -1557,7 +1592,7 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by)
//Proceed to positioning the window fully inside the screen, if possible
//Find screen that contains most of the window
//FIXME: this ought to be the "work area" instead of the entire screen !
- int scr_x, scr_y, scr_w, scr_h;
+ int scr_x = 0, scr_y = 0, scr_w = 0, scr_h = 0;
Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h, X, Y, W, H);
//Make border's lower right corner visible
if (scr_x+scr_w < X+W) X = scr_x+scr_w - W;
@@ -1582,6 +1617,10 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by)
return ret;
}
+int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) {
+ return fake_X_wm_style(w, X, Y, bt, bx, by, 0, 0, w->maxw, w->minw, w->maxh, w->minh, w->size_range_set);
+}
+
////////////////////////////////////////////////////////////////
void Fl_Window::resize(int X,int Y,int W,int H) {
@@ -1789,7 +1828,7 @@ Fl_X* Fl_X::make(Fl_Window* w) {
wcw.lpfnWndProc = (WNDPROC)WndProc;
wcw.cbClsExtra = wcw.cbWndExtra = 0;
wcw.hInstance = fl_display;
- if (!w->icon())
+ if (!w->icon() && !w->icon_->count)
w->icon((void *)LoadIcon(NULL, IDI_APPLICATION));
wcw.hIcon = wcw.hIconSm = (HICON)w->icon();
wcw.hCursor = LoadCursor(NULL, IDC_ARROW);
@@ -1832,8 +1871,14 @@ Fl_X* Fl_X::make(Fl_Window* w) {
}
}
styleEx |= WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT;
- int xwm = xp , ywm = yp , bt, bx, by;
- switch (fake_X_wm(w, xwm, ywm, bt, bx, by)) {
+
+ int wintype = 0;
+ if (w->border() && !w->parent()) {
+ if (w->size_range_set && (w->maxw != w->minw || w->maxh != w->minh)) wintype = 2;
+ else wintype = 1;
+ }
+
+ switch (wintype) {
// No border (used for menus)
case 0:
style |= WS_POPUP;
@@ -1854,6 +1899,9 @@ Fl_X* Fl_X::make(Fl_Window* w) {
style |= WS_MINIMIZEBOX;
break;
}
+
+ int xwm = xp , ywm = yp , bt, bx, by;
+ fake_X_wm_style(w, xwm, ywm, bt, bx, by, style, styleEx, w->maxw, w->minw, w->maxh, w->minh, w->size_range_set);
if (by+bt) {
wp += 2*bx;
hp += 2*by+bt;
@@ -2177,8 +2225,10 @@ static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon,
return NULL;
const uchar *i = (const uchar*)*image->data();
- for (int y = 0;y < image->h();y++) {
- for (int x = 0;x < image->w();x++) {
+ const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0;
+
+ 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];
@@ -2196,7 +2246,7 @@ static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon,
i += image->d();
bits++;
}
- i += image->ld();
+ i += extra_data;
}
// A mask bitmap is still needed even though it isn't used
@@ -2219,9 +2269,6 @@ static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon,
DeleteObject(bitmap);
DeleteObject(mask);
- if (icon == NULL)
- return NULL;
-
return icon;
}
@@ -2494,8 +2541,8 @@ void Fl_Window::show() {
//ShowWindow(i->xid,fl_capture?SW_SHOWNOACTIVATE:SW_RESTORE);
}
#ifdef USE_PRINT_BUTTON
-void preparePrintFront(void);
-preparePrintFront();
+ void preparePrintFront(void);
+ preparePrintFront();
#endif
}
@@ -2649,60 +2696,113 @@ FL_EXPORT Window fl_xid_(const Fl_Window *w) {
return temp ? temp->xid : 0;
}
+static RECT border_width_title_bar_height(Fl_Window *win, int &bx, int &by, int &bt, float *pscaling=0)
+{
+ RECT r = {0,0,0,0};
+ bx = by = bt = 0;
+ float scaling = 1;
+ if (win->shown() && !win->parent() && win->border() && win->visible()) {
+ static HMODULE dwmapi_dll = LoadLibrary("dwmapi.dll");
+ typedef HRESULT (WINAPI* DwmGetWindowAttribute_type)(HWND hwnd, DWORD dwAttribute, PVOID pvAttribute, DWORD cbAttribute);
+ static DwmGetWindowAttribute_type DwmGetWindowAttribute = dwmapi_dll ?
+ (DwmGetWindowAttribute_type)GetProcAddress(dwmapi_dll, "DwmGetWindowAttribute") : NULL;
+ int need_r = 1;
+ if (DwmGetWindowAttribute) {
+ const DWORD DWMWA_EXTENDED_FRAME_BOUNDS = 9;
+ if ( DwmGetWindowAttribute(fl_xid(win), DWMWA_EXTENDED_FRAME_BOUNDS, &r, sizeof(RECT)) == S_OK ) {
+ need_r = 0;
+ // Compute the global display scaling factor: 1, 1.25, 1.5, 1.75, etc...
+ // This factor can be set in Windows 10 by
+ // "Change the size of text, apps and other items" in display settings.
+ HDC hdc = GetDC(NULL);
+ int hr = GetDeviceCaps(hdc, HORZRES); // pixels visible to the app
+#ifndef DESKTOPHORZRES
+#define DESKTOPHORZRES 118
+#endif
+ int dhr = GetDeviceCaps(hdc, DESKTOPHORZRES); // true number of pixels on display
+ ReleaseDC(NULL, hdc);
+ scaling = dhr/float(hr); // display scaling factor
+ scaling = int(scaling * 100 + 0.5)/100.; // round to 2 digits after decimal point
+ }
+ }
+ if (need_r) {
+ GetWindowRect(fl_xid(win), &r);
+ }
+ bx = (r.right - r.left - int(win->w() * scaling))/2;
+ if (bx < 1) bx = 1;
+ by = bx;
+ bt = r.bottom - r.top - int(win->h() * scaling) - 2 * by;
+ }
+ if (pscaling) *pscaling = scaling;
+ return r;
+}
+
int Fl_Window::decorated_w()
{
- if (!shown() || parent() || !border() || !visible()) return w();
- int X, Y, bt, bx, by;
- Fl_X::fake_X_wm(this, X, Y, bt, bx, by);
+ int bt, bx, by;
+ border_width_title_bar_height(this, bx, by, bt);
return w() + 2 * bx;
}
int Fl_Window::decorated_h()
{
- if (!shown() || parent() || !border() || !visible()) return h();
- int X, Y, bt, bx, by;
- Fl_X::fake_X_wm(this, X, Y, bt, bx, by);
- return h() + bt + 2 * by;
+ int bt, bx, by;
+ float scaling;
+ border_width_title_bar_height(this, bx, by, bt, &scaling);
+ return h() + bt/scaling + 2 * by;
}
void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
{
- if (!win->shown() || win->parent() || !win->border() || !win->visible()) {
- this->print_widget(win, x_offset, y_offset);
- return;
+ draw_decorated_window(win, x_offset, y_offset, this);
+}
+
+void Fl_Paged_Device::draw_decorated_window(Fl_Window *win, int x_offset, int y_offset, Fl_Surface_Device *toset)
+{
+ int bt, bx, by; // border width and title bar height of window
+ float scaling;
+ RECT r = border_width_title_bar_height(win, bx, by, bt, &scaling);
+ if (bt) {
+ Fl_Display_Device::display_device()->set_current(); // make window current
+ win->show();
+ Fl::check();
+ win->make_current();
+ HDC save_gc = fl_gc;
+ fl_gc = GetDC(NULL); // get the screen device context
+ int ww = win->w() + 2 * bx;
+ int wh = win->h() + bt + 2 * by;
+ // capture the 4 window sides from screen
+ Window save_win = fl_window;
+ fl_window = NULL; // force use of read_win_rectangle() by fl_read_image()
+ uchar *top_image = fl_read_image(NULL, r.left, r.top, r.right - r.left + 1, bt + by);
+ uchar *left_image = bx ? fl_read_image(NULL, r.left, r.top, bx, wh) : NULL;
+ uchar *right_image = bx ? fl_read_image(NULL, r.right - bx, r.top, bx, wh) : NULL;
+ uchar *bottom_image = by ? fl_read_image(NULL, r.left, r.bottom-by, ww, by) : NULL;
+ fl_window = save_win;
+ ReleaseDC(NULL, fl_gc); fl_gc = save_gc;
+ toset->set_current();
+ // draw the 4 window sides
+ //fl_draw_image(top_image, x_offset, y_offset, ww, bt + by, 3);
+ Fl_RGB_Image *top_r = new Fl_RGB_Image(top_image, r.right - r.left + 1, bt + by, 3);
+ top_r->alloc_array = 1;
+ if (scaling > 1) {
+ Fl_RGB_Scaling current = Fl_Image::RGB_scaling();
+ Fl_Image::RGB_scaling(FL_RGB_SCALING_BILINEAR);
+ Fl_RGB_Image *tmp_img = (Fl_RGB_Image*)top_r->copy(ww, (bt + by)/scaling);
+ Fl_Image::RGB_scaling(current);
+ delete top_r;
+ top_r = tmp_img;
+ }
+ top_r->draw(x_offset, y_offset);
+ delete top_r;
+
+ if (left_image) { fl_draw_image(left_image, x_offset, y_offset, bx, wh, 3); delete left_image; }
+ if (right_image) { fl_draw_image(right_image, x_offset + win->w() + bx, y_offset, bx, wh, 3); delete right_image; }
+ if (bottom_image) { fl_draw_image(bottom_image, x_offset, y_offset + win->h() + bt + by, ww, by, 3); delete bottom_image; }
}
- int X, Y, bt, bx, by, ww, wh; // compute the window border sizes
- Fl_X::fake_X_wm(win, X, Y, bt, bx, by);
- ww = win->w() + 2 * bx;
- wh = win->h() + bt + 2 * by;
- Fl_Display_Device::display_device()->set_current(); // make window current
- win->show();
- Fl::check();
- win->make_current();
- HDC save_gc = fl_gc;
- fl_gc = GetDC(NULL); // get the screen device context
- // capture the 4 window sides from screen
- RECT r; GetWindowRect(fl_window, &r);
- uchar *top_image = fl_read_image(NULL, r.left, r.top, ww, bt + by);
- uchar *left_image = fl_read_image(NULL, r.left, r.top, bx, wh);
- uchar *right_image = fl_read_image(NULL, r.right - bx, r.top, bx, wh);
- uchar *bottom_image = fl_read_image(NULL, r.left, r.bottom-by, ww, by);
- ReleaseDC(NULL, fl_gc); fl_gc = save_gc;
- this->set_current();
- // print the 4 window sides
- fl_draw_image(top_image, x_offset, y_offset, ww, bt + by, 3);
- fl_draw_image(left_image, x_offset, y_offset, bx, wh, 3);
- fl_draw_image(right_image, x_offset + win->w() + bx, y_offset, bx, wh, 3);
- fl_draw_image(bottom_image, x_offset, y_offset + win->h() + bt + by, ww, by, 3);
- delete[] top_image;
- delete[] left_image;
- delete[] right_image;
- delete[] bottom_image;
- // print the window inner part
- this->print_widget(win, x_offset + bx, y_offset + bt + by);
- fl_gc = GetDC(fl_xid(win));
- ReleaseDC(fl_xid(win), fl_gc);
-}
+ // draw the window inner part
+ this->print_widget(win, x_offset + bx, y_offset + (bt + by)/scaling);
+}
#ifdef USE_PRINT_BUTTON
// to test the Fl_Printer class creating a "Print front window" button in a separate window
@@ -2745,14 +2845,30 @@ void printFront(Fl_Widget *o, void *data)
o->window()->show();
}
+#include <FL/Fl_Copy_Surface.H>
+void copyFront(Fl_Widget *o, void *data)
+{
+ o->window()->hide();
+ Fl_Window *win = Fl::first_window();
+ if (!win) return;
+ Fl_Copy_Surface *surf = new Fl_Copy_Surface(win->decorated_w(), win->decorated_h());
+ surf->set_current();
+ surf->draw_decorated_window(win); // draw the window content
+ delete surf; // put the window on the clipboard
+ Fl_Display_Device::display_device()->set_current();
+ o->window()->show();
+}
+
void preparePrintFront(void)
{
static BOOL first=TRUE;
if(!first) return;
first=FALSE;
- static Fl_Window w(0,0,120,30);
- static Fl_Button b(0,0,w.w(),w.h(), "Print front window");
- b.callback(printFront);
+ static Fl_Window w(0,0,120,60);
+ static Fl_Button bp(0,0,w.w(),30, "Print front window");
+ bp.callback(printFront);
+ static Fl_Button bc(0,30,w.w(),30, "Copy front window");
+ bc.callback(copyFront);
w.end();
w.show();
}
@@ -2761,5 +2877,5 @@ void preparePrintFront(void)
#endif // FL_DOXYGEN
//
-// End of "$Id: Fl_win32.cxx 10387 2014-10-20 15:14:12Z ossman $".
+// End of "$Id: Fl_win32.cxx 12028 2016-10-14 16:35:44Z AlbrechtS $".
//
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 11d1b2f..7c03d33 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_x.cxx 10412 2014-10-29 20:25:46Z cand $"
+// "$Id: Fl_x.cxx 12028 2016-10-14 16:35:44Z AlbrechtS $"
//
// X specific code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2012 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -69,9 +69,9 @@ static bool have_xfixes = false;
# if HAVE_XCURSOR
# include <X11/Xcursor/Xcursor.h>
# endif
-static Fl_Xlib_Graphics_Driver fl_xlib_driver;
-static Fl_Display_Device fl_xlib_display(&fl_xlib_driver);
-Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the platform display
+# if HAVE_XRENDER
+# include <X11/extensions/Xrender.h>
+# endif
////////////////////////////////////////////////////////////////
// interface to poll/select call:
@@ -352,6 +352,7 @@ static Atom fl_XaTextUriList;
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_SUPPORTING_WM_CHECK;
@@ -670,7 +671,7 @@ void fl_open_display() {
if (fl_display) return;
setlocale(LC_CTYPE, "");
- XSetLocaleModifiers("");
+ XSetLocaleModifiers("@im=");
XSetIOErrorHandler(io_error_handler);
XSetErrorHandler(xerror_handler);
@@ -716,6 +717,7 @@ void fl_open_display(Display* d) {
fl_XaImageBmp = XInternAtom(d, "image/bmp", 0);
fl_XaImagePNG = XInternAtom(d, "image/png", 0);
fl_INCR = XInternAtom(d, "INCR", 0);
+ fl_NET_WM_PID = XInternAtom(d, "_NET_WM_PID", 0);
fl_NET_WM_NAME = XInternAtom(d, "_NET_WM_NAME", 0);
fl_NET_WM_ICON_NAME = XInternAtom(d, "_NET_WM_ICON_NAME", 0);
fl_NET_SUPPORTING_WM_CHECK = XInternAtom(d, "_NET_SUPPORTING_WM_CHECK", 0);
@@ -891,8 +893,8 @@ int Fl::clipboard_contains(const char *type)
if (event.type == SelectionNotify && event.xselection.property == None) return 0;
i++;
}
- while (i < 10 && event.type != SelectionNotify);
- if (i >= 10) return 0;
+ while (i < 50 && event.type != SelectionNotify);
+ if (i >= 50) return 0;
XGetWindowProperty(fl_display,
event.xselection.requestor,
event.xselection.property,
@@ -992,6 +994,13 @@ static int get_xwinprop(Window wnd, Atom prop, long max_length,
void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
if (!stuff || len<0) return;
+
+ if (clipboard >= 2) {
+ copy(stuff, len, 0, type);
+ copy(stuff, len, 1, type);
+ return;
+ }
+
if (len+1 > fl_selection_buffer_length[clipboard]) {
delete[] fl_selection_buffer[clipboard];
fl_selection_buffer[clipboard] = new char[len+100];
@@ -1469,9 +1478,9 @@ fprintf(stderr,"\n");*/
sn_buffer[bytesread] = 0;
convert_crlf(sn_buffer, bytesread);
}
+ if (!fl_selection_requestor) return 0;
if (Fl::e_clipboard_type == Fl::clipboard_image) {
if (bytesread == 0) return 0;
- Fl_Image *image = 0;
static char tmp_fname[21];
static Fl_Shared_Image *shared = 0;
strcpy(tmp_fname, "/tmp/clipboardXXXXXX");
@@ -1487,18 +1496,23 @@ fprintf(stderr,"\n");*/
shared = Fl_Shared_Image::get(tmp_fname);
unlink(tmp_fname);
if (!shared) return 0;
- image = shared->copy();
+ uchar *rgb = new uchar[shared->w() * shared->h() * shared->d()];
+ memcpy(rgb, shared->data()[0], shared->w() * shared->h() * shared->d());
+ Fl_RGB_Image *image = new Fl_RGB_Image(rgb, shared->w(), shared->h(), shared->d());
shared->release();
+ image->alloc_array = 1;
Fl::e_clipboard_data = (void*)image;
}
- if (!fl_selection_requestor) return 0;
-
- if (Fl::e_clipboard_type == Fl::clipboard_plain_text) {
+ else if (Fl::e_clipboard_type == Fl::clipboard_plain_text) {
Fl::e_text = sn_buffer ? (char*)sn_buffer : (char *)"";
Fl::e_length = bytesread;
}
int old_event = Fl::e_number;
- fl_selection_requestor->handle(Fl::e_number = FL_PASTE);
+ int retval = fl_selection_requestor->handle(Fl::e_number = FL_PASTE);
+ if (!retval && Fl::e_clipboard_type == Fl::clipboard_image) {
+ delete (Fl_RGB_Image*)Fl::e_clipboard_data;
+ Fl::e_clipboard_data = NULL;
+ }
Fl::e_number = old_event;
// Detect if this paste is due to Xdnd by the property name (I use
// XA_SECONDARY for that) and send an XdndFinished message. It is not
@@ -1857,7 +1871,7 @@ fprintf(stderr,"\n");*/
case 149: keysym = FL_Menu; break;
}
# endif
-# if BACKSPACE_HACK
+# ifdef BACKSPACE_HACK
// Attempt to fix keyboards that send "delete" for the key in the
// upper-right corner of the main keyboard. But it appears that
// very few of these remain?
@@ -2211,6 +2225,7 @@ int Fl_X::ewmh_supported() {
static int result = -1;
if (result == -1) {
+ fl_open_display();
result = 0;
unsigned long nitems;
unsigned long *words = 0;
@@ -2229,6 +2244,23 @@ int Fl_X::ewmh_supported() {
return result;
}
+int Fl_X::xrender_supported() {
+#if HAVE_XRENDER
+ static int result = -1;
+
+ if (result == -1) {
+ fl_open_display();
+
+ int nop1, nop2;
+ result = XRenderQueryExtension(fl_display, &nop1, &nop2);
+ }
+
+ return result;
+#else
+ return 0;
+#endif
+}
+
extern Fl_Window *fl_xfocus;
void Fl_X::activate_window(Window w) {
@@ -2452,6 +2484,15 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
mask, &attr));
int showit = 1;
+ // Set WM_CLIENT_MACHINE and WM_LOCALE_NAME
+ XSetWMProperties(fl_display, xp->xid, NULL, NULL, NULL, 0, NULL, NULL, NULL);
+
+ // Set _NET_WM_PID
+ long pid;
+ pid = getpid();
+ XChangeProperty(fl_display, xp->xid, fl_NET_WM_PID,
+ XA_CARDINAL, 32, 0, (unsigned char *)&pid, 1);
+
if (!win->parent() && !attr.override_redirect) {
// Communicate all kinds 'o junk to the X Window Manager:
@@ -2661,6 +2702,8 @@ void Fl_Window::size_range_() {
static unsigned long *default_net_wm_icons = 0L;
static size_t default_net_wm_icons_size = 0;
+// Note: icons[] *must* contain at least <count> valid image pointers (!NULL),
+// but: <count> *may* be 0
static void icons_to_property(const Fl_RGB_Image *icons[], int count,
unsigned long **property, size_t *len) {
size_t sz;
@@ -2684,9 +2727,11 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count,
data[1] = image->h();
data += 2;
+ const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0;
+
const uchar *in = (const uchar*)*image->data();
- for (int y = 0;y < image->h();y++) {
- for (int x = 0;x < image->w();x++) {
+ for (int y = 0; y < image->h(); y++) {
+ for (int x = 0; x < image->w(); x++) {
switch (image->d()) {
case 1:
*data = ( 0xff<<24) | (in[0]<<16) | (in[0]<<8) | in[0];
@@ -2704,7 +2749,7 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count,
in += image->d();
data++;
}
- in += image->ld();
+ in += extra_data;
}
}
}
@@ -2820,6 +2865,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
if (!cursor)
return 0;
+ const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0;
const uchar *i = (const uchar*)*image->data();
XcursorPixel *o = cursor->pixels;
for (int y = 0;y < image->h();y++) {
@@ -2841,7 +2887,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
i += image->d();
o++;
}
- i += image->ld();
+ i += extra_data;
}
cursor->xhot = hotx;
@@ -2988,6 +3034,11 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
this->print_widget(win, x_offset, y_offset);
return;
}
+ draw_decorated_window(win, x_offset, y_offset, this);
+}
+
+void Fl_Paged_Device::draw_decorated_window(Fl_Window *win, int x_offset, int y_offset, Fl_Surface_Device *toset)
+{
Fl_Display_Device::display_device()->set_current();
win->show();
Fl::check();
@@ -3003,7 +3054,7 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
// and I don't know where to find the window decoration
if (do_it && root == parent) do_it = 0;
if (!do_it) {
- this->set_current();
+ toset->set_current();
this->print_widget(win, x_offset, y_offset);
return;
}
@@ -3016,7 +3067,7 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
bottom_image = fl_read_image(NULL, 0, bt + win->h(), -(win->w() + 2*bx), bx);
}
fl_window = from;
- this->set_current();
+ toset->set_current();
if (top_image) {
fl_draw_image(top_image, x_offset, y_offset, win->w() + 2 * bx, bt, 3);
delete[] top_image;
@@ -3074,14 +3125,29 @@ void printFront(Fl_Widget *o, void *data)
o->window()->show();
}
+#include <FL/Fl_Copy_Surface.H>
+void copyFront(Fl_Widget *o, void *data)
+{
+ o->window()->hide();
+ Fl_Window *win = Fl::first_window();
+ if (!win) return;
+ Fl_Copy_Surface *surf = new Fl_Copy_Surface(win->decorated_w(), win->decorated_h());
+ surf->set_current();
+ surf->draw_decorated_window(win); // draw the window content
+ delete surf; // put the window on the clipboard
+ o->window()->show();
+}
+
void preparePrintFront(void)
{
static int first=1;
if(!first) return;
first=0;
- static Fl_Window w(0,0,150,30);
- static Fl_Button b(0,0,w.w(),w.h(), "Print front window");
- b.callback(printFront);
+ static Fl_Window w(0,0,140,60);
+ static Fl_Button bp(0,0,w.w(),30, "Print front window");
+ bp.callback(printFront);
+ static Fl_Button bc(0,30,w.w(),30, "Copy front window");
+ bc.callback(copyFront);
w.end();
w.show();
}
@@ -3090,5 +3156,5 @@ void preparePrintFront(void)
#endif
//
-// End of "$Id: Fl_x.cxx 10412 2014-10-29 20:25:46Z cand $".
+// End of "$Id: Fl_x.cxx 12028 2016-10-14 16:35:44Z AlbrechtS $".
//
diff --git a/src/Makefile b/src/Makefile
index d55ea70..71abb76 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile 10419 2014-10-30 16:05:22Z AlbrechtS $"
+# "$Id: Makefile 10653 2015-03-25 20:06:54Z AlbrechtS $"
#
# Library makefile for the Fast Light Tool Kit (FLTK).
#
@@ -16,6 +16,9 @@
# http://www.fltk.org/str.php
#
+# Note: see ../configure.in and/or ../makeinclude for definition of
+# FL_VERSION (x.y.z), FL_ABI_VERSION (x.y.0), and FL_DSO_VERSION (x.y)
+
CPPFILES = \
Fl.cxx \
Fl_Adjuster.cxx \
@@ -234,27 +237,27 @@ $(LIBNAME): $(OBJECTS)
$(LIBCOMMAND) $@ $(OBJECTS)
$(RANLIB) $@
-libfltk.so.1.3: $(OBJECTS)
+libfltk.so.$(FL_DSO_VERSION): $(OBJECTS)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(OBJECTS) $(LDLIBS)
$(RM) libfltk.so
- $(LN) libfltk.so.1.3 libfltk.so
+ $(LN) libfltk.so.$(FL_DSO_VERSION) libfltk.so
-libfltk.sl.1.3: $(OBJECTS)
+libfltk.sl.$(FL_DSO_VERSION): $(OBJECTS)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(OBJECTS)
$(RM) libfltk.sl
- $(LN) libfltk.sl.1.3 libfltk.sl
+ $(LN) libfltk.sl.$(FL_DSO_VERSION) libfltk.sl
-libfltk.1.3.dylib: $(OBJECTS)
+libfltk.$(FL_DSO_VERSION).dylib: $(OBJECTS)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ \
-install_name $(libdir)/$@ \
- -current_version 1.3.3 \
- -compatibility_version 1.3.0 \
+ -current_version $(FL_VERSION) \
+ -compatibility_version $(FL_DSO_VERSION).0 \
$(OBJECTS) $(LDLIBS)
$(RM) libfltk.dylib
- $(LN) libfltk.1.3.dylib libfltk.dylib
+ $(LN) libfltk.$(FL_DSO_VERSION).dylib libfltk.dylib
libfltk_s.a: $(OBJECTS)
echo $(DSOCOMMAND) libfltk_s.o ...
@@ -270,27 +273,27 @@ $(FLLIBNAME): $(FLOBJECTS)
$(LIBCOMMAND) $@ $(FLOBJECTS)
$(RANLIB) $@
-libfltk_forms.so.1.3: $(FLOBJECTS) libfltk.so.1.3
+libfltk_forms.so.$(FL_DSO_VERSION): $(FLOBJECTS) libfltk.so.$(FL_DSO_VERSION)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(FLOBJECTS) -L. -lfltk $(LDLIBS)
$(RM) libfltk_forms.so
- $(LN) libfltk_forms.so.1.3 libfltk_forms.so
+ $(LN) libfltk_forms.so.$(FL_DSO_VERSION) libfltk_forms.so
-libfltk_forms.sl.1.3: $(FLOBJECTS) libfltk.sl.1.3
+libfltk_forms.sl.$(FL_DSO_VERSION): $(FLOBJECTS) libfltk.sl.$(FL_DSO_VERSION)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(FLOBJECTS) -L. -lfltk
$(RM) libfltk_forms.sl
- $(LN) libfltk_forms.sl.1.3 libfltk_forms.sl
+ $(LN) libfltk_forms.sl.$(FL_DSO_VERSION) libfltk_forms.sl
-libfltk_forms.1.3.dylib: $(FLOBJECTS) libfltk.1.3.dylib
+libfltk_forms.$(FL_DSO_VERSION).dylib: $(FLOBJECTS) libfltk.$(FL_DSO_VERSION).dylib
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ \
-install_name $(libdir)/$@ \
- -current_version 1.3.3 \
- -compatibility_version 1.3.0 \
+ -current_version $(FL_VERSION) \
+ -compatibility_version $(FL_ABI_VERSION) \
$(FLOBJECTS) -L. $(LDLIBS) -lfltk
$(RM) libfltk_forms.dylib
- $(LN) libfltk_forms.1.3.dylib libfltk_forms.dylib
+ $(LN) libfltk_forms.$(FL_DSO_VERSION).dylib libfltk_forms.dylib
libfltk_forms_s.a: $(FLOBJECTS)
echo $(DSOCOMMAND) libfltk_forms_s.o ...
@@ -306,27 +309,27 @@ $(GLLIBNAME): $(GLOBJECTS)
$(LIBCOMMAND) $@ $(GLOBJECTS)
$(RANLIB) $@
-libfltk_gl.so.1.3: $(GLOBJECTS) libfltk.so.1.3
+libfltk_gl.so.$(FL_DSO_VERSION): $(GLOBJECTS) libfltk.so.$(FL_DSO_VERSION)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(GLOBJECTS) -L. -lfltk $(LDLIBS) $(GLDLIBS)
$(RM) libfltk_gl.so
- $(LN) libfltk_gl.so.1.3 libfltk_gl.so
+ $(LN) libfltk_gl.so.$(FL_DSO_VERSION) libfltk_gl.so
-libfltk_gl.sl.1.3: $(GLOBJECTS) libfltk.sl.1.3
+libfltk_gl.sl.$(FL_DSO_VERSION): $(GLOBJECTS) libfltk.sl.$(FL_DSO_VERSION)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(GLOBJECTS) -L. -lfltk
$(RM) libfltk_gl.sl
- $(LN) libfltk_gl.sl.1.3 libfltk_gl.sl
+ $(LN) libfltk_gl.sl.$(FL_DSO_VERSION) libfltk_gl.sl
-libfltk_gl.1.3.dylib: $(GLOBJECTS) libfltk.1.3.dylib
+libfltk_gl.$(FL_DSO_VERSION).dylib: $(GLOBJECTS) libfltk.$(FL_DSO_VERSION).dylib
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ \
-install_name $(libdir)/$@ \
- -current_version 1.3.3 \
- -compatibility_version 1.3.0 \
+ -current_version $(FL_VERSION) \
+ -compatibility_version $(FL_ABI_VERSION) \
$(GLOBJECTS) -L. $(GLDLIBS) -lfltk
$(RM) libfltk_gl.dylib
- $(LN) libfltk_gl.1.3.dylib libfltk_gl.dylib
+ $(LN) libfltk_gl.$(FL_DSO_VERSION).dylib libfltk_gl.dylib
libfltk_gl_s.a: $(GLOBJECTS)
echo $(DSOCOMMAND) libfltk_gl_s.o ...
@@ -342,27 +345,27 @@ $(IMGLIBNAME): $(IMGOBJECTS)
$(LIBCOMMAND) $@ $(IMGOBJECTS)
$(RANLIB) $@
-libfltk_images.so.1.3: $(IMGOBJECTS) libfltk.so.1.3
+libfltk_images.so.$(FL_DSO_VERSION): $(IMGOBJECTS) libfltk.so.$(FL_DSO_VERSION)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(IMGOBJECTS) -L. $(IMAGELIBS) -lfltk $(LDLIBS)
$(RM) libfltk_images.so
- $(LN) libfltk_images.so.1.3 libfltk_images.so
+ $(LN) libfltk_images.so.$(FL_DSO_VERSION) libfltk_images.so
-libfltk_images.sl.1.3: $(IMGOBJECTS) libfltk.sl.1.3
+libfltk_images.sl.$(FL_DSO_VERSION): $(IMGOBJECTS) libfltk.sl.$(FL_DSO_VERSION)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(IMGOBJECTS) -L. $(IMAGELIBS) -lfltk
$(RM) libfltk_images.sl
- $(LN) libfltk_images.sl.1.3 libfltk_images.sl
+ $(LN) libfltk_images.sl.$(FL_DSO_VERSION) libfltk_images.sl
-libfltk_images.1.3.dylib: $(IMGOBJECTS) libfltk.1.3.dylib
+libfltk_images.$(FL_DSO_VERSION).dylib: $(IMGOBJECTS) libfltk.$(FL_DSO_VERSION).dylib
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ \
-install_name $(libdir)/$@ \
- -current_version 1.3.3 \
- -compatibility_version 1.3.0 \
+ -current_version $(FL_VERSION) \
+ -compatibility_version $(FL_ABI_VERSION) \
$(IMGOBJECTS) -L. $(LDLIBS) $(IMAGELIBS) -lfltk
$(RM) libfltk_images.dylib
- $(LN) libfltk_images.1.3.dylib libfltk_images.dylib
+ $(LN) libfltk_images.$(FL_DSO_VERSION).dylib libfltk_images.dylib
libfltk_images_s.a: $(IMGOBJECTS)
echo $(DSOCOMMAND) libfltk_images_s.o ...
@@ -384,24 +387,24 @@ libfltk_images_s.a: $(IMGOBJECTS)
# cygwin GDI shared libraries
#-----------------------------------------------------------------
-cygfltknox-1.3.dll: $(LIBNAME)
+cygfltknox-$(FL_DSO_VERSION).dll: $(LIBNAME)
echo $(DSOCOMMAND) $(LIBNAME) ...
$(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk.dll.a $(LDLIBS)
-cygfltknox_forms-1.3.dll: $(FLLIBNAME) cygfltknox-1.3.dll
+cygfltknox_forms-$(FL_DSO_VERSION).dll: $(FLLIBNAME) cygfltknox-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(FLLIBNAME) ...
$(DSOCOMMAND) $(FLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_forms.dll.a \
-L. -lfltk $(LDLIBS)
-cygfltknox_gl-1.3.dll: $(GLLIBNAME) cygfltknox-1.3.dll
+cygfltknox_gl-$(FL_DSO_VERSION).dll: $(GLLIBNAME) cygfltknox-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(GLLIBNAME) ...
$(DSOCOMMAND) $(GLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_gl.dll.a \
-L. -lfltk $(GLDLIBS)
-cygfltknox_images-1.3.dll: $(IMGLIBNAME) cygfltknox-1.3.dll
+cygfltknox_images-$(FL_DSO_VERSION).dll: $(IMGLIBNAME) cygfltknox-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(IMGLIBNAME) ...
$(DSOCOMMAND) $(IMGLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_images.dll.a \
@@ -412,42 +415,42 @@ cygfltknox_images-1.3.dll: $(IMGLIBNAME) cygfltknox-1.3.dll
# cygwin X11 shared libraries
#-----------------------------------------------------------------
-cygfltk-1.3.dll: $(LIBNAME)
+cygfltk-$(FL_DSO_VERSION).dll: $(LIBNAME)
echo $(DSOCOMMAND) $(LIBNAME) ...
$(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk.dll.a $(LDLIBS)
-cygfltk_forms-1.3.dll: $(FLLIBNAME) cygfltk-1.3.dll
+cygfltk_forms-$(FL_DSO_VERSION).dll: $(FLLIBNAME) cygfltk-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(FLLIBNAME) ...
$(DSOCOMMAND) $(FLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_forms.dll.a \
-L. -lfltk $(LDLIBS)
-cygfltk_gl-1.3.dll: $(GLLIBNAME) cygfltk-1.3.dll
+cygfltk_gl-$(FL_DSO_VERSION).dll: $(GLLIBNAME) cygfltk-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(GLLIBNAME) ...
$(DSOCOMMAND) $(GLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_gl.dll.a \
-L. -lfltk $(GLDLIBS)
-cygfltk_images-1.3.dll: $(IMGLIBNAME) cygfltk-1.3.dll
+cygfltk_images-$(FL_DSO_VERSION).dll: $(IMGLIBNAME) cygfltk-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(IMGLIBNAME) ...
$(DSOCOMMAND) $(IMGLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_images.dll.a \
-L. -lfltk -Wl,--exclude-libs -Wl,libfltk_png.a \
$(IMAGELIBS) $(LDLIBS)
-mgwfltknox-1.3.dll: $(LIBNAME)
+mgwfltknox-$(FL_DSO_VERSION).dll: $(LIBNAME)
echo $(DSOCOMMAND) $(LIBNAME) ...
$(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk.dll.a $(LDLIBS)
-mgwfltknox_forms-1.3.dll: $(FLLIBNAME) mgwfltknox-1.3.dll
+mgwfltknox_forms-$(FL_DSO_VERSION).dll: $(FLLIBNAME) mgwfltknox-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(FLLIBNAME) ...
$(DSOCOMMAND) $(FLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_forms.dll.a \
-L. -lfltk $(LDLIBS)
-mgwfltknox_gl-1.3.dll: $(GLLIBNAME) mgwfltknox-1.3.dll
+mgwfltknox_gl-$(FL_DSO_VERSION).dll: $(GLLIBNAME) mgwfltknox-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(GLLIBNAME) ...
$(DSOCOMMAND) $(GLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_gl.dll.a \
@@ -457,7 +460,7 @@ mgwfltknox_gl-1.3.dll: $(GLLIBNAME) mgwfltknox-1.3.dll
# See STR #1585 for --exclude-libs
#-----------------------------------------------------
-mgwfltknox_images-1.3.dll: $(IMGLIBNAME) mgwfltknox-1.3.dll
+mgwfltknox_images-$(FL_DSO_VERSION).dll: $(IMGLIBNAME) mgwfltknox-$(FL_DSO_VERSION).dll
echo $(DSOCOMMAND) $(IMGLIBNAME) ...
$(DSOCOMMAND) $(IMGLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_images.dll.a \
@@ -568,125 +571,125 @@ install: $(LIBNAME) $(DSONAME) \
$(RANLIB) $(DESTDIR)$(libdir)/$(GLLIBBASENAME); \
fi
$(RANLIB) $(DESTDIR)$(libdir)/$(IMGLIBBASENAME)
- if test x$(DSONAME) = xlibfltk.so.1.3; then\
+ if test x$(DSONAME) = xlibfltk.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk.so*;\
- $(INSTALL_LIB) libfltk.so.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk.so.1.3 $(DESTDIR)$(libdir)/libfltk.so;\
+ $(INSTALL_LIB) libfltk.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk.so;\
fi
- if test x$(DSONAME) = xlibfltk.sl.1.3; then\
+ if test x$(DSONAME) = xlibfltk.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk.sl*;\
- $(INSTALL_LIB) libfltk.sl.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk.sl.1.3 $(DESTDIR)$(libdir)/libfltk.sl;\
+ $(INSTALL_LIB) libfltk.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk.sl;\
fi
- if test x$(DSONAME) = xlibfltk.1.3.dylib; then\
+ if test x$(DSONAME) = xlibfltk.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk.*dylib;\
- $(INSTALL_LIB) libfltk.1.3.dylib $(DESTDIR)$(libdir); \
- $(LN) libfltk.1.3.dylib $(DESTDIR)$(libdir)/libfltk.dylib;\
+ $(INSTALL_LIB) libfltk.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir); \
+ $(LN) libfltk.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir)/libfltk.dylib;\
fi
if test x$(DSONAME) = xlibfltk_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_s.a;\
$(INSTALL_LIB) libfltk_s.a $(DESTDIR)$(libdir); \
fi
- if test x$(DSONAME) = xcygfltknox-1.3.dll; then\
+ if test x$(DSONAME) = xcygfltknox-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME);\
$(INSTALL_LIB) $(DSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
$(INSTALL_LIB) libfltk.dll.a $(DESTDIR)$(libdir); \
fi
- if test x$(DSONAME) = xmgwfltknox-1.3.dll; then\
+ if test x$(DSONAME) = xmgwfltknox-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME);\
$(INSTALL_LIB) $(DSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
$(INSTALL_LIB) libfltk.dll.a $(DESTDIR)$(libdir); \
fi
- if test x$(FLDSONAME) = xlibfltk_forms.so.1.3; then\
+ if test x$(FLDSONAME) = xlibfltk_forms.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.so*;\
- $(INSTALL_LIB) libfltk_forms.so.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk_forms.so.1.3 $(DESTDIR)$(libdir)/libfltk_forms.so;\
+ $(INSTALL_LIB) libfltk_forms.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk_forms.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk_forms.so;\
fi
- if test x$(FLDSONAME) = xlibfltk_forms.sl.1.3; then\
+ if test x$(FLDSONAME) = xlibfltk_forms.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.sl*;\
- $(INSTALL_LIB) libfltk_forms.sl.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk_forms.sl.1.3 $(DESTDIR)$(libdir)/libfltk_forms.sl;\
+ $(INSTALL_LIB) libfltk_forms.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk_forms.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk_forms.sl;\
fi
- if test x$(FLDSONAME) = xlibfltk_forms.1.3.dylib; then\
+ if test x$(FLDSONAME) = xlibfltk_forms.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.*dylib;\
- $(INSTALL_LIB) libfltk_forms.1.3.dylib $(DESTDIR)$(libdir); \
- $(LN) libfltk_forms.1.3.dylib $(DESTDIR)$(libdir)/libfltk_forms.dylib;\
+ $(INSTALL_LIB) libfltk_forms.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir); \
+ $(LN) libfltk_forms.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir)/libfltk_forms.dylib;\
fi
if test x$(FLDSONAME) = xlibfltk_forms_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms_s.a;\
$(INSTALL_LIB) libfltk_forms_s.a $(DESTDIR)$(libdir); \
fi
- if test x$(FLDSONAME) = xcygfltknox_forms-1.3.dll; then\
+ if test x$(FLDSONAME) = xcygfltknox_forms-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME);\
$(INSTALL_LIB) $(FLDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
$(INSTALL_LIB) libfltk_forms.dll.a $(DESTDIR)$(libdir); \
fi
- if test x$(FLDSONAME) = xmgwfltknox_forms-1.3.dll; then\
+ if test x$(FLDSONAME) = xmgwfltknox_forms-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME);\
$(INSTALL_LIB) $(FLDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
$(INSTALL_LIB) libfltk_forms.dll.a $(DESTDIR)$(libdir); \
fi
- if test x$(GLDSONAME) = xlibfltk_gl.so.1.3; then\
+ if test x$(GLDSONAME) = xlibfltk_gl.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.so*;\
- $(INSTALL_LIB) libfltk_gl.so.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk_gl.so.1.3 $(DESTDIR)$(libdir)/libfltk_gl.so;\
+ $(INSTALL_LIB) libfltk_gl.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk_gl.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk_gl.so;\
fi
- if test x$(GLDSONAME) = xlibfltk_gl.sl.1.3; then\
+ if test x$(GLDSONAME) = xlibfltk_gl.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.sl*;\
- $(INSTALL_LIB) libfltk_gl.sl.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk_gl.sl.1.3 $(DESTDIR)$(libdir)/libfltk_gl.sl;\
+ $(INSTALL_LIB) libfltk_gl.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk_gl.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk_gl.sl;\
fi
- if test x$(GLDSONAME) = xlibfltk_gl.1.3.dylib; then\
+ if test x$(GLDSONAME) = xlibfltk_gl.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.*dylib;\
- $(INSTALL_LIB) libfltk_gl.1.3.dylib $(DESTDIR)$(libdir); \
- $(LN) libfltk_gl.1.3.dylib $(DESTDIR)$(libdir)/libfltk_gl.dylib;\
+ $(INSTALL_LIB) libfltk_gl.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir); \
+ $(LN) libfltk_gl.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir)/libfltk_gl.dylib;\
fi
if test x$(GLDSONAME) = xlibfltk_gl_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl_s.a;\
$(INSTALL_LIB) libfltk_gl_s.a $(DESTDIR)$(libdir); \
fi
- if test x$(GLDSONAME) = xcygfltknox_gl-1.3.dll; then\
+ if test x$(GLDSONAME) = xcygfltknox_gl-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME);\
$(INSTALL_LIB) $(GLDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
$(INSTALL_LIB) libfltk_gl.dll.a $(DESTDIR)$(libdir); \
fi
- if test x$(GLDSONAME) = xmgwfltknox_gl-1.3.dll; then\
+ if test x$(GLDSONAME) = xmgwfltknox_gl-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME);\
$(INSTALL_LIB) $(GLDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
$(INSTALL_LIB) libfltk_gl.dll.a $(DESTDIR)$(libdir); \
fi
- if test x$(IMGDSONAME) = xlibfltk_images.so.1.3; then\
+ if test x$(IMGDSONAME) = xlibfltk_images.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images.so*;\
- $(INSTALL_LIB) libfltk_images.so.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk_images.so.1.3 $(DESTDIR)$(libdir)/libfltk_images.so;\
+ $(INSTALL_LIB) libfltk_images.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk_images.so.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk_images.so;\
fi
- if test x$(IMGDSONAME) = xlibfltk_images.sl.1.3; then\
+ if test x$(IMGDSONAME) = xlibfltk_images.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images.sl*;\
- $(INSTALL_LIB) libfltk_images.sl.1.3 $(DESTDIR)$(libdir); \
- $(LN) libfltk_images.sl.1.3 $(DESTDIR)$(libdir)/libfltk_images.sl;\
+ $(INSTALL_LIB) libfltk_images.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir); \
+ $(LN) libfltk_images.sl.$(FL_DSO_VERSION) $(DESTDIR)$(libdir)/libfltk_images.sl;\
fi
- if test x$(IMGDSONAME) = xlibfltk_images.1.3.dylib; then\
+ if test x$(IMGDSONAME) = xlibfltk_images.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images.*dylib;\
- $(INSTALL_LIB) libfltk_images.1.3.dylib $(DESTDIR)$(libdir); \
- $(LN) libfltk_images.1.3.dylib $(DESTDIR)$(libdir)/libfltk_images.dylib;\
+ $(INSTALL_LIB) libfltk_images.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir); \
+ $(LN) libfltk_images.$(FL_DSO_VERSION).dylib $(DESTDIR)$(libdir)/libfltk_images.dylib;\
fi
if test x$(IMGDSONAME) = xlibfltk_images_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images_s.a;\
$(INSTALL_LIB) libfltk_images_s.a $(DESTDIR)$(libdir); \
fi
- if test x$(IMGDSONAME) = xcygfltknox_images-1.3.dll; then\
+ if test x$(IMGDSONAME) = xcygfltknox_images-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(INSTALL_LIB) $(IMGDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
$(INSTALL_LIB) libfltk_images.dll.a $(DESTDIR)$(libdir); \
fi
- if test x$(IMGDSONAME) = xmgwfltknox_images-1.3.dll; then\
+ if test x$(IMGDSONAME) = xmgwfltknox_images-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(INSTALL_LIB) $(IMGDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
@@ -697,110 +700,110 @@ install: $(LIBNAME) $(DSONAME) \
uninstall:
echo "Uninstalling libraries..."
$(RM) $(DESTDIR)$(libdir)/$(LIBBASENAME)
- if test x$(DSONAME) = xlibfltk.so.1.3; then\
+ if test x$(DSONAME) = xlibfltk.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk.so*;\
fi
- if test x$(DSONAME) = xlibfltk.sl.1.3; then\
+ if test x$(DSONAME) = xlibfltk.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk.sl*;\
fi
- if test x$(DSONAME) = xlibfltk.1.3.dylib; then\
+ if test x$(DSONAME) = xlibfltk.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk.*dylib;\
fi
if test x$(DSONAME) = xlibfltk_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_s.a;\
fi
- if test x$(DSONAME) = xcygfltknox-1.3.dll; then\
+ if test x$(DSONAME) = xcygfltknox-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
fi
- if test x$(DSONAME) = xcygfltk-1.3.dll; then\
+ if test x$(DSONAME) = xcygfltk-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
fi
- if test x$(DSONAME) = xmgwfltknox-1.3.dll; then\
+ if test x$(DSONAME) = xmgwfltknox-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
fi
$(RM) $(DESTDIR)$(libdir)/$(FLLIBBASENAME);
- if test x$(FLDSONAME) = xlibfltk_forms.so.1.3; then\
+ if test x$(FLDSONAME) = xlibfltk_forms.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.so*;\
fi
- if test x$(FLDSONAME) = xlibfltk_forms.sl.1.3; then\
+ if test x$(FLDSONAME) = xlibfltk_forms.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.sl*;\
fi
- if test x$(FLDSONAME) = xlibfltk_forms.1.3.dylib; then\
+ if test x$(FLDSONAME) = xlibfltk_forms.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.*dylib;\
fi
if test x$(FLDSONAME) = xlibfltk_forms_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms_s.a;\
fi
- if test x$(FLDSONAME) = xcygfltknox_forms-1.3.dll; then\
+ if test x$(FLDSONAME) = xcygfltknox_forms-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
fi
- if test x$(FLDSONAME) = xcygfltk_forms-1.3.dll; then\
+ if test x$(FLDSONAME) = xcygfltk_forms-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
fi
- if test x$(FLDSONAME) = xmgwfltknox_forms-1.3.dll; then\
+ if test x$(FLDSONAME) = xmgwfltknox_forms-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
fi
if test x$(GLLIBNAME) != x; then\
$(RM) $(DESTDIR)$(libdir)/$(GLLIBBASENAME);\
fi
- if test x$(GLDSONAME) = xlibfltk_gl.so.1.3; then\
+ if test x$(GLDSONAME) = xlibfltk_gl.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.so*;\
fi
- if test x$(GLDSONAME) = xlibfltk_gl.sl.1.3; then\
+ if test x$(GLDSONAME) = xlibfltk_gl.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.sl*;\
fi
- if test x$(GLDSONAME) = xlibfltk_gl.1.3.dylib; then\
+ if test x$(GLDSONAME) = xlibfltk_gl.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.*dylib;\
fi
if test x$(GLDSONAME) = xlibfltk_gl_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl_s.a;\
fi
- if test x$(GLDSONAME) = xcygfltknox_gl-1.3.dll; then\
+ if test x$(GLDSONAME) = xcygfltknox_gl-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
fi
- if test x$(GLDSONAME) = xcygfltk_gl-1.3.dll; then\
+ if test x$(GLDSONAME) = xcygfltk_gl-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
fi
- if test x$(GLDSONAME) = xmgwfltknox_gl-1.3.dll; then\
+ if test x$(GLDSONAME) = xmgwfltknox_gl-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
fi
if test x$(IMGLIBNAME) != x; then\
$(RM) $(DESTDIR)$(libdir)/$(IMGLIBBASENAME);\
fi
- if test x$(IMGDSONAME) = xlibfltk_images.so.1.3; then\
+ if test x$(IMGDSONAME) = xlibfltk_images.so.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images.so*;\
fi
- if test x$(IMGDSONAME) = xlibfltk_images.sl.1.3; then\
+ if test x$(IMGDSONAME) = xlibfltk_images.sl.$(FL_DSO_VERSION); then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images.sl*;\
fi
- if test x$(IMGDSONAME) = xlibfltk_images.1.3.dylib; then\
+ if test x$(IMGDSONAME) = xlibfltk_images.$(FL_DSO_VERSION).dylib; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images.*dylib;\
fi
if test x$(IMGDSONAME) = xlibfltk_images_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images_s.a;\
fi
- if test x$(IMGDSONAME) = xcygfltknox_images-1.3.dll; then\
+ if test x$(IMGDSONAME) = xcygfltknox_images-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
fi
- if test x$(IMGDSONAME) = xcygfltk_images-1.3.dll; then\
+ if test x$(IMGDSONAME) = xcygfltk_images-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
fi
- if test x$(IMGDSONAME) = xmgwfltknox_images-1.3.dll; then\
+ if test x$(IMGDSONAME) = xmgwfltknox_images-$(FL_DSO_VERSION).dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
fi
#
-# End of "$Id: Makefile 10419 2014-10-30 16:05:22Z AlbrechtS $".
+# End of "$Id: Makefile 10653 2015-03-25 20:06:54Z AlbrechtS $".
#
diff --git a/src/Xutf8.h b/src/Xutf8.h
index 7e5d357..b23c0d4 100644
--- a/src/Xutf8.h
+++ b/src/Xutf8.h
@@ -1,4 +1,4 @@
-/* "$Id: Xutf8.h 10248 2014-08-23 08:41:58Z cand $"
+/* "$Id: Xutf8.h 10588 2015-02-22 13:26:00Z AlbrechtS $"
*
* Author: Jean-Marc Lienher ( http://oksid.ch )
* Copyright 2000-2010 by O'ksi'D.
@@ -25,6 +25,7 @@ extern "C" {
#include <X11/Xlib.h>
#include <X11/Xlocale.h>
#include <X11/Xutil.h>
+#include <FL/Fl_Export.H>
typedef struct {
int nb_font;
@@ -98,8 +99,8 @@ XUtf8UcsWidth(
XUtf8FontStruct *font_set,
unsigned int ucs);
-int
-XGetUtf8FontAndGlyph(
+FL_EXPORT int
+fl_XGetUtf8FontAndGlyph(
XUtf8FontStruct *font_set,
unsigned int ucs,
XFontStruct **fnt,
@@ -180,5 +181,5 @@ XUtf8Toupper(
#endif
/*
- * End of "$Id: Xutf8.h 10248 2014-08-23 08:41:58Z cand $".
+ * End of "$Id: Xutf8.h 10588 2015-02-22 13:26:00Z AlbrechtS $".
*/
diff --git a/src/filename_absolute.cxx b/src/filename_absolute.cxx
index 1cfec99..c31b24b 100644
--- a/src/filename_absolute.cxx
+++ b/src/filename_absolute.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: filename_absolute.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: filename_absolute.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $"
//
// Filename expansion routines for the Fast Light Tool Kit (FLTK).
//
@@ -83,7 +83,7 @@ int fl_filename_absolute(char *to, int tolen, const char *from) {
while (*start == '.') {
if (start[1]=='.' && isdirsep(start[2])) {
char *b;
- for (b = a-1; b >= temp && !isdirsep(*b); b--);
+ for (b = a-1; b >= temp && !isdirsep(*b); b--) {/*empty*/}
if (b < temp) break;
a = b;
start += 3;
@@ -259,5 +259,5 @@ fl_filename_relative(char *to, // O - Relative filename
//
-// End of "$Id: filename_absolute.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: filename_absolute.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $".
//
diff --git a/src/filename_expand.cxx b/src/filename_expand.cxx
index 0c973a1..f0634a1 100644
--- a/src/filename_expand.cxx
+++ b/src/filename_expand.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: filename_expand.cxx 9325 2012-04-05 05:12:30Z fabien $"
+// "$Id: filename_expand.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $"
//
// Filename expansion routines for the Fast Light Tool Kit (FLTK).
//
@@ -70,7 +70,7 @@ int fl_filename_expand(char *to,int tolen, const char *from) {
int ret = 0;
for (char *a=temp; a<end; ) { // for each slash component
- char *e; for (e=a; e<end && !isdirsep(*e); e++); // find next slash
+ 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
@@ -121,5 +121,5 @@ int fl_filename_expand(char *to,int tolen, const char *from) {
//
-// End of "$Id: filename_expand.cxx 9325 2012-04-05 05:12:30Z fabien $".
+// End of "$Id: filename_expand.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $".
//
diff --git a/src/fl_arci.cxx b/src/fl_arci.cxx
index f50a4cf..74c52bd 100644
--- a/src/fl_arci.cxx
+++ b/src/fl_arci.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_arci.cxx 9023 2011-08-30 07:50:16Z AlbrechtS $"
+// "$Id: fl_arci.cxx 10825 2015-08-05 20:20:30Z manolo $"
//
// Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK).
//
@@ -119,5 +119,5 @@ void Fl_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) {
}
//
-// End of "$Id: fl_arci.cxx 9023 2011-08-30 07:50:16Z AlbrechtS $".
+// End of "$Id: fl_arci.cxx 10825 2015-08-05 20:20:30Z manolo $".
//
diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx
index 051b67f..fc3d22f 100644
--- a/src/fl_ask.cxx
+++ b/src/fl_ask.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_ask.cxx 10232 2014-08-21 12:13:47Z cand $"
+// "$Id: fl_ask.cxx 11842 2016-07-22 02:05:44Z greg.ercolano $"
//
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
//
@@ -73,7 +73,6 @@ static void button_cb(Fl_Widget *, long val) {
static Fl_Window *makeform() {
if (message_form) {
- message_form->size(410,103);
return message_form;
}
// make sure that the dialog does not become the child of some
@@ -134,6 +133,8 @@ static void resizeform() {
int x, w, h, max_w, max_h;
const int icon_size = 50;
+ message_form->size(410,103);
+
fl_font(message->labelfont(), message->labelsize());
message_w = message_h = 0;
fl_measure(message->label(), message_w, message_h);
@@ -209,6 +210,7 @@ static int innards(const char* fmt, va_list ap,
avoidRecursion = 1;
makeform();
+ message_form->size(410,103);
char buffer[1024];
if (!strcmp(fmt,"%s")) {
message->label(va_arg(ap, const char*));
@@ -249,7 +251,9 @@ static int innards(const char* fmt, va_list ap,
// deactivate Fl::grab(), because it is incompatible with modal windows
Fl_Window* g = Fl::grab();
if (g) Fl::grab(0);
+ Fl_Group *current_group = Fl_Group::current(); // make sure the dialog does not interfere with any active group
message_form->show();
+ Fl_Group::current(current_group);
while (message_form->shown()) Fl::wait();
if (g) // regrab the previous popup menu, if there was one
Fl::grab(g);
@@ -378,6 +382,10 @@ void fl_alert(const char *fmt, ...) {
\param[in] fmt can be used as an sprintf-like format and variables for the message text
\retval 0 if the no button is selected or another dialog box is still open
\retval 1 if yes is selected
+
+ \deprecated fl_ask() is deprecated since it uses "Yes" and "No" for the buttons which
+ does not conform to the current FLTK Human Interface Guidelines.
+ Use fl_choice() with the appropriate verbs instead.
*/
int fl_ask(const char *fmt, ...) {
@@ -394,20 +402,59 @@ int fl_ask(const char *fmt, ...) {
return r;
}
-/** Shows a dialog displaying the \p fmt message,
+/** Shows a dialog displaying the printf style \p fmt message,
this dialog features up to 3 customizable choice buttons
\note Common dialog boxes are application modal. No more than one common dialog box
can be open at any time. Requests for additional dialog boxes are ignored.
\note \#include <FL/fl_ask.H>
+ Three choices with printf() style formatting:
+ \code
+ int num_msgs = GetNumberOfMessages();
+ switch ( fl_choice("What to do with %d messages?", "Send", "Save", "Delete", num_msgs) ) {
+ case 0: .. // Send
+ case 1: .. // Save (default)
+ case 2: .. // Delete
+ ..
+ }
+ \endcode
+
+ Three choice example:
+ \image html fl_choice_three.png
+ \image latex fl_choice_three.png "fl_choice() three choices" width=4cm
+ \code
+ switch ( fl_choice("How many musketeers?", "One", "Two", "Three") ) {
+ case 0: .. // One
+ case 1: .. // Two (default)
+ case 2: .. // Three
+ }
+ \endcode
+
+ Two choice example:
+ \image html fl_choice_two.png
+ \image latex fl_choice_two.png "fl_choice() two choices" width=4cm
+ \code
+ switch ( fl_choice("Empty trash?", "Yes", "No", 0) ) {
+ case 0: .. // Yes
+ case 1: .. // No (default)
+ }
+ \endcode
+
+ One choice example:
+ \image html fl_choice_one.png
+ \image latex fl_choice_one.png "fl_choice() one choice" width=4cm
+ \code
+ fl_choice("All hope is lost.", "OK", 0, 0); // "OK" default
+ \endcode
+
\param[in] fmt can be used as an sprintf-like format and variables for the message text
\param[in] b0 text label of button 0
- \param[in] b1 text label of button 1
- \param[in] b2 text label of button 2
- \retval 0 if the first button with \p b0 text is selected or another dialog box is still open
- \retval 1 if the second button with \p b1 text is selected
- \retval 2 if the third button with \p b2 text is selected
+ \param[in] b1 text label of button 1 (can be 0)
+ \param[in] b2 text label of button 2 (can be 0)
+ \retval 0 if the first button with \p b0 text is pushed or another dialog box is still open
+ \retval 1 if the second button with \p b1 text is pushed
+ \retval 2 if the third button with \p b2 text is pushed
*/
int fl_choice(const char*fmt,const char *b0,const char *b1,const char *b2,...){
@@ -432,6 +479,7 @@ Fl_Widget *fl_message_icon() {makeform(); return icon;}
static const char* input_innards(const char* fmt, va_list ap,
const char* defstr, uchar type) {
makeform();
+ message_form->size(410,103);
message->position(60,10);
input->type(type);
input->show();
@@ -568,5 +616,5 @@ void fl_message_title_default(const char *title) {
/** @} */
//
-// End of "$Id: fl_ask.cxx 10232 2014-08-21 12:13:47Z cand $".
+// End of "$Id: fl_ask.cxx 11842 2016-07-22 02:05:44Z greg.ercolano $".
//
diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx
index 6d688b5..1e42453 100644
--- a/src/fl_boxtype.cxx
+++ b/src/fl_boxtype.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_boxtype.cxx 10253 2014-08-23 09:27:30Z cand $"
+// "$Id: fl_boxtype.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $"
//
// Box drawing code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -49,14 +49,50 @@ static const uchar inactive_ramp[24] = {
static int draw_it_active = 1;
/**
- Determines if the current draw box is active or inactive.
- If inactive, the box color is changed by the inactive color.
+ Determines if the currently drawn box is active or inactive.
+
+ If inactive, the box color should be changed to the inactive color.
+
+ \see Fl::box_color(Fl_Color c)
*/
int Fl::draw_box_active() { return draw_it_active; }
const uchar *fl_gray_ramp() {return (draw_it_active?active_ramp:inactive_ramp)-'A';}
/**
+ Gets the drawing color to be used for the background of a box.
+
+ This method is only useful inside box drawing code. It returns the
+ color to be used, either fl_inactive(c) if the widget is inactive_r()
+ or \p c otherwise.
+*/
+Fl_Color Fl::box_color(Fl_Color c) {
+ return (draw_it_active ? c : fl_inactive(c));
+}
+
+/**
+ Sets the drawing color for the box that is currently drawn.
+
+ This method sets the current drawing color fl_color() depending on
+ the widget's state to either \p c or fl_inactive(c).
+
+ It should be used whenever a box background is drawn in the box (type)
+ drawing code instead of calling fl_color(Fl_Color bg) with the
+ background color \p bg, usually Fl_Widget::color().
+
+ This method is only useful inside box drawing code. Whenever a box is
+ drawn with one of the standard box drawing methods, a static variable
+ is set depending on the widget's current state - if the widget is
+ inactive_r() then the internal variable is false (0), otherwise it
+ is true (1). This is faster than calling Fl_Widget::active_r()
+ because the state is cached.
+
+ \see Fl::draw_box_active()
+ \see Fl::box_color(Fl_Color)
+*/
+void Fl::set_box_color(Fl_Color c) { fl_color(box_color(c)); }
+
+/**
Draws a series of line segments around the given box.
The string \p s must contain groups of 4 letters which specify one of 24
standard grayscale values, where 'A' is black and 'X' is white.
@@ -127,6 +163,11 @@ void fl_frame2(const char* s, int x, int y, int w, int h) {
/** Draws a box of type FL_NO_BOX */
void fl_no_box(int, int, int, int, Fl_Color) {}
+/** Draws a box of type FL_FLAT_BOX */
+void fl_flat_box(int x, int y, int w, int h, Fl_Color c) {
+ fl_rectf(x, y, w, h, Fl::box_color(c));
+}
+
/** Draws a frame of type FL_THIN_DOWN_FRAME */
void fl_thin_down_frame(int x, int y, int w, int h, Fl_Color) {
fl_frame2("WWHH",x,y,w,h);
@@ -135,7 +176,7 @@ void fl_thin_down_frame(int x, int y, int w, int h, Fl_Color) {
/** Draws a box of type FL_THIN_DOWN_BOX */
void fl_thin_down_box(int x, int y, int w, int h, Fl_Color c) {
fl_thin_down_frame(x,y,w,h,c);
- fl_color(draw_it_active ? c : fl_inactive(c));
+ Fl::set_box_color(c);
fl_rectf(x+1, y+1, w-2, h-2);
}
@@ -147,7 +188,7 @@ void fl_thin_up_frame(int x, int y, int w, int h, Fl_Color) {
/** Draws a box of type FL_THIN_UP_BOX */
void fl_thin_up_box(int x, int y, int w, int h, Fl_Color c) {
fl_thin_up_frame(x,y,w,h,c);
- fl_color(draw_it_active ? c : fl_inactive(c));
+ Fl::set_box_color(c);
fl_rectf(x+1, y+1, w-2, h-2);
}
@@ -170,7 +211,7 @@ void fl_up_frame(int x, int y, int w, int h, Fl_Color) {
/** Draws a box of type FL_UP_BOX */
void fl_up_box(int x, int y, int w, int h, Fl_Color c) {
fl_up_frame(x,y,w,h,c);
- fl_color(draw_it_active ? c : fl_inactive(c));
+ Fl::set_box_color(c);
fl_rectf(x+D1, y+D1, w-D2, h-D2);
}
@@ -190,7 +231,8 @@ void fl_down_frame(int x, int y, int w, int h, Fl_Color) {
/** Draws a box of type FL_DOWN_BOX */
void fl_down_box(int x, int y, int w, int h, Fl_Color c) {
fl_down_frame(x,y,w,h,c);
- fl_color(c); fl_rectf(x+D1, y+D1, w-D2, h-D2);
+ Fl::set_box_color(c);
+ fl_rectf(x+D1, y+D1, w-D2, h-D2);
}
/** Draws a frame of type FL_ENGRAVED_FRAME */
@@ -201,7 +243,7 @@ void fl_engraved_frame(int x, int y, int w, int h, Fl_Color) {
/** Draws a box of type FL_ENGRAVED_BOX */
void fl_engraved_box(int x, int y, int w, int h, Fl_Color c) {
fl_engraved_frame(x,y,w,h,c);
- fl_color(draw_it_active ? c : fl_inactive(c));
+ Fl::set_box_color(c);
fl_rectf(x+2, y+2, w-4, h-4);
}
@@ -213,7 +255,7 @@ void fl_embossed_frame(int x, int y, int w, int h, Fl_Color) {
/** Draws a box of type FL_EMBOSSED_BOX */
void fl_embossed_box(int x, int y, int w, int h, Fl_Color c) {
fl_embossed_frame(x,y,w,h,c);
- fl_color(draw_it_active ? c : fl_inactive(c));
+ Fl::set_box_color(c);
fl_rectf(x+2, y+2, w-4, h-4);
}
@@ -222,9 +264,9 @@ void fl_embossed_box(int x, int y, int w, int h, Fl_Color c) {
Equivalent to drawing a box of type FL_BORDER_BOX.
*/
void fl_rectbound(int x, int y, int w, int h, Fl_Color bgcolor) {
- fl_color(draw_it_active ? FL_BLACK : fl_inactive(FL_BLACK));
+ Fl::set_box_color(FL_BLACK);
fl_rect(x, y, w, h);
- fl_color(draw_it_active ? bgcolor : fl_inactive(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 */
@@ -233,7 +275,7 @@ void fl_rectbound(int x, int y, int w, int h, Fl_Color bgcolor) {
Draws a frame of type FL_BORDER_FRAME.
*/
void fl_border_frame(int x, int y, int w, int h, Fl_Color c) {
- fl_color(draw_it_active ? c : fl_inactive(c));
+ Fl::set_box_color(c);
fl_rect(x, y, w, h);
}
@@ -245,8 +287,8 @@ static struct {
int set;
} fl_box_table[256] = {
// must match list in Enumerations.H!!!
- {fl_no_box, 0,0,0,0,1},
- {fl_rectf, 0,0,0,0,1}, // FL_FLAT_BOX
+ {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},
@@ -260,39 +302,47 @@ static struct {
{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_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,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_rectf, 0,0,0,0,0}, // _FL_RFLAT_BOX,
+ {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_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_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_rectf, 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_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
@@ -300,7 +350,7 @@ static struct {
{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_down_box, 3,3,6,6,0} // FL_FREE_BOX+7
};
/**
@@ -317,8 +367,8 @@ int Fl::box_dx(Fl_Boxtype t) {return fl_box_table[t].dx;}
prevent overdrawing the borders.
For instance, in the case of a boxtype like FL_DOWN_BOX
- where the border width might be 2 pixels all around, the above
- functions would return 2, 2, 4, and 4 for box_dx,
+ where the border width might be 2 pixels all around, the above
+ functions would return 2, 2, 4, and 4 for box_dx,
box_dy, box_dw, and box_dh respectively.
An example to compute the area inside a widget's box():
@@ -328,8 +378,8 @@ int Fl::box_dx(Fl_Boxtype t) {return fl_box_table[t].dx;}
int W = yourwidget->w() - Fl::box_dw(yourwidget->box());
int H = yourwidget->h() - Fl::box_dh(yourwidget->box());
\endcode
- These functions are mainly useful in the draw() code
- for deriving custom widgets, where one wants to avoid drawing
+ These functions are mainly useful in the draw() code
+ for deriving custom widgets, where one wants to avoid drawing
over the widget's own border box().
*/
int Fl::box_dy(Fl_Boxtype t) {return fl_box_table[t].dy;}
@@ -400,7 +450,7 @@ void Fl_Widget::draw_backdrop() const {
// if there is no image, we will not draw the deimage either
if (img && deimage() && !active_r())
img = deimage();
- if (img)
+ if (img)
((Fl_Image*)img)->draw(x_+(w_-img->w())/2, y_+(h_-img->h())/2);
}
}
@@ -416,5 +466,5 @@ void Fl_Widget::draw_box(Fl_Boxtype t, int X, int Y, int W, int H, Fl_Color c) c
}
//
-// End of "$Id: fl_boxtype.cxx 10253 2014-08-23 09:27:30Z cand $".
+// End of "$Id: fl_boxtype.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $".
//
diff --git a/src/fl_color_mac.cxx b/src/fl_color_mac.cxx
index ac21963..2329cfd 100644
--- a/src/fl_color_mac.cxx
+++ b/src/fl_color_mac.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_color_mac.cxx 9151 2011-10-26 11:17:31Z manolo $"
+// "$Id: fl_color_mac.cxx 10739 2015-05-30 13:46:59Z manolo $"
//
// MacOS color functions for the Fast Light Tool Kit (FLTK).
//
@@ -63,6 +63,7 @@ void Fl_Quartz_Graphics_Driver::color(uchar r, uchar g, uchar b) {
float fr = r/255.0f;
float fg = g/255.0f;
float fb = b/255.0f;
+ if (!fl_gc) return; // no context yet? We will assign the color later.
CGContextSetRGBFillColor(fl_gc, fr, fg, fb, 1.0f);
CGContextSetRGBStrokeColor(fl_gc, fr, fg, fb, 1.0f);
}
@@ -74,5 +75,5 @@ void Fl::set_color(Fl_Color i, unsigned c) {
}
//
-// End of "$Id: fl_color_mac.cxx 9151 2011-10-26 11:17:31Z manolo $".
+// End of "$Id: fl_color_mac.cxx 10739 2015-05-30 13:46:59Z manolo $".
//
diff --git a/src/fl_diamond_box.cxx b/src/fl_diamond_box.cxx
index db2bfb2..9487393 100644
--- a/src/fl_diamond_box.cxx
+++ b/src/fl_diamond_box.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_diamond_box.cxx 10306 2014-09-13 16:49:47Z manolo $"
+// "$Id: fl_diamond_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $"
//
// Diamond box code for the Fast Light Tool Kit (FLTK).
//
@@ -32,7 +32,8 @@ static void fl_diamond_up_box(int x,int y,int w,int h,Fl_Color bgcolor) {
h &= -2;
int x1 = x+w/2;
int y1 = y+h/2;
- fl_color(bgcolor); fl_polygon(x+3, y1, x1,y+3, x+w-3,y1, x1,y+h-3);
+ Fl::set_box_color(bgcolor);
+ fl_polygon(x+3, y1, x1,y+3, x+w-3,y1, x1,y+h-3);
const uchar *g = fl_gray_ramp();
fl_color(g[(int)'W']); fl_line(x+1, y1, x1, y+1, x+w-1, y1);
fl_color(g[(int)'U']); fl_line(x+2, y1, x1, y+2, x+w-2, y1);
@@ -55,7 +56,8 @@ static void fl_diamond_down_box(int x,int y,int w,int h,Fl_Color bgcolor) {
fl_color(g[(int)'W']); fl_line(x+2, y1, x1, y+h-2, x+w-2, y1);
fl_color(g[(int)'U']); fl_line(x+1, y1, x1, y+h-1, x+w-1, y1);
fl_color(g[(int)'S']); fl_line(x+0, y1, x1, y+h-0, x+w-0, y1);
- fl_color(bgcolor); fl_polygon(x+3, y1, x1,y+3, x+w-3,y1, x1,y+h-3);
+ Fl::set_box_color(bgcolor);
+ fl_polygon(x+3, y1, x1,y+3, x+w-3,y1, x1,y+h-3);
fl_color(g[(int)'A']); fl_loop(x+3, y1, x1, y+3, x+w-3, y1, x1, y+h-3);
}
@@ -67,5 +69,5 @@ Fl_Boxtype fl_define_FL_DIAMOND_BOX() {
}
//
-// End of "$Id: fl_diamond_box.cxx 10306 2014-09-13 16:49:47Z manolo $".
+// End of "$Id: fl_diamond_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $".
//
diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx
index 20c13b8..551c88b 100644
--- a/src/fl_dnd_win32.cxx
+++ b/src/fl_dnd_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_dnd_win32.cxx 9677 2012-08-18 11:32:50Z AlbrechtS $"
+// "$Id: fl_dnd_win32.cxx 11131 2016-02-07 10:10:52Z AlbrechtS $"
//
// Drag & Drop code for the Fast Light Tool Kit (FLTK).
//
@@ -134,6 +134,8 @@ public:
}
px = pt.x; py = pt.y;
lastEffect = *pdwEffect;
+ // show insert position if dnd'ing in the same window/process (STR #3209)
+ Fl::flush();
return S_OK;
}
HRESULT STDMETHODCALLTYPE DragLeave() {
@@ -334,7 +336,7 @@ public:
delete this;
return nTemp;
}
- STDMETHODIMP GiveFeedback( ulong ) { return DRAGDROP_S_USEDEFAULTCURSORS; }
+ STDMETHODIMP GiveFeedback( DWORD ) { return DRAGDROP_S_USEDEFAULTCURSORS; }
STDMETHODIMP QueryContinueDrag( BOOL esc, DWORD keyState ) {
if ( esc )
return DRAGDROP_S_CANCEL;
@@ -546,5 +548,5 @@ int Fl::dnd()
}
//
-// End of "$Id: fl_dnd_win32.cxx 9677 2012-08-18 11:32:50Z AlbrechtS $".
+// End of "$Id: fl_dnd_win32.cxx 11131 2016-02-07 10:10:52Z AlbrechtS $".
//
diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx
index 355b04a..d7dd0b9 100644
--- a/src/fl_draw.cxx
+++ b/src/fl_draw.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_draw.cxx 10265 2014-09-03 10:07:33Z AlbrechtS $"
+// "$Id: fl_draw.cxx 11847 2016-07-24 08:53:08Z AlbrechtS $"
//
// Label drawing code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -129,7 +129,7 @@ static const char* expand_text_(const char* from, char*& buf, int maxbuf, double
Also word-wrap if width exceeds maxw.
Returns a pointer to the start of the next line of characters.
Sets n to the number of characters put into the buffer.
- Sets width to the width of the string in the current font.
+ Sets width to the width of the string in the \ref drawing_fl_font "current font".
*/
const char*
fl_expand_text(const char* from, char* buf, int maxbuf, double maxw, int& n,
@@ -174,7 +174,7 @@ void fl_draw(
// Start with a symbol...
for (symptr = symbol[0];
*str && !isspace(*str) && symptr < (symbol[0] + sizeof(symbol[0]) - 1);
- *symptr++ = *str++);
+ *symptr++ = *str++) {/*empty*/}
*symptr = '\0';
if (isspace(*str)) str++;
symwidth[0] = (w < h ? w : h);
@@ -354,9 +354,13 @@ void fl_draw(
fl_draw() function with \p align parameter. If the incoming \p w
is non-zero it will wrap to that width.
- The 'current font' is used to do the width/height calculations,
- so unless its value is known at the time fl_measure() is called,
- it is advised to first set the current font with fl_font().
+ The \ref drawing_fl_font "current font" is used to do the width/height
+ calculations, so unless its value is known at the time fl_measure() is
+ called, it is advised to first set the current font with fl_font().
+ With event-driven GUI programming you can never be sure which
+ widget was exposed and redrawn last, nor which font it used.
+ If you have not called fl_font() explicitly in your own code,
+ the width and height may be set to unexpected values, even zero!
\b Note: In the general use case, it's a common error to forget to set
\p w to 0 before calling fl_measure() when wrap behavior isn't needed.
@@ -452,5 +456,5 @@ int fl_height(int font, int size) {
}
//
-// End of "$Id: fl_draw.cxx 10265 2014-09-03 10:07:33Z AlbrechtS $".
+// End of "$Id: fl_draw.cxx 11847 2016-07-24 08:53:08Z AlbrechtS $".
//
diff --git a/src/fl_draw_image.cxx b/src/fl_draw_image.cxx
index fbbed41..164ca22 100644
--- a/src/fl_draw_image.cxx
+++ b/src/fl_draw_image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw_image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_draw_image.cxx 11270 2016-03-02 15:45:26Z AlbrechtS $"
//
// Image drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -316,6 +316,13 @@ static void xrgb_converter(const uchar *from, uchar *to, int w, int delta) {
INNARDS32((from[0]<<16)+(from[1]<<8)+(from[2]));
}
+static void argb_premul_converter(const uchar *from, uchar *to, int w, int delta) {
+ INNARDS32((unsigned(from[3]) << 24) +
+ (((from[0] * from[3]) / 255) << 16) +
+ (((from[1] * from[3]) / 255) << 8) +
+ ((from[2] * from[3]) / 255));
+}
+
static void bgrx_converter(const uchar *from, uchar *to, int w, int delta) {
INNARDS32((from[0]<<8)+(from[1]<<16)+(unsigned(from[2])<<24));
}
@@ -451,9 +458,10 @@ static void figure_out_visual() {
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)
+ Fl_Draw_Image_Cb cb, void* userdata,
+ const bool alpha)
{
- if (!linedelta) linedelta = W*delta;
+ if (!linedelta) linedelta = W*abs(delta);
int dx, dy, w, h;
fl_clip_box(X,Y,W,H,dx,dy,w,h);
@@ -462,11 +470,28 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
dy -= Y;
if (!bytes_per_pixel) figure_out_visual();
+ const unsigned oldbpp = bytes_per_pixel;
+ const GC oldgc = fl_gc;
+ static GC gc32 = None;
xi.width = w;
xi.height = h;
void (*conv)(const uchar *from, uchar *to, int w, int delta) = converter;
if (mono) conv = mono_converter;
+ if (alpha) {
+ // This flag states the destination format is ARGB32 (big-endian), pre-multiplied.
+ bytes_per_pixel = 4;
+ conv = argb_premul_converter;
+ xi.depth = 32;
+ xi.bits_per_pixel = 32;
+
+ // Do we need a new GC?
+ if (fl_visual->depth != 32) {
+ if (gc32 == None)
+ gc32 = XCreateGC(fl_display, fl_window, 0, NULL);
+ fl_gc = gc32;
+ }
+ }
// See if the data is already in the right format. Unfortunately
// some 32-bit x servers (XFree86) care about the unknown 8 bits
@@ -534,21 +559,44 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
delete[] linebuf;
}
}
+
+ if (alpha) {
+ bytes_per_pixel = oldbpp;
+ xi.depth = fl_visual->depth;
+ xi.bits_per_pixel = oldbpp * 8;
+
+ if (fl_visual->depth != 32) {
+ fl_gc = oldgc;
+ }
+ }
}
void Fl_Xlib_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
- innards(buf,x,y,w,h,d,l,(d<3&&d>-3),0,0);
+
+ const bool alpha = !!(abs(d) & FL_IMAGE_WITH_ALPHA);
+ if (alpha) d ^= FL_IMAGE_WITH_ALPHA;
+ const int mono = (d>-3 && d<3);
+
+ innards(buf,x,y,w,h,d,l,mono,0,0,alpha);
}
+
void Fl_Xlib_Graphics_Driver::draw_image(Fl_Draw_Image_Cb cb, void* data,
int x, int y, int w, int h,int d) {
- innards(0,x,y,w,h,d,0,(d<3&&d>-3),cb,data);
+
+ const bool alpha = !!(abs(d) & FL_IMAGE_WITH_ALPHA);
+ if (alpha) d ^= FL_IMAGE_WITH_ALPHA;
+ const int mono = (d>-3 && d<3);
+
+ innards(0,x,y,w,h,d,0,mono,cb,data,alpha);
}
+
void Fl_Xlib_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);
+ innards(buf,x,y,w,h,d,l,1,0,0,0);
}
+
void Fl_Xlib_Graphics_Driver::draw_image_mono(Fl_Draw_Image_Cb cb, void* data,
int x, int y, int w, int h,int d) {
- innards(0,x,y,w,h,d,0,1,cb,data);
+ innards(0,x,y,w,h,d,0,1,cb,data,0);
}
void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
@@ -558,12 +606,12 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
} else {
uchar c[3];
c[0] = r; c[1] = g; c[2] = b;
- innards(c,x,y,w,h,0,0,0,0,0);
+ innards(c,x,y,w,h,0,0,0,0,0,0);
}
}
#endif
//
-// End of "$Id: fl_draw_image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_draw_image.cxx 11270 2016-03-02 15:45:26Z AlbrechtS $".
//
diff --git a/src/fl_draw_image_mac.cxx b/src/fl_draw_image_mac.cxx
index e81f7f1..7c53d90 100644
--- a/src/fl_draw_image_mac.cxx
+++ b/src/fl_draw_image_mac.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw_image_mac.cxx 9293 2012-03-18 18:48:29Z manolo $"
+// "$Id: fl_draw_image_mac.cxx 11263 2016-03-02 07:51:53Z manolo $"
//
// MacOS image drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -51,45 +51,57 @@ 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)
{
- if (!linedelta) linedelta = W*delta;
+ if (!linedelta) linedelta = W*abs(delta);
- const void *array = buf;
uchar *tmpBuf = 0;
+ if (!cb) {
+ if (delta < 0) buf -= (W-1)*(-delta);
+ if (linedelta < 0) buf -= (H-1)*(-linedelta);
+ }
+ const void *array = buf;
if (cb || Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) {
- tmpBuf = new uchar[ H*W*delta ];
+ tmpBuf = new uchar[ H*W*abs(delta) ];
if (cb) {
for (int i=0; i<H; i++) {
- cb(userdata, 0, i, W, tmpBuf+i*W*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*linedelta, W*delta);
- p += W*delta;
+ memcpy(p, buf+i*abs(linedelta), W*abs(delta));
+ p += W*abs(delta);
}
}
array = (void*)tmpBuf;
- linedelta = W*delta;
+ linedelta = W*abs(delta);
}
// create an image context
CGColorSpaceRef lut = 0;
- if (delta<=2)
+ if (abs(delta) <= 2)
lut = CGColorSpaceCreateDeviceGray();
else
lut = CGColorSpaceCreateDeviceRGB();
// a release callback is necessary when the fl_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, linedelta*H,
+ CGDataProviderRef src = CGDataProviderCreateWithData( 0L, array, abs(linedelta)*H,
tmpBuf ? dataReleaseCB : NULL
);
- CGImageRef img = CGImageCreate( W, H, 8, 8*delta, linedelta,
- lut, delta&1?kCGImageAlphaNone:kCGImageAlphaNoneSkipLast,
+ CGImageRef img = CGImageCreate( W, H, 8, 8*abs(delta), abs(linedelta),
+ lut, abs(delta)&1?kCGImageAlphaNone:kCGImageAlphaNoneSkipLast,
//lut, delta&1?kCGImageAlphaNone:kCGImageAlphaLast,
src, 0L, false, kCGRenderingIntentDefault);
// draw the image into the destination context
if (img) {
- CGRect rect = { { X, Y }, { W, H } };
+ CGRect rect = CGRectMake( X, Y, W, H);
Fl_X::q_begin_image(rect, 0, 0, W, H);
+ if (linedelta < 0) {
+ CGContextTranslateCTM(fl_gc, 0, H);
+ CGContextScaleCTM(fl_gc, 1, -1);
+ }
+ if (delta < 0) {
+ CGContextTranslateCTM(fl_gc, W, 0);
+ CGContextScaleCTM(fl_gc, -1, 1);
+ }
CGContextDrawImage(fl_gc, rect, img);
Fl_X::q_end_image();
// release all allocated resources
@@ -163,5 +175,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
}
//
-// End of "$Id: fl_draw_image_mac.cxx 9293 2012-03-18 18:48:29Z manolo $".
+// End of "$Id: fl_draw_image_mac.cxx 11263 2016-03-02 07:51:53Z manolo $".
//
diff --git a/src/fl_draw_image_win32.cxx b/src/fl_draw_image_win32.cxx
index 11a46af..ca4d263 100644
--- a/src/fl_draw_image_win32.cxx
+++ b/src/fl_draw_image_win32.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_draw_image_win32.cxx 9293 2012-03-18 18:48:29Z manolo $"
+// "$Id: fl_draw_image_win32.cxx 11270 2016-03-02 15:45:26Z AlbrechtS $"
//
// WIN32 image drawing code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2012 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -103,6 +103,8 @@ static void monodither(uchar* to, const uchar* from, int w, int delta) {
#endif // USE_COLORMAP
+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)
@@ -117,7 +119,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
if (indexed || !fl_can_do_alpha_blending())
depth = (depth-1)|1;
- if (!linedelta) linedelta = W*delta;
+ if (!linedelta) linedelta = W*fl_abs(delta);
int x, y, w, h;
fl_clip_box(X,Y,W,H,x,y,w,h);
@@ -143,11 +145,12 @@ 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)
for (int i=0; i<256; i++) {
- bmi.bmiColors[i].rgbBlue = (uchar)i;
- bmi.bmiColors[i].rgbGreen = (uchar)i;
- bmi.bmiColors[i].rgbRed = (uchar)i;
- bmi.bmiColors[i].rgbReserved = (uchar)0; // must be zero
+ 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
}
}
bmi.bmiHeader.biWidth = w;
@@ -277,8 +280,6 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
}
}
-static int fl_abs(int v) { return v<0 ? -v : v; }
-
void Fl_GDI_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
if (fl_abs(d)&FL_IMAGE_WITH_ALPHA) {
d ^= FL_IMAGE_WITH_ALPHA;
@@ -332,5 +333,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
}
//
-// End of "$Id: fl_draw_image_win32.cxx 9293 2012-03-18 18:48:29Z manolo $".
+// End of "$Id: fl_draw_image_win32.cxx 11270 2016-03-02 15:45:26Z AlbrechtS $".
//
diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx
index 8440d55..5d2b7ce 100644
--- a/src/fl_draw_pixmap.cxx
+++ b/src/fl_draw_pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw_pixmap.cxx 10242 2014-08-22 10:28:50Z AlbrechtS $"
+// "$Id: fl_draw_pixmap.cxx 10568 2015-02-10 14:33:51Z manolo $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -253,8 +253,10 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
#ifdef __APPLE_QUARTZ__
if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) {
Fl_RGB_Image* rgb = new Fl_RGB_Image(buffer, w, h, 4);
+ rgb->alloc_array = 1;
rgb->draw(x, y);
delete rgb;
+ return 1;
} else {
#endif // __APPLE_QUARTZ__
// build the mask bitmap used by Fl_Pixmap:
@@ -289,5 +291,5 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
}
//
-// End of "$Id: fl_draw_pixmap.cxx 10242 2014-08-22 10:28:50Z AlbrechtS $".
+// End of "$Id: fl_draw_pixmap.cxx 10568 2015-02-10 14:33:51Z manolo $".
//
diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx
index 1b1bcff..c6940d8 100644
--- a/src/fl_file_dir.cxx
+++ b/src/fl_file_dir.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_file_dir.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_file_dir.cxx 10550 2015-02-02 17:55:22Z AlbrechtS $"
//
// File chooser widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -33,6 +33,22 @@ static void callback(Fl_File_Chooser *, void*) {
(*current_callback)(fc->value());
}
+// Pop up a file chooser dialog window and wait until it is closed...
+static void popup(Fl_File_Chooser *fc) {
+ fc->show();
+
+ // deactivate Fl::grab(), because it is incompatible with modal windows
+ Fl_Window* g = Fl::grab();
+ if (g) Fl::grab(0);
+
+ while (fc->shown())
+ Fl::wait();
+
+ if (g) // regrab the previous popup menu, if there was one
+ Fl::grab(g);
+}
+
+
/** \addtogroup group_comdlg
@{ */
@@ -130,11 +146,7 @@ fl_file_chooser(const char *message, // I - Message in titlebar
}
fc->ok_label(current_label);
- fc->show();
-
- while (fc->shown())
- Fl::wait();
-
+ popup(fc);
if (fc->value() && relative) {
fl_filename_relative(retname, sizeof(retname), fc->value());
@@ -171,10 +183,7 @@ fl_dir_chooser(const char *message, // I - Message for titlebar
fc->label(message);
}
- fc->show();
-
- while (fc->shown())
- Fl::wait();
+ popup(fc);
if (fc->value() && relative) {
fl_filename_relative(retname, sizeof(retname), fc->value());
@@ -187,5 +196,5 @@ fl_dir_chooser(const char *message, // I - Message for titlebar
//
-// End of "$Id: fl_file_dir.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_file_dir.cxx 10550 2015-02-02 17:55:22Z AlbrechtS $".
//
diff --git a/src/fl_font.cxx b/src/fl_font.cxx
index 48a5bb5..862b65f 100644
--- a/src/fl_font.cxx
+++ b/src/fl_font.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_font.cxx 9325 2012-04-05 05:12:30Z fabien $"
+// "$Id: fl_font.cxx 10504 2014-12-21 10:11:18Z manolo $"
//
// Font selection code for the Fast Light Tool Kit (FLTK).
//
@@ -55,6 +55,12 @@
# include "fl_font_x.cxx"
#endif // WIN32
+#if ! (defined(WIN32) || defined(__APPLE__))
+XFontStruct *fl_X_core_font()
+{
+ return fl_xfont.value();
+}
+#endif
double fl_width(const char* c) {
if (c) return fl_width(c, (int) strlen(c));
@@ -86,5 +92,5 @@ void fl_draw(const char* str, int l, float x, float y) {
#endif
}
//
-// End of "$Id: fl_font.cxx 9325 2012-04-05 05:12:30Z fabien $".
+// End of "$Id: fl_font.cxx 10504 2014-12-21 10:11:18Z manolo $".
//
diff --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx
index dac6f81..56a651a 100644
--- a/src/fl_font_mac.cxx
+++ b/src/fl_font_mac.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_font_mac.cxx 10193 2014-06-14 11:06:42Z manolo $"
+// "$Id: fl_font_mac.cxx 11943 2016-09-13 11:51:24Z manolo $"
//
// MacOS font selection routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -17,6 +17,9 @@
//
#include <config.h>
+#include <math.h>
+
+Fl_Fontdesc* fl_fonts = NULL;
/* from fl_utf.c */
extern unsigned fl_utf8toUtf16(const char* src, unsigned srclen, unsigned short* dst, unsigned dstlen);
@@ -27,6 +30,8 @@ static CFMutableDictionaryRef attributes = NULL;
#endif
const int Fl_X::CoreText_threshold = 100500; // this represents Mac OS 10.5
+// condition when the ATSU API is available at compile time
+#define HAS_ATSU (!defined(__LP64__) || !__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
Fl_Font_Descriptor::Fl_Font_Descriptor(const char* name, Fl_Fontsize Size) {
next = 0;
@@ -48,7 +53,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) {
double w;
CTFontGetAdvancesForGlyphs(fontref, kCTFontHorizontalOrientation, glyph, advances, 2);
w = advances[0].width;
- if ( abs(advances[0].width - advances[1].width) < 1E-2 ) {//this is a fixed-width font
+ if ( fabs(advances[0].width - advances[1].width) < 1E-2 ) {//this is a fixed-width font
// slightly rescale fixed-width fonts so the character width has an integral value
CFRelease(fontref);
CGFloat fsize = size / ( w/floor(w + 0.5) );
@@ -86,7 +91,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) {
}
else {
#endif
-#if ! __LP64__
+#if HAS_ATSU
OSStatus err;
// fill our structure with a few default values
ascent = Size*3/4.;
@@ -141,7 +146,7 @@ else {
// cause ATSU to find a suitable font to render any chars the current font can't do...
ATSUSetTransientFontMatching (layout, true);
# endif
-#endif//__LP64__
+#endif//HAS_ATSU
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
}
#endif
@@ -181,10 +186,10 @@ static Fl_Fontdesc built_in_table_PS[] = { // PostScript font names preferred wh
{"Arial-BoldMT"},
{"Arial-ItalicMT"},
{"Arial-BoldItalicMT"},
-{"CourierNewPSMT"},
-{"CourierNewPS-BoldMT"},
-{"CourierNewPS-ItalicMT"},
-{"CourierNewPS-BoldItalicMT"},
+{"Courier"},
+{"Courier-Bold"},
+{"Courier-Oblique"},
+{"Courier-BoldOblique"},
{"TimesNewRomanPSMT"},
{"TimesNewRomanPS-BoldMT"},
{"TimesNewRomanPS-ItalicMT"},
@@ -201,8 +206,8 @@ static Fl_Fontdesc built_in_table_full[] = { // full font names used before 10.5
{"Arial Bold"},
{"Arial Italic"},
{"Arial Bold Italic"},
- {"Courier New"},
- {"Courier New Bold"},
+ {"Courier"},
+ {"Courier Bold"},
{"Courier New Italic"},
{"Courier New Bold Italic"},
{"Times New Roman"},
@@ -234,6 +239,7 @@ static UniChar *mac_Utf8_to_Utf16(const char *txt, int len, int *new_len)
Fl_Fontdesc* Fl_X::calc_fl_fonts(void)
{
+ if (!fl_mac_os_version) fl_mac_os_version = calc_mac_os_version();
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
return (fl_mac_os_version >= Fl_X::CoreText_threshold ? built_in_table_PS : built_in_table_full);
#else
@@ -242,6 +248,7 @@ Fl_Fontdesc* Fl_X::calc_fl_fonts(void)
}
static Fl_Font_Descriptor* find(Fl_Font fnum, Fl_Fontsize size) {
+ if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts();
Fl_Fontdesc* s = fl_fonts+fnum;
if (!s->name) s = fl_fonts; // use 0 if fnum undefined
Fl_Font_Descriptor* f;
@@ -299,6 +306,18 @@ static CGFloat surrogate_width(const UniChar *txt, Fl_Font_Descriptor *fl_fontsi
if(must_release) CFRelease(font2);
return a.width;
}
+
+static CGFloat variation_selector_width(CFStringRef str16, Fl_Font_Descriptor *fl_fontsize)
+{
+ CGFloat retval;
+ CFDictionarySetValue(attributes, kCTFontAttributeName, fl_fontsize->fontref);
+ CFAttributedStringRef mastr = CFAttributedStringCreate(kCFAllocatorDefault, str16, attributes);
+ CTLineRef ctline = CTLineCreateWithAttributedString(mastr);
+ CFRelease(mastr);
+ retval = CTLineGetOffsetForStringIndex(ctline, 2, NULL);
+ CFRelease(ctline);
+ return retval;
+}
#endif
static double fl_mac_width(const UniChar* txt, int n, Fl_Font_Descriptor *fl_fontsize) {
@@ -314,6 +333,13 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) {
i++; // because a pair of UniChar's represent a single character
continue;
}
+ if (i+1 < n && txt[i+1] >= 0xFE00 && txt[i+1] <= 0xFE0F) { // handles variation selectors
+ CFStringRef substr = CFStringCreateWithCharacters(NULL, txt + i, 2);
+ retval += variation_selector_width(substr, fl_fontsize);
+ CFRelease(substr);
+ i++;
+ continue;
+ }
const int block = 0x10000 / (sizeof(fl_fontsize->width)/sizeof(float*)); // block size
// r: index of the character block containing uni
unsigned int r = uni >> 7; // change 7 if sizeof(width) is changed
@@ -363,7 +389,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) {
return retval;
} else {
#endif
-#if ! __LP64__
+#if HAS_ATSU
OSStatus err;
Fixed bBefore, bAfter, bAscent, bDescent;
ATSUTextLayout layout;
@@ -441,7 +467,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) {
}
else {
#endif
-#if ! __LP64__
+#if HAS_ATSU
OSStatus err;
ATSUTextLayout layout;
ByteCount iSize;
@@ -491,7 +517,7 @@ static void fl_mac_draw(const char *str, int n, float x, float y, Fl_Graphics_Dr
UniChar *uniStr = mac_Utf8_to_Utf16(str, n, &n);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (fl_mac_os_version >= Fl_X::CoreText_threshold) {
- CFStringRef str16 = CFStringCreateWithCharactersNoCopy(NULL, uniStr, n, kCFAllocatorNull);
+ CFMutableStringRef str16 = CFStringCreateMutableWithExternalCharactersNoCopy(NULL, uniStr, n, n, kCFAllocatorNull);
if (str16 == NULL) return; // shd not happen
CGColorRef color = flcolortocgcolor(driver->color());
CFDictionarySetValue (attributes, kCTFontAttributeName, driver->font_descriptor()->fontref);
@@ -509,7 +535,7 @@ static void fl_mac_draw(const char *str, int n, float x, float y, Fl_Graphics_Dr
CFRelease(ctline);
} else {
#endif
-#if ! __LP64__
+#if HAS_ATSU
OSStatus err;
// now collect our ATSU resources
ATSUTextLayout layout = driver->font_descriptor()->layout;
@@ -556,5 +582,5 @@ void Fl_Quartz_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
}
//
-// End of "$Id: fl_font_mac.cxx 10193 2014-06-14 11:06:42Z manolo $".
+// End of "$Id: fl_font_mac.cxx 11943 2016-09-13 11:51:24Z manolo $".
//
diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx
index 3970f08..cf1ebf4 100644
--- a/src/fl_font_win32.cxx
+++ b/src/fl_font_win32.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_font_win32.cxx 10226 2014-08-19 12:36:12Z AlbrechtS $"
+// "$Id: fl_font_win32.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $"
//
// WIN32 font selection routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2012 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -383,6 +383,8 @@ exit_error:
void Fl_GDI_Graphics_Driver::draw(const char* str, int n, int x, int y) {
COLORREF oldColor = SetTextColor(fl_gc, fl_RGB());
+ // avoid crash if no font has been set yet
+ if (!font_descriptor()) this->font(FL_HELVETICA, FL_NORMAL_SIZE);
SelectObject(fl_gc, font_descriptor()->fid);
int wn = fl_utf8toUtf16(str, n, wstr, wstr_len);
if(wn >= wstr_len) {
@@ -442,5 +444,5 @@ void Fl_GDI_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
}
#endif
//
-// End of "$Id: fl_font_win32.cxx 10226 2014-08-19 12:36:12Z AlbrechtS $".
+// End of "$Id: fl_font_win32.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $".
//
diff --git a/src/fl_font_x.cxx b/src/fl_font_x.cxx
index 3801936..7bb94d8 100644
--- a/src/fl_font_x.cxx
+++ b/src/fl_font_x.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_font_x.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_font_x.cxx 11977 2016-09-25 11:07:06Z AlbrechtS $"
//
// Standard X11 font selection code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -318,7 +318,13 @@ void Fl_Xlib_Graphics_Driver::draw(const char* c, int n, int x, int y) {
}
void Fl_Xlib_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) {
- fprintf(stderr,"ROTATING TEXT NOT IMPLEMENTED\n");
+ static char warning = 0; // issue warning only once
+ 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");
+ }
this->draw(str, n, (int)x, (int)y);
}
@@ -331,5 +337,5 @@ void Fl_Xlib_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
}
#endif // FL_DOXYGEN
//
-// End of "$Id: fl_font_x.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_font_x.cxx 11977 2016-09-25 11:07:06Z AlbrechtS $".
//
diff --git a/src/fl_font_xft.cxx b/src/fl_font_xft.cxx
index 1f2bbda..3ee84e2 100644
--- a/src/fl_font_xft.cxx
+++ b/src/fl_font_xft.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_font_xft.cxx 10232 2014-08-21 12:13:47Z cand $"
+// "$Id: fl_font_xft.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $"
//
// Xft font code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2001-2011 Bill Spitzak and others.
+// Copyright 2001-2016 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
@@ -58,6 +58,8 @@
#include <math.h>
+#define USE_OVERLAY 0
+
// The predefined fonts that FLTK has:
static Fl_Fontdesc built_in_table[] = {
#if 1
@@ -693,5 +695,5 @@ void Fl_Xlib_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
#endif
//
-// End of "$Id: fl_font_xft.cxx 10232 2014-08-21 12:13:47Z cand $"
+// End of "$Id: fl_font_xft.cxx 11094 2016-01-31 02:49:56Z AlbrechtS $"
//
diff --git a/src/fl_gleam.cxx b/src/fl_gleam.cxx
index b1c3bc5..3744e69 100644
--- a/src/fl_gleam.cxx
+++ b/src/fl_gleam.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_gleam.cxx 10143 2014-05-02 09:13:29Z ianmacarthur $"
+// "$Id: fl_gleam.cxx 11914 2016-09-01 12:41:19Z AlbrechtS $"
//
// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -30,8 +30,7 @@
static void gleam_color(Fl_Color c) {
- if (Fl::draw_box_active()) fl_color(c);
- else fl_color(fl_inactive(c));
+ Fl::set_box_color(c);
}
static void shade_rect_top_bottom(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, float th) {
@@ -40,12 +39,12 @@ static void shade_rect_top_bottom(int x, int y, int w, int h, Fl_Color fg1, Fl_C
int h_bottom = ((h/6) < (15) ? (h/6) : (15)); // min(h/6,15);
int h_flat = h-(h_top+h_bottom);
int j = 0;
- float step_size_top = h_top>1?(0.999/(float)(h_top)):1;
- float step_size_bottom = h_bottom>1?(0.999/(float)(h_bottom)):1;
+ float step_size_top = h_top>1?(0.999f/(float)(h_top)):1;
+ float step_size_bottom = h_bottom>1?(0.999f/(float)(h_bottom)):1;
// This loop generates the gradient at the top of the widget
for (float k = 1; k >= 0; k -= step_size_top){
gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
- fl_line(x, y+j, x+w, y+j);
+ fl_xyline(x, y+j, x+w);
j++;
}
gleam_color(fg1);
@@ -53,7 +52,7 @@ static void shade_rect_top_bottom(int x, int y, int w, int h, Fl_Color fg1, Fl_C
// This loop generates the gradient at the bottom of the widget
for (float k = 1; k >= 0; k -= step_size_bottom){
gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
- fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+ fl_xyline(x, y+j+h_flat-1, x+w);
j++;
}
}
@@ -68,16 +67,16 @@ static void shade_rect_top_bottom_down(int x, int y, int w, int h, Fl_Color bc,
static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, Fl_Color lc) {
gleam_color(fg1);
- fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
- fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
- fl_line(x+1, y, x+w-1, y); //Go across the top
- fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+ fl_yxline(x, y+h-1, y+1); //Go from bottom to top left side
+ fl_yxline(x+w, y+h-1, y+1); //Go from bottom to top right side
+ fl_xyline(x+1, y, x+w-1); //Go across the top
+ fl_xyline(x+1, y+h, x+w-1); //Go across the bottom
gleam_color(fg2);
- fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
- fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+ fl_yxline(x+1, y+h-2, y+2); //Go from bottom to top left side
+ fl_yxline(x+w-1, y+h-2, y+2); //Go from bottom to top right side
gleam_color(lc);
- fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
- fl_line(x+2, y+h-1, x+w-3, y+h-1); //Go across the bottom
+ fl_xyline(x+2, y+1, x+w-3); //Go across the top
+ fl_xyline(x+2, y+h-1, x+w-3); //Go across the bottom
}
static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, Fl_Color lc, float th1, float th2) {
@@ -132,6 +131,6 @@ Fl_Boxtype fl_define_FL_GLEAM_UP_BOX() {
//
-// End of "$Id: fl_gleam.cxx 10143 2014-05-02 09:13:29Z ianmacarthur $".
+// End of "$Id: fl_gleam.cxx 11914 2016-09-01 12:41:19Z AlbrechtS $".
//
diff --git a/src/fl_gtk.cxx b/src/fl_gtk.cxx
index ac7780d..dbe8117 100644
--- a/src/fl_gtk.cxx
+++ b/src/fl_gtk.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_gtk.cxx 10232 2014-08-21 12:13:47Z cand $"
+// "$Id: fl_gtk.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $"
//
// "GTK" drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -30,11 +30,9 @@ extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*);
static void gtk_color(Fl_Color c) {
- if (Fl::draw_box_active()) fl_color(c);
- else fl_color(fl_inactive(c));
+ Fl::set_box_color(c);
}
-
static void gtk_up_frame(int x, int y, int w, int h, Fl_Color c) {
gtk_color(fl_color_average(FL_WHITE, c, 0.5));
fl_xyline(x + 2, y + 1, x + w - 3);
@@ -204,7 +202,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) {
- fl_color(c);
+ gtk_color(c);
draw(FILL, x, y, w, h, 2);
gtk_color(fl_color_average(FL_BLACK, c, 0.025f));
@@ -235,7 +233,7 @@ static void gtk_round_up_box(int x, int y, int w, int h, Fl_Color c) {
}
static void gtk_round_down_box(int x, int y, int w, int h, Fl_Color c) {
- fl_color(c);
+ gtk_color(c);
draw(FILL, x, y, w, h, 2);
gtk_color(fl_color_average(FL_BLACK, c, 0.05f));
@@ -291,5 +289,5 @@ Fl_Boxtype fl_define_FL_GTK_UP_BOX() {
//
-// End of "$Id: fl_gtk.cxx 10232 2014-08-21 12:13:47Z cand $".
+// End of "$Id: fl_gtk.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $".
//
diff --git a/src/fl_line_style.cxx b/src/fl_line_style.cxx
index 3c1158e..41446e2 100644
--- a/src/fl_line_style.cxx
+++ b/src/fl_line_style.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_line_style.cxx 9293 2012-03-18 18:48:29Z manolo $"
+// "$Id: fl_line_style.cxx 10794 2015-07-17 16:16:09Z manolo $"
//
// Line style code for the Fast Light Tool Kit (FLTK).
//
@@ -35,8 +35,8 @@ int fl_line_width_ = 0;
#ifdef __APPLE_QUARTZ__
float fl_quartz_line_width_ = 1.0f;
-static enum CGLineCap fl_quartz_line_cap_ = kCGLineCapButt;
-static enum CGLineJoin fl_quartz_line_join_ = kCGLineJoinMiter;
+static /*enum*/ CGLineCap fl_quartz_line_cap_ = kCGLineCapButt;
+static /*enum*/ CGLineJoin fl_quartz_line_join_ = kCGLineJoinMiter;
static CGFloat *fl_quartz_line_pattern = 0;
static int fl_quartz_line_pattern_size = 0;
void fl_quartz_restore_line_style_() {
@@ -110,9 +110,9 @@ void Fl_Graphics_Driver::line_style(int style, int width, char* dashes) {
DeleteObject(fl_current_xmap->pen);
fl_current_xmap->pen = newpen;
#elif defined(__APPLE_QUARTZ__)
- static enum CGLineCap Cap[4] = { kCGLineCapButt, kCGLineCapButt,
+ static /*enum*/ CGLineCap Cap[4] = { kCGLineCapButt, kCGLineCapButt,
kCGLineCapRound, kCGLineCapSquare };
- static enum CGLineJoin Join[4] = { kCGLineJoinMiter, kCGLineJoinMiter,
+ static /*enum*/ CGLineJoin Join[4] = { kCGLineJoinMiter, kCGLineJoinMiter,
kCGLineJoinRound, kCGLineJoinBevel };
if (width<1) width = 1;
fl_quartz_line_width_ = (float)width;
@@ -161,5 +161,5 @@ void Fl_Graphics_Driver::line_style(int style, int width, char* dashes) {
//
-// End of "$Id: fl_line_style.cxx 9293 2012-03-18 18:48:29Z manolo $".
+// End of "$Id: fl_line_style.cxx 10794 2015-07-17 16:16:09Z manolo $".
//
diff --git a/src/fl_oval_box.cxx b/src/fl_oval_box.cxx
index cf62220..fdb50dd 100644
--- a/src/fl_oval_box.cxx
+++ b/src/fl_oval_box.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_oval_box.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_oval_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $"
//
// Oval box drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -24,12 +24,12 @@
#include <FL/fl_draw.H>
static void fl_oval_flat_box(int x, int y, int w, int h, Fl_Color c) {
- fl_color(c);
+ Fl::set_box_color(c);
fl_pie(x, y, w, h, 0, 360);
}
static void fl_oval_frame(int x, int y, int w, int h, Fl_Color c) {
- fl_color(c);
+ Fl::set_box_color(c);
fl_arc(x, y, w, h, 0, 360);
}
@@ -53,5 +53,5 @@ Fl_Boxtype fl_define_FL_OVAL_BOX() {
}
//
-// End of "$Id: fl_oval_box.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_oval_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $".
//
diff --git a/src/fl_read_image.cxx b/src/fl_read_image.cxx
index 9a12aa0..775f3f7 100644
--- a/src/fl_read_image.cxx
+++ b/src/fl_read_image.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_read_image.cxx 10388 2014-10-22 16:27:20Z manolo $"
+// "$Id: fl_read_image.cxx 10436 2014-11-06 16:48:57Z manolo $"
//
// X11 image reading routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2014 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -25,11 +25,151 @@
# include <stdio.h>
#endif // DEBUG
-#ifdef WIN32
-# include "fl_read_image_win32.cxx"
-#elif defined(__APPLE__)
+#if defined(__APPLE__)
# include "fl_read_image_mac.cxx"
#else
+# include <FL/Fl_RGB_Image.H>
+# include <FL/Fl_Window.H>
+# include <FL/Fl_Plugin.H>
+# include <FL/Fl_Device.H>
+
+static uchar *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha);
+
+
+static void write_image_inside(Fl_RGB_Image *to, Fl_RGB_Image *from, int to_x, int to_y)
+/* Copy the image "from" inside image "to" with its top-left angle at coordinates to_x, to_y.
+ Also, exchange top and bottom of "from". Image depth can differ between "to" and "from".
+ */
+{
+ int to_ld = (to->ld() == 0? to->w() * to->d() : to->ld());
+ int from_ld = (from->ld() == 0? from->w() * from->d() : from->ld());
+ uchar *tobytes = (uchar*)to->array + to_y * to_ld + to_x * to->d();
+ const uchar *frombytes = from->array + (from->h() - 1) * from_ld;
+ for (int i = from->h() - 1; i >= 0; i--) {
+ if (from->d() == to->d()) memcpy(tobytes, frombytes, from->w() * from->d());
+ else {
+ for (int j = 0; j < from->w(); j++) {
+ memcpy(tobytes + j * to->d(), frombytes + j * from->d(), from->d());
+ }
+ }
+ tobytes += to_ld;
+ frombytes -= from_ld;
+ }
+}
+
+/* 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
+ p: as in fl_read_image()
+ x,y,w,h: a rectangle in window g's coordinates
+ alpha: as in fl_read_image()
+ full_img: NULL
+
+ Arguments when this function recursively calls itself:
+ g: an Fl_Group
+ p: as above
+ 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
+ alpha: as above
+ 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* of depth 4 if alpha>0 or 3 if alpha = 0 containing the captured pixels.
+ */
+static Fl_RGB_Image *traverse_to_gl_subwindows(Fl_Group *g, uchar *p, int x, int y, int w, int h, int alpha,
+ Fl_RGB_Image *full_img)
+{
+ if ( g->as_gl_window() ) {
+ Fl_Plugin_Manager pm("fltk:device");
+ Fl_Device_Plugin *pi = (Fl_Device_Plugin*)pm.plugin("opengl.device.fltk.org");
+ if (!pi) return full_img;
+ Fl_RGB_Image *img = pi->rectangle_capture(g, x, y, w, h); // bottom to top image
+ if (full_img) full_img = img; // top and bottom will be exchanged later
+ else { // exchange top and bottom to get a proper FLTK image
+ uchar *data = ( p ? p : new uchar[img->w() * img->h() * (alpha?4:3)] );
+ full_img = new Fl_RGB_Image(data, img->w(), img->h(), alpha?4:3);
+ if (!p) full_img->alloc_array = 1;
+ if (alpha) memset(data, alpha, img->w() * img->h() * 4);
+ write_image_inside(full_img, img, 0, 0);
+ delete img;
+ }
+ }
+ else if ( g->as_window() && (!full_img || (g->window() && g->window()->as_gl_window())) ) {
+ // the starting window or one inside a GL window
+ if (full_img) g->as_window()->make_current();
+ uchar *image_data;
+ int alloc_img = (full_img != NULL || p == NULL); // false means use p, don't alloc new memory for image
+#ifdef __APPLE_CC__
+ // on Darwin + X11, read_win_rectangle() sometimes returns NULL when there are subwindows
+ do image_data = read_win_rectangle( (alloc_img ? NULL : p), x, y, w, h, alpha); while (!image_data);
+#else
+ image_data = read_win_rectangle( (alloc_img ? NULL : p), x, y, w, h, alpha);
+#endif
+ full_img = new Fl_RGB_Image(image_data, w, h, alpha?4:3);
+ if (alloc_img) full_img->alloc_array = 1;
+ }
+ int n = g->children();
+ for (int i = 0; i < n; i++) {
+ Fl_Widget *c = g->child(i);
+ if ( !c->visible() || !c->as_group()) continue;
+ if ( c->as_window() ) {
+ int origin_x = x; // compute intersection of x,y,w,h and the c window
+ if (x < c->x()) origin_x = c->x();
+ int origin_y = y;
+ if (y < c->y()) origin_y = c->y();
+ int width = c->w();
+ if (origin_x + width > c->x() + c->w()) width = c->x() + c->w() - origin_x;
+ if (origin_x + width > x + w) width = x + w - origin_x;
+ int height = c->w();
+ if (origin_y + height > c->y() + c->h()) height = c->y() + c->h() - origin_y;
+ if (origin_y + height > y + h) height = y + h - origin_y;
+ if (width > 0 && height > 0) {
+ Fl_RGB_Image *img = traverse_to_gl_subwindows(c->as_window(), p, origin_x - c->x(),
+ origin_y - c->y(), width, height, alpha, full_img);
+ if (img == full_img) continue;
+ int top;
+ if (c->as_gl_window()) {
+ top = origin_y - y;
+ } else {
+ top = full_img->h() - (origin_y - y + img->h());
+ }
+ write_image_inside(full_img, img, origin_x - x, top);
+ delete img;
+ }
+ }
+ else traverse_to_gl_subwindows(c->as_group(), p, x, y, w, h, alpha, full_img);
+ }
+ return full_img;
+}
+
+//
+// 'fl_read_image()' - Read an image from the current window or off-screen buffer
+// this is the version for X11 and WIN32. The mac version is in fl_read_image_mac.cxx
+
+uchar * // O - Pixel buffer or NULL if failed
+fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate
+ int X, // I - Left position
+ int Y, // I - Top position
+ int w, // I - Width of area to read
+ // negative allows capture of window title bar and frame (X11 only)
+ int h, // I - Height of area to read
+ int alpha)// I - Alpha value for image (0 for none)
+{
+ if (w < 0 || fl_find(fl_window) == 0) { // read from off_screen buffer or title bar and frame
+ return read_win_rectangle(p, X, Y, w, h, alpha); // this function has an X11 and a WIN32 version
+ }
+ Fl_RGB_Image *img = traverse_to_gl_subwindows(Fl_Window::current(), p, X, Y, w, h, alpha, NULL);
+ uchar *image_data = (uchar*)img->array;
+ img->alloc_array = 0;
+ delete img;
+ return image_data;
+}
+
+#ifdef WIN32
+# include "fl_read_image_win32.cxx" // gives the WIN32 version of read_win_rectangle()
+#else
# include <X11/Xutil.h>
# ifdef __sgi
# include <X11/extensions/readdisplay.h>
@@ -76,18 +216,9 @@ extern "C" {
}
}
-//
-// 'fl_read_image()' - Read an image from the current window.
-//
-uchar * // O - Pixel buffer or NULL if failed
-fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate
- int X, // I - Left position
- int Y, // I - Top position
- int w, // I - Width of area to read
- // negative allows capture of window title bar and frame
- int h, // I - Height of area to read
- int alpha) { // I - Alpha value for image (0 for none)
+static uchar *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha)
+{
XImage *image; // Captured image
int i, maxindex; // Looping vars
int x, y; // Current X & Y in image
@@ -495,8 +626,10 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate
return p;
}
-#endif
+#endif // !WIN32
+
+#endif // !__APPLE__
//
-// End of "$Id: fl_read_image.cxx 10388 2014-10-22 16:27:20Z manolo $".
+// End of "$Id: fl_read_image.cxx 10436 2014-11-06 16:48:57Z manolo $".
//
diff --git a/src/fl_read_image_mac.cxx b/src/fl_read_image_mac.cxx
index d9a20df..c787470 100644
--- a/src/fl_read_image_mac.cxx
+++ b/src/fl_read_image_mac.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_read_image_mac.cxx 10078 2014-01-22 20:39:21Z manolo $"
+// "$Id: fl_read_image_mac.cxx 10468 2014-11-25 09:03:30Z manolo $"
//
// WIN32 image reading routines for the Fast Light Tool Kit (FLTK).
//
@@ -42,9 +42,7 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate
if( (sw - x < w) || (sh - y < h) ) return NULL;
}
else { // reading from current window
- Fl_Window *window = Fl_Window::current();
- while(window->window()) window = window->window();
- base = Fl_X::bitmap_from_window_rect(window,x,y,w,h,&delta);
+ base = Fl_X::bitmap_from_window_rect(Fl_Window::current(),x,y,w,h,&delta);
if (!base) return NULL;
rowBytes = delta*w;
x = y = 0;
@@ -70,5 +68,5 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate
//
-// End of "$Id: fl_read_image_mac.cxx 10078 2014-01-22 20:39:21Z manolo $".
+// End of "$Id: fl_read_image_mac.cxx 10468 2014-11-25 09:03:30Z manolo $".
//
diff --git a/src/fl_read_image_win32.cxx b/src/fl_read_image_win32.cxx
index 3d0ecd5..491fa17 100644
--- a/src/fl_read_image_win32.cxx
+++ b/src/fl_read_image_win32.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_read_image_win32.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_read_image_win32.cxx 10436 2014-11-06 16:48:57Z manolo $"
//
// WIN32 image reading routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2014 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -16,12 +16,8 @@
// http://www.fltk.org/str.php
//
-//
-// 'fl_read_image()' - Read an image from the current window.
-//
-
-uchar * // O - Pixel buffer or NULL if failed
-fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate
+static uchar * // O - Pixel buffer or NULL if failed
+read_win_rectangle(uchar *p, // I - Pixel buffer or NULL to allocate
int X, // I - Left position
int Y, // I - Top position
int w, // I - Width of area to read
@@ -120,5 +116,5 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate
}
//
-// End of "$Id: fl_read_image_win32.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_read_image_win32.cxx 10436 2014-11-06 16:48:57Z manolo $".
//
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx
index d96b35f..f1ff1c4 100644
--- a/src/fl_rect.cxx
+++ b/src/fl_rect.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_rect.cxx 10401 2014-10-28 13:44:09Z manolo $"
+// "$Id: fl_rect.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $"
//
// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -40,7 +40,7 @@ extern int fl_line_width_;
#ifdef __APPLE_QUARTZ__
extern float fl_quartz_line_width_;
-#define USINGQUARTZPRINTER (Fl_Surface_Device::surface() != Fl_Display_Device::display_device())
+#define USINGQUARTZPRINTER (Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id)
#endif
#ifdef USE_X11
@@ -205,6 +205,14 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1) {
CGContextMoveToPoint(fl_gc, x, y);
CGContextAddLineToPoint(fl_gc, x1, y);
CGContextStrokePath(fl_gc);
+ if (Fl_Display_Device::high_resolution()) {
+ /* On retina displays, all xyline() and yxline() functions produce lines that are half-unit
+ (or one pixel) too short at both ends. This is corrected by filling at both ends rectangles
+ of size one unit by line-width.
+ */
+ CGContextFillRect(fl_gc, CGRectMake(x-0.5 , y - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
+ CGContextFillRect(fl_gc, CGRectMake(x1-0.5 , y - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
+ }
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
#else
# error unsupported platform
@@ -229,6 +237,10 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1, int y2) {
CGContextAddLineToPoint(fl_gc, x1, y);
CGContextAddLineToPoint(fl_gc, x1, y2);
CGContextStrokePath(fl_gc);
+ if (Fl_Display_Device::high_resolution()) {
+ CGContextFillRect(fl_gc, CGRectMake(x-0.5, y - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
+ CGContextFillRect(fl_gc, CGRectMake(x1 - fl_quartz_line_width_/2, y2-0.5, fl_quartz_line_width_, 1));
+ }
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
#else
#error unsupported platform
@@ -256,6 +268,10 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1, int y2, int x3) {
CGContextAddLineToPoint(fl_gc, x1, y2);
CGContextAddLineToPoint(fl_gc, x3, y2);
CGContextStrokePath(fl_gc);
+ if (Fl_Display_Device::high_resolution()) {
+ CGContextFillRect(fl_gc, CGRectMake(x-0.5, y - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
+ CGContextFillRect(fl_gc, CGRectMake(x3-0.5, y2 - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
+ }
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
#else
# error unsupported platform
@@ -274,6 +290,10 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1) {
CGContextMoveToPoint(fl_gc, x, y);
CGContextAddLineToPoint(fl_gc, x, y1);
CGContextStrokePath(fl_gc);
+ if (Fl_Display_Device::high_resolution()) {
+ CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, y-0.5, fl_quartz_line_width_, 1));
+ CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, y1-0.5, fl_quartz_line_width_, 1));
+ }
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
#else
# error unsupported platform
@@ -298,6 +318,10 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1, int x2) {
CGContextAddLineToPoint(fl_gc, x, y1);
CGContextAddLineToPoint(fl_gc, x2, y1);
CGContextStrokePath(fl_gc);
+ if (Fl_Display_Device::high_resolution()) {
+ CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, y-0.5, fl_quartz_line_width_, 1));
+ CGContextFillRect(fl_gc, CGRectMake(x2-0.5, y1 - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
+ }
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
#else
# error unsupported platform
@@ -325,6 +349,10 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1, int x2, int y3) {
CGContextAddLineToPoint(fl_gc, x2, y1);
CGContextAddLineToPoint(fl_gc, x2, y3);
CGContextStrokePath(fl_gc);
+ if (Fl_Display_Device::high_resolution()) {
+ CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, y-0.5, fl_quartz_line_width_, 1));
+ CGContextFillRect(fl_gc, CGRectMake(x2 - fl_quartz_line_width_/2, y3-0.5, fl_quartz_line_width_, 1));
+ }
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
#else
# error unsupported platform
@@ -513,6 +541,7 @@ Fl_Region XRectangleRegion(int x, int y, int w, int h) {
void Fl_Graphics_Driver::restore_clip() {
fl_clip_state_number++;
+ if (!fl_gc) return;
Fl_Region r = rstack[rstackptr];
#if defined(USE_X11)
if (r) XSetRegion(fl_display, fl_gc, r);
@@ -520,19 +549,13 @@ void Fl_Graphics_Driver::restore_clip() {
#elif defined(WIN32)
SelectClipRgn(fl_gc, r); //if r is NULL, clip is automatically cleared
#elif defined(__APPLE_QUARTZ__)
- if ( fl_window ) { // clipping for a true window
+ if ( fl_window || fl_gc ) { // clipping for a true window or an offscreen buffer
Fl_X::q_clear_clipping();
Fl_X::q_fill_context();//flip coords if bitmap context
//apply program clip
if (r) {
CGContextClipToRects(fl_gc, r->rects, r->count);
}
- } else if (fl_gc) { // clipping for an offscreen drawing world (CGBitmap)
- Fl_X::q_clear_clipping();
- Fl_X::q_fill_context();
- if (r) {
- CGContextClipToRects(fl_gc, r->rects, r->count);
- }
}
#else
# error unsupported platform
@@ -696,10 +719,10 @@ int Fl_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, int
else u = CGRectUnion(u, test);
}
}
- X = int(u.origin.x);
- Y = int(u.origin.y);
- W = int(u.size.width + 1);
- H = int(u.size.height + 1);
+ X = int(u.origin.x + 0.5); // reverse offset introduced by fl_cgrectmake_cocoa()
+ Y = int(u.origin.y + 0.5);
+ W = int(u.size.width + 0.5); // round to nearest integer
+ H = int(u.size.height + 0.5);
if(CGRectIsEmpty(u)) W = H = 0;
return ! CGRectEqualToRect(arg, u);
#else
@@ -708,5 +731,5 @@ int Fl_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, int
}
//
-// End of "$Id: fl_rect.cxx 10401 2014-10-28 13:44:09Z manolo $".
+// End of "$Id: fl_rect.cxx 11243 2016-02-27 15:14:42Z AlbrechtS $".
//
diff --git a/src/fl_round_box.cxx b/src/fl_round_box.cxx
index eb0b31a..0322239 100644
--- a/src/fl_round_box.cxx
+++ b/src/fl_round_box.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_round_box.cxx 10307 2014-09-13 17:04:20Z manolo $"
+// "$Id: fl_round_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $"
//
// Round box drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -75,7 +75,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, 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']);
@@ -89,7 +89,7 @@ void fl_round_down_box(int x, int y, int w, int h, Fl_Color bgcolor) {
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, 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']);
@@ -109,5 +109,5 @@ Fl_Boxtype fl_define_FL_ROUND_UP_BOX() {
}
//
-// End of "$Id: fl_round_box.cxx 10307 2014-09-13 17:04:20Z manolo $".
+// End of "$Id: fl_round_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $".
//
diff --git a/src/fl_rounded_box.cxx b/src/fl_rounded_box.cxx
index a3cf8fd..34fc0d5 100644
--- a/src/fl_rounded_box.cxx
+++ b/src/fl_rounded_box.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_rounded_box.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_rounded_box.cxx 11814 2016-07-15 22:10:23Z AlbrechtS $"
//
// Rounded box drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -19,42 +19,56 @@
#include <FL/Fl.H>
#include <FL/fl_draw.H>
+// Constants for rounded corner drawing algorithm:
+//
+// RN = number of segments per corner (must match offset array size)
+// RS = max. corner radius
+// BW = box shadow width
+
#define RN 5
#define RS 15
#define BW 3
static double offset[RN] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0};
+static inline void fl_vertex_r(double x, double y) {
+ fl_vertex(x + 0.5, y + 0.5);
+}
+
static void rbox(int fill, int x, int y, int w, int h) {
int i;
- int rsx ,rsy, rs;
- rsx = w*2/5; rsy = h*2/5;
- if (rsx > rsy) rs = rsy; else rs = rsx;
+ int rs, rsy;
+ rs = w*2/5; rsy = h*2/5;
+ if (rs > rsy) rs = rsy; // use smaller radius
if (rs > RS) rs = RS;
- rsx = rs; rsy = 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 (fill) fl_begin_polygon(); else fl_begin_loop();
for (i=0; i<RN; i++)
- fl_vertex(x + offset[RN-i-1]*rsx, y + offset[i] * rsy);
+ fl_vertex_r(x + offset[RN-i-1]*rs, y + offset[i] * rs);
for (i=0; i<RN; i++)
- fl_vertex(x + offset[i]*rsx, y + h-1 - offset[RN-i-1] * rsy);
+ fl_vertex_r(x + offset[i]*rs, y + h-1 - offset[RN-i-1] * rs);
for (i=0; i<RN; i++)
- fl_vertex(x + w-1 - offset[RN-i-1]*rsx, y + h-1 - offset[i] * rsy);
+ fl_vertex_r(x + w-1 - offset[RN-i-1]*rs, y + h-1 - offset[i] * rs);
for (i=0; i<RN; i++)
- fl_vertex(x + w-1 - offset[i]*rsx, y + offset[RN-i-1] * rsy);
+ fl_vertex_r(x + w-1 - offset[i]*rs, y + offset[RN-i-1] * rs);
if (fill) fl_end_polygon(); else fl_end_loop();
}
static void fl_rflat_box(int x, int y, int w, int h, Fl_Color c) {
- fl_color(c); rbox(1, x, y, w, h); rbox(0, x, y, w, h);
+ Fl::set_box_color(c);
+ rbox(1, x, y, w, h); rbox(0, x, y, w, h);
}
static void fl_rounded_frame(int x, int y, int w, int h, Fl_Color c) {
- fl_color(c); rbox(0, x, y, w, h);
+ Fl::set_box_color(c);
+ rbox(0, x, y, w, h);
}
static void fl_rounded_box(int x, int y, int w, int h, Fl_Color c) {
- fl_color(c); rbox(1, x, y, w, h);
+ Fl::set_box_color(c);
+ rbox(1, x, y, w, h);
fl_color(FL_BLACK); rbox(0, x, y, w, h);
}
@@ -86,5 +100,5 @@ Fl_Boxtype fl_define_FL_RSHADOW_BOX() {
}
//
-// End of "$Id: fl_rounded_box.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_rounded_box.cxx 11814 2016-07-15 22:10:23Z AlbrechtS $".
//
diff --git a/src/fl_scroll_area.cxx b/src/fl_scroll_area.cxx
index a694da2..998c903 100644
--- a/src/fl_scroll_area.cxx
+++ b/src/fl_scroll_area.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_scroll_area.cxx 10078 2014-01-22 20:39:21Z manolo $"
+// "$Id: fl_scroll_area.cxx 10560 2015-02-08 06:48:19Z manolo $"
//
// Scrolling routines for the Fast Light Tool Kit (FLTK).
//
@@ -144,7 +144,7 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
#elif defined(__APPLE_QUARTZ__)
CGImageRef img = Fl_X::CGImage_from_window_rect(Fl_Window::current(), src_x, src_y, src_w, src_h);
if (img) {
- CGRect rect = { { dest_x, dest_y }, { src_w, src_h } };
+ CGRect rect = CGRectMake(dest_x, dest_y, src_w, src_h);
Fl_X::q_begin_image(rect, 0, 0, src_w, src_h);
CGContextDrawImage(fl_gc, rect, img);
Fl_X::q_end_image();
@@ -158,5 +158,5 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
}
//
-// End of "$Id: fl_scroll_area.cxx 10078 2014-01-22 20:39:21Z manolo $".
+// End of "$Id: fl_scroll_area.cxx 10560 2015-02-08 06:48:19Z manolo $".
//
diff --git a/src/fl_set_font.cxx b/src/fl_set_font.cxx
index 5482728..25fdae8 100644
--- a/src/fl_set_font.cxx
+++ b/src/fl_set_font.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_set_font.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_set_font.cxx 10726 2015-04-28 22:02:48Z manolo $"
//
// Font utilities for the Fast Light Tool Kit (FLTK).
//
@@ -32,6 +32,9 @@ static int table_size;
the string is not copied, so the string must be in static memory.
*/
void Fl::set_font(Fl_Font fnum, const char* name) {
+#ifdef __APPLE__
+ if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts();
+#endif
while (fnum >= table_size) {
int i = table_size;
if (!i) { // don't realloc the built-in table
@@ -70,7 +73,7 @@ void Fl::set_font(Fl_Font fnum, const char* name) {
s->xlist = 0;
#endif
s->first = 0;
- fl_font(-1, 0);
+ Fl_Display_Device::display_device()->driver()->font(-1, 0);
}
/** Copies one face to another. */
void Fl::set_font(Fl_Font fnum, Fl_Font from) {
@@ -81,8 +84,13 @@ void Fl::set_font(Fl_Font fnum, Fl_Font from) {
face. Under X this value is passed to XListFonts to get all the sizes
of this face.
*/
-const char* Fl::get_font(Fl_Font fnum) {return fl_fonts[fnum].name;}
+const char* Fl::get_font(Fl_Font fnum) {
+#ifdef __APPLE__
+ if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts();
+#endif
+ return fl_fonts[fnum].name;
+}
//
-// End of "$Id: fl_set_font.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_set_font.cxx 10726 2015-04-28 22:02:48Z manolo $".
//
diff --git a/src/fl_set_fonts_mac.cxx b/src/fl_set_fonts_mac.cxx
index 81f4207..900524e 100644
--- a/src/fl_set_fonts_mac.cxx
+++ b/src/fl_set_fonts_mac.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_set_fonts_mac.cxx 10014 2013-10-30 13:36:16Z manolo $"
+// "$Id: fl_set_fonts_mac.cxx 11943 2016-09-13 11:51:24Z manolo $"
//
// MacOS font utilities for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -29,6 +29,7 @@
// turn a stored font name into a pretty name:
const char* Fl::get_font_name(Fl_Font fnum, int* ap) {
+ if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts();
Fl_Fontdesc *f = fl_fonts + fnum;
if (!f->fontname[0]) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
@@ -136,7 +137,7 @@ if(fl_mac_os_version >= Fl_X::CoreText_threshold) {
}
else {
#endif
-#if ! __LP64__
+#if (!defined(__LP64__) || !__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
ItemCount oFontCount, oCountAgain;
ATSUFontID *oFontIDs;
// How many fonts?
@@ -180,6 +181,7 @@ else {
static int array[128];
int Fl::get_font_sizes(Fl_Font fnum, int*& sizep) {
+ if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts();
Fl_Fontdesc *s = fl_fonts+fnum;
if (!s->name) s = fl_fonts; // empty slot in table, use entry 0
int cnt = 0;
@@ -193,5 +195,5 @@ int Fl::get_font_sizes(Fl_Font fnum, int*& sizep) {
}
//
-// End of "$Id: fl_set_fonts_mac.cxx 10014 2013-10-30 13:36:16Z manolo $".
+// End of "$Id: fl_set_fonts_mac.cxx 11943 2016-09-13 11:51:24Z manolo $".
//
diff --git a/src/fl_shadow_box.cxx b/src/fl_shadow_box.cxx
index 9301d4c..a8fdfaa 100644
--- a/src/fl_shadow_box.cxx
+++ b/src/fl_shadow_box.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_shadow_box.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: fl_shadow_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $"
//
// Shadow box drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -25,12 +25,12 @@ static void fl_shadow_frame(int x, int y, int w, int h, Fl_Color c) {
fl_color(FL_DARK3);
fl_rectf(x+BW, y+h-BW, w - BW, BW);
fl_rectf(x+w-BW, y+BW, BW, h - BW);
- fl_color(c);
+ Fl::set_box_color(c);
fl_rect(x,y,w-BW,h-BW);
}
static void fl_shadow_box(int x, int y, int w, int h, Fl_Color c) {
- fl_color(c);
+ Fl::set_box_color(c);
fl_rectf(x+1,y+1,w-2-BW,h-2-BW);
fl_shadow_frame(x,y,w,h,FL_GRAY0);
}
@@ -43,5 +43,5 @@ Fl_Boxtype fl_define_FL_SHADOW_BOX() {
}
//
-// End of "$Id: fl_shadow_box.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: fl_shadow_box.cxx 10781 2015-07-09 00:10:44Z AlbrechtS $".
//
diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx
index 28e59a9..ab828de 100644
--- a/src/fl_shortcut.cxx
+++ b/src/fl_shortcut.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: fl_shortcut.cxx 10250 2014-08-23 09:10:50Z cand $"
+// "$Id: fl_shortcut.cxx 11321 2016-03-08 16:58:43Z AlbrechtS $"
//
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -36,6 +36,7 @@
#include <FL/Fl_Widget.H>
#include <FL/Fl_Button.H>
#include <FL/fl_draw.H>
+#include <stdlib.h>
#include <ctype.h>
#include "flstring.h"
#if !defined(WIN32) && !defined(__APPLE__)
@@ -119,8 +120,8 @@ static Keyname table[] = {
};
#elif defined(__APPLE__)
static Keyname table[] = {
- // v - this column contains UTF-8 characters
- {' ', "Space"},
+ // v - this column may contain UTF-8 characters
+ {' ', "Space"},
{FL_BackSpace,"\xe2\x8c\xab"}, // erase to the left
{FL_Tab, "\xe2\x87\xa5"}, // rightwards arrow to bar
{0xff0b, "\xe2\x8c\xa6"}, // erase to the right
@@ -163,6 +164,35 @@ static Keyname table[] = {
zero then an empty string is returned. The return value points at
a static buffer that is overwritten with each call.
+ \since FLTK 1.3.4 modifier key names can be localized, but key names
+ can not yet be localized. This may be added to a future FLTK version.
+
+ Modifier key names (human-readable shortcut names) can be defined
+ with the following global const char * pointer variables:
+
+ - fl_local_ctrl => name of FL_CTRL
+ - fl_local_alt => name of FL_ALT
+ - fl_local_shift => name of FL_SHIFT
+ - fl_local_meta => name of FL_META
+
+ \code
+ fl_local_ctrl = "Strg"; // German for "Ctrl"
+ fl_local_shift = "Umschalt"; // German for "Shift"
+ \endcode
+
+ The shortcut name will be constructed by adding all modifier names in the
+ order defined above plus the name of the key. A '+' character is added to
+ each modifier name unless it has a trailing '\' or a trailing '+'.
+
+ Example:
+
+ Ctrl+Alt+Shift+Meta+F12
+
+ The default values for modifier key names are as given above for all
+ platforms except Mac OS X. Mac OS X uses graphical characters that represent
+ the typical OS X modifier names in menus, e.g. cloverleaf, saucepan, etc.
+ You may, however, redefine Mac OS X modifier names as well.
+
\param [in] shortcut the integer value containing the ascii character or extended keystroke plus modifiers
\return a pointer to a static buffer containing human readable text for the shortcut
*/
@@ -170,38 +200,74 @@ const char* fl_shortcut_label(unsigned int shortcut) {
return fl_shortcut_label(shortcut, 0L);
}
+/*
+ This static function adds a modifier key name to a character
+ buffer and returns the pointer behind the modifier name and a
+ trailing '+' character.
+
+ Exceptions:
+ (1) Last character = '\' : remove it, done (don't add '+')
+ (2) Last character = '+' : user added '+', don't add another one
+
+ In case of buffer overflow the modifier key name is replaced with "..."
+ if that fits or not added at all. This should rarely (never) happen.
+*/
+
+static char *add_modifier_key(char *p, const char *end, const char *name) {
+ int ln = strlen(name);
+ if (p+ln > end) { // string too long
+ if (p+4 <= end) { // can replace with "..." ?
+ strcpy(p,"...");
+ p += 3;
+ } else
+ return p;
+ } else {
+ strcpy(p,name);
+ p += ln;
+ }
+ if (p[-1] == '\\') // remove (last) '\' character
+ p--;
+ else if (p[-1] == '+') // don't add another '+' character
+ {/*empty*/}
+ else // not a '\' or '+'
+ *p++ = '+'; // add a '+' character
+ return p;
+}
+
/**
Get a human-readable string from a shortcut value.
\param [in] shortcut the integer value containing the ascii character or extended keystroke plus modifiers
\param [in] eom if this pointer is set, it will receive a pointer to the end of the modifier text
\return a pointer to a static buffer containing human readable text for the shortcut
+
\see fl_shortcut_label(unsigned int shortcut)
- */
+*/
+
const char* fl_shortcut_label(unsigned int shortcut, const char **eom) {
- static char buf[40];
+ static char buf[80];
char *p = buf;
+ char *end = &buf[sizeof(buf)-20]; // account for key name (max. ~10 + x)
if (eom) *eom = p;
if (!shortcut) {*p = 0; return buf;}
// fix upper case shortcuts
- unsigned int v = shortcut & FL_KEY_MASK;
- if (((unsigned)fl_tolower(v))!=v) {
+ unsigned int key = shortcut & FL_KEY_MASK;
+ if (((unsigned)fl_tolower(key)) != key) {
shortcut |= FL_SHIFT;
}
-#ifdef __APPLE__
- // this column contains utf8 characters - v
- if (shortcut & FL_SHIFT) {strcpy(p,"\xe2\x87\xa7"); p += 3;} // U+21E7 (upwards white arrow)
- if (shortcut & FL_CTRL) {strcpy(p,"\xe2\x8c\x83"); p += 3;} // U+2303 (up arrowhead)
- if (shortcut & FL_ALT) {strcpy(p,"\xe2\x8c\xa5"); p += 3;} // U+2325 (option key)
- if (shortcut & FL_META) {strcpy(p,"\xe2\x8c\x98"); p += 3;} // U+2318 (place of interest sign)
-#else
- if (shortcut & FL_META) {strcpy(p,"Meta+"); p += 5;}
- if (shortcut & FL_ALT) {strcpy(p,"Alt+"); p += 4;}
- if (shortcut & FL_SHIFT) {strcpy(p,"Shift+"); p += 6;}
- if (shortcut & FL_CTRL) {strcpy(p,"Ctrl+"); p += 5;}
-#endif // __APPLE__
+
+ // Add modifier key names.
+ // Note: if necessary we could change the order here depending on the platform.
+ // However, as discussed in fltk.development, the order appears to be the
+ // same on all platforms, with exceptions in _some_ Linux applications.
+
+ if (shortcut & FL_CTRL) {p = add_modifier_key(p, end, fl_local_ctrl);}
+ if (shortcut & FL_ALT) {p = add_modifier_key(p, end, fl_local_alt);}
+ if (shortcut & FL_SHIFT) {p = add_modifier_key(p, end, fl_local_shift);}
+ if (shortcut & FL_META) {p = add_modifier_key(p, end, fl_local_meta);}
if (eom) *eom = p;
- unsigned int key = shortcut & FL_KEY_MASK;
+
+ // add key name
#if defined(WIN32) || defined(__APPLE__) // if not X
if (key >= FL_F && key <= FL_F_Last) {
*p++ = 'F';
@@ -258,7 +324,6 @@ const char* fl_shortcut_label(unsigned int shortcut, const char **eom) {
}
// Emulation of XForms named shortcuts
-#include <stdlib.h>
/**
Emulation of XForms named shortcuts.
@@ -432,5 +497,5 @@ int Fl_Widget::test_shortcut() {
}
//
-// End of "$Id: fl_shortcut.cxx 10250 2014-08-23 09:10:50Z cand $".
+// End of "$Id: fl_shortcut.cxx 11321 2016-03-08 16:58:43Z AlbrechtS $".
//
diff --git a/src/fl_utf.c b/src/fl_utf.c
index 55eabde..3908a13 100644
--- a/src/fl_utf.c
+++ b/src/fl_utf.c
@@ -1,9 +1,9 @@
/*
- * "$Id: fl_utf.c 8864 2011-07-19 04:49:30Z greg.ercolano $"
+ * "$Id: fl_utf.c 11404 2016-03-23 13:36:50Z AlbrechtS $"
*
* This is the utf.c file from fltk2 adapted for use in my fltk1.1 port
*/
-/* Copyright 2006-2011 by Bill Spitzak and others.
+/* Copyright 2006-2015 by Bill Spitzak and others.
*
* This library is free software. Distribution and use rights are outlined in
* the file "COPYING" which should have been included with this file. If this
@@ -59,7 +59,7 @@
/** @} */
#endif /* 0 */
-/*!Set to 1 to turn bad UTF8 bytes into ISO-8859-1. If this is to zero
+/*!Set to 1 to turn bad UTF-8 bytes into ISO-8859-1. If this is zero
they are instead turned into the Unicode REPLACEMENT CHARACTER, of
value 0xfffd.
If this is on fl_utf8decode() will correctly map most (perhaps all)
@@ -67,15 +67,19 @@
to completely ignore character sets in your code because virtually
everything is either ISO-8859-1 or UTF-8.
*/
-#define ERRORS_TO_ISO8859_1 1
+#ifndef ERRORS_TO_ISO8859_1
+# define ERRORS_TO_ISO8859_1 1
+#endif
-/*!Set to 1 to turn bad UTF8 bytes in the 0x80-0x9f range into the
+/*!Set to 1 to turn bad UTF-8 bytes in the 0x80-0x9f range into the
Unicode index for Microsoft's CP1252 character set. You should
also set ERRORS_TO_ISO8859_1. With this a huge amount of more
available text (such as all web pages) are correctly converted
to Unicode.
*/
-#define ERRORS_TO_CP1252 1
+#ifndef ERRORS_TO_CP1252
+# define ERRORS_TO_CP1252 1
+#endif
/*!A number of Unicode code points are in fact illegal and should not
be produced by a UTF-8 converter. Turn this on will replace the
@@ -83,7 +87,9 @@
arbitrary 16-bit data to UTF-8 and then back is not an identity,
which will probably break a lot of software.
*/
-#define STRICT_RFC3629 0
+#ifndef STRICT_RFC3629
+# define STRICT_RFC3629 0
+#endif
#if ERRORS_TO_CP1252
/* Codes 0x80..0x9f from the Microsoft CP1252 character set, translated
@@ -103,7 +109,7 @@ static unsigned short cp1252[32] = {
(adding \e len to \e p will point at the next character).
If \p p points at an illegal UTF-8 encoding, including one that
- would go past \e end, or where a code is uses more bytes than
+ would go past \e end, or where a code uses more bytes than
necessary, then *(unsigned char*)p is translated as though it is
in the Microsoft CP1252 character set and \e len is set to 1.
Treating errors this way allows this to decode almost any
@@ -118,7 +124,7 @@ static unsigned short cp1252[32] = {
if (*p & 0x80) { // what should be a multibyte encoding
code = fl_utf8decode(p,end,&len);
if (len<2) code = 0xFFFD; // Turn errors into REPLACEMENT CHARACTER
- } else { // handle the 1-byte utf8 encoding:
+ } else { // handle the 1-byte UTF-8 encoding:
code = *p;
len = 1;
}
@@ -130,7 +136,7 @@ static unsigned short cp1252[32] = {
*/
unsigned fl_utf8decode(const char* p, const char* end, int* len)
{
- unsigned char c = *(unsigned char*)p;
+ unsigned char c = *(const unsigned char*)p;
if (c < 0x80) {
if (len) *len = 1;
return c;
@@ -149,17 +155,17 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
((p[0] & 0x1f) << 6) +
((p[1] & 0x3f));
} else if (c == 0xe0) {
- if (((unsigned char*)p)[1] < 0xa0) goto FAIL;
+ if (((const unsigned char*)p)[1] < 0xa0) goto FAIL;
goto UTF8_3;
#if STRICT_RFC3629
} else if (c == 0xed) {
/* RFC 3629 says surrogate chars are illegal. */
- if (((unsigned char*)p)[1] >= 0xa0) goto FAIL;
+ if (((const unsigned char*)p)[1] >= 0xa0) goto FAIL;
goto UTF8_3;
} else if (c == 0xef) {
/* 0xfffe and 0xffff are also illegal characters */
- if (((unsigned char*)p)[1]==0xbf &&
- ((unsigned char*)p)[2]>=0xbe) goto FAIL;
+ if (((const unsigned char*)p)[1]==0xbf &&
+ ((const unsigned char*)p)[2]>=0xbe) goto FAIL;
goto UTF8_3;
#endif
} else if (c < 0xf0) {
@@ -171,7 +177,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
((p[1] & 0x3f) << 6) +
((p[2] & 0x3f));
} else if (c == 0xf0) {
- if (((unsigned char*)p)[1] < 0x90) goto FAIL;
+ if (((const unsigned char*)p)[1] < 0x90) goto FAIL;
goto UTF8_4;
} else if (c < 0xf4) {
UTF8_4:
@@ -180,8 +186,8 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
#if STRICT_RFC3629
/* RFC 3629 says all codes ending in fffe or ffff are illegal: */
if ((p[1]&0xf)==0xf &&
- ((unsigned char*)p)[2] == 0xbf &&
- ((unsigned char*)p)[3] >= 0xbe) goto FAIL;
+ ((const unsigned char*)p)[2] == 0xbf &&
+ ((const unsigned char*)p)[3] >= 0xbe) goto FAIL;
#endif
return
((p[0] & 0x07) << 18) +
@@ -189,7 +195,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
((p[2] & 0x3f) << 6) +
((p[3] & 0x3f));
} else if (c == 0xf4) {
- if (((unsigned char*)p)[1] > 0x8f) goto FAIL; /* after 0x10ffff */
+ if (((const unsigned char*)p)[1] > 0x8f) goto FAIL; /* after 0x10ffff */
goto UTF8_4;
} else {
FAIL:
@@ -208,7 +214,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
byte of the error is an individual character.
\e start is the start of the string and is used to limit the
- backwards search for the start of a utf8 character.
+ backwards search for the start of a UTF-8 character.
\e end is the end of the string and is assumed to be a break
between characters. It is assumed to be greater than p.
@@ -216,7 +222,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
This function is for moving a pointer that was jumped to the
middle of a string, such as when doing a binary search for
a position. You should use either this or fl_utf8back() depending
- on which direction your algorithim can handle the pointer
+ on which direction your algorithm can handle the pointer
moving. Do not use this to scan strings, use fl_utf8decode()
instead.
*/
@@ -321,9 +327,9 @@ int fl_utf8encode(unsigned ucs, char* buf) {
return 4;
} else {
/* encode 0xfffd: */
- buf[0] = 0xefU;
- buf[1] = 0xbfU;
- buf[2] = 0xbdU;
+ buf[0] = (char)0xef;
+ buf[1] = (char)0xbf;
+ buf[2] = (char)0xbd;
return 3;
}
}
@@ -532,12 +538,12 @@ unsigned fl_utf8towc(const char* src, unsigned srclen,
If the UTF-8 decodes to a character greater than 0xff then it is
replaced with '?'.
- Errors in the UTF-8 are converted as individual bytes, same as
+ Errors in the UTF-8 sequence are converted as individual bytes, same as
fl_utf8decode() does. This allows ISO-8859-1 text mistakenly identified
- as UTF-8 to be printed correctly (and possibly CP1512 on Windows).
+ as UTF-8 to be printed correctly (and possibly CP1252 on Windows).
- \p src points at the UTF-8, and \p srclen is the number of bytes to
- convert.
+ \p src points at the UTF-8 sequence, and \p srclen is the number of
+ bytes to convert.
Up to \p dstlen bytes are written to \p dst, including a null
terminator. The return value is the number of bytes that would be
@@ -556,7 +562,7 @@ unsigned fl_utf8toa(const char* src, unsigned srclen,
if (dstlen) for (;;) {
unsigned char c;
if (p >= e) {dst[count] = 0; return count;}
- c = *(unsigned char*)p;
+ c = *(const unsigned char*)p;
if (c < 0xC2) { /* ascii or bad code */
dst[count] = c;
p++;
@@ -629,7 +635,7 @@ unsigned fl_utf8fromwc(char* dst, unsigned dstlen,
/* surrogate pair */
unsigned ucs2 = src[i++];
ucs = 0x10000U + ((ucs&0x3ff)<<10) + (ucs2&0x3ff);
- /* all surrogate pairs turn into 4-byte utf8 */
+ /* all surrogate pairs turn into 4-byte UTF-8 */
#else
} else if (ucs >= 0x10000) {
if (ucs > 0x10ffff) {
@@ -704,7 +710,7 @@ unsigned fl_utf8froma(char* dst, unsigned dstlen,
if (dstlen) for (;;) {
unsigned char ucs;
if (p >= e) {dst[count] = 0; return count;}
- ucs = *(unsigned char*)p++;
+ ucs = *(const unsigned char*)p++;
if (ucs < 0x80U) {
dst[count++] = ucs;
if (count >= dstlen) {dst[count-1] = 0; break;}
@@ -716,7 +722,7 @@ unsigned fl_utf8froma(char* dst, unsigned dstlen,
}
/* we filled dst, measure the rest: */
while (p < e) {
- unsigned char ucs = *(unsigned char*)p++;
+ unsigned char ucs = *(const unsigned char*)p++;
if (ucs < 0x80U) {
count++;
} else {
@@ -806,14 +812,14 @@ unsigned fl_utf8to_mb(const char* src, unsigned srclen,
wchar_t lbuf[1024];
wchar_t* buf = lbuf;
unsigned length = fl_utf8towc(src, srclen, buf, 1024);
- int ret;
+ int ret; /* note: wcstombs() returns unsigned(length) or unsigned(-1) */
if (length >= 1024) {
buf = (wchar_t*)(malloc((length+1)*sizeof(wchar_t)));
fl_utf8towc(src, srclen, buf, length+1);
}
if (dstlen) {
ret = wcstombs(dst, buf, dstlen);
- if (ret >= dstlen-1) ret = wcstombs(0,buf,0);
+ if (ret >= (int)dstlen-1) ret = wcstombs(0,buf,0);
} else {
ret = wcstombs(0,buf,0);
}
@@ -982,5 +988,5 @@ int fl_wcwidth(const char* src) {
/** @} */
/*
- * End of "$Id: fl_utf.c 8864 2011-07-19 04:49:30Z greg.ercolano $".
+ * End of "$Id: fl_utf.c 11404 2016-03-23 13:36:50Z AlbrechtS $".
*/
diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx
index 8ad2f3b..80802b4 100644
--- a/src/fl_utf8.cxx
+++ b/src/fl_utf8.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_utf8.cxx 10248 2014-08-23 08:41:58Z cand $"
+// "$Id: fl_utf8.cxx 10761 2015-06-16 09:31:05Z ianmacarthur $"
//
// Unicode to UTF-8 conversion functions.
//
@@ -75,42 +75,39 @@ extern "C" {
@{
*/
-/*** NOTE : all functions are LIMITED to 24 bits Unicode values !!! ***/
-/*** but only 16 bits are really used under Linux and win32 ***/
+// *** NOTE : All functions are LIMITED to 24 bits Unicode values !!! ***
+// *** But only 16 bits are really used under Linux and win32 ***
#define NBC 0xFFFF + 1
-static int
-Toupper(
- int ucs)
-{
- long i;
- static unsigned short *table = NULL;
-
- if (!table) {
- table = (unsigned short*) malloc(
- sizeof(unsigned short) * (NBC));
- for (i = 0; i < NBC; i++) {
- table[i] = (unsigned short) i;
- }
- for (i = 0; i < NBC; i++) {
- int l;
- l = XUtf8Tolower(i);
- if (l != i) table[l] = (unsigned short) i;
- }
-
- }
- if (ucs >= NBC || ucs < 0) return ucs;
- return table[ucs];
+static int Toupper(int ucs) {
+ long i;
+ static unsigned short *table = NULL;
+
+ if (!table) {
+ table = (unsigned short*) malloc(
+ sizeof(unsigned short) * (NBC));
+ for (i = 0; i < NBC; i++) {
+ table[i] = (unsigned short) i;
+ }
+ for (i = 0; i < NBC; i++) {
+ int l;
+ l = XUtf8Tolower(i);
+ if (l != i) table[l] = (unsigned short) i;
+ }
+ }
+ if (ucs >= NBC || ucs < 0) return ucs;
+ return table[ucs];
}
/**
- return the byte length of the UTF-8 sequence with first byte \p c,
- or -1 if \p c is not valid.
- This function is helpful for finding faulty UTF8 sequences.
- \see fl_utf8len1
- */
+ Returns the byte length of the UTF-8 sequence with first byte \p c,
+ or -1 if \p c is not valid.
+
+ This function is helpful for finding faulty UTF-8 sequences.
+ \see fl_utf8len1
+*/
int fl_utf8len(char c)
{
if (!(c & 0x80)) return 1;
@@ -134,12 +131,13 @@ int fl_utf8len(char c)
/**
- Return the byte length of the UTF-8 sequence with first byte \p c,
- or 1 if \p c is not valid.
- This function can be used to scan faulty UTF8 sequence, albeit ignoring invalid
- codes.
- \see fl_utf8len
- */
+ Returns the byte length of the UTF-8 sequence with first byte \p c,
+ or 1 if \p c is not valid.
+
+ This function can be used to scan faulty UTF-8 sequences, albeit
+ ignoring invalid codes.
+ \see fl_utf8len
+*/
int fl_utf8len1(char c)
{
if (!(c & 0x80)) return 1;
@@ -163,43 +161,44 @@ int fl_utf8len1(char c)
/**
- returns the number of Unicode chars in the UTF-8 string
- */
+ Returns the number of Unicode chars in the UTF-8 string.
+*/
int
fl_utf_nb_char(
const unsigned char *buf,
int len)
{
- int i = 0;
- int nbc = 0;
- while (i < len) {
- int cl = fl_utf8len((buf+i)[0]);//fl_utflen(buf + i, len - i);
- if (cl < 1) cl = 1;
- nbc++;
- i += cl;
- }
- return nbc;
+ int i = 0;
+ int nbc = 0;
+ while (i < len) {
+ int cl = fl_utf8len((buf+i)[0]);
+ if (cl < 1) cl = 1;
+ nbc++;
+ i += cl;
+ }
+ return nbc;
}
/**
- UTF-8 aware strncasecmp - converts to lower case Unicode and tests.
-
- \param s1, s2 the utf8 strings to compare
- \param n the maximum number of utf8 characters to compare
- \return 0 if the strings are equal
- \return >0 if s1 is greater than s2
- \return <0 if s1 is less than s2
- */
+ UTF-8 aware strncasecmp - converts to lower case Unicode and tests.
+
+ \param s1, s2 the UTF-8 strings to compare
+ \param n the maximum number of UTF-8 characters to compare
+ \return result of comparison
+ \retval 0 if the strings are equal
+ \retval >0 if s1 is greater than s2
+ \retval <0 if s1 is less than s2
+*/
int fl_utf_strncasecmp(const char *s1, const char *s2, int n)
{
int i;
for (i = 0; i < n; i++) {
int l1, l2;
unsigned int u1, u2;
-
+
if (*s1==0 && *s2==0) return 0; // all compared equal, return 0
-
+
u1 = fl_utf8decode(s1, 0, &l1);
u2 = fl_utf8decode(s2, 0, &l2);
int res = XUtf8Tolower(u1) - XUtf8Tolower(u2);
@@ -212,171 +211,125 @@ int fl_utf_strncasecmp(const char *s1, const char *s2, int n)
/**
- UTF-8 aware strcasecmp - converts to Unicode and tests.
-
- \return 0 if the strings are equal
- \return 1 if s1 is greater than s2
- \return -1 if s1 is less than s2
- */
+ UTF-8 aware strcasecmp - converts to Unicode and tests.
+
+ \return result of comparison
+ \retval 0 if the strings are equal
+ \retval 1 if s1 is greater than s2
+ \retval -1 if s1 is less than s2
+*/
int fl_utf_strcasecmp(const char *s1, const char *s2)
{
return fl_utf_strncasecmp(s1, s2, 0x7fffffff);
}
/**
- return the Unicode lower case value of \p ucs
- */
+ Returns the Unicode lower case value of \p ucs.
+*/
int fl_tolower(unsigned int ucs)
{
- return XUtf8Tolower(ucs);
+ return XUtf8Tolower(ucs);
}
/**
- return the Unicode upper case value of \p ucs
- */
+ Returns the Unicode upper case value of \p ucs.
+*/
int fl_toupper(unsigned int ucs)
{
- return Toupper(ucs);
+ return Toupper(ucs);
}
/**
- converts the str string to the lower case equivalent into buf.
+ Converts the string \p str to its lower case equivalent into buf.
Warning: to be safe buf length must be at least 3 * len [for 16-bit Unicode]
- */
+*/
int fl_utf_tolower(const unsigned char *str, int len, char *buf)
{
- int i;
- int l = 0;
- char *end = (char *)&str[len];
- for (i = 0; i < len;) {
- int l1, l2;
- unsigned int u1;
-
-// l1 = fl_utf2ucs((unsigned char*)str + i, len - i, &u1);
- u1 = fl_utf8decode((const char*)(str + i), end, &l1);
- l2 = fl_utf8encode((unsigned int) XUtf8Tolower(u1), buf + l);
- if (l1 < 1) {
- i += 1;
- } else {
- i += l1;
- }
- if (l2 < 1) {
- l += 1;
- } else {
- l += l2;
- }
-
- }
- return l;
+ int i;
+ int l = 0;
+ char *end = (char *)&str[len];
+ for (i = 0; i < len;) {
+ int l1, l2;
+ unsigned int u1;
+
+ u1 = fl_utf8decode((const char*)(str + i), end, &l1);
+ l2 = fl_utf8encode((unsigned int) XUtf8Tolower(u1), buf + l);
+ if (l1 < 1) {
+ i += 1;
+ } else {
+ i += l1;
+ }
+ if (l2 < 1) {
+ l += 1;
+ } else {
+ l += l2;
+ }
+ }
+ return l;
}
/**
- converts the str string to the upper case equivalent into buf.
+ Converts the string \p str to its upper case equivalent into buf.
Warning: to be safe buf length must be at least 3 * len [for 16-bit Unicode]
- */
+*/
int fl_utf_toupper(const unsigned char *str, int len, char *buf)
{
- int i;
- int l = 0;
- char *end = (char *)&str[len];
- for (i = 0; i < len;) {
- int l1, l2;
- unsigned int u1;
-
-// l1 = fl_utf2ucs((unsigned char*)str + i, len - i, &u1);
- u1 = fl_utf8decode((const char*)(str + i), end, &l1);
- l2 = fl_utf8encode((unsigned int) Toupper(u1), buf + l);
- if (l1 < 1) {
- i += 1;
- } else {
- i += l1;
- }
- if (l2 < 1) {
- l += 1;
- } else {
- l += l2;
- }
- }
- return l;
-}
-
-#if 0 // deprecated in favour of FLTK2's fl_utf8toa
-/*
- * convert UTF-8 str to latin1
- * Warning: buf must be at least len long
- */
-int fl_utf2latin1(const unsigned char *str, int len, char *buf)
-{
- int i;
- int l = 0;
- char *end = (char *)&str[len];
- for (i = 0; i < len;) {
- unsigned int u1;
- int l1;
-
-// l1 = fl_utf2ucs((unsigned char*)str + i, len - i, &u1);
- u1 = fl_utf8decode((const char*)(str + i), end, &l1);
- if (u1 > 0xFF) u1 = '?';
- buf[l] = (char) u1;
- if (l1 < 1) {
- i += 1;
- } else {
- i += l1;
- }
- l++;
-
- }
- return l;
+ int i;
+ int l = 0;
+ char *end = (char *)&str[len];
+ for (i = 0; i < len;) {
+ int l1, l2;
+ unsigned int u1;
+
+ u1 = fl_utf8decode((const char*)(str + i), end, &l1);
+ l2 = fl_utf8encode((unsigned int) Toupper(u1), buf + l);
+ if (l1 < 1) {
+ i += 1;
+ } else {
+ i += l1;
+ }
+ if (l2 < 1) {
+ l += 1;
+ } else {
+ l += l2;
+ }
+ }
+ return l;
}
-#endif
-#if 0 // deprecated in favour of FLTK2's fl_utf8froma
-/*
- * convert latin1 str to UTF-8
- * Warning: buf must be at least 2 * len long
- */
-int fl_latin12utf(const unsigned char *str, int len, char *buf)
-{
- int i;
- int l = 0;
- int l1 = 0;
- for (i = 0; i < len; i++) {
- unsigned int n = (unsigned int) str[i];
- l1 = fl_utf8encode(n, buf + l);
- if (l1 < 1) {
- l = l + 1;
- } else {
- l = l + l1;
- }
-
- }
- return l;
-}
-#endif
/**
- returns true if the character is non-spacing.
- \todo explain what non-spacing means.
- */
+ Returns true if the Unicode character \p ucs is non-spacing.
+
+ Non-spacing characters in Unicode are typically combining marks like
+ tilde (~), diaeresis (¨), or other marks that are added to a base
+ character, for instance 'a' (base character) + '¨' (combining mark) = 'ä'
+ (German Umlaut).
+
+ - http://unicode.org/glossary/#base_character
+ - http://unicode.org/glossary/#nonspacing_mark
+ - http://unicode.org/glossary/#combining_character
+*/
unsigned int fl_nonspacing(unsigned int ucs)
{
-#ifdef __APPLE__
- return (ucs==0x20); // FIXME: what does this really do?
-#else
return (unsigned int) XUtf8IsNonSpacing(ucs);
-#endif
}
-#if defined(WIN32) && !defined(__CYGWIN__)
-static xchar *mbwbuf = NULL;
-#endif
-
#ifdef WIN32
unsigned int fl_codepage = 0;
#endif
#if defined (WIN32) && !defined(__CYGWIN__)
+// For Win32 platforms, we frequently need to translate between
+// Windows 16-bit wide characters (usually UTF-16) and our
+// native UTF-8 strings. To this end, we maintain a number of
+// character buffers to support the conversions.
+// NOTE: Our re-use of these buffers means this code is not
+// going to be thread-safe.
+static xchar *mbwbuf = NULL;
+static xchar *wbuf = NULL;
+static xchar *wbuf1 = NULL;
static char *buf = NULL;
static int buf_len = 0;
static unsigned short *wbufa = NULL;
@@ -384,143 +337,121 @@ static unsigned short *wbufa = NULL;
// FIXME: This should *maybe* return 'const char *' instead of 'char *'
char *fl_utf8_to_locale(const char *s, int len, UINT codepage)
{
- if (!s) return (char *)"";
- int l = 0;
-// if (buf_len < len * 2 + 1) {
-// buf_len = len * 2 + 1;
-// buf = (char*) realloc(buf, buf_len);
-// wbufa = (unsigned short*) realloc(wbufa, buf_len * sizeof(short));
-// }
- unsigned wn = fl_utf8toUtf16(s, len, NULL, 0); // Query length
- wn = wn * 2 + 1;
- if (wn >= (unsigned)buf_len) {
- buf_len = wn;
- buf = (char*) realloc(buf, buf_len);
- wbufa = (unsigned short*) realloc(wbufa, buf_len * sizeof(short));
- }
- if (codepage < 1) codepage = fl_codepage;
-// l = fl_utf2unicode((const unsigned char *)s, len, (xchar*) wbufa);
- l = fl_utf8toUtf16(s, len, wbufa, wn); // Convert string
- wbufa[l] = 0;
- buf[l] = 0;
- l = WideCharToMultiByte(codepage, 0, (WCHAR*)wbufa, l, buf, buf_len, NULL, NULL);
- if (l < 0) l = 0;
- buf[l] = 0;
- return buf;
+ if (!s) return (char *)"";
+ int l = 0;
+ unsigned wn = fl_utf8toUtf16(s, len, NULL, 0); // Query length
+ wn = wn * 2 + 1;
+ if (wn >= (unsigned)buf_len) {
+ buf_len = wn;
+ buf = (char*) realloc(buf, buf_len);
+ wbufa = (unsigned short*) realloc(wbufa, buf_len * sizeof(short));
+ }
+ if (codepage < 1) codepage = fl_codepage;
+ l = fl_utf8toUtf16(s, len, wbufa, wn); // Convert string
+ wbufa[l] = 0;
+ buf[l] = 0;
+ l = WideCharToMultiByte(codepage, 0, (WCHAR*)wbufa, l, buf, buf_len, NULL, NULL);
+ if (l < 0) l = 0;
+ buf[l] = 0;
+ return buf;
}
// FIXME: This should maybe return 'const char *' instead of 'char *'
char *fl_locale_to_utf8(const char *s, int len, UINT codepage)
{
- if (!s) return (char *)"";
- int l = 0;
- if (buf_len < len * 5 + 1) {
- buf_len = len * 5 + 1;
- buf = (char*) realloc(buf, buf_len);
- wbufa = (unsigned short*) realloc(wbufa, buf_len * sizeof(short));
- }
- 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;
-// l = fl_unicode2utf((xchar*)wbufa, l, buf);
- l = fl_utf8fromwc(buf, buf_len, (xchar*)wbufa, l);
- buf[l] = 0;
- return buf;
+ if (!s) return (char *)"";
+ int l = 0;
+ if (buf_len < len * 5 + 1) {
+ buf_len = len * 5 + 1;
+ buf = (char*) realloc(buf, buf_len);
+ wbufa = (unsigned short*) realloc(wbufa, buf_len * sizeof(short));
+ }
+ 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;
+ l = fl_utf8fromwc(buf, buf_len, (xchar*)wbufa, l);
+ buf[l] = 0;
+ return buf;
}
#endif
/**
- converts UTF8 to a local multi-byte character string.
- */
+ Converts UTF-8 string \p s to a local multi-byte character string.
+*/
char * fl_utf2mbcs(const char *s)
{
- if (!s) return NULL;
+ if (!s) return NULL;
+
#if defined(WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(s);
- static char *buf = NULL;
-
-// mbwbuf = (xchar*)realloc(mbwbuf, (l+6) * sizeof(xchar));
-// l = fl_utf2unicode((unsigned char*)s, l, mbwbuf);
-// mbwbuf[l] = 0;
- unsigned wn = fl_utf8toUtf16(s, (unsigned) l, NULL, 0) + 7; // Query length
- mbwbuf = (xchar*)realloc(mbwbuf, sizeof(xchar)*wn);
- l = fl_utf8toUtf16(s, (unsigned) l, (unsigned short *)mbwbuf, wn); // Convert string
- mbwbuf[l] = 0;
-
- buf = (char*)realloc(buf, (unsigned) (l * 6 + 1));
- l = (unsigned) wcstombs(buf, mbwbuf, (unsigned) l * 6);
- buf[l] = 0;
- return buf;
+
+ size_t l = strlen(s);
+ static char *buf = NULL;
+
+ unsigned wn = fl_utf8toUtf16(s, (unsigned) l, NULL, 0) + 7; // Query length
+ mbwbuf = (xchar*)realloc(mbwbuf, sizeof(xchar)*wn);
+ l = fl_utf8toUtf16(s, (unsigned) l, (unsigned short *)mbwbuf, wn); // Convert string
+ mbwbuf[l] = 0;
+
+ buf = (char*)realloc(buf, (unsigned) (l * 6 + 1));
+ l = (unsigned) wcstombs(buf, mbwbuf, (unsigned) l * 6);
+ buf[l] = 0;
+ return buf;
#else
- return (char*) s;
+ return (char*) s;
#endif
}
+/** Cross-platform function to get environment variables with a UTF-8 encoded
+ name or value.
-#if 0 // deprecated in favour of FLTK2's fl_utf8from_mb
-char * fl_mbcs2utf(const char *s)
-{
- if (!s) return NULL;
-#if defined(WIN32)
- int l = strlen(s);
- unsigned dstlen;
- static char *buf = NULL;
-
- mbwbuf = (xchar*)realloc(mbwbuf,(l * 6 + 6) * sizeof(xchar));
- l = mbstowcs(mbwbuf, s, l);
- dstlen = l * 6 + 1;
- buf = (char*)realloc(buf, dstlen);
-// l = fl_unicode2utf(mbwbuf, l, buf);
- l = fl_utf8fromwc(buf, dstlen, mbwbuf, l);
- buf[l] = 0;
- return buf;
-#else
- return (char*) s;
-#endif
-} // fl_mbcs2utf
-#endif
+ This function is especially useful under the MSWindows platform where
+ non-ASCII environment variables are encoded as wide characters.
+ The returned value of the variable is encoded in UTF-8 as well.
-#if defined(WIN32) && !defined(__CYGWIN__)
-static xchar *wbuf = NULL;
-static xchar *wbuf1 = NULL;
-#endif
+ On platforms other than MSWindows this function calls getenv directly.
+ The return value is returned as-is.
+ \param[in] v the UTF-8 encoded environment variable
+ \return the environment variable in UTF-8 encoding, or NULL in case of error.
+*/
+
+char *fl_getenv(const char* v) {
-char *fl_getenv(const char* v)
-{
#if defined (WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(v);
-// static xchar* wbuf = NULL;
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)v, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(v, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(v, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- xchar *ret = _wgetenv(wbuf);
- static char *buf = NULL;
- if (ret) {
- l = (unsigned) wcslen(ret);
- wn = fl_utf8fromwc(NULL, 0, ret, (unsigned) l) + 1; // query length
- buf = (char*) realloc(buf, wn);
-// buf[fl_unicode2utf(ret, l, buf)] = 0;
- wn = fl_utf8fromwc(buf, wn, ret, (unsigned) l); // convert string
- buf[wn] = 0;
- return buf;
- } else {
- return NULL;
- }
+
+ size_t l = strlen(v);
+ unsigned wn = fl_utf8toUtf16(v, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(v, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ xchar *ret = _wgetenv(wbuf);
+ static char *buf = NULL;
+ if (ret) {
+ l = (unsigned) wcslen(ret);
+ wn = fl_utf8fromwc(NULL, 0, ret, (unsigned) l) + 1; // query length
+ buf = (char*) realloc(buf, wn);
+ wn = fl_utf8fromwc(buf, wn, ret, (unsigned) l); // convert string
+ buf[wn] = 0;
+ return buf;
+ } else {
+ return NULL;
+ }
+
#else
- return getenv(v);
+
+ return getenv(v);
+
#endif
-}
+
+} // fl_getenv()
+
/** Cross-platform function to open files with a UTF-8 encoded name.
-
- This function is especially useful under the MSWindows platform where the
+
+ This function is especially useful under the MSWindows platform where the
standard open() function fails with UTF-8 encoded non-ASCII filenames.
\param f the UTF-8 encoded filename
\param oflags other arguments are as in the standard open() function
@@ -529,271 +460,400 @@ char *fl_getenv(const char* v)
*/
int fl_open(const char* f, int oflags, ...)
{
- int pmode;
- va_list ap;
- va_start(ap, oflags);
- pmode = va_arg (ap, int);
- va_end(ap);
+ int pmode;
+ va_list ap;
+ va_start(ap, oflags);
+ pmode = va_arg (ap, int);
+ va_end(ap);
+
#if defined (WIN32) && !defined(__CYGWIN__)
- unsigned l = (unsigned) strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- if (pmode == -1) return _wopen(wbuf, oflags);
- else return _wopen(wbuf, oflags, pmode);
+
+ unsigned l = (unsigned) strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ if (pmode == -1) return _wopen(wbuf, oflags);
+ else return _wopen(wbuf, oflags, pmode);
+
#else
- if (pmode == -1) return open(f, oflags);
- else return open(f, oflags, pmode);
+
+ if (pmode == -1) return open(f, oflags);
+ else return open(f, oflags, pmode);
+
#endif
-}
+
+} // fl_open()
+
/** Cross-platform function to open files with a UTF-8 encoded name.
-
- This function is especially useful under the MSWindows platform where the
- standard fopen() function fails with UTF-8 encoded non-ASCII filenames.
- \param f the UTF-8 encoded filename
- \param mode same as the second argument of the standard fopen() function
- \return a FILE pointer upon successful completion, or NULL in case of error.
- \sa fl_open().
- */
-FILE *fl_fopen(const char* f, const char *mode)
-{
+
+ This function is especially useful under the MSWindows platform where the
+ standard fopen() function fails with UTF-8 encoded non-ASCII filenames.
+ \param f the UTF-8 encoded filename
+ \param mode same as the second argument of the standard fopen() function
+ \return a FILE pointer upon successful completion, or NULL in case of error.
+ \sa fl_open().
+*/
+FILE *fl_fopen(const char* f, const char *mode) {
+
#if defined (WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- l = strlen(mode);
-// wbuf1 = (xchar*)realloc(wbuf1, sizeof(xchar) * (l+1));
-// wbuf1[fl_utf2unicode((const unsigned char*)mode, l, wbuf1)] = 0;
- wn = fl_utf8toUtf16(mode, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf1 = (xchar*)realloc(wbuf1, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(mode, (unsigned) l, (unsigned short *)wbuf1, wn); // Convert string
- wbuf1[wn] = 0;
- return _wfopen(wbuf, wbuf1);
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ l = strlen(mode);
+ wn = fl_utf8toUtf16(mode, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf1 = (xchar*)realloc(wbuf1, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(mode, (unsigned) l, (unsigned short *)wbuf1, wn); // Convert string
+ wbuf1[wn] = 0;
+ return _wfopen(wbuf, wbuf1);
+
#else
- return fopen(f, mode);
+
+ return fopen(f, mode);
+
#endif
-}
-int fl_system(const char* f)
+} // fl_fopen()
+
+
+/** Cross-platform function to run a system command with a UTF-8 encoded string.
+
+ This function is especially useful under the MSWindows platform where
+ non-ASCII program (file) names must be encoded as wide characters.
+
+ On platforms other than MSWindows this function calls system() directly.
+
+ \param[in] cmd the UTF-8 encoded command string
+ \return the return value of _wsystem() on Windows or system() on other platforms.
+*/
+
+int fl_system(const char* cmd)
{
-#if defined (WIN32) && !defined(__CYGWIN__)
-# ifdef __MINGW32__
- return system(fl_utf2mbcs(f));
-# else
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- return _wsystem(wbuf);
-# endif
+#if defined(WIN32) && !defined(__CYGWIN__)
+
+# ifdef __MINGW32__
+ return system(fl_utf2mbcs(cmd));
+# else
+ size_t l = strlen(cmd);
+ unsigned wn = fl_utf8toUtf16(cmd, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(cmd, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ return _wsystem(wbuf);
+# endif
+
#else
- return system(f);
+ return system(cmd);
#endif
}
int fl_execvp(const char *file, char *const *argv)
{
-#if defined (WIN32) && !defined(__CYGWIN__)
-#ifdef __MINGW32__
- return _execvp(fl_utf2mbcs(file), argv);
-#else
- size_t l = strlen(file);
- int i, n;
- xchar **ar;
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)file, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(file, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(file, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
-
- i = 0; n = 0;
- while (argv[i]) {i++; n++;}
- ar = (xchar**) malloc(sizeof(xchar*) * (n + 1));
- i = 0;
- while (i <= n) {
- unsigned wn;
- l = strlen(argv[i]);
-// ar[i] = (xchar *)malloc(sizeof(xchar) * (l+1));
-// ar[i][fl_utf2unicode((const unsigned char*)argv[i], l, ar[i])] = 0;
- wn = fl_utf8toUtf16(argv[i], (unsigned) l, NULL, 0) + 1; // Query length
- ar[i] = (xchar *)malloc(sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(argv[i], (unsigned) l, (unsigned short *)ar[i], wn); // Convert string
- ar[i][wn] = 0;
- i++;
- }
- ar[n] = NULL;
- _wexecvp(wbuf, ar); // STR #3040
- i = 0;
- while (i <= n) {
- free(ar[i]);
- i++;
- }
- free(ar);
- return -1; // STR #3040
-#endif
-#else
- return execvp(file, argv);
+#if defined(WIN32) && !defined(__CYGWIN__) // Windows
+
+# ifdef __MINGW32__
+ return _execvp(fl_utf2mbcs(file), argv);
+# else
+ size_t l = strlen(file);
+ int i, n;
+ xchar **ar;
+ unsigned wn = fl_utf8toUtf16(file, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(file, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+
+ i = 0; n = 0;
+ while (argv[i]) {i++; n++;}
+ ar = (xchar**) malloc(sizeof(xchar*) * (n + 1));
+ i = 0;
+ while (i <= n) {
+ unsigned wn;
+ l = strlen(argv[i]);
+ wn = fl_utf8toUtf16(argv[i], (unsigned) l, NULL, 0) + 1; // Query length
+ ar[i] = (xchar *)malloc(sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(argv[i], (unsigned) l, (unsigned short *)ar[i], wn); // Convert string
+ ar[i][wn] = 0;
+ i++;
+ }
+ ar[n] = NULL;
+ _wexecvp(wbuf, ar); // STR #3040
+ i = 0;
+ while (i <= n) {
+ free(ar[i]);
+ i++;
+ }
+ free(ar);
+ return -1; // STR #3040
+# endif
+
+#else // other platforms
+ return execvp(file, argv);
#endif
+
}
+/** Cross-platform function to set a files mode() with a UTF-8 encoded
+ name or value.
+ This function is especially useful under the MSWindows platform where the
+ standard chmod() function fails with UTF-8 encoded non-ASCII filenames.
+
+ \param[in] f the UTF-8 encoded filename
+ \param[in] mode the mode to set
+ \return the return value of _wchmod() on Windows or chmod() on other platforms.
+*/
+int fl_chmod(const char* f, int mode) {
+
+#if defined(WIN32) && !defined(__CYGWIN__) // Windows
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ return _wchmod(wbuf, mode);
+
+#else // other platforms
+
+ return chmod(f, mode);
-int fl_chmod(const char* f, int mode)
-{
-#if defined (WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- return _wchmod(wbuf, mode);
-#else
- return chmod(f, mode);
#endif
-}
-int fl_access(const char* f, int mode)
-{
-#if defined (WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- return _waccess(wbuf, mode);
-#else
- return access(f, mode);
+} // fl_chmod()
+
+
+/** Cross-platform function to test a files access() with a UTF-8 encoded
+ name or value.
+
+ This function is especially useful under the MSWindows platform where the
+ standard access() function fails with UTF-8 encoded non-ASCII filenames.
+
+ \param[in] f the UTF-8 encoded filename
+ \param[in] mode the mode to test
+ \return the return value of _waccess() on Windows or access() on other platforms.
+*/
+int fl_access(const char* f, int mode) {
+
+#if defined (WIN32) && !defined(__CYGWIN__) // Windows
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ return _waccess(wbuf, mode);
+
+#else // other platforms
+
+ return access(f, mode);
+
#endif
-}
+} // fl_access()
+
+
+/** Cross-platform function to stat() a file using a UTF-8 encoded
+ name or value.
+
+ This function is especially useful under the MSWindows platform where the
+ standard stat() function fails with UTF-8 encoded non-ASCII filenames.
+
+ \param[in] f the UTF-8 encoded filename
+ \param b the stat struct to populate
+ \return the return value of _wstat() on Windows or stat() on other platforms.
+*/
+int fl_stat(const char* f, struct stat *b) {
+
+#if defined(WIN32) && !defined(__CYGWIN__) // Windows
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ return _wstat(wbuf, (struct _stat*)b);
+
+#else // other platforms
+
+ return stat(f, b);
-int fl_stat(const char* f, struct stat *b)
-{
-#if defined(WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- return _wstat(wbuf, (struct _stat*)b);
-#else
- return stat(f, b);
#endif
-}
-char *fl_getcwd(char* b, int l)
-{
- if (b == NULL) {
- b = (char*) malloc(l+1);
- }
-#if defined(WIN32) && !defined(__CYGWIN__)
- static xchar *wbuf = NULL;
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// xchar *ret = _wgetcwd(wbuf, l / 5);
- xchar *ret = _wgetcwd(wbuf, l);
- if (ret) {
- unsigned dstlen = l;
- l = (int) wcslen(wbuf);
-// b[fl_unicode2utf(wbuf, l, b)] = 0;
- dstlen = fl_utf8fromwc(b, dstlen, wbuf, (unsigned) l);
- b[dstlen] = 0;
- return b;
- } else {
- return NULL;
- }
-#else
- return getcwd(b, l);
+} // fl_stat()
+
+
+/** Cross-platform function to get the current working directory
+ as a UTF-8 encoded value.
+
+ This function is especially useful under the MSWindows platform where the
+ standard _wgetcwd() function returns UTF-16 encoded non-ASCII filenames.
+
+ \param b the buffer to populate
+ \param l the length of the buffer
+ \return the CWD encoded as UTF-8.
+*/
+char *fl_getcwd(char* b, int l) {
+
+ if (b == NULL) {
+ b = (char*) malloc(l+1);
+ }
+
+#if defined(WIN32) && !defined(__CYGWIN__) // Windows
+
+ static xchar *wbuf = NULL;
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
+ xchar *ret = _wgetcwd(wbuf, l);
+ if (ret) {
+ unsigned dstlen = l;
+ l = (int) wcslen(wbuf);
+ dstlen = fl_utf8fromwc(b, dstlen, wbuf, (unsigned) l);
+ b[dstlen] = 0;
+ return b;
+ } else {
+ return NULL;
+ }
+
+#else // other platforms
+
+ return getcwd(b, l);
+
#endif
-}
+} // fl_getcwd()
+
+
+/** Cross-platform function to unlink() (that is, delete) a file using
+ a UTF-8 encoded filename.
+
+ This function is especially useful under the MSWindows platform where the
+ standard function expects UTF-16 encoded non-ASCII filenames.
+
+ \param f the filename to unlink
+ \return the return value of _wunlink() on Windows or unlink() on other platforms.
+*/
+int fl_unlink(const char* f) {
+
+#if defined(WIN32) && !defined(__CYGWIN__) // Windows
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ return _wunlink(wbuf);
+
+#else // other platforms
+
+ return unlink(f);
-int fl_unlink(const char* f)
-{
-#if defined(WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- return _wunlink(wbuf);
-#else
- return unlink(f);
#endif
-}
-int fl_mkdir(const char* f, int mode)
-{
-#if defined(WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(short) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- return _wmkdir(wbuf);
-#else
- return mkdir(f, mode);
+} // fl_unlink()
+
+
+/** Cross-platform function to create a directory with a UTF-8 encoded
+ name.
+
+ This function is especially useful on the MSWindows platform where the
+ standard _wmkdir() function expects UTF-16 encoded non-ASCII filenames.
+
+ \param[in] f the UTF-8 encoded filename
+ \param[in] mode the mode of the directory
+ \return the return value of _wmkdir() on Windows or mkdir() on other platforms.
+*/
+int fl_mkdir(const char* f, int mode) {
+
+#if defined(WIN32) && !defined(__CYGWIN__) // Windows
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ return _wmkdir(wbuf);
+
+#else // other platforms
+
+ return mkdir(f, mode);
+
#endif
-}
+} // fl_mkdir()
+
+
+/** Cross-platform function to remove a directory with a UTF-8 encoded
+ name.
+
+ This function is especially useful on the MSWindows platform where the
+ standard _wrmdir() function expects UTF-16 encoded non-ASCII filenames.
+
+ \param[in] f the UTF-8 encoded filename to remove
+ \return the return value of _wrmdir() on Windows or rmdir() on other platforms.
+*/
+int fl_rmdir(const char* f) {
+
+#if defined (WIN32) && !defined(__CYGWIN__) // Windows
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ return _wrmdir(wbuf);
-int fl_rmdir(const char* f)
-{
-#if defined (WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
-// wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
-// wbuf[fl_utf2unicode((const unsigned char*)f, l, wbuf)] = 0;
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- return _wrmdir(wbuf);
#else
- return rmdir(f);
+
+ return rmdir(f);
+
#endif
-}
-int fl_rename(const char* f, const char *n)
-{
-#if defined (WIN32) && !defined(__CYGWIN__)
- size_t l = strlen(f);
- unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
- wbuf[wn] = 0;
- l = strlen(n);
- wn = fl_utf8toUtf16(n, (unsigned) l, NULL, 0) + 1; // Query length
- wbuf1 = (xchar*)realloc(wbuf1, sizeof(xchar)*wn);
- wn = fl_utf8toUtf16(n, (unsigned) l, (unsigned short *)wbuf1, wn); // Convert string
- wbuf1[wn] = 0;
- return _wrename(wbuf, wbuf1);
+} // fl_rmdir()
+
+
+/** Cross-platform function to rename a filesystem object using
+ UTF-8 encoded names.
+
+ This function is especially useful on the MSWindows platform where the
+ standard _wrename() function expects UTF-16 encoded non-ASCII filenames.
+
+ \param[in] f the UTF-8 encoded filename to change
+ \param[in] n the new UTF-8 encoded filename to set
+ \return the return value of _wrename() on Windows or rename() on other platforms.
+*/
+int fl_rename(const char* f, const char *n) {
+
+#if defined (WIN32) && !defined(__CYGWIN__) // Windows
+
+ size_t l = strlen(f);
+ unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
+ wbuf[wn] = 0;
+ l = strlen(n);
+ wn = fl_utf8toUtf16(n, (unsigned) l, NULL, 0) + 1; // Query length
+ wbuf1 = (xchar*)realloc(wbuf1, sizeof(xchar)*wn);
+ wn = fl_utf8toUtf16(n, (unsigned) l, (unsigned short *)wbuf1, wn); // Convert string
+ wbuf1[wn] = 0;
+ return _wrename(wbuf, wbuf1);
+
#else
- return rename(f, n);
+
+ return rename(f, n);
+
#endif
-}
-// recursively create a path in the file system
+} // fl_rename()
+
+
+/** Cross-platform function to recursively create a path in the file system.
+
+ This function creates a \p path in the file system by recursively creating
+ all directories.
+*/
char fl_make_path( const char *path ) {
if (fl_access(path, 0)) {
const char *s = strrchr( path, '/' );
@@ -809,9 +869,14 @@ char fl_make_path( const char *path ) {
return 1;
}
-// strip the filename and create a path
-void fl_make_path_for_file( const char *path )
-{
+/** Cross-platform function to create a path for the file in the file system.
+
+ This function strips the filename from the given \p path and creates
+ a path in the file system by recursively creating all directories.
+*/
+
+void fl_make_path_for_file( const char *path ) {
+
const char *s = strrchr( path, '/' );
if ( !s ) return;
size_t len = (s-path);
@@ -820,10 +885,11 @@ void fl_make_path_for_file( const char *path )
p[len] = 0;
fl_make_path( p );
free( p );
-}
+
+} // fl_make_path_for_file()
/** @} */
//
-// End of "$Id: fl_utf8.cxx 10248 2014-08-23 08:41:58Z cand $".
+// End of "$Id: fl_utf8.cxx 10761 2015-06-16 09:31:05Z ianmacarthur $".
//
diff --git a/src/fl_vertex.cxx b/src/fl_vertex.cxx
index bdca702..751d090 100644
--- a/src/fl_vertex.cxx
+++ b/src/fl_vertex.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_vertex.cxx 9239 2012-02-17 09:47:04Z manolo $"
+// "$Id: fl_vertex.cxx 10825 2015-08-05 20:20:30Z manolo $"
//
// Portable drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -273,5 +273,5 @@ void Fl_Graphics_Driver::circle(double x, double y,double r) {
}
//
-// End of "$Id: fl_vertex.cxx 9239 2012-02-17 09:47:04Z manolo $".
+// End of "$Id: fl_vertex.cxx 10825 2015-08-05 20:20:30Z manolo $".
//
diff --git a/src/flstring.h b/src/flstring.h
index 2c6aff4..1cc10b2 100644
--- a/src/flstring.h
+++ b/src/flstring.h
@@ -1,9 +1,9 @@
/*
- * "$Id: flstring.h 10074 2014-01-21 11:07:43Z AlbrechtS $"
+ * "$Id: flstring.h 11094 2016-01-31 02:49:56Z AlbrechtS $"
*
* Common string header file for the Fast Light Tool Kit (FLTK).
*
- * Copyright 1998-2010 by Bill Spitzak and others.
+ * Copyright 1998-2016 by Bill Spitzak and others.
*
* This library is free software. Distribution and use rights are outlined in
* the file "COPYING" which should have been included with this file. If this
@@ -60,12 +60,12 @@ extern "C" {
# endif /* __cplusplus */
FL_EXPORT extern int fl_snprintf(char *, size_t, const char *, ...);
-# if !HAVE_SNPRINTF
+# ifndef HAVE_SNPRINTF
# define snprintf fl_snprintf
# endif /* !HAVE_SNPRINTF */
FL_EXPORT extern int fl_vsnprintf(char *, size_t, const char *, va_list ap);
-# if !HAVE_VSNPRINTF
+# ifndef HAVE_VSNPRINTF
# define vsnprintf fl_vsnprintf
# endif /* !HAVE_VSNPRINTF */
@@ -75,12 +75,12 @@ FL_EXPORT extern int fl_vsnprintf(char *, size_t, const char *, va_list ap);
*/
FL_EXPORT extern size_t fl_strlcat(char *, const char *, size_t);
-# if !HAVE_STRLCAT
+# ifndef HAVE_STRLCAT
# define strlcat fl_strlcat
# endif /* !HAVE_STRLCAT */
FL_EXPORT extern size_t fl_strlcpy(char *, const char *, size_t);
-# if !HAVE_STRLCPY
+# ifndef HAVE_STRLCPY
# define strlcpy fl_strlcpy
# endif /* !HAVE_STRLCPY */
@@ -97,5 +97,5 @@ FL_EXPORT extern int fl_ascii_strcasecmp(const char *s, const char *t);
#endif /* !flstring_h */
/*
- * End of "$Id: flstring.h 10074 2014-01-21 11:07:43Z AlbrechtS $".
+ * End of "$Id: flstring.h 11094 2016-01-31 02:49:56Z AlbrechtS $".
*/
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index 5f78902..29df6ec 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: gl_draw.cxx 10414 2014-10-30 09:18:45Z cand $"
+// "$Id: gl_draw.cxx 11989 2016-09-27 10:36:08Z manolo $"
//
// OpenGL drawing support routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -36,9 +36,19 @@
#include "Xutf8.h"
#endif
-#if USE_XFT
-//extern XFontStruct* fl_xxfont();
-#endif // USE_XFT
+#if defined(__APPLE__)
+
+#if !defined(kCGBitmapByteOrder32Host) // doc says available 10.4 but some 10.4 don't have it
+# define kCGBitmapByteOrder32Host 0
+#endif
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
+# include <OpenGL/glext.h>
+# define GL_TEXTURE_RECTANGLE_ARB GL_TEXTURE_RECTANGLE_EXT
+# include <FL/Fl_Gl_Window.H>
+#endif // < MAC_OS_X_VERSION_10_4
+
+#endif // __APPLE__
/** Returns the current font's height */
int gl_height() {return fl_height();}
@@ -53,11 +63,9 @@ double gl_width(uchar c) {return fl_width(c);}
static Fl_Font_Descriptor *gl_fontsize;
-#define GL_DRAW_USES_TEXTURES (defined(__APPLE__) && !__ppc__) // 1 only for non-PPC OSX
+#define GENLISTSIZE 256
#ifndef __APPLE__
# define USE_OksiD_style_GL_font_selection 1 // Most hosts except OSX
-#else
-# undef USE_OksiD_style_GL_font_selection // OSX
#endif
#if USE_XFT
@@ -70,11 +78,13 @@ static Fl_Font_Descriptor *gl_fontsize;
void gl_font(int fontid, int size) {
fl_font(fontid, size);
Fl_Font_Descriptor *fl_fontsize = fl_graphics_driver->font_descriptor();
-#if !GL_DRAW_USES_TEXTURES
+#ifndef __APPLE__
if (!fl_fontsize->listbase) {
#ifdef USE_OksiD_style_GL_font_selection
- fl_fontsize->listbase = glGenLists(0x10000);
+#undef GENLISTSIZE
+#define GENLISTSIZE 0x10000
+ fl_fontsize->listbase = glGenLists(GENLISTSIZE);
#else // Fltk-1.1.8 style GL font selection
#if defined (USE_X11) // X-windows options follow, either XFT or "plain" X
@@ -84,41 +94,25 @@ void gl_font(int fontid, int size) {
* then sorting through them at draw time (for normal X rendering) to find which one can
* render the current glyph... But for now, just use the first font in the list for GL...
*/
- XFontStruct *font = fl_xfont;
+ XFontStruct *font = fl_X_core_font();
int base = font->min_char_or_byte2;
int count = font->max_char_or_byte2-base+1;
- fl_fontsize->listbase = glGenLists(256);
+ fl_fontsize->listbase = glGenLists(GENLISTSIZE);
glXUseXFont(font->fid, base, count, fl_fontsize->listbase+base);
# elif defined(WIN32)
// this is unused because USE_OksiD_style_GL_font_selection == 1
int base = fl_fontsize->metr.tmFirstChar;
int count = fl_fontsize->metr.tmLastChar-base+1;
HFONT oldFid = (HFONT)SelectObject(fl_gc, fl_fontsize->fid);
- fl_fontsize->listbase = glGenLists(256);
+ fl_fontsize->listbase = glGenLists(GENLISTSIZE);
wglUseFontBitmaps(fl_gc, base, count, fl_fontsize->listbase+base);
SelectObject(fl_gc, oldFid);
-# elif defined(__APPLE_QUARTZ__)
-//AGL is not supported for use in 64-bit applications:
-//http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/Carbon64BitGuide/OtherAPIChanges/OtherAPIChanges.html
- short font, face, size;
- uchar fn[256];
- const char *pname = Fl::get_font_name(fontid, NULL);
- fn[0]=strlen(pname);
- strcpy((char*)(fn+1), pname);
- GetFNum(fn, &font);
- face = 0;
- size = fl_fontsize->size;
- fl_fontsize->listbase = glGenLists(256);
- aglUseFont(aglGetCurrentContext(), font, face,
- size, 0, 256, fl_fontsize->listbase);
-# else
-# error unsupported platform
# endif
#endif // USE_OksiD_style_GL_font_selection
}
glListBase(fl_fontsize->listbase);
-#endif // !GL_DRAW_USES_TEXTURES
+#endif // !__APPLE__
gl_fontsize = fl_fontsize;
}
@@ -133,7 +127,7 @@ static void get_list(int r) {
for (int i = 0; i < 0x400; i++) {
XFontStruct *font = NULL;
unsigned short id;
- XGetUtf8FontAndGlyph(gl_fontsize->font, ii, &font, &id);
+ fl_XGetUtf8FontAndGlyph(gl_fontsize->font, ii, &font, &id);
if (font) glXUseXFont(font->fid, id, 1, gl_fontsize->listbase+ii);
ii++;
}
@@ -143,8 +137,6 @@ static void get_list(int r) {
HFONT oldFid = (HFONT)SelectObject(fl_gc, gl_fontsize->fid);
wglUseFontBitmapsW(fl_gc, ii, ii + 0x03ff, gl_fontsize->listbase+ii);
SelectObject(fl_gc, oldFid);
-#elif defined(__APPLE_QUARTZ__)
-// handled by textures
#else
# error unsupported platform
#endif
@@ -172,8 +164,8 @@ void gl_remove_displaylist_fonts()
past->next = f->next;
}
- // It would be nice if this next line was in a desctructor somewhere
- glDeleteLists(f->listbase, 256);
+ // It would be nice if this next line was in a destructor somewhere
+ glDeleteLists(f->listbase, GENLISTSIZE);
Fl_Font_Descriptor* tmp = f;
f = f->next;
@@ -189,7 +181,7 @@ void gl_remove_displaylist_fonts()
#endif
}
-#if GL_DRAW_USES_TEXTURES
+#ifdef __APPLE__
static void gl_draw_textures(const char* str, int n);
#endif
@@ -200,14 +192,8 @@ static void gl_draw_textures(const char* str, int n);
*/
void gl_draw(const char* str, int n) {
#ifdef __APPLE__
-
-#if GL_DRAW_USES_TEXTURES
gl_draw_textures(str, n);
#else
- glCallLists(n, GL_UNSIGNED_BYTE, str);
-#endif
-
-#else
static xchar *buf = NULL;
static int l = 0;
int wn = fl_utf8toUtf16(str, n, (unsigned short*)buf, l);
@@ -284,11 +270,13 @@ void gl_draw(
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);
+ fl_draw(str, x, -y-h, w, h, align, gl_draw_invert, NULL, 0);
}
/** Measure how wide and tall the string will be when drawn by the gl_draw() function */
-void gl_measure(const char* str, int& x, int& y) {fl_measure(str,x,y);}
+void gl_measure(const char* str, int& x, int& y) {
+ fl_measure(str,x,y,0);
+}
/**
Outlines the given rectangle with the current color.
@@ -350,9 +338,19 @@ void gl_draw_image(const uchar* b, int x, int y, int w, int h, int d, int ld) {
glDrawPixels(w,h,d<4?GL_RGB:GL_RGBA,GL_UNSIGNED_BYTE,(const ulong*)b);
}
-#if GL_DRAW_USES_TEXTURES || defined(FL_DOXYGEN)
+#if defined(__APPLE__) || defined(FL_DOXYGEN)
+/* Text drawing to an OpenGL scene under Mac OS X is implemented using textures, as recommended by Apple.
+ This allows to use any font at any size, and any Unicode character.
+ Some old Apple hardware doesn't implement the required GL_EXT_texture_rectangle extension.
+ For these, glutStrokeString() is used to draw text. In that case, it's possible to vary text size,
+ but not text font, and only ASCII characters can be drawn.
+ */
-#include <FL/glu.h>
+static int gl_scale = 1; // set to 2 for high resolution Fl_Gl_Window
+static int has_texture_rectangle = 0; // true means GL_EXT_texture_rectangle is available
+
+#include <FL/glu.h> // for gluUnProject() and gluCheckExtension()
+#include <FL/glut.H> // for glutStrokeString() and glutStrokeLength()
// manages a fifo pile of pre-computed string textures
class gl_texture_fifo {
@@ -363,13 +361,14 @@ private:
char *utf8; //its text
Fl_Font_Descriptor *fdesc; // its font
int width; // its width
- int height; // its height
+ float ratio; // used without rectangle texture
+ int scale; // 1 or 2 for low/high resolution
} data;
data *fifo; // array of pile elements
int size_; // pile height
int current; // the oldest texture to have entered the pile
int last; // pile top
- int textures_generated; // true iff glGenTextures has been called
+ int textures_generated; // true after glGenTextures has been called
void display_texture(int rank);
int compute_texture(const char* str, int n);
int already_known(const char *str, int n);
@@ -408,36 +407,46 @@ void gl_texture_fifo::display_texture(int rank)
glMatrixMode (GL_MODELVIEW);
glPushMatrix();
glLoadIdentity ();
- float winw = Fl_Window::current()->w();
- float winh = Fl_Window::current()->h();
- glScalef (2.0f / winw, 2.0f / winh, 1.0f);
- glTranslatef (-winw / 2.0f, -winh / 2.0f, 0.0f);
- //write the texture on screen
- GLfloat pos[4];
- glGetFloatv(GL_CURRENT_RASTER_POSITION, pos);
- CGRect bounds = CGRectMake (pos[0], pos[1] - fl_descent(), fifo[rank].width, fifo[rank].height);
-
+ float winw = gl_scale * Fl_Window::current()->w();
+ float winh = gl_scale * Fl_Window::current()->h();
// GL_COLOR_BUFFER_BIT for glBlendFunc, GL_ENABLE_BIT for glEnable / glDisable
glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT);
glDisable (GL_DEPTH_TEST); // ensure text is not removed by depth buffer test.
glEnable (GL_BLEND); // for text fading
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // ditto
- glEnable (GL_TEXTURE_RECTANGLE_EXT);
glDisable(GL_LIGHTING);
- glBindTexture (GL_TEXTURE_RECTANGLE_EXT, fifo[rank].texName);
- glBegin (GL_QUADS);
- glTexCoord2f (0.0f, 0.0f); // draw lower left in world coordinates
- glVertex2f (bounds.origin.x, bounds.origin.y);
-
- glTexCoord2f (0.0f, fifo[rank].height); // draw upper left in world coordinates
- glVertex2f (bounds.origin.x, bounds.origin.y + bounds.size.height);
-
- glTexCoord2f (fifo[rank].width, fifo[rank].height); // draw upper right in world coordinates
- glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y + bounds.size.height);
-
- glTexCoord2f (fifo[rank].width, 0.0f); // draw lower right in world coordinates
- glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y);
- glEnd ();
+ GLfloat pos[4];
+ glGetFloatv(GL_CURRENT_RASTER_POSITION, pos);
+ float R = 2;
+ if (!has_texture_rectangle) {
+ R *= fifo[rank].ratio;
+ }
+ glScalef (R/winw, R/winh, 1.0f);
+ glTranslatef (-winw/R, -winh/R, 0.0f);
+ if (has_texture_rectangle) {
+ glEnable (GL_TEXTURE_RECTANGLE_ARB);
+ glBindTexture (GL_TEXTURE_RECTANGLE_ARB, fifo[rank].texName);
+ GLint height;
+ glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB, 0, GL_TEXTURE_HEIGHT, &height);
+ CGRect bounds = CGRectMake (pos[0], pos[1] - gl_scale*fl_descent(), fifo[rank].width, height);
+ //write the texture on screen
+ glBegin (GL_QUADS);
+ glTexCoord2f (0.0f, 0.0f); // draw lower left in world coordinates
+ glVertex2f (bounds.origin.x, bounds.origin.y);
+
+ glTexCoord2f (0.0f, height); // draw upper left in world coordinates
+ glVertex2f (bounds.origin.x, bounds.origin.y + bounds.size.height);
+
+ glTexCoord2f (fifo[rank].width, height); // draw upper right in world coordinates
+ glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y + bounds.size.height);
+
+ glTexCoord2f (fifo[rank].width, 0.0f); // draw lower right in world coordinates
+ glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y);
+ glEnd ();
+ } else {
+ glTranslatef(pos[0]*2/R, pos[1]*2/R, 0.0);
+ glutStrokeString(GLUT_STROKE_ROMAN, (uchar*)fifo[rank].utf8);
+ }
glPopAttrib();
// reset original matrices
@@ -464,35 +473,45 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
{
current = (current + 1) % size_;
if (current > last) last = current;
- //write str to a bitmap just big enough
if ( fifo[current].utf8 ) free(fifo[current].utf8);
fifo[current].utf8 = (char *)malloc(n + 1);
memcpy(fifo[current].utf8, str, n);
fifo[current].utf8[n] = 0;
- fifo[current].width = 0, fifo[current].height = 0;
- fl_measure(fifo[current].utf8, fifo[current].width, fifo[current].height, 0);
- CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
- void *base = calloc(4*fifo[current].width, fifo[current].height);
- if (base == NULL) return -1;
- CGContextRef save_gc = fl_gc;
- fl_gc = CGBitmapContextCreate(base, fifo[current].width, fifo[current].height, 8, fifo[current].width*4, lut, kCGImageAlphaPremultipliedLast);
- CGColorSpaceRelease(lut);
fl_graphics_driver->font_descriptor(gl_fontsize);
- GLfloat colors[4];
- glGetFloatv(GL_CURRENT_COLOR, colors);
- fl_color((uchar)(colors[0]*255), (uchar)(colors[1]*255), (uchar)(colors[2]*255));
- fl_draw(str, n, 0, fifo[current].height - fl_descent());
- //put this bitmap in a texture
- glPushAttrib(GL_TEXTURE_BIT);
- glBindTexture (GL_TEXTURE_RECTANGLE_EXT, fifo[current].texName);
- glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, fifo[current].width, fifo[current].height, 0, GL_RGBA, GL_UNSIGNED_BYTE, base);
- glPopAttrib();
- CGContextRelease(fl_gc);
- fl_gc = save_gc;
- free(base);
+ int h;
+ fl_measure(fifo[current].utf8, fifo[current].width, h, 0);
+ fifo[current].width *= gl_scale;
+ h *= gl_scale;
+ fifo[current].scale = gl_scale;
fifo[current].fdesc = gl_fontsize;
+ if (has_texture_rectangle) {
+ //write str to a bitmap just big enough
+ CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
+ void *base = NULL;
+ if (fl_mac_os_version < 100600) base = calloc(4*fifo[current].width, h);
+ CGContextRef save_gc = fl_gc;
+ fl_gc = CGBitmapContextCreate(base, fifo[current].width, h, 8, fifo[current].width*4, lut,
+ (CGBitmapInfo)(kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
+ CGColorSpaceRelease(lut);
+ GLfloat colors[4];
+ glGetFloatv(GL_CURRENT_COLOR, colors);
+ fl_color((uchar)(colors[0]*255), (uchar)(colors[1]*255), (uchar)(colors[2]*255));
+ CGContextTranslateCTM(fl_gc, 0, h - gl_scale*fl_descent());
+ CGContextScaleCTM(fl_gc, gl_scale, gl_scale);
+ fl_draw(str, n, 0, 0);
+ //put this bitmap in a texture
+ glPushAttrib(GL_TEXTURE_BIT);
+ glBindTexture (GL_TEXTURE_RECTANGLE_ARB, fifo[current].texName);
+ glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, fifo[current].width);
+ glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, fifo[current].width, h, 0, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, CGBitmapContextGetData(fl_gc));
+ glPopAttrib();
+ CGContextRelease(fl_gc);
+ fl_gc = save_gc;
+ if (base) free(base);
+ } else {
+ fifo[current].ratio = float(fifo[current].width)/glutStrokeLength(GLUT_STROKE_ROMAN, (uchar*)fifo[current].utf8);
+ }
return current;
}
@@ -502,7 +521,7 @@ int gl_texture_fifo::already_known(const char *str, int n)
int rank;
for ( rank = 0; rank <= last; rank++) {
if ( memcmp(str, fifo[rank].utf8, n) == 0 && fifo[rank].utf8[n] == 0 &&
- fifo[rank].fdesc == gl_fontsize) return rank;
+ fifo[rank].fdesc == gl_fontsize && fifo[rank].scale == gl_scale) return rank;
}
return -1;
}
@@ -512,9 +531,13 @@ static gl_texture_fifo *gl_fifo = NULL; // points to the texture pile class inst
// draws a utf8 string using pre-computed texture if available
static void gl_draw_textures(const char* str, int n)
{
+ Fl_Gl_Window *gwin = Fl_Window::current()->as_gl_window();
+ gl_scale = (gwin ? gwin->pixels_per_unit() : 1);
+ //fprintf(stderr,"gl_scale=%d\n",gl_scale);
if (! gl_fifo) gl_fifo = new gl_texture_fifo();
if (!gl_fifo->textures_generated) {
- for (int i = 0; i < gl_fifo->size_; i++) glGenTextures (1, &(gl_fifo->fifo[i].texName));
+ has_texture_rectangle = gluCheckExtension((GLubyte*)"GL_EXT_texture_rectangle", glGetString(GL_EXTENSIONS));
+ if (has_texture_rectangle) for (int i = 0; i < gl_fifo->size_; i++) glGenTextures(1, &(gl_fifo->fifo[i].texName));
gl_fifo->textures_generated = 1;
}
int rank = gl_fifo->already_known(str, n);
@@ -553,22 +576,14 @@ void gl_texture_pile_height(int max)
/** @} */
-#elif defined(__APPLE__)
-// used only if __ppc__
-int gl_texture_pile_height(void) {return 0;}
-void gl_texture_pile_height(int max) {}
-#endif // GL_DRAW_USES_TEXTURES
-#if defined(__APPLE__)
void gl_texture_reset()
{
-#if GL_DRAW_USES_TEXTURES
if (gl_fifo) gl_texture_pile_height(gl_texture_pile_height());
-#endif // GL_DRAW_USES_TEXTURES
}
#endif // __APPLE__
#endif // HAVE_GL
//
-// End of "$Id: gl_draw.cxx 10414 2014-10-30 09:18:45Z cand $".
+// End of "$Id: gl_draw.cxx 11989 2016-09-27 10:36:08Z manolo $".
//
diff --git a/src/gl_start.cxx b/src/gl_start.cxx
index 416b3f6..4250c18 100644
--- a/src/gl_start.cxx
+++ b/src/gl_start.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: gl_start.cxx 10414 2014-10-30 09:18:45Z cand $"
+// "$Id: gl_start.cxx 10548 2015-02-02 13:08:51Z manolo $"
//
// OpenGL context routines for the Fast Light Tool Kit (FLTK).
//
@@ -61,14 +61,15 @@ void gl_start() {
if (!gl_choice) Fl::gl_visual(0);
context = fl_create_gl_context(Fl_Window::current(), gl_choice);
#elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
context = fl_create_gl_context(Fl_Window::current(), gl_choice);
#else
# error Unsupported platform
#endif
}
fl_set_gl_context(Fl_Window::current(), context);
-#if !defined(WIN32) && !defined(__APPLE__)
+#ifdef __APPLE__
+ Fl_X::GLcontext_update(context); // supports window resizing
+#elif !defined(WIN32)
glXWaitX();
#endif
if (pw != Fl_Window::current()->w() || ph != Fl_Window::current()->h()) {
@@ -110,7 +111,6 @@ int Fl::gl_visual(int mode, int *alist) {
#elif defined(WIN32)
gl_choice = c;
#elif defined(__APPLE_QUARTZ__)
- // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
gl_choice = c;
#else
# error Unsupported platform
@@ -120,5 +120,5 @@ int Fl::gl_visual(int mode, int *alist) {
#endif
//
-// End of "$Id: gl_start.cxx 10414 2014-10-30 09:18:45Z cand $".
+// End of "$Id: gl_start.cxx 10548 2015-02-02 13:08:51Z manolo $".
//
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx
index 550dff8..90f1f34 100644
--- a/src/glut_compatability.cxx
+++ b/src/glut_compatability.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: glut_compatability.cxx 9697 2012-10-08 10:32:05Z manolo $"
+// "$Id: glut_compatability.cxx 11787 2016-06-22 05:44:14Z manolo $"
//
// GLUT emulation routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -34,10 +34,13 @@
# define GLX_GLXEXT_LEGACY
# include <GL/glx.h>
# endif // HAVE_GLXGETPROCADDRESSARB
-# ifdef HAVE_DLFCN_H
+# if HAVE_DLFCN_H
# include <dlfcn.h>
# endif // HAVE_DLFCN_H
# define MAXWINDOWS 32
+# ifdef __APPLE__
+# include <FL/x.H>
+# endif
static Fl_Glut_Window *windows[MAXWINDOWS+1];
static void (*glut_idle_func)() = 0; // global glut idle function
@@ -59,7 +62,7 @@ static int indraw;
void Fl_Glut_Window::draw() {
glut_window = this;
indraw = 1;
- if (!valid()) {reshape(w(),h()); valid(1);}
+ if (!valid()) {reshape(pixel_w(),pixel_h()); valid(1);}
display();
indraw = 0;
}
@@ -70,7 +73,7 @@ void glutSwapBuffers() {
void Fl_Glut_Window::draw_overlay() {
glut_window = this;
- if (!valid()) {reshape(w(),h()); valid(1);}
+ if (!valid()) {reshape(pixel_w(),pixel_h()); valid(1);}
overlaydisplay();
}
@@ -80,6 +83,9 @@ int Fl_Glut_Window::handle(int event) {
make_current();
int ex = Fl::event_x();
int ey = Fl::event_y();
+ float factor = pixels_per_unit();
+ ex = int(ex * factor + 0.5);
+ ey = int(ey * factor + 0.5);
int button;
switch (event) {
@@ -377,8 +383,8 @@ int glutGet(GLenum type) {
case GLUT_RETURN_ZERO: return 0;
case GLUT_WINDOW_X: return glut_window->x();
case GLUT_WINDOW_Y: return glut_window->y();
- case GLUT_WINDOW_WIDTH: return glut_window->w();
- case GLUT_WINDOW_HEIGHT: return glut_window->h();
+ case GLUT_WINDOW_WIDTH: return glut_window->pixel_w();
+ case GLUT_WINDOW_HEIGHT: return glut_window->pixel_h();
case GLUT_WINDOW_PARENT:
if (glut_window->parent())
return ((Fl_Glut_Window *)(glut_window->parent()))->number;
@@ -437,7 +443,7 @@ GLUTproc glutGetProcAddress(const char *procName) {
# ifdef WIN32
return (GLUTproc)wglGetProcAddress((LPCSTR)procName);
-# elif defined(HAVE_DLSYM) && defined(HAVE_DLFCN_H)
+# elif (HAVE_DLSYM && HAVE_DLFCN_H)
char symbol[1024];
snprintf(symbol, sizeof(symbol), "_%s", procName);
@@ -509,5 +515,5 @@ void glutIdleFunc(void (*f)())
#endif // HAVE_GL
//
-// End of "$Id: glut_compatability.cxx 9697 2012-10-08 10:32:05Z manolo $".
+// End of "$Id: glut_compatability.cxx 11787 2016-06-22 05:44:14Z manolo $".
//
diff --git a/src/makedepend b/src/makedepend
index 32d5ff0..10684ef 100644
--- a/src/makedepend
+++ b/src/makedepend
@@ -1,167 +1,178 @@
# DO NOT DELETE
-Fl.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl.o: ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H ../FL/x.H ../FL/Fl_Window.H
-Fl.o: flstring.h ../FL/Fl_Export.H ../FL/fl_draw.H ../FL/Enumerations.H
-Fl.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl.o: ../FL/Fl_RGB_Image.H
-Fl_Adjuster.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Adjuster.o: ../FL/Enumerations.H ../FL/Fl_Adjuster.H ../FL/Fl_Valuator.H
-Fl_Adjuster.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/x.H
-Fl_Adjuster.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl_Adjuster.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Adjuster.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Adjuster.o: ../FL/Fl_Image.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Adjuster.o: fastarrow.h mediumarrow.h slowarrow.h
-Fl_Bitmap.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Bitmap.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H
-Fl_Bitmap.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Bitmap.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Bitmap.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Bitmap.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Bitmap.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
-Fl_Bitmap.o: ../FL/Fl_Printer.H ../FL/Fl_Paged_Device.H ../FL/Fl_PostScript.H
-Fl_Bitmap.o: flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Browser.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Browser.o: ../FL/Enumerations.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
-Fl_Browser.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H
-Fl_Browser.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Image.H
-Fl_Browser.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Browser.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
-Fl_Browser.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Browser.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Browser.o: ../FL/Fl_RGB_Image.H flstring.h ../FL/Fl_Export.H ../config.h
+Fl.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl.o: ../FL/abi-version.h ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Tooltip.H
+Fl.o: ../FL/Fl_Widget.H ../FL/x.H ../FL/Fl_Window.H flstring.h
+Fl.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Device.H
+Fl.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Adjuster.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Adjuster.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Adjuster.o: ../FL/Fl_Adjuster.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
+Fl_Adjuster.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Adjuster.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Adjuster.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Adjuster.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Adjuster.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H fastarrow.h
+Fl_Adjuster.o: mediumarrow.h slowarrow.h
+Fl_Bitmap.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Bitmap.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Bitmap.o: ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Enumerations.H
+Fl_Bitmap.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_Bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Bitmap.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Bitmap.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Printer.H
+Fl_Bitmap.o: ../FL/Fl_Paged_Device.H ../FL/Fl_PostScript.H flstring.h
+Fl_Bitmap.o: ../config.h
+Fl_Browser.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Browser.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Browser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Group.H
+Fl_Browser.o: ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+Fl_Browser.o: ../FL/Fl_Valuator.H ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H
+Fl_Browser.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Browser.o: ../FL/Fl_Bitmap.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Browser.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Browser.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h ../config.h
Fl_Browser.o: ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H
Fl_Browser.o: ../FL/Fl_Multi_Browser.H ../FL/Fl_Select_Browser.H
-Fl_Browser_.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Browser_.o: ../FL/Enumerations.H ../FL/Fl_Widget.H ../FL/Fl_Browser_.H
-Fl_Browser_.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H
-Fl_Browser_.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
-Fl_Browser_.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Browser_.o: ../FL/Fl_Window.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Browser_.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Browser_.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Browser_.o: ../FL/Fl_RGB_Image.H
-Fl_Browser_load.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Browser_load.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Browser.H
-Fl_Browser_load.o: ../FL/Fl_Browser_.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Browser_load.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-Fl_Browser_load.o: ../FL/Fl_Image.H ../FL/fl_utf8.h
+Fl_Browser_.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Browser_.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Browser_.o: ../FL/Fl_Widget.H ../FL/Fl_Browser_.H ../FL/Fl_Group.H
+Fl_Browser_.o: ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+Fl_Browser_.o: ../FL/Fl_Valuator.H ../FL/fl_draw.H ../FL/x.H
+Fl_Browser_.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Browser_.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Browser_.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Browser_.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Browser_load.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Browser_load.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Browser_load.o: ../FL/abi-version.h ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
+Fl_Browser_load.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H
+Fl_Browser_load.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Image.H
+Fl_Browser_load.o: ../FL/fl_utf8.h
Fl_Box.o: ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Widget.H
-Fl_Box.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Button.o: ../FL/Enumerations.H ../FL/Fl_Button.H ../FL/Fl_Widget.H
-Fl_Button.o: ../FL/Fl_Group.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Button.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Radio_Button.H
-Fl_Button.o: ../FL/Fl_Button.H ../FL/Fl_Toggle_Button.H
-Fl_Chart.o: ../FL/math.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Chart.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Chart.H
-Fl_Chart.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Chart.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Chart.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Chart.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Chart.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Chart.o: flstring.h ../FL/Fl_Export.H ../config.h
+Fl_Box.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/Fl_Export.H
+Fl_Box.o: ../FL/fl_types.h
+Fl_Button.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Button.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Button.o: ../FL/Fl_Button.H ../FL/Fl_Widget.H ../FL/Fl_Group.H
+Fl_Button.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Button.o: ../FL/Fl_Image.H ../FL/Fl_Radio_Button.H ../FL/Fl_Button.H
+Fl_Button.o: ../FL/Fl_Toggle_Button.H
+Fl_Chart.o: ../FL/math.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Chart.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Chart.o: ../FL/abi-version.h ../FL/Fl_Chart.H ../FL/Fl_Widget.H
+Fl_Chart.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Chart.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Chart.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Chart.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Chart.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h ../config.h
Fl_Check_Browser.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/fl_draw.H
-Fl_Check_Browser.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-Fl_Check_Browser.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Check_Browser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Check_Browser.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Check_Browser.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Check_Browser.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Check_Browser.o: ../FL/x.H ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Check_Browser.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+Fl_Check_Browser.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Check_Browser.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_Check_Browser.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Check_Browser.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Check_Browser.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
Fl_Check_Browser.o: ../FL/Fl_Check_Browser.H ../FL/Fl.H ../FL/fl_utf8.h
Fl_Check_Browser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
Fl_Check_Browser.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl.H
-Fl_Check_Button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Check_Button.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Check_Button.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
-Fl_Check_Button.o: ../FL/Fl_Button.H
-Fl_Choice.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Choice.o: ../FL/Enumerations.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
-Fl_Choice.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
-Fl_Choice.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Choice.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
-Fl_Choice.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Choice.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Choice.o: ../FL/Fl_RGB_Image.H flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Clock.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Clock.o: ../FL/Enumerations.H ../FL/Fl_Clock.H ../FL/Fl_Widget.H
-Fl_Clock.o: ../FL/Fl_Round_Clock.H ../FL/Fl_Clock.H ../FL/fl_draw.H ../FL/x.H
-Fl_Clock.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl_Clock.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Clock.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Clock.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Clock.o: ../FL/Fl_RGB_Image.H
-Fl_Color_Chooser.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Color_Chooser.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Color_Chooser.o: ../FL/Fl_Color_Chooser.H ../FL/Fl_Group.H ../FL/Fl_Box.H
-Fl_Color_Chooser.o: ../FL/Fl_Widget.H ../FL/Fl_Return_Button.H
-Fl_Color_Chooser.o: ../FL/Fl_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
-Fl_Color_Chooser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
-Fl_Color_Chooser.o: ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H
-Fl_Color_Chooser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_draw.H
-Fl_Color_Chooser.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Color_Chooser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
-Fl_Color_Chooser.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Check_Button.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Check_Button.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Check_Button.o: ../FL/abi-version.h ../FL/Fl_Check_Button.H
+Fl_Check_Button.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
+Fl_Choice.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Choice.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Choice.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Widget.H
+Fl_Choice.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H
+Fl_Choice.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Choice.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Device.H
+Fl_Choice.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Choice.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Choice.o: flstring.h ../config.h
+Fl_Clock.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Clock.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Clock.o: ../FL/Fl_Clock.H ../FL/Fl_Widget.H ../FL/Fl_Round_Clock.H
+Fl_Clock.o: ../FL/Fl_Clock.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Clock.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Clock.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Clock.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Clock.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Color_Chooser.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Color_Chooser.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Color_Chooser.o: ../FL/abi-version.h ../FL/Fl_Color_Chooser.H
+Fl_Color_Chooser.o: ../FL/Fl_Group.H ../FL/Fl_Box.H ../FL/Fl_Widget.H
+Fl_Color_Chooser.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
+Fl_Color_Chooser.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H
+Fl_Color_Chooser.o: ../FL/Fl_Image.H ../FL/Fl_Value_Input.H
+Fl_Color_Chooser.o: ../FL/Fl_Valuator.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
+Fl_Color_Chooser.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Color_Chooser.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Color_Chooser.o: ../FL/Fl_Bitmap.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_Color_Chooser.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
Fl_Color_Chooser.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/math.h
Fl_Copy_Surface.o: ../FL/Fl_Copy_Surface.H ../FL/Fl_Paged_Device.H
Fl_Copy_Surface.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Enumerations.H
-Fl_Copy_Surface.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
-Fl_Copy_Surface.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Copy_Surface.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
-Fl_Copy_Surface.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Copy_Surface.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Printer.H
-Fl_Copy_Surface.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_PostScript.H
-Fl_Copy_Surface.o: ../FL/Fl.H ../FL/fl_utf8.h
-Fl_Counter.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Counter.o: ../FL/Enumerations.H ../FL/Fl_Counter.H ../FL/Fl_Valuator.H
-Fl_Counter.o: ../FL/Fl_Widget.H ../FL/Fl_Simple_Counter.H ../FL/Fl_Counter.H
-Fl_Counter.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Counter.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Counter.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Counter.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Counter.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Dial.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Dial.o: ../FL/Enumerations.H ../FL/Fl_Dial.H ../FL/Fl_Valuator.H
-Fl_Dial.o: ../FL/Fl_Widget.H ../FL/Fl_Fill_Dial.H ../FL/Fl_Dial.H
-Fl_Dial.o: ../FL/Fl_Line_Dial.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Dial.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Dial.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Dial.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Dial.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Dial.o: ../FL/math.h
-Fl_Device.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Device.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/x.H
-Fl_Device.o: ../FL/Fl_Window.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Device.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Device.o: ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
-Fl_Double_Window.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Double_Window.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Double_Window.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
-Fl_Double_Window.o: ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
-Fl_Double_Window.o: ../FL/Fl_Printer.H ../FL/x.H ../FL/Fl_Paged_Device.H
-Fl_Double_Window.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Double_Window.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Double_Window.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
-Fl_Double_Window.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Double_Window.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/Enumerations.H
-Fl_Double_Window.o: ../FL/Fl_PostScript.H
+Fl_Copy_Surface.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Copy_Surface.o: ../FL/Fl_Window.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_Copy_Surface.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_Copy_Surface.o: ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H
+Fl_Copy_Surface.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Copy_Surface.o: ../FL/Fl_Printer.H ../FL/fl_draw.H ../FL/Enumerations.H
+Fl_Copy_Surface.o: ../FL/Fl_PostScript.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_Copy_Surface.o: ../FL/fl_utf8.h
+Fl_Counter.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Counter.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Counter.o: ../FL/Fl_Counter.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
+Fl_Counter.o: ../FL/Fl_Simple_Counter.H ../FL/Fl_Counter.H ../FL/fl_draw.H
+Fl_Counter.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Counter.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Counter.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Counter.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Counter.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Dial.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Dial.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Dial.o: ../FL/Fl_Dial.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
+Fl_Dial.o: ../FL/Fl_Fill_Dial.H ../FL/Fl_Dial.H ../FL/Fl_Line_Dial.H
+Fl_Dial.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Dial.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Dial.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Dial.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Dial.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/math.h
+Fl_Device.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Device.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Device.o: ../FL/Fl_Device.H ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Plugin.H
+Fl_Device.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Device.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
+Fl_Double_Window.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Double_Window.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Double_Window.o: ../FL/abi-version.h ../FL/Fl_Double_Window.H
+Fl_Double_Window.o: ../FL/Fl_Window.H ../FL/Fl_Overlay_Window.H
+Fl_Double_Window.o: ../FL/Fl_Double_Window.H ../FL/Fl_Printer.H ../FL/x.H
+Fl_Double_Window.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H
+Fl_Double_Window.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Double_Window.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+Fl_Double_Window.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Double_Window.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/fl_draw.H
+Fl_Double_Window.o: ../FL/Enumerations.H ../FL/Fl_PostScript.H
Fl_File_Browser.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H
-Fl_File_Browser.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/fl_utf8.h
-Fl_File_Browser.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
-Fl_File_Browser.o: ../FL/filename.H ../FL/fl_draw.H ../FL/x.H
-Fl_File_Browser.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl_File_Browser.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_File_Browser.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_File_Browser.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_File_Browser.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/filename.H
-Fl_File_Browser.o: flstring.h ../FL/Fl_Export.H ../config.h
-Fl_File_Chooser.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/fl_utf8.h
-Fl_File_Chooser.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_File_Browser.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_File_Browser.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_File_Browser.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/filename.H
+Fl_File_Browser.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_File_Browser.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_File_Browser.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_File_Browser.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_File_Browser.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_File_Browser.o: ../FL/Fl_RGB_Image.H ../FL/filename.H flstring.h
+Fl_File_Browser.o: ../config.h
+Fl_File_Chooser.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_File_Chooser.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_File_Chooser.o: ../FL/Enumerations.H ../FL/abi-version.h
Fl_File_Chooser.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
Fl_File_Chooser.o: ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
Fl_File_Chooser.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
@@ -177,8 +188,9 @@ Fl_File_Chooser.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Window.H
Fl_File_Chooser.o: ../FL/Fl_Bitmap.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_File_Chooser.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
Fl_File_Chooser.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_File_Chooser2.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/fl_utf8.h
-Fl_File_Chooser2.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_File_Chooser2.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_File_Chooser2.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_File_Chooser2.o: ../FL/Enumerations.H ../FL/abi-version.h
Fl_File_Chooser2.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
Fl_File_Chooser2.o: ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
Fl_File_Chooser2.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
@@ -195,148 +207,160 @@ Fl_File_Chooser2.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
Fl_File_Chooser2.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_File_Chooser2.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
Fl_File_Chooser2.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
-Fl_File_Chooser2.o: ../FL/Fl_Export.H ../config.h
+Fl_File_Chooser2.o: ../config.h
Fl_File_Icon.o: ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H ../config.h
Fl_File_Icon.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/fl_utf8.h
Fl_File_Icon.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
-Fl_File_Icon.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_File_Icon.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_File_Icon.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_File_Icon.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_File_Icon.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_File_Icon.o: ../FL/Fl_RGB_Image.H ../FL/filename.H
-Fl_File_Input.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_File_Input.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_File_Input.H
-Fl_File_Input.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Window.H
-Fl_File_Input.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_File_Input.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_File_Icon.o: ../FL/abi-version.h ../FL/Fl_Widget.H ../FL/fl_draw.H
+Fl_File_Icon.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_File_Icon.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_File_Icon.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_File_Icon.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_File_Icon.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_File_Icon.o: ../FL/filename.H
+Fl_File_Input.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_File_Input.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_File_Input.o: ../FL/abi-version.h ../FL/Fl_File_Input.H ../FL/Fl_Input.H
+Fl_File_Input.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_File_Input.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_File_Input.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
Fl_File_Input.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_File_Input.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
Fl_File_Input.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/filename.H
-Fl_File_Input.o: flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Group.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Group.o: ../FL/Enumerations.H ../FL/Fl_Group.H ../FL/Fl_Window.H
-Fl_Group.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_Group.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Group.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Group.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Group.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Input_Choice.H
-Fl_Group.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Menu_Button.H
-Fl_Group.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Spinner.H
-Fl_Group.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H ../FL/Fl_Button.H
-Fl_Help_View.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/fl_utf8.h
-Fl_Help_View.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Help_View.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H
-Fl_Help_View.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
-Fl_Help_View.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Help_View.o: ../FL/Fl_Window.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Help_View.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Help_View.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Help_View.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Shared_Image.H ../FL/filename.H
-Fl_Help_View.o: ../FL/fl_utf8.h ../FL/filename.H flstring.h ../FL/Fl_Export.H
-Fl_Help_View.o: ../config.h
-Fl_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Image.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Image.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Image.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Image.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Image.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Image.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
-Fl_Image.o: flstring.h ../FL/Fl_Export.H ../config.h
+Fl_File_Input.o: flstring.h ../config.h
+Fl_Group.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Group.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Group.o: ../FL/Fl_Group.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Group.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_Group.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Group.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_Group.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_Group.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Input_Choice.H ../FL/Fl_Input.H
+Fl_Group.o: ../FL/Fl_Input_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
+Fl_Group.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Spinner.H ../FL/Fl_Repeat_Button.H
+Fl_Group.o: ../FL/Fl.H ../FL/Fl_Button.H
+Fl_Help_View.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_Help_View.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Help_View.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/Fl_Group.H
+Fl_Help_View.o: ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+Fl_Help_View.o: ../FL/Fl_Valuator.H ../FL/fl_draw.H ../FL/x.H
+Fl_Help_View.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Help_View.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Help_View.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Help_View.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Help_View.o: ../FL/Fl_Shared_Image.H ../FL/filename.H ../FL/fl_utf8.h
+Fl_Help_View.o: ../FL/filename.H flstring.h ../config.h
+Fl_Image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Image.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Image.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Image.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_Image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Image.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Image.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Printer.H
+Fl_Image.o: ../FL/Fl_Paged_Device.H ../FL/Fl_PostScript.H flstring.h
+Fl_Image.o: ../config.h
Fl_Image_Surface.o: ../FL/Fl_Image_Surface.H ../FL/Fl_Copy_Surface.H
Fl_Image_Surface.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H ../FL/x.H
-Fl_Image_Surface.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Image_Surface.o: ../FL/Fl_Window.H ../FL/Fl_Plugin.H
-Fl_Image_Surface.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Image_Surface.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
-Fl_Image_Surface.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Image_Surface.o: ../FL/Fl_Bitmap.H ../FL/Fl_Printer.H ../FL/fl_draw.H
-Fl_Image_Surface.o: ../FL/Enumerations.H ../FL/Fl_PostScript.H ../FL/Fl.H
-Fl_Image_Surface.o: ../FL/fl_utf8.h
-Fl_Input.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Input.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Input.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Input.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_draw.H ../FL/x.H
-Fl_Input.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Device.H
-Fl_Input.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Input.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Input.o: ../FL/fl_ask.H flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Input.o: ../FL/Fl_Float_Input.H ../FL/Fl_Input.H ../FL/Fl_Int_Input.H
-Fl_Input.o: ../FL/Fl_Multiline_Input.H ../FL/Fl_Output.H
+Fl_Image_Surface.o: ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Image_Surface.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+Fl_Image_Surface.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Image_Surface.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+Fl_Image_Surface.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Image_Surface.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Printer.H
+Fl_Image_Surface.o: ../FL/fl_draw.H ../FL/Enumerations.H
+Fl_Image_Surface.o: ../FL/Fl_PostScript.H ../FL/Fl_Shared_Image.H ../FL/Fl.H
+Fl_Image_Surface.o: ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Input.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Input.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Input.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_Input.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Input.H
+Fl_Input.o: ../FL/Fl_Input_.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Input.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Input.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Input.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/fl_ask.H flstring.h
+Fl_Input.o: ../config.h ../FL/Fl_Float_Input.H ../FL/Fl_Input.H
+Fl_Input.o: ../FL/Fl_Int_Input.H ../FL/Fl_Multiline_Input.H ../FL/Fl_Output.H
Fl_Input.o: ../FL/Fl_Multiline_Output.H ../FL/Fl_Output.H
Fl_Input.o: ../FL/Fl_Secret_Input.H
-Fl_Input_.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Input_.o: ../FL/Enumerations.H ../FL/Fl_Input_.H ../FL/Fl_Widget.H
-Fl_Input_.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
-Fl_Input_.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Input_.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Input_.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Input_.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/fl_ask.H
-Fl_Input_.o: ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Light_Button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Light_Button.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Light_Button.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
-Fl_Light_Button.o: ../FL/Fl_Radio_Light_Button.H ../FL/Fl_Light_Button.H
-Fl_Light_Button.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Light_Button.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Light_Button.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Light_Button.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Light_Button.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Light_Button.o: ../FL/Fl_RGB_Image.H flstring.h ../FL/Fl_Export.H
+Fl_Input_.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Input_.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Input_.o: ../FL/Fl_Input_.H ../FL/Fl_Widget.H ../FL/Fl_Window.H
+Fl_Input_.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_Input_.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Input_.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_Input_.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_Input_.o: ../FL/Fl_RGB_Image.H ../FL/fl_ask.H ../FL/fl_utf8.h flstring.h
+Fl_Input_.o: ../config.h
+Fl_Light_Button.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Light_Button.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Light_Button.o: ../FL/abi-version.h ../FL/Fl_Light_Button.H
+Fl_Light_Button.o: ../FL/Fl_Button.H ../FL/Fl_Radio_Light_Button.H
+Fl_Light_Button.o: ../FL/Fl_Light_Button.H ../FL/fl_draw.H ../FL/x.H
+Fl_Light_Button.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Light_Button.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Light_Button.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Light_Button.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Light_Button.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
Fl_Light_Button.o: ../config.h
-Fl_Menu.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Menu.o: ../FL/Enumerations.H ../FL/Fl_Menu_Window.H
-Fl_Menu.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H ../FL/Fl_Menu_.H
-Fl_Menu.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
-Fl_Menu.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl_Menu.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Device.H
-Fl_Menu.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Menu.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Menu.o: flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Menu_.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Menu_.o: ../FL/Enumerations.H ../FL/Fl_Menu_.H ../FL/Fl_Widget.H
-Fl_Menu_.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H flstring.h
-Fl_Menu_.o: ../FL/Fl_Export.H ../config.h
-Fl_Menu_Bar.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Menu_Bar.o: ../FL/Enumerations.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H
-Fl_Menu_Bar.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
-Fl_Menu_Bar.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Menu_Bar.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Menu_Bar.o: ../FL/Fl_Bitmap.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Menu_Bar.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Menu_Bar.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Menu_Button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Menu_Button.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Menu_Button.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Widget.H
-Fl_Menu_Button.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/fl_draw.H
-Fl_Menu_Button.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Menu_Button.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
-Fl_Menu_Button.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Menu_Button.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Menu_Button.o: ../FL/Fl_RGB_Image.H
-Fl_Menu_Window.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Menu_Window.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
-Fl_Menu_Window.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Enumerations.H
-Fl_Menu_Window.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Menu_Window.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Menu_Window.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Menu_Window.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Menu.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Menu.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Menu.o: ../FL/Fl_Menu_Window.H ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
+Fl_Menu.o: ../FL/Fl_Menu_.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
+Fl_Menu.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
+Fl_Menu.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Menu.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_Menu.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_Menu.o: ../FL/Fl_RGB_Image.H flstring.h ../config.h
+Fl_Menu_.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Menu_.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Menu_.o: ../FL/Fl_Menu_.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
+Fl_Menu_.o: ../FL/Fl_Image.H flstring.h ../config.h
+Fl_Menu_Bar.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Menu_Bar.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Menu_Bar.o: ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H ../FL/Fl_Widget.H
+Fl_Menu_Bar.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/fl_draw.H
+Fl_Menu_Bar.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Menu_Bar.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Menu_Bar.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_Menu_Bar.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_Menu_Bar.o: ../FL/Fl_RGB_Image.H
+Fl_Menu_Button.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Menu_Button.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Menu_Button.o: ../FL/abi-version.h ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H
+Fl_Menu_Button.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
+Fl_Menu_Button.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Menu_Button.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Menu_Button.o: ../FL/Fl_Bitmap.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Menu_Button.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Menu_Button.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Menu_Window.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Menu_Window.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Menu_Window.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+Fl_Menu_Window.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Menu_Window.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Menu_Window.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Menu_Window.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Menu_Window.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
Fl_Menu_Window.o: ../FL/Fl_Menu_Window.H ../FL/Fl_Single_Window.H
Fl_Menu_add.o: ../FL/Fl_Menu_.H ../FL/Fl_Widget.H ../FL/Enumerations.H
-Fl_Menu_add.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Menu_Item.H
-Fl_Menu_add.o: ../FL/Fl_Image.H flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Menu_global.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Menu_global.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Menu_.H
-Fl_Menu_global.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
-Fl_Multi_Label.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Multi_Label.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Widget.H
-Fl_Multi_Label.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
-Fl_Multi_Label.o: ../FL/Fl_Multi_Label.H
+Fl_Menu_add.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Menu_add.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H flstring.h
+Fl_Menu_add.o: ../FL/Fl_Export.H ../config.h
+Fl_Menu_global.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Menu_global.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Menu_global.o: ../FL/abi-version.h ../FL/Fl_Menu_.H ../FL/Fl_Widget.H
+Fl_Menu_global.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
+Fl_Multi_Label.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Multi_Label.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Multi_Label.o: ../FL/abi-version.h ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
+Fl_Multi_Label.o: ../FL/Fl_Widget.H ../FL/Fl_Image.H ../FL/Fl_Multi_Label.H
Fl_Native_File_Chooser.o: Fl_Native_File_Chooser_FLTK.cxx ../config.h
Fl_Native_File_Chooser.o: ../FL/Fl_Native_File_Chooser.H
-Fl_Native_File_Chooser.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/fl_utf8.h
-Fl_Native_File_Chooser.o: ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Native_File_Chooser.o: ../FL/Enumerations.H ../FL/Fl_Double_Window.H
+Fl_Native_File_Chooser.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H
+Fl_Native_File_Chooser.o: ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Native_File_Chooser.o: ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Native_File_Chooser.o: ../FL/abi-version.h ../FL/Fl_Double_Window.H
Fl_Native_File_Chooser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H
Fl_Native_File_Chooser.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
Fl_Native_File_Chooser.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
@@ -353,51 +377,53 @@ Fl_Native_File_Chooser.o: ../FL/fl_ask.H ../FL/Fl_File_Icon.H
Fl_Native_File_Chooser.o: Fl_Native_File_Chooser_common.cxx
Fl_Native_File_Chooser.o: ../FL/Enumerations.H Fl_Native_File_Chooser_GTK.cxx
Fl_Native_File_Chooser.o: ../FL/x.H
-Fl_Overlay_Window.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Overlay_Window.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Overlay_Window.o: ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
-Fl_Overlay_Window.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H
-Fl_Overlay_Window.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Overlay_Window.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Overlay_Window.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Overlay_Window.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Overlay_Window.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Overlay_Window.o: ../FL/abi-version.h ../FL/Fl_Overlay_Window.H
+Fl_Overlay_Window.o: ../FL/Fl_Double_Window.H ../FL/fl_draw.H ../FL/x.H
+Fl_Overlay_Window.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Overlay_Window.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Overlay_Window.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_Overlay_Window.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H
Fl_Overlay_Window.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Pack.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Pack.o: ../FL/Enumerations.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
-Fl_Pack.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Pack.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Pack.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Pack.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Pack.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Pack.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Pack.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Pack.o: ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/fl_draw.H ../FL/x.H
+Fl_Pack.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Pack.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Pack.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Pack.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Pack.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
Fl_Paged_Device.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H ../FL/x.H
-Fl_Paged_Device.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Paged_Device.o: ../FL/Fl_Window.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Paged_Device.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Paged_Device.o: ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H
-Fl_Paged_Device.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_Paged_Device.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/fl_draw.H
-Fl_Paged_Device.o: ../FL/Enumerations.H
-Fl_Pixmap.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Pixmap.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Paged_Device.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/Fl_Export.H
+Fl_Paged_Device.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Fl_Plugin.H
+Fl_Paged_Device.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Paged_Device.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
+Fl_Paged_Device.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_Paged_Device.o: ../FL/Fl_Bitmap.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_Paged_Device.o: ../FL/fl_utf8.h ../FL/fl_draw.H ../FL/Enumerations.H
+Fl_Pixmap.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Pixmap.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Pixmap.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
Fl_Pixmap.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
Fl_Pixmap.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
Fl_Pixmap.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
Fl_Pixmap.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
Fl_Pixmap.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
Fl_Pixmap.o: ../FL/Fl_Printer.H ../FL/Fl_Paged_Device.H ../FL/Fl_PostScript.H
-Fl_Pixmap.o: flstring.h ../FL/Fl_Export.H ../config.h
+Fl_Pixmap.o: flstring.h
Fl_PostScript.o: ../FL/Fl_Printer.H ../FL/x.H ../FL/Enumerations.H
-Fl_PostScript.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
-Fl_PostScript.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_PostScript.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_PostScript.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
-Fl_PostScript.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_PostScript.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/Enumerations.H
-Fl_PostScript.o: ../FL/Fl_PostScript.H ../config.h ../FL/Fl.H ../FL/fl_utf8.h
-Fl_PostScript.o: ../FL/fl_ask.H ../FL/Fl_Native_File_Chooser.H
-Fl_PostScript.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Double_Window.H
-Fl_PostScript.o: ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
-Fl_PostScript.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Menu_Button.H
+Fl_PostScript.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_PostScript.o: ../FL/Fl_Window.H ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H
+Fl_PostScript.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_PostScript.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+Fl_PostScript.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_PostScript.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/fl_draw.H
+Fl_PostScript.o: ../FL/Enumerations.H ../FL/Fl_PostScript.H ../config.h
+Fl_PostScript.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/fl_ask.H
+Fl_PostScript.o: ../FL/Fl_Native_File_Chooser.H ../FL/Fl_File_Chooser.H
+Fl_PostScript.o: ../FL/Fl_Double_Window.H ../FL/Fl_Group.H ../FL/Fl_Choice.H
+Fl_PostScript.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Menu_Button.H
Fl_PostScript.o: ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H
Fl_PostScript.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H
Fl_PostScript.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H
@@ -407,106 +433,116 @@ Fl_PostScript.o: ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
Fl_PostScript.o: ../FL/Fl_Return_Button.H Fl_Font.H print_panel.cxx
Fl_PostScript.o: print_panel.h ../FL/Fl_Round_Button.H ../FL/Fl_Spinner.H
Fl_PostScript.o: ../FL/Fl_Repeat_Button.H ../FL/Fl_Progress.H
-Fl_PostScript.o: ../src/flstring.h ../FL/Fl_Export.H ../FL/Fl_Int_Input.H
-Fl_PostScript.o: ../FL/Fl_Input.H
-Fl_Positioner.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Positioner.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Positioner.H
-Fl_Positioner.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H
-Fl_Positioner.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl_Positioner.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Positioner.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Positioner.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Positioner.o: ../FL/Fl_RGB_Image.H
-Fl_Preferences.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Preferences.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Preferences.o: ../FL/Fl_Preferences.H ../FL/Fl_Plugin.H
-Fl_Preferences.o: ../FL/Fl_Preferences.H ../FL/filename.H ../FL/fl_utf8.h
-Fl_Preferences.o: flstring.h ../FL/Fl_Export.H ../config.h
+Fl_PostScript.o: ../src/flstring.h ../FL/Fl_Int_Input.H ../FL/Fl_Input.H
+Fl_Positioner.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Positioner.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Positioner.o: ../FL/abi-version.h ../FL/Fl_Positioner.H ../FL/Fl_Widget.H
+Fl_Positioner.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Positioner.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Positioner.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Positioner.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Positioner.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Preferences.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Preferences.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Preferences.o: ../FL/abi-version.h ../FL/Fl_Preferences.H
+Fl_Preferences.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/filename.H
+Fl_Preferences.o: ../FL/fl_utf8.h flstring.h ../config.h
Fl_Printer.o: ../FL/Fl_Printer.H ../FL/x.H ../FL/Enumerations.H
-Fl_Printer.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
-Fl_Printer.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Printer.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Printer.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
-Fl_Printer.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Printer.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/Enumerations.H
-Fl_Printer.o: ../FL/Fl_PostScript.H
-Fl_Progress.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Progress.o: ../FL/Enumerations.H ../FL/Fl_Progress.H ../FL/Fl_Widget.H
-Fl_Progress.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Progress.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Progress.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Progress.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Progress.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Repeat_Button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Repeat_Button.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Repeat_Button.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H ../FL/Fl_Button.H
-Fl_Return_Button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Return_Button.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Return_Button.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
-Fl_Return_Button.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Return_Button.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Return_Button.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Return_Button.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Printer.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Printer.o: ../FL/Fl_Window.H ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H
+Fl_Printer.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Printer.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+Fl_Printer.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Printer.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/fl_draw.H
+Fl_Printer.o: ../FL/Enumerations.H ../FL/Fl_PostScript.H
+Fl_Progress.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Progress.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Progress.o: ../FL/Fl_Progress.H ../FL/Fl_Widget.H ../FL/fl_draw.H
+Fl_Progress.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Progress.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Progress.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Progress.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Progress.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Repeat_Button.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Repeat_Button.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Repeat_Button.o: ../FL/abi-version.h ../FL/Fl_Repeat_Button.H ../FL/Fl.H
+Fl_Repeat_Button.o: ../FL/Fl_Button.H
+Fl_Return_Button.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Return_Button.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Return_Button.o: ../FL/abi-version.h ../FL/Fl_Return_Button.H
+Fl_Return_Button.o: ../FL/Fl_Button.H ../FL/fl_draw.H ../FL/x.H
+Fl_Return_Button.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Return_Button.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Return_Button.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_Return_Button.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
Fl_Return_Button.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Roller.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Roller.o: ../FL/Enumerations.H ../FL/Fl_Roller.H ../FL/Fl_Valuator.H
-Fl_Roller.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Roller.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Roller.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Roller.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Roller.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Round_Button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Round_Button.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Round_Button.o: ../FL/Fl_Round_Button.H ../FL/Fl_Light_Button.H
-Fl_Round_Button.o: ../FL/Fl_Button.H ../FL/Fl_Radio_Round_Button.H
-Fl_Round_Button.o: ../FL/Fl_Round_Button.H
-Fl_Scroll.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Scroll.o: ../FL/Enumerations.H ../FL/Fl_Tiled_Image.H ../FL/Fl_Image.H
-Fl_Scroll.o: ../FL/Fl_Scroll.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Scroll.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-Fl_Scroll.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Scroll.o: ../FL/Fl_Window.H ../FL/Fl_Bitmap.H ../FL/Fl_Device.H
-Fl_Scroll.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Scroll.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Scrollbar.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Scrollbar.o: ../FL/Enumerations.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+Fl_Roller.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Roller.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Roller.o: ../FL/Fl_Roller.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
+Fl_Roller.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Roller.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Roller.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Roller.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Roller.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Round_Button.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Round_Button.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Round_Button.o: ../FL/abi-version.h ../FL/Fl_Round_Button.H
+Fl_Round_Button.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
+Fl_Round_Button.o: ../FL/Fl_Radio_Round_Button.H ../FL/Fl_Round_Button.H
+Fl_Scroll.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Scroll.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Scroll.o: ../FL/Fl_Tiled_Image.H ../FL/Fl_Image.H ../FL/Fl_Scroll.H
+Fl_Scroll.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H
+Fl_Scroll.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H ../FL/x.H
+Fl_Scroll.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Scroll.o: ../FL/Fl_Bitmap.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Scroll.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Scroll.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Scrollbar.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Scrollbar.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Scrollbar.o: ../FL/abi-version.h ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
Fl_Scrollbar.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Scrollbar.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
Fl_Scrollbar.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
Fl_Scrollbar.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_Scrollbar.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Scrollbar.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
-Fl_Scrollbar.o: ../FL/Fl_Export.H ../config.h
+Fl_Scrollbar.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h ../config.h
Fl_Shared_Image.o: ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H ../config.h
Fl_Shared_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Shared_Image.o: ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Shared_Image.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
Fl_Shared_Image.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
Fl_Shared_Image.o: ../FL/Fl_XBM_Image.H ../FL/Fl_Bitmap.H
Fl_Shared_Image.o: ../FL/Fl_XPM_Image.H ../FL/Fl_Pixmap.H
+Fl_Shared_Image.o: ../FL/Fl_Preferences.H ../FL/fl_draw.H ../FL/x.H
+Fl_Shared_Image.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Shared_Image.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Device.H
+Fl_Shared_Image.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Shared_Image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
Fl_Single_Window.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
-Fl_Slider.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Slider.o: ../FL/Enumerations.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-Fl_Slider.o: ../FL/Fl_Widget.H ../FL/Fl_Fill_Slider.H ../FL/Fl_Slider.H
-Fl_Slider.o: ../FL/Fl_Hor_Slider.H ../FL/Fl_Hor_Fill_Slider.H
-Fl_Slider.o: ../FL/Fl_Hor_Nice_Slider.H ../FL/Fl_Nice_Slider.H
-Fl_Slider.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Slider.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
-Fl_Slider.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Slider.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Slider.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
-Fl_Slider.o: ../FL/Fl_Export.H ../config.h
-Fl_Table.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-Fl_Table.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Table.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Table.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Table.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Table.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Table.o: ../FL/Fl_Table.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Group.H
+Fl_Slider.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Slider.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Slider.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
+Fl_Slider.o: ../FL/Fl_Fill_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Hor_Slider.H
+Fl_Slider.o: ../FL/Fl_Hor_Fill_Slider.H ../FL/Fl_Hor_Nice_Slider.H
+Fl_Slider.o: ../FL/Fl_Nice_Slider.H ../FL/fl_draw.H ../FL/x.H
+Fl_Slider.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Slider.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_Slider.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_Slider.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_Slider.o: ../FL/Fl_RGB_Image.H flstring.h ../config.h
+Fl_Table.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
+Fl_Table.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Table.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Table.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Table.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Table.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Table.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Table.H
+Fl_Table.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Group.H
Fl_Table.o: ../FL/Fl_Scroll.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
Fl_Table.o: ../FL/Fl_Valuator.H ../FL/Fl_Box.H ../FL/Fl_Scrollbar.H
-Fl_Table_Row.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Table_Row.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
+Fl_Table_Row.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Table_Row.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Table_Row.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
Fl_Table_Row.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
Fl_Table_Row.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
Fl_Table_Row.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
@@ -515,21 +551,21 @@ Fl_Table_Row.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Table_Row.H
Fl_Table_Row.o: ../FL/Fl_Table.H ../FL/Fl_Group.H ../FL/Fl_Scroll.H
Fl_Table_Row.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
Fl_Table_Row.o: ../FL/Fl_Box.H ../FL/Fl_Scrollbar.H
-Fl_Tabs.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Tabs.o: ../FL/Enumerations.H ../FL/Fl_Tabs.H ../FL/Fl_Group.H
-Fl_Tabs.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Tabs.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
-Fl_Tabs.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Tabs.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Tabs.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Tooltip.H
-Fl_Tabs.o: ../FL/Fl_Widget.H
+Fl_Tabs.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Tabs.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Tabs.o: ../FL/Fl_Tabs.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/fl_draw.H
+Fl_Tabs.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Tabs.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Tabs.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Tabs.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Tabs.o: ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
Fl_Text_Buffer.o: ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H ../config.h
Fl_Text_Buffer.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Text_Buffer.o: ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Text_Buffer.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
Fl_Text_Buffer.o: ../FL/Fl_Text_Buffer.H ../FL/fl_ask.H
Fl_Text_Display.o: ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H ../config.h
Fl_Text_Display.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Text_Display.o: ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Text_Display.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
Fl_Text_Display.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H
Fl_Text_Display.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
Fl_Text_Display.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
@@ -538,55 +574,55 @@ Fl_Text_Display.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
Fl_Text_Display.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
Fl_Text_Display.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Scrollbar.H
Fl_Text_Display.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-Fl_Text_Display.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Printer.H
-Fl_Text_Display.o: ../FL/Fl_Paged_Device.H ../FL/fl_draw.H
-Fl_Text_Display.o: ../FL/Fl_PostScript.H
+Fl_Text_Display.o: ../FL/Fl_Text_Buffer.H
Fl_Text_Editor.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/Fl.H
Fl_Text_Editor.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Text_Editor.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Text_Editor.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Text_Editor.o: ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H
-Fl_Text_Editor.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Text_Editor.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Text_Editor.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Text_Editor.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Scrollbar.H
-Fl_Text_Editor.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
+Fl_Text_Editor.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/Fl_Window.H
+Fl_Text_Editor.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Text_Editor.o: ../FL/Fl_Image.H ../FL/Fl_Text_Editor.H
+Fl_Text_Editor.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/x.H
+Fl_Text_Editor.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Device.H
+Fl_Text_Editor.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Text_Editor.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Text_Editor.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
Fl_Text_Editor.o: ../FL/Fl_Text_Buffer.H ../FL/fl_ask.H
-Fl_Tile.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Tile.o: ../FL/Enumerations.H ../FL/Fl_Tile.H ../FL/Fl_Group.H
-Fl_Tile.o: ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
-Fl_Tile.o: ../FL/Fl_Image.H
-Fl_Tiled_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Tiled_Image.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Tiled_Image.o: ../FL/Fl_Tiled_Image.H ../FL/Fl_Image.H ../FL/Fl_Window.H
-Fl_Tiled_Image.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_Tiled_Image.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Tiled_Image.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Tiled_Image.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Tiled_Image.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Tree.o: ../FL/Fl_Tree.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Tree.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Group.H
-Fl_Tree.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-Fl_Tree.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Tree.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Tree.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Tree.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Tree.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Tree.o: ../FL/Fl_Tree_Item.H ../FL/Fl_Widget.H ../FL/Fl_Tree_Item_Array.H
-Fl_Tree.o: ../FL/Fl_Tree_Prefs.H ../FL/Fl_Preferences.H
+Fl_Tile.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Tile.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Tile.o: ../FL/Fl_Tile.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_Tile.o: ../FL/Fl_Window.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_Tiled_Image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Tiled_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Tiled_Image.o: ../FL/abi-version.h ../FL/Fl_Tiled_Image.H ../FL/Fl_Image.H
+Fl_Tiled_Image.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_Tiled_Image.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/x.H
+Fl_Tiled_Image.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Device.H
+Fl_Tiled_Image.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Tiled_Image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Tree.o: ../FL/Fl_Tree.H ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Tree.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Tree.o: ../FL/abi-version.h ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
+Fl_Tree.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
+Fl_Tree.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Tree.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Tree.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Tree.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Tree.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Tree_Item.H
+Fl_Tree.o: ../FL/Fl_Widget.H ../FL/Fl_Tree_Item_Array.H ../FL/Fl_Tree_Prefs.H
+Fl_Tree.o: ../FL/Fl_Preferences.H
Fl_Tree_Item.o: ../FL/Fl_Widget.H ../FL/Fl_Tree_Item.H ../FL/Fl.H
-Fl_Tree_Item.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Tree_Item.o: ../FL/Enumerations.H ../FL/Fl_Image.H ../FL/fl_draw.H
-Fl_Tree_Item.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Tree_Item.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Tree_Item.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Tree_Item.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Bitmap.H
-Fl_Tree_Item.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Tree_Item.o: ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Tree_Item.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Tree_Item.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Tree_Item.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Tree_Item.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_Tree_Item.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_Tree_Item.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
Fl_Tree_Item.o: ../FL/Fl_Tree_Item_Array.H ../FL/Fl_Tree_Prefs.H
Fl_Tree_Item.o: ../FL/Fl_Tree.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
Fl_Tree_Item.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-Fl_Tree_Item_Array.o: ../FL/Fl_Tree_Item_Array.H ../FL/Fl.H ../FL/fl_utf8.h
-Fl_Tree_Item_Array.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Tree_Item_Array.o: ../FL/Fl_Tree_Item_Array.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_Tree_Item_Array.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Tree_Item_Array.o: ../FL/Enumerations.H ../FL/abi-version.h
Fl_Tree_Item_Array.o: ../FL/Fl_Tree_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
Fl_Tree_Item_Array.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
Fl_Tree_Item_Array.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
@@ -595,137 +631,152 @@ Fl_Tree_Item_Array.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
Fl_Tree_Item_Array.o: ../FL/Fl_Preferences.H ../FL/Fl_Bitmap.H
Fl_Tree_Item_Array.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
Fl_Tree_Item_Array.o: ../FL/Fl_Tree_Prefs.H
-Fl_Tree_Prefs.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Tree_Prefs.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Pixmap.H
-Fl_Tree_Prefs.o: ../FL/Fl_Image.H ../FL/Fl_Tree_Prefs.H
-Fl_Tooltip.o: ../FL/Fl_Tooltip.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Tooltip.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Widget.H
-Fl_Tooltip.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Tooltip.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Tooltip.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Tooltip.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Tooltip.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Tooltip.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Menu_Window.H
+Fl_Tree_Prefs.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Tree_Prefs.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Tree_Prefs.o: ../FL/abi-version.h ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+Fl_Tree_Prefs.o: ../FL/Fl_Tree_Prefs.H
+Fl_Tooltip.o: ../FL/Fl_Tooltip.H ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Tooltip.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Tooltip.o: ../FL/abi-version.h ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H
+Fl_Tooltip.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Tooltip.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Tooltip.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Tooltip.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Tooltip.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Menu_Window.H
Fl_Tooltip.o: ../FL/Fl_Single_Window.H
-Fl_Valuator.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Valuator.o: ../FL/Enumerations.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
-Fl_Valuator.o: ../FL/math.h flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Value_Input.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Value_Input.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Value_Input.o: ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H
-Fl_Value_Input.o: ../FL/Fl_Widget.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
-Fl_Value_Input.o: ../FL/Fl_Group.H ../FL/math.h
-Fl_Value_Output.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Value_Output.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Value_Output.o: ../FL/Fl_Value_Output.H ../FL/Fl_Valuator.H
-Fl_Value_Output.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H
-Fl_Value_Output.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl_Value_Output.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Value_Output.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Value_Output.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Value_Output.o: ../FL/Fl_RGB_Image.H
-Fl_Value_Slider.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Value_Slider.o: ../FL/fl_types.h ../FL/Enumerations.H
-Fl_Value_Slider.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H
-Fl_Value_Slider.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
+Fl_Valuator.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Valuator.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Valuator.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/math.h flstring.h
+Fl_Valuator.o: ../config.h
+Fl_Value_Input.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Value_Input.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Value_Input.o: ../FL/abi-version.h ../FL/Fl_Value_Input.H
+Fl_Value_Input.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/Fl_Input.H
+Fl_Value_Input.o: ../FL/Fl_Input_.H ../FL/Fl_Group.H ../FL/math.h
+Fl_Value_Output.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Value_Output.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Value_Output.o: ../FL/abi-version.h ../FL/Fl_Value_Output.H
+Fl_Value_Output.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/fl_draw.H
+Fl_Value_Output.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Value_Output.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+Fl_Value_Output.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Value_Output.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Value_Output.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Value_Slider.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Value_Slider.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Value_Slider.o: ../FL/abi-version.h ../FL/Fl_Value_Slider.H
+Fl_Value_Slider.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
Fl_Value_Slider.o: ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H
Fl_Value_Slider.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
Fl_Value_Slider.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
Fl_Value_Slider.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
Fl_Value_Slider.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
Fl_Value_Slider.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Widget.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Widget.o: ../FL/Enumerations.H ../FL/Fl_Widget.H ../FL/Fl_Group.H
-Fl_Widget.o: ../FL/Fl_Tooltip.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Widget.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_Widget.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-Fl_Widget.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_Widget.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_Widget.o: ../FL/Fl_RGB_Image.H flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Window.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Window.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
-Fl_Window.o: ../FL/Fl_Window.H ../FL/Fl_RGB_Image.H ../FL/Fl_Image.H
-Fl_Window.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Window.o: ../FL/Fl_Bitmap.H flstring.h ../FL/Fl_Export.H
-Fl_Window_fullscreen.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Window_fullscreen.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
+Fl_Widget.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_Widget.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Widget.o: ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Tooltip.H
+Fl_Widget.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+Fl_Widget.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_Widget.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+Fl_Widget.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Widget.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_Widget.o: flstring.h ../config.h
+Fl_Window.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Window.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Window.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+Fl_Window.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Image.H ../FL/Fl_Window.H
+Fl_Window.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H flstring.h
+Fl_Window_fullscreen.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Window_fullscreen.o: ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Window_fullscreen.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/x.H
Fl_Window_fullscreen.o: ../FL/Fl_Window.H ../config.h
-Fl_Window_hotspot.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Window_hotspot.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Window.H
-Fl_Window_hotspot.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_Window_hotspot.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Window_iconize.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-Fl_Window_iconize.o: ../FL/fl_types.h ../FL/Fl_Window.H
-Fl_Window_shape.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Window_shape.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-Fl_Window_shape.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_Window_shape.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_Window_shape.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_Window_shape.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_Window_shape.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_Window_shape.o: ../config.h
+Fl_Window_hotspot.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Window_hotspot.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Window_hotspot.o: ../FL/abi-version.h ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_Window_hotspot.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_Window_hotspot.o: ../FL/x.H ../FL/Fl_Window.H
+Fl_Window_iconize.o: ../FL/x.H ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Window_iconize.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+Fl_Window_shape.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Window_shape.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Window_shape.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+Fl_Window_shape.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_Window_shape.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Window_shape.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_Window_shape.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_Window_shape.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../config.h
Fl_Wizard.o: ../FL/Fl_Wizard.H ../FL/Fl_Group.H ../FL/Fl_Window.H
Fl_Wizard.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Enumerations.H
-Fl_Wizard.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Bitmap.H
-Fl_Wizard.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Wizard.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-Fl_Wizard.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-Fl_Wizard.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_XBM_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_XBM_Image.o: ../FL/Enumerations.H ../FL/Fl_XBM_Image.H ../FL/Fl_Bitmap.H
-Fl_XBM_Image.o: ../FL/Fl_Image.H ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H
-Fl_XBM_Image.o: ../config.h
-Fl_XPM_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_XPM_Image.o: ../FL/Enumerations.H ../FL/Fl_XPM_Image.H ../FL/Fl_Pixmap.H
-Fl_XPM_Image.o: ../FL/Fl_Image.H ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H
-Fl_XPM_Image.o: ../config.h
-Fl_abort.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_abort.o: ../FL/Enumerations.H flstring.h ../FL/Fl_Export.H ../config.h
-Fl_add_idle.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_add_idle.o: ../FL/Enumerations.H
-Fl_arg.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_arg.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Window.H
-Fl_arg.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_arg.o: ../FL/Fl_Image.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
-Fl_arg.o: ../FL/filename.H ../FL/fl_draw.H ../FL/Enumerations.H
-Fl_arg.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_arg.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_arg.o: ../FL/Fl_RGB_Image.H flstring.h ../FL/Fl_Export.H ../config.h
-Fl_compose.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_compose.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
-Fl_display.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_display.o: ../FL/Enumerations.H flstring.h ../FL/Fl_Export.H ../config.h
-Fl_get_key.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_get_key.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
-Fl_get_system_colors.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_get_system_colors.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-Fl_get_system_colors.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-Fl_get_system_colors.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_get_system_colors.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-Fl_get_system_colors.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_get_system_colors.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_Wizard.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Wizard.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/x.H
+Fl_Wizard.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Device.H
+Fl_Wizard.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_Wizard.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+Fl_XBM_Image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_XBM_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_XBM_Image.o: ../FL/abi-version.h ../FL/Fl_XBM_Image.H ../FL/Fl_Bitmap.H
+Fl_XBM_Image.o: ../FL/Fl_Image.H ../FL/fl_utf8.h flstring.h ../config.h
+Fl_XPM_Image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_XPM_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_XPM_Image.o: ../FL/abi-version.h ../FL/Fl_XPM_Image.H ../FL/Fl_Pixmap.H
+Fl_XPM_Image.o: ../FL/Fl_Image.H ../FL/fl_utf8.h flstring.h ../config.h
+Fl_abort.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_abort.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_abort.o: flstring.h ../config.h
+Fl_add_idle.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_add_idle.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_arg.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_arg.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h ../FL/x.H
+Fl_arg.o: ../FL/Fl_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+Fl_arg.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_arg.o: ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H ../FL/filename.H
+Fl_arg.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Device.H
+Fl_arg.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_arg.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
+Fl_arg.o: ../config.h
+Fl_compose.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_compose.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_compose.o: ../FL/x.H ../FL/Fl_Window.H
+Fl_display.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_display.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_display.o: flstring.h ../config.h
+Fl_get_key.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_get_key.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_get_key.o: ../FL/x.H ../FL/Fl_Window.H
+Fl_get_system_colors.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_get_system_colors.o: ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_get_system_colors.o: ../FL/Enumerations.H ../FL/abi-version.h
+Fl_get_system_colors.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+Fl_get_system_colors.o: ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_get_system_colors.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_get_system_colors.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_get_system_colors.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+Fl_get_system_colors.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
Fl_get_system_colors.o: ../FL/Fl_RGB_Image.H ../FL/math.h ../FL/fl_utf8.h
-Fl_get_system_colors.o: flstring.h ../FL/Fl_Export.H ../config.h
-Fl_get_system_colors.o: ../FL/Fl_Tiled_Image.H tile.xpm
-Fl_grab.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_grab.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
-Fl_lock.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_lock.o: ../FL/Enumerations.H ../config.h
-Fl_own_colormap.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_own_colormap.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
-Fl_own_colormap.o: ../FL/Fl_Window.H
-Fl_visual.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_visual.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
-Fl_visual.o: ../FL/Fl_Window.H
-Fl_x.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_x.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
-Fl_x.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-Fl_x.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/fl_utf8.h ../FL/Fl_Tooltip.H
-Fl_x.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/Enumerations.H
-Fl_x.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-Fl_x.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-Fl_x.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Paged_Device.H ../FL/Fl_Shared_Image.H
-Fl_x.o: ../FL/fl_ask.H ../FL/filename.H flstring.h ../FL/Fl_Export.H Xutf8.h
+Fl_get_system_colors.o: flstring.h ../config.h ../FL/Fl_Tiled_Image.H
+Fl_get_system_colors.o: tile.xpm
+Fl_grab.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_grab.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_grab.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+Fl_lock.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+Fl_lock.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+Fl_lock.o: ../config.h
+Fl_own_colormap.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_own_colormap.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_own_colormap.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+Fl_visual.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_visual.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_visual.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+Fl_x.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_x.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_x.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Window.H
+Fl_x.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+Fl_x.o: ../FL/fl_utf8.h ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H ../FL/fl_draw.H
+Fl_x.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+Fl_x.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+Fl_x.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Paged_Device.H
+Fl_x.o: ../FL/Fl_Shared_Image.H ../FL/fl_ask.H ../FL/filename.H flstring.h
+Fl_x.o: Xutf8.h
filename_absolute.o: ../FL/filename.H ../FL/fl_utf8.h flstring.h
filename_absolute.o: ../FL/Fl_Export.H ../config.h
filename_expand.o: ../FL/filename.H ../FL/fl_utf8.h flstring.h
@@ -737,107 +788,114 @@ filename_list.o: ../FL/filename.H ../FL/fl_utf8.h flstring.h
filename_list.o: ../FL/Fl_Export.H ../config.h
filename_match.o: ../FL/filename.H
filename_setext.o: ../FL/filename.H flstring.h ../FL/Fl_Export.H ../config.h
-fl_arc.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-fl_arc.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_arc.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_arc.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_arc.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_arc.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_arc.o: ../FL/math.h
-fl_arci.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-fl_arci.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_arci.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_arci.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_arci.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_arci.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_arci.o: ../config.h
+fl_arc.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/abi-version.h
+fl_arc.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+fl_arc.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_arc.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_arc.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_arc.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_arc.o: ../FL/Fl_RGB_Image.H ../FL/math.h
+fl_arci.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/abi-version.h
+fl_arci.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+fl_arci.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_arci.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_arci.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_arci.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_arci.o: ../FL/Fl_RGB_Image.H ../config.h
fl_ask.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/Fl.H ../FL/fl_utf8.h
fl_ask.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
-fl_ask.o: ../FL/fl_ask.H ../FL/Fl_Box.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
-fl_ask.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/Fl_Window.H
-fl_ask.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_ask.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Secret_Input.H
-fl_ask.o: ../FL/Fl_Input.H ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H
-fl_ask.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_ask.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-fl_ask.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_boxtype.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_boxtype.o: ../FL/Enumerations.H ../FL/Fl_Widget.H ../FL/fl_draw.H
-fl_boxtype.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_boxtype.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_boxtype.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_boxtype.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_boxtype.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_boxtype.o: ../config.h
-fl_color.o: Fl_XColor.H ../config.h ../FL/Enumerations.H ../FL/Fl_Export.H
-fl_color.o: ../FL/fl_types.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Enumerations.H
+fl_ask.o: ../FL/abi-version.h ../FL/fl_ask.H ../FL/Fl_Box.H ../FL/Fl_Widget.H
+fl_ask.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
+fl_ask.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Bitmap.H
+fl_ask.o: ../FL/Fl_Image.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
+fl_ask.o: ../FL/Fl_Secret_Input.H ../FL/Fl_Input.H ../FL/x.H
+fl_ask.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Enumerations.H
+fl_ask.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_ask.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_ask.o: ../FL/Fl_RGB_Image.H
+fl_boxtype.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_boxtype.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_boxtype.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+fl_boxtype.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_boxtype.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_boxtype.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_boxtype.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_boxtype.o: ../FL/Fl_RGB_Image.H ../config.h
+fl_color.o: Fl_XColor.H ../config.h ../FL/Enumerations.H ../FL/Fl.H
+fl_color.o: ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_color.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
fl_color.o: ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_Window.H
fl_color.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
fl_color.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
fl_color.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
fl_color.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H fl_cmap.h
-fl_cursor.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_cursor.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_cursor.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_cursor.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/x.H
-fl_cursor.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Enumerations.H
-fl_cursor.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-fl_cursor.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H fl_cursor_wait.xpm
-fl_cursor.o: fl_cursor_help.xpm fl_cursor_nwse.xpm fl_cursor_nesw.xpm
-fl_cursor.o: fl_cursor_none.xpm
-fl_curve.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-fl_curve.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_curve.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_curve.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_curve.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_curve.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_diamond_box.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_diamond_box.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-fl_diamond_box.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_diamond_box.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_diamond_box.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_diamond_box.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_diamond_box.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_dnd.o: fl_dnd_x.cxx ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_dnd.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Window.H
-fl_dnd.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-fl_dnd.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H flstring.h
-fl_dnd.o: ../FL/Fl_Export.H ../config.h
-fl_draw.o: ../FL/fl_utf8.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_draw.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
-fl_draw.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-fl_draw.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-fl_draw.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_draw.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-fl_draw.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
-fl_draw.o: ../FL/Fl_Export.H ../config.h
-fl_draw_image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_draw_image.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-fl_draw_image.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_draw_image.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_draw_image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_draw_image.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_draw_image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_draw_image.o: Fl_XColor.H ../config.h flstring.h ../FL/Fl_Export.H
-fl_draw_pixmap.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_draw_pixmap.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-fl_draw_pixmap.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_draw_pixmap.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_draw_pixmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_draw_pixmap.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_draw_pixmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_draw_pixmap.o: flstring.h ../FL/Fl_Export.H ../config.h
+fl_cursor.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_cursor.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_cursor.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+fl_cursor.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Pixmap.H
+fl_cursor.o: ../FL/Fl_RGB_Image.H ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H
+fl_cursor.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_cursor.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_cursor.o: fl_cursor_wait.xpm fl_cursor_help.xpm fl_cursor_nwse.xpm
+fl_cursor.o: fl_cursor_nesw.xpm fl_cursor_none.xpm
+fl_curve.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
+fl_curve.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+fl_curve.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_curve.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_curve.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_curve.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_curve.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_diamond_box.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_diamond_box.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_diamond_box.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+fl_diamond_box.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_diamond_box.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_diamond_box.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_diamond_box.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_diamond_box.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_dnd.o: fl_dnd_x.cxx ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_dnd.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_dnd.o: ../FL/abi-version.h ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_dnd.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H
+fl_dnd.o: ../FL/Fl_Window.H flstring.h ../config.h
+fl_draw.o: ../FL/fl_utf8.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_draw.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_draw.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+fl_draw.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_draw.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_draw.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_draw.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_draw.o: ../FL/Fl_RGB_Image.H flstring.h ../config.h
+fl_draw_image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_draw_image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_draw_image.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+fl_draw_image.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_draw_image.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_draw_image.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_draw_image.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_draw_image.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H Fl_XColor.H
+fl_draw_image.o: ../config.h flstring.h
+fl_draw_pixmap.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_draw_pixmap.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_draw_pixmap.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+fl_draw_pixmap.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_draw_pixmap.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_draw_pixmap.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_draw_pixmap.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_draw_pixmap.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
+fl_draw_pixmap.o: ../config.h
fl_encoding_latin1.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
-fl_encoding_latin1.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
-fl_encoding_latin1.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_encoding_latin1.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_encoding_latin1.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_encoding_latin1.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_encoding_latin1.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_encoding_latin1.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+fl_encoding_latin1.o: ../FL/Fl_Window.H ../FL/Enumerations.H
+fl_encoding_latin1.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+fl_encoding_latin1.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+fl_encoding_latin1.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_encoding_latin1.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
fl_encoding_latin1.o: ../FL/Fl_RGB_Image.H flstring.h ../FL/Fl_Export.H
fl_encoding_latin1.o: ../config.h
fl_encoding_mac_roman.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
-fl_encoding_mac_roman.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+fl_encoding_mac_roman.o: ../FL/abi-version.h ../FL/Fl_Export.H
+fl_encoding_mac_roman.o: ../FL/fl_types.h ../FL/Fl_Window.H
fl_encoding_mac_roman.o: ../FL/Enumerations.H ../FL/Fl_Window.H
fl_encoding_mac_roman.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
fl_encoding_mac_roman.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
@@ -845,196 +903,212 @@ fl_encoding_mac_roman.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H
fl_encoding_mac_roman.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
fl_encoding_mac_roman.o: ../FL/Fl_RGB_Image.H flstring.h ../FL/Fl_Export.H
fl_encoding_mac_roman.o: ../config.h
-fl_engraved_label.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_engraved_label.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Widget.H
-fl_engraved_label.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-fl_engraved_label.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_engraved_label.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_engraved_label.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_engraved_label.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_engraved_label.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_engraved_label.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_engraved_label.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_engraved_label.o: ../FL/abi-version.h ../FL/Fl_Widget.H ../FL/fl_draw.H
+fl_engraved_label.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+fl_engraved_label.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+fl_engraved_label.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+fl_engraved_label.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_engraved_label.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_engraved_label.o: ../FL/Fl_RGB_Image.H
fl_file_dir.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/filename.H
fl_file_dir.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/fl_utf8.h
fl_file_dir.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
-fl_file_dir.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_file_dir.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Widget.H
-fl_file_dir.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Menu_Button.H
-fl_file_dir.o: ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H
-fl_file_dir.o: ../FL/Fl_Group.H ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H
+fl_file_dir.o: ../FL/abi-version.h ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
+fl_file_dir.o: ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
+fl_file_dir.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
+fl_file_dir.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H
+fl_file_dir.o: ../FL/Fl_Preferences.H ../FL/Fl_Tile.H ../FL/Fl_Group.H
+fl_file_dir.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H
fl_file_dir.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H
fl_file_dir.o: ../FL/Fl_Box.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
fl_file_dir.o: ../FL/Fl_Button.H ../FL/Fl_File_Input.H ../FL/Fl_Input.H
fl_file_dir.o: ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H
fl_font.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/Fl.H
fl_font.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_font.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-fl_font.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_font.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_font.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-fl_font.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-fl_font.o: ../FL/Fl_RGB_Image.H Fl_Font.H fl_font_xft.cxx
-fl_gleam.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_gleam.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-fl_gleam.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_gleam.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_gleam.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-fl_gleam.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-fl_gleam.o: ../FL/Fl_RGB_Image.H
-fl_gtk.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_gtk.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-fl_gtk.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_gtk.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_gtk.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-fl_gtk.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-fl_gtk.o: ../FL/Fl_RGB_Image.H
-fl_labeltype.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_labeltype.o: ../FL/Enumerations.H ../FL/Fl_Widget.H ../FL/Fl_Group.H
+fl_font.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+fl_font.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_font.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_font.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_font.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_font.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H Fl_Font.H fl_font_xft.cxx
+fl_gleam.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_gleam.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_gleam.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+fl_gleam.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+fl_gleam.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+fl_gleam.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+fl_gleam.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_gtk.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_gtk.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_gtk.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
+fl_gtk.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+fl_gtk.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
+fl_gtk.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+fl_gtk.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_labeltype.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_labeltype.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_labeltype.o: ../FL/abi-version.h ../FL/Fl_Widget.H ../FL/Fl_Group.H
fl_labeltype.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
fl_labeltype.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
fl_labeltype.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
fl_labeltype.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
fl_labeltype.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
fl_labeltype.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Input_.H
-fl_line_style.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_line_style.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-fl_line_style.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_line_style.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_line_style.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_line_style.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_line_style.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_line_style.o: ../FL/Fl_Printer.H ../FL/Fl_Paged_Device.H
-fl_line_style.o: ../FL/Fl_PostScript.H flstring.h ../FL/Fl_Export.H
+fl_line_style.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_line_style.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_line_style.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+fl_line_style.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_line_style.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_line_style.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_line_style.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_line_style.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_Printer.H
+fl_line_style.o: ../FL/Fl_Paged_Device.H ../FL/Fl_PostScript.H flstring.h
fl_line_style.o: ../config.h
fl_open_uri.o: ../FL/filename.H flstring.h ../FL/Fl_Export.H ../config.h
-fl_oval_box.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_oval_box.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
-fl_oval_box.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-fl_oval_box.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-fl_oval_box.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_oval_box.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-fl_oval_box.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_overlay.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-fl_overlay.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/fl_draw.H
-fl_overlay.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_overlay.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_overlay.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-fl_overlay.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-fl_overlay.o: ../FL/Fl_RGB_Image.H
+fl_oval_box.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_oval_box.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_oval_box.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+fl_oval_box.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_oval_box.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_oval_box.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_oval_box.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_oval_box.o: ../FL/Fl_RGB_Image.H
+fl_overlay.o: ../FL/x.H ../FL/Enumerations.H ../FL/abi-version.h
+fl_overlay.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+fl_overlay.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_overlay.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_overlay.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_overlay.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_overlay.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
fl_overlay_visual.o: ../config.h
-fl_plastic.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_plastic.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
-fl_plastic.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-fl_plastic.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-fl_plastic.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_plastic.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-fl_plastic.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
-fl_plastic.o: ../FL/Fl_Export.H ../config.h
-fl_read_image.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H
-fl_read_image.o: ../FL/fl_types.h ../FL/Fl_Window.H ../FL/Fl.H
-fl_read_image.o: ../FL/fl_utf8.h ../FL/fl_draw.H ../FL/Enumerations.H
-fl_read_image.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_read_image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_read_image.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_read_image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_read_image.o: flstring.h ../FL/Fl_Export.H ../config.h
-fl_rect.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_rect.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Widget.H
-fl_rect.o: ../FL/Fl_Printer.H ../FL/x.H ../FL/Fl_Window.H
-fl_rect.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_rect.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-fl_rect.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
-fl_rect.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_rect.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/Enumerations.H
-fl_rect.o: ../FL/Fl_PostScript.H
-fl_round_box.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_round_box.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
+fl_plastic.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_plastic.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_plastic.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+fl_plastic.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_plastic.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_plastic.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_plastic.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_plastic.o: ../FL/Fl_RGB_Image.H flstring.h ../config.h
+fl_read_image.o: ../FL/x.H ../FL/Enumerations.H ../FL/abi-version.h
+fl_read_image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+fl_read_image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/fl_draw.H
+fl_read_image.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_read_image.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_read_image.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_read_image.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_read_image.o: ../FL/Fl_RGB_Image.H flstring.h ../config.h
+fl_rect.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_rect.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_rect.o: ../FL/abi-version.h ../FL/Fl_Widget.H ../FL/Fl_Printer.H ../FL/x.H
+fl_rect.o: ../FL/Fl_Window.H ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H
+fl_rect.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+fl_rect.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+fl_rect.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_rect.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/fl_draw.H
+fl_rect.o: ../FL/Enumerations.H ../FL/Fl_PostScript.H
+fl_round_box.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_round_box.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_round_box.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
fl_round_box.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
fl_round_box.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
fl_round_box.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
fl_round_box.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
fl_round_box.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_rounded_box.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_rounded_box.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-fl_rounded_box.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_rounded_box.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_rounded_box.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_rounded_box.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_rounded_box.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_set_font.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_set_font.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
-fl_set_font.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Window.H
-fl_set_font.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-fl_set_font.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_set_font.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-fl_set_font.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H flstring.h
-fl_set_font.o: ../FL/Fl_Export.H ../config.h Fl_Font.H
-fl_set_fonts.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_set_fonts.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H Fl_Font.H
-fl_set_fonts.o: ../config.h flstring.h ../FL/Fl_Export.H fl_set_fonts_xft.cxx
-fl_scroll_area.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_scroll_area.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
-fl_scroll_area.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Enumerations.H
-fl_scroll_area.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_scroll_area.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_scroll_area.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_scroll_area.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_shadow_box.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_shadow_box.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/fl_draw.H
-fl_shadow_box.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Enumerations.H
-fl_shadow_box.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_shadow_box.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_shadow_box.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_shadow_box.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_shortcut.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_shortcut.o: ../FL/Enumerations.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
-fl_shortcut.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+fl_rounded_box.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_rounded_box.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_rounded_box.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+fl_rounded_box.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_rounded_box.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_rounded_box.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_rounded_box.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_rounded_box.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_set_font.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_set_font.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_set_font.o: ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H
+fl_set_font.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_set_font.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_set_font.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_set_font.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_set_font.o: ../FL/Fl_RGB_Image.H flstring.h ../config.h Fl_Font.H
+fl_set_fonts.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_set_fonts.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_set_fonts.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H Fl_Font.H
+fl_set_fonts.o: ../config.h flstring.h fl_set_fonts_xft.cxx
+fl_scroll_area.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_scroll_area.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_scroll_area.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+fl_scroll_area.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_scroll_area.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_scroll_area.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_scroll_area.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_scroll_area.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_shadow_box.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_shadow_box.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_shadow_box.o: ../FL/abi-version.h ../FL/fl_draw.H ../FL/x.H
+fl_shadow_box.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_shadow_box.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_shadow_box.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_shadow_box.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_shadow_box.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_shortcut.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_shortcut.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_shortcut.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Widget.H
+fl_shortcut.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
fl_shortcut.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
fl_shortcut.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
fl_shortcut.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
fl_shortcut.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-fl_shortcut.o: flstring.h ../FL/Fl_Export.H ../config.h
-fl_show_colormap.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-fl_show_colormap.o: ../FL/fl_types.h ../FL/Enumerations.H
-fl_show_colormap.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
-fl_show_colormap.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
-fl_show_colormap.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-fl_show_colormap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-fl_show_colormap.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-fl_show_colormap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+fl_shortcut.o: flstring.h ../config.h
+fl_show_colormap.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+fl_show_colormap.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+fl_show_colormap.o: ../FL/abi-version.h ../FL/Fl_Single_Window.H
+fl_show_colormap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H
+fl_show_colormap.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_show_colormap.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_show_colormap.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_show_colormap.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_show_colormap.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
fl_show_colormap.o: ../FL/fl_show_colormap.H ../config.h
-fl_symbols.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-fl_symbols.o: ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
-fl_symbols.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
-fl_symbols.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-fl_symbols.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-fl_symbols.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-fl_symbols.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/math.h flstring.h
-fl_symbols.o: ../FL/Fl_Export.H ../config.h
+fl_symbols.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+fl_symbols.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+fl_symbols.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
+fl_symbols.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+fl_symbols.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+fl_symbols.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+fl_symbols.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+fl_symbols.o: ../FL/Fl_RGB_Image.H ../FL/math.h flstring.h ../config.h
fl_vertex.o: ../config.h ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
-fl_vertex.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
-fl_vertex.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-fl_vertex.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
-fl_vertex.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-fl_vertex.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-fl_vertex.o: ../FL/Fl_RGB_Image.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/math.h
-screen_xywh.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-screen_xywh.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H ../config.h
-fl_utf8.o: ../config.h ../FL/filename.H Xutf8.h ../FL/fl_utf8.h
+fl_vertex.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+fl_vertex.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+fl_vertex.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+fl_vertex.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+fl_vertex.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+fl_vertex.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl.H
+fl_vertex.o: ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/math.h
+screen_xywh.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+screen_xywh.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+screen_xywh.o: ../FL/x.H ../FL/Fl_Window.H ../config.h
+fl_utf8.o: ../config.h ../FL/filename.H Xutf8.h ../FL/Fl_Export.H
+fl_utf8.o: ../FL/fl_utf8.h
ps_image.o: ../FL/Fl_PostScript.H ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H
-ps_image.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
-ps_image.o: ../FL/Fl_Window.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-ps_image.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
-ps_image.o: ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H
-ps_image.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-ps_image.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl.H ../FL/fl_utf8.h
-forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/fl_utf8.h
-forms_compatability.o: ../FL/Fl_Export.H ../FL/fl_types.h
-forms_compatability.o: ../FL/Enumerations.H ../FL/Fl_Group.H
-forms_compatability.o: ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/fl_draw.H
-forms_compatability.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Window.H
-forms_compatability.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-forms_compatability.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
-forms_compatability.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+ps_image.o: ../FL/x.H ../FL/Enumerations.H ../FL/abi-version.h
+ps_image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
+ps_image.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+ps_image.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+ps_image.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+ps_image.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/fl_draw.H
+ps_image.o: ../FL/Enumerations.H ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Export.H
+forms_compatability.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
+forms_compatability.o: ../FL/Enumerations.H ../FL/abi-version.h
+forms_compatability.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Window.H
+forms_compatability.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H
+forms_compatability.o: ../FL/Fl_Window.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+forms_compatability.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+forms_compatability.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H
+forms_compatability.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
forms_compatability.o: ../FL/Fl_RGB_Image.H ../FL/Fl_FormsBitmap.H
forms_compatability.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
forms_compatability.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Button.H
@@ -1057,9 +1131,10 @@ forms_compatability.o: ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H
forms_compatability.o: ../FL/Fl_Positioner.H ../FL/Fl_Slider.H
forms_compatability.o: ../FL/Fl_Valuator.H ../FL/Fl_Value_Slider.H
forms_compatability.o: ../FL/Fl_Timer.H ../FL/Fl_Repeat_Button.H
-forms_bitmap.o: ../FL/forms.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-forms_bitmap.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Group.H
-forms_bitmap.o: ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H
+forms_bitmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+forms_bitmap.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+forms_bitmap.o: ../FL/abi-version.h ../FL/Fl_Group.H ../FL/Fl_Widget.H
+forms_bitmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H
forms_bitmap.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
forms_bitmap.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
forms_bitmap.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
@@ -1080,15 +1155,17 @@ forms_bitmap.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H
forms_bitmap.o: ../FL/fl_ask.H ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H
forms_bitmap.o: ../FL/Fl_Positioner.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
forms_bitmap.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
-forms_free.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-forms_free.o: ../FL/Enumerations.H ../FL/Fl_Free.H ../FL/Fl_Widget.H
-forms_fselect.o: ../FL/forms.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-forms_fselect.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Group.H
-forms_fselect.o: ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/fl_draw.H
-forms_fselect.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Window.H
-forms_fselect.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-forms_fselect.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-forms_fselect.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
+forms_free.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+forms_free.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+forms_free.o: ../FL/Fl_Free.H ../FL/Fl_Widget.H
+forms_fselect.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+forms_fselect.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+forms_fselect.o: ../FL/abi-version.h ../FL/Fl_Group.H ../FL/Fl_Widget.H
+forms_fselect.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H
+forms_fselect.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
+forms_fselect.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+forms_fselect.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+forms_fselect.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
forms_fselect.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_FormsPixmap.H
forms_fselect.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
forms_fselect.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
@@ -1106,10 +1183,11 @@ forms_fselect.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H
forms_fselect.o: ../FL/fl_ask.H ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H
forms_fselect.o: ../FL/Fl_Positioner.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
forms_fselect.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H flstring.h
-forms_fselect.o: ../FL/Fl_Export.H ../config.h
-forms_pixmap.o: ../FL/forms.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-forms_pixmap.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Group.H
-forms_pixmap.o: ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H
+forms_fselect.o: ../config.h
+forms_pixmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+forms_pixmap.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+forms_pixmap.o: ../FL/abi-version.h ../FL/Fl_Group.H ../FL/Fl_Widget.H
+forms_pixmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H
forms_pixmap.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
forms_pixmap.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
forms_pixmap.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
@@ -1130,14 +1208,14 @@ forms_pixmap.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H
forms_pixmap.o: ../FL/fl_ask.H ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H
forms_pixmap.o: ../FL/Fl_Positioner.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
forms_pixmap.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
-forms_timer.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-forms_timer.o: ../FL/Enumerations.H ../FL/Fl_Timer.H ../FL/Fl_Widget.H
-forms_timer.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-forms_timer.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-forms_timer.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-forms_timer.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-forms_timer.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-forms_timer.o: ../FL/forms.H ../FL/Fl.H ../FL/fl_draw.H
+forms_timer.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h ../FL/Fl_Export.H
+forms_timer.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/abi-version.h
+forms_timer.o: ../FL/Fl_Timer.H ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H
+forms_timer.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+forms_timer.o: ../FL/Fl_Group.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
+forms_timer.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+forms_timer.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+forms_timer.o: ../FL/Fl_RGB_Image.H ../FL/forms.H ../FL/Fl.H ../FL/fl_draw.H
forms_timer.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_FormsPixmap.H
forms_timer.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
forms_timer.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
@@ -1155,16 +1233,18 @@ forms_timer.o: ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H
forms_timer.o: ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
forms_timer.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Value_Slider.H
forms_timer.o: ../FL/Fl_Timer.H
-Fl_Gl_Choice.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Gl_Choice.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
-Fl_Gl_Choice.o: ../FL/Fl_Window.H Fl_Gl_Choice.H ../FL/gl_draw.H ../FL/gl.h
-Fl_Gl_Choice.o: flstring.h ../FL/Fl_Export.H ../FL/fl_utf8.h
-Fl_Gl_Overlay.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-Fl_Gl_Overlay.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/x.H
-Fl_Gl_Overlay.o: ../FL/Fl_Window.H Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H
+Fl_Gl_Choice.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Gl_Choice.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Gl_Choice.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+Fl_Gl_Choice.o: Fl_Gl_Choice.H ../FL/gl_draw.H ../FL/gl.h flstring.h
+Fl_Gl_Choice.o: ../FL/fl_utf8.h
+Fl_Gl_Overlay.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_Gl_Overlay.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_Gl_Overlay.o: ../FL/abi-version.h ../FL/x.H ../FL/Fl_Window.H
+Fl_Gl_Overlay.o: Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H
Fl_Gl_Device_Plugin.o: ../config.h ../FL/Fl_Printer.H ../FL/x.H
-Fl_Gl_Device_Plugin.o: ../FL/Enumerations.H ../FL/Fl_Export.H
-Fl_Gl_Device_Plugin.o: ../FL/fl_types.h ../FL/Fl_Window.H
+Fl_Gl_Device_Plugin.o: ../FL/Enumerations.H ../FL/abi-version.h
+Fl_Gl_Device_Plugin.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Window.H
Fl_Gl_Device_Plugin.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H
Fl_Gl_Device_Plugin.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
Fl_Gl_Device_Plugin.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
@@ -1172,76 +1252,86 @@ Fl_Gl_Device_Plugin.o: ../FL/Fl_Image.H ../FL/Fl_RGB_Image.H
Fl_Gl_Device_Plugin.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_Gl_Device_Plugin.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H ../FL/Enumerations.H
Fl_Gl_Device_Plugin.o: ../FL/Fl_PostScript.H ../FL/Fl_Gl_Window.H
-Fl_Gl_Device_Plugin.o: Fl_Gl_Choice.H ../FL/Fl.H ../FL/fl_utf8.h
+Fl_Gl_Device_Plugin.o: Fl_Gl_Choice.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_Gl_Device_Plugin.o: ../FL/fl_utf8.h
Fl_Gl_Window.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/Fl.H
Fl_Gl_Window.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_Gl_Window.o: ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
-Fl_Gl_Window.o: Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H ../FL/fl_utf8.h
+Fl_Gl_Window.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/x.H
+Fl_Gl_Window.o: ../FL/Fl_Window.H Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H
+Fl_Gl_Window.o: ../FL/fl_utf8.h
freeglut_geometry.o: ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H
-freeglut_geometry.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H
-freeglut_geometry.o: ../FL/fl_utf8.h ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
-freeglut_geometry.o: ../FL/math.h
+freeglut_geometry.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+freeglut_geometry.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+freeglut_geometry.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H ../FL/math.h
freeglut_stroke_mono_roman.o: ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H
-freeglut_stroke_mono_roman.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H
+freeglut_stroke_mono_roman.o: ../FL/abi-version.h ../FL/Fl_Export.H
+freeglut_stroke_mono_roman.o: ../FL/fl_types.h ../FL/Fl.H ../FL/Fl_Export.H
freeglut_stroke_mono_roman.o: ../FL/fl_utf8.h ../FL/Fl_Gl_Window.H
freeglut_stroke_mono_roman.o: ../FL/Fl_Window.H
freeglut_stroke_roman.o: ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H
-freeglut_stroke_roman.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H
+freeglut_stroke_roman.o: ../FL/abi-version.h ../FL/Fl_Export.H
+freeglut_stroke_roman.o: ../FL/fl_types.h ../FL/Fl.H ../FL/Fl_Export.H
freeglut_stroke_roman.o: ../FL/fl_utf8.h ../FL/Fl_Gl_Window.H
freeglut_stroke_roman.o: ../FL/Fl_Window.H
freeglut_teapot.o: ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H
-freeglut_teapot.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H
-freeglut_teapot.o: ../FL/fl_utf8.h ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
+freeglut_teapot.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+freeglut_teapot.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+freeglut_teapot.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
freeglut_teapot.o: freeglut_teapot_data.h
gl_draw.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/Fl.H
gl_draw.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-gl_draw.o: ../FL/Enumerations.H ../FL/gl.h ../FL/gl_draw.H ../FL/gl.h
-gl_draw.o: ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Enumerations.H
-gl_draw.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-gl_draw.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
-gl_draw.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-gl_draw.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-gl_draw.o: Fl_Gl_Choice.H Fl_Font.H ../FL/fl_utf8.h Xutf8.h
-gl_start.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H
-gl_start.o: ../FL/fl_types.h ../FL/Enumerations.H ../FL/Fl_Window.H
-gl_start.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-gl_start.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H
-gl_start.o: ../FL/Enumerations.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
-gl_start.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
-gl_start.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/gl.h Fl_Gl_Choice.H
+gl_draw.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/gl.h
+gl_draw.o: ../FL/gl_draw.H ../FL/gl.h ../FL/x.H ../FL/Fl_Window.H
+gl_draw.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Window.H
+gl_draw.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+gl_draw.o: ../FL/Fl_Image.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H
+gl_draw.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
+gl_draw.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H Fl_Gl_Choice.H Fl_Font.H
+gl_draw.o: ../FL/fl_utf8.h Xutf8.h
+gl_start.o: ../config.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+gl_start.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+gl_start.o: ../FL/abi-version.h ../FL/Fl_Window.H ../FL/Fl_Group.H
+gl_start.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H
+gl_start.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Enumerations.H
+gl_start.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+gl_start.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+gl_start.o: ../FL/Fl_RGB_Image.H ../FL/gl.h Fl_Gl_Choice.H
glut_compatability.o: flstring.h ../FL/Fl_Export.H ../config.h ../FL/glut.H
-glut_compatability.o: ../FL/gl.h ../FL/Enumerations.H ../FL/Fl_Export.H
-glut_compatability.o: ../FL/fl_types.h ../FL/Fl.H ../FL/fl_utf8.h
-glut_compatability.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
+glut_compatability.o: ../FL/gl.h ../FL/Enumerations.H ../FL/abi-version.h
+glut_compatability.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H
+glut_compatability.o: ../FL/fl_utf8.h ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
glut_compatability.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
glut_font.o: ../config.h ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H
-glut_font.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H ../FL/fl_utf8.h
+glut_font.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+glut_font.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
glut_font.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
fl_images_core.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
-fl_images_core.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h
-fl_images_core.o: ../FL/Fl_BMP_Image.H ../FL/Fl_GIF_Image.H ../FL/Fl_Pixmap.H
-fl_images_core.o: ../FL/Fl_JPEG_Image.H ../FL/Fl_PNG_Image.H
-fl_images_core.o: ../FL/Fl_PNM_Image.H flstring.h ../FL/Fl_Export.H
-fl_images_core.o: ../config.h
+fl_images_core.o: ../FL/Enumerations.H ../FL/abi-version.h ../FL/Fl_Export.H
+fl_images_core.o: ../FL/fl_types.h ../FL/Fl_BMP_Image.H ../FL/Fl_GIF_Image.H
+fl_images_core.o: ../FL/Fl_Pixmap.H ../FL/Fl_JPEG_Image.H
+fl_images_core.o: ../FL/Fl_PNG_Image.H ../FL/Fl_PNM_Image.H flstring.h
+fl_images_core.o: ../FL/Fl_Export.H ../config.h
Fl_BMP_Image.o: ../FL/Fl_BMP_Image.H ../FL/Fl_Image.H ../FL/Enumerations.H
-Fl_BMP_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/fl_utf8.h ../FL/Fl.H
-Fl_BMP_Image.o: ../FL/fl_utf8.h ../config.h
+Fl_BMP_Image.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_BMP_Image.o: ../FL/fl_utf8.h ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_BMP_Image.o: ../config.h
Fl_File_Icon2.o: ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H ../config.h
Fl_File_Icon2.o: ../FL/math.h ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/fl_utf8.h
Fl_File_Icon2.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
-Fl_File_Icon2.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/Fl_Widget.H
-Fl_File_Icon2.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H
-Fl_File_Icon2.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_File_Icon2.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Device.H
-Fl_File_Icon2.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
-Fl_File_Icon2.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
-Fl_File_Icon2.o: ../FL/filename.H
-Fl_GIF_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_GIF_Image.o: ../FL/Enumerations.H ../FL/Fl_GIF_Image.H ../FL/Fl_Pixmap.H
-Fl_GIF_Image.o: ../FL/Fl_Image.H ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H
-Fl_GIF_Image.o: ../config.h
-Fl_Help_Dialog.o: ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/fl_utf8.h
-Fl_Help_Dialog.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_File_Icon2.o: ../FL/abi-version.h ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
+Fl_File_Icon2.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/x.H
+Fl_File_Icon2.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
+Fl_File_Icon2.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_File_Icon2.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H
+Fl_File_Icon2.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H
+Fl_File_Icon2.o: ../FL/Fl_RGB_Image.H ../FL/filename.H
+Fl_GIF_Image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_GIF_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_GIF_Image.o: ../FL/abi-version.h ../FL/Fl_GIF_Image.H ../FL/Fl_Pixmap.H
+Fl_GIF_Image.o: ../FL/Fl_Image.H ../FL/fl_utf8.h flstring.h ../config.h
+Fl_Help_Dialog.o: ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/Fl_Export.H
+Fl_Help_Dialog.o: ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_Help_Dialog.o: ../FL/Enumerations.H ../FL/abi-version.h
Fl_Help_Dialog.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
Fl_Help_Dialog.o: ../FL/Fl_Button.H ../FL/Fl_Widget.H ../FL/Fl_Input.H
Fl_Help_Dialog.o: ../FL/Fl_Input_.H ../FL/Fl_Box.H ../FL/Fl_Help_View.H
@@ -1252,40 +1342,46 @@ Fl_Help_Dialog.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Device.H
Fl_Help_Dialog.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H
Fl_Help_Dialog.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H
Fl_Help_Dialog.o: ../FL/Fl_Shared_Image.H ../FL/filename.H flstring.h
-Fl_Help_Dialog.o: ../FL/Fl_Export.H ../config.h ../FL/fl_ask.H
+Fl_Help_Dialog.o: ../config.h ../FL/fl_ask.H
Fl_JPEG_Image.o: ../FL/Fl_JPEG_Image.H ../FL/Fl_Image.H ../FL/Enumerations.H
-Fl_JPEG_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Shared_Image.H
-Fl_JPEG_Image.o: ../FL/fl_utf8.h ../FL/Fl.H ../FL/fl_utf8.h ../config.h
-Fl_PNG_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_PNG_Image.o: ../FL/Enumerations.H ../FL/Fl_PNG_Image.H ../FL/Fl_Image.H
+Fl_JPEG_Image.o: ../FL/abi-version.h ../FL/Fl_Export.H ../FL/fl_types.h
+Fl_JPEG_Image.o: ../FL/Fl_Shared_Image.H ../FL/fl_utf8.h ../FL/Fl.H
+Fl_JPEG_Image.o: ../FL/Fl_Export.H ../FL/fl_utf8.h ../config.h
+Fl_PNG_Image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_PNG_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_PNG_Image.o: ../FL/abi-version.h ../FL/Fl_PNG_Image.H ../FL/Fl_Image.H
Fl_PNG_Image.o: ../FL/Fl_Shared_Image.H ../config.h ../FL/fl_utf8.h
-Fl_PNM_Image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
-Fl_PNM_Image.o: ../FL/Enumerations.H ../FL/Fl_PNM_Image.H ../FL/Fl_Image.H
-Fl_PNM_Image.o: ../FL/fl_utf8.h flstring.h ../FL/Fl_Export.H ../config.h
+Fl_PNM_Image.o: ../FL/Fl.H ../FL/Fl_Export.H ../FL/fl_utf8.h
+Fl_PNM_Image.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Enumerations.H
+Fl_PNM_Image.o: ../FL/abi-version.h ../FL/Fl_PNM_Image.H ../FL/Fl_Image.H
+Fl_PNM_Image.o: ../FL/fl_utf8.h flstring.h ../config.h
flstring.o: flstring.h ../FL/Fl_Export.H ../config.h
scandir.o: ../config.h
numericsort.o: ../config.h ../FL/filename.H
vsnprintf.o: flstring.h ../FL/Fl_Export.H ../config.h
fl_utf.o: ../FL/fl_utf8.h xutf8/mk_wcwidth.c
-xutf8/case.o: xutf8/headers/case.h
-xutf8/is_right2left.o: Xutf8.h
-xutf8/is_spacing.o: xutf8/headers/spacing.h
-xutf8/keysym2Ucs.o: Xutf8.h xutf8/imKStoUCS.c xutf8/Xlibint.h xutf8/Ximint.h
-xutf8/utf8Input.o: ../config.h Xutf8.h xutf8/lcUniConv/big5.h
-xutf8/utf8Input.o: xutf8/lcUniConv/gb2312.h xutf8/lcUniConv/cp936ext.h
-xutf8/utf8Input.o: xutf8/lcUniConv/jisx0201.h xutf8/lcUniConv/jisx0208.h
-xutf8/utf8Input.o: xutf8/lcUniConv/jisx0212.h xutf8/lcUniConv/ksc5601.h
-xutf8/utf8Utils.o: Xutf8.h
-xutf8/utf8Wrap.o: Xutf8.h xutf8/ucs2fontmap.c xutf8/lcUniConv/cp936ext.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/big5.h xutf8/lcUniConv/gb2312.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_10.h xutf8/lcUniConv/iso8859_11.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_13.h xutf8/lcUniConv/iso8859_14.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_15.h xutf8/lcUniConv/iso8859_2.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_3.h xutf8/lcUniConv/iso8859_4.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_5.h xutf8/lcUniConv/iso8859_6.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_7.h xutf8/lcUniConv/iso8859_8.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_9.h xutf8/lcUniConv/jisx0201.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/jisx0208.h xutf8/lcUniConv/jisx0212.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/koi8_r.h xutf8/lcUniConv/koi8_u.h
-xutf8/utf8Wrap.o: xutf8/lcUniConv/ksc5601.h xutf8/lcUniConv/cp1251.h
-xutf8/utf8Wrap.o: xutf8/headers/symbol_.h xutf8/headers/dingbats_.h
+xutf8/case.o: Xutf8.h ../FL/Fl_Export.H xutf8/headers/case.h
+xutf8/is_right2left.o: Xutf8.h ../FL/Fl_Export.H
+xutf8/is_spacing.o: Xutf8.h ../FL/Fl_Export.H xutf8/headers/spacing.h
+xutf8/keysym2Ucs.o: Xutf8.h ../FL/Fl_Export.H xutf8/imKStoUCS.c
+xutf8/keysym2Ucs.o: xutf8/Xlibint.h xutf8/Ximint.h
+xutf8/utf8Input.o: ../config.h Xutf8.h ../FL/Fl_Export.H
+xutf8/utf8Input.o: xutf8/lcUniConv/big5.h xutf8/lcUniConv/gb2312.h
+xutf8/utf8Input.o: xutf8/lcUniConv/cp936ext.h xutf8/lcUniConv/jisx0201.h
+xutf8/utf8Input.o: xutf8/lcUniConv/jisx0208.h xutf8/lcUniConv/jisx0212.h
+xutf8/utf8Input.o: xutf8/lcUniConv/ksc5601.h
+xutf8/utf8Utils.o: Xutf8.h ../FL/Fl_Export.H
+xutf8/utf8Wrap.o: Xutf8.h ../FL/Fl_Export.H xutf8/ucs2fontmap.c
+xutf8/utf8Wrap.o: xutf8/lcUniConv/cp936ext.h xutf8/lcUniConv/big5.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/gb2312.h xutf8/lcUniConv/iso8859_10.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_11.h xutf8/lcUniConv/iso8859_13.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_14.h xutf8/lcUniConv/iso8859_15.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_2.h xutf8/lcUniConv/iso8859_3.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_4.h xutf8/lcUniConv/iso8859_5.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_6.h xutf8/lcUniConv/iso8859_7.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/iso8859_8.h xutf8/lcUniConv/iso8859_9.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/jisx0201.h xutf8/lcUniConv/jisx0208.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/jisx0212.h xutf8/lcUniConv/koi8_r.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/koi8_u.h xutf8/lcUniConv/ksc5601.h
+xutf8/utf8Wrap.o: xutf8/lcUniConv/cp1251.h xutf8/headers/symbol_.h
+xutf8/utf8Wrap.o: xutf8/headers/dingbats_.h
diff --git a/src/makefile.wat b/src/makefile.wat
deleted file mode 100644
index 0b960bd..0000000
--- a/src/makefile.wat
+++ /dev/null
@@ -1,229 +0,0 @@
-#
-# "$Id: makefile.wat 8864 2011-07-19 04:49:30Z greg.ercolano $"
-#
-# Library makefile for the Fast Light Tool Kit (FLTK).
-#
-# Copyright 1998-2010 by Bill Spitzak and others.
-#
-# This library is free software. Distribution and use rights are outlined in
-# the file "COPYING" which should have been included with this file. If this
-# file is missing or damaged, see the license at:
-#
-# http://www.fltk.org/COPYING.php
-#
-# Please report all bugs and problems on the following page:
-#
-# http://www.fltk.org/str.php
-#
-
-CPPFILES = &
- Fl.obj &
- Fl_Adjuster.obj &
- Fl_Bitmap.obj &
- Fl_Browser.obj &
- Fl_Browser_.obj &
- Fl_Browser_load.obj &
- Fl_Box.obj &
- Fl_Button.obj &
- Fl_Chart.obj &
- Fl_Check_Browser.obj &
- Fl_Check_Button.obj &
- Fl_Choice.obj &
- Fl_Clock.obj &
- Fl_Color_Chooser.obj &
- Fl_Counter.obj &
- Fl_Dial.obj &
- Fl_Double_Window.obj &
- Fl_File_Browser.obj &
- Fl_File_Chooser.obj &
- Fl_File_Chooser2.obj &
- Fl_File_Icon.obj &
- Fl_File_Input.obj &
- Fl_Group.obj &
- Fl_Help_View.obj &
- Fl_Image.obj &
- Fl_Input.obj &
- Fl_Input_.obj &
- Fl_Light_Button.obj &
- Fl_Menu.obj &
- Fl_Menu_.obj &
- Fl_Menu_Bar.obj &
- Fl_Sys_Menu_Bar.obj &
- Fl_Menu_Button.obj &
- Fl_Menu_Window.obj &
- Fl_Menu_add.obj &
- Fl_Menu_global.obj &
- Fl_Multi_Label.obj &
- Fl_Native_File_Chooser.obj &
- Fl_Overlay_Window.obj &
- Fl_Pack.obj &
- Fl_Pixmap.obj &
- Fl_Positioner.obj &
- Fl_Preferences.obj &
- Fl_Progress.obj &
- Fl_Repeat_Button.obj &
- Fl_Return_Button.obj &
- Fl_Roller.obj &
- Fl_Round_Button.obj &
- Fl_Scroll.obj &
- Fl_Scrollbar.obj &
- Fl_Shared_Image.obj &
- Fl_Single_Window.obj &
- Fl_Slider.obj &
- Fl_Tabs.obj &
- Fl_Text_Buffer.obj &
- Fl_Text_Display.obj &
- Fl_Text_Editor.obj &
- Fl_Tile.obj &
- Fl_Tiled_Image.obj &
- Fl_Tooltip.obj &
- Fl_Valuator.obj &
- Fl_Value_Input.obj &
- Fl_Value_Output.obj &
- Fl_Value_Slider.obj &
- Fl_Widget.obj &
- Fl_Window.obj &
- Fl_Window_fullscreen.obj &
- Fl_Window_hotspot.obj &
- Fl_Window_iconize.obj &
- Fl_Wizard.obj &
- Fl_XBM_Image.obj &
- Fl_XPM_Image.obj &
- Fl_abort.obj &
- Fl_add_idle.obj &
- Fl_arg.obj &
- Fl_compose.obj &
- Fl_display.obj &
- Fl_get_key.obj &
- Fl_get_system_colors.obj &
- Fl_grab.obj &
- Fl_lock.obj &
- Fl_own_colormap.obj &
- Fl_visual.obj &
- Fl_x.obj &
- filename_absolute.obj &
- filename_expand.obj &
- filename_ext.obj &
- filename_isdir.obj &
- filename_list.obj &
- filename_match.obj &
- filename_setext.obj &
- fl_arc.obj &
- fl_arci.obj &
- fl_ask.obj &
- fl_boxtype.obj &
- fl_color.obj &
- fl_cursor.obj &
- fl_curve.obj &
- fl_diamond_box.obj &
- fl_dnd.obj &
- fl_draw.obj &
- fl_draw_image.obj &
- fl_draw_pixmap.obj &
- fl_encoding_latin1.obj &
- fl_encoding_mac_roman.obj &
- fl_engraved_label.obj &
- fl_file_dir.obj &
- fl_font.obj &
- fl_gtk.obj &
- fl_labeltype.obj &
- fl_line_style.obj &
- fl_open_uri.obj &
- fl_oval_box.obj &
- fl_overlay.obj &
- fl_overlay_visual.obj &
- fl_plastic.obj &
- fl_read_image.obj &
- fl_rect.obj &
- fl_round_box.obj &
- fl_rounded_box.obj &
- fl_set_font.obj &
- fl_set_fonts.obj &
- fl_scroll_area.obj &
- fl_shadow_box.obj &
- fl_shortcut.obj &
- fl_show_colormap.obj &
- fl_symbols.obj &
- fl_vertex.obj &
- screen_xywh.obj
-
-FLCPPFILES = &
- forms_compatability.obj &
- forms_bitmap.obj &
- forms_free.obj &
- forms_fselect.obj &
- forms_pixmap.obj &
- forms_timer.obj
-
-GLCPPFILES = &
- Fl_Gl_Choice.obj &
- Fl_Gl_Overlay.obj &
- Fl_Gl_Window.obj &
- freeglut_geometry.obj &
- freeglut_stroke_mono_roman.obj &
- freeglut_stroke_roman.obj &
- freeglut_teapot.obj &
- gl_draw.obj &
- gl_start.obj &
- glut_compatability.obj &
- glut_font.obj
-
-IMGCPPFILES = &
- fl_images_core.obj &
- Fl_BMP_Image.obj &
- Fl_File_Icon2.obj &
- Fl_GIF_Image.obj &
- Fl_Help_Dialog.obj &
- Fl_JPEG_Image.obj &
- Fl_PNG_Image.obj &
- Fl_PNM_Image.obj
-
-CFILES = fl_call_main.obj flstring.obj scandir.obj numericsort.obj vsnprintf.obj
-
-################################################################
-
-!include ../watcom.mif
-
-OBJECTS = $(CPPFILES) $(CFILES)
-FLOBJECTS = $(FLCPPFILES)
-GLOBJECTS = $(GLCPPFILES)
-IMGOBJECTS = $(IMGCPPFILES)
-
-# The four basic fltk libraries are defined in ../watcom.mif, so that appliactions
-# can also use them.
-all: $(LIBNAME) &
- $(LIBNAMEFL) &
- $(LIBNAMEGL) &
- $(LIBNAMEIMG)
-
-# $(DSONAME) &
-# $(FLDSONAME) &
-# $(GLDSONAME) &
-# $(IMGDSONAME)
-
-
-$(LIBNAME): $(OBJECTS)
- $(LIB) $(LIBOPTS) $@ $<
-
-$(LIBNAMEFL): $(FLOBJECTS)
- $(LIB) $(LIBOPTS) $@ $<
-
-$(LIBNAMEGL): $(GLOBJECTS)
- $(LIB) $(LIBOPTS) $@ $<
-
-$(LIBNAMEIMG): $(IMGOBJECTS)
- $(LIB) $(LIBOPTS) $@ $<
-
-#
-# Clean all directories
-#
-clean : .SYMBOLIC
- @echo Cleaning up.
-CLEANEXTS = exe map sym obj lk1
- @for %a in ($(CLEANEXTS)) do -rm -f $(ODIR)\*.%a
- -rm -f *.err
- -rm -f $(LIBNAME)
- -rm -f $(LIBNAMEFL)
- -rm -f $(LIBNAMEGL)
- -rm -f $(LIBNAMEIMG)
-
diff --git a/src/numericsort.c b/src/numericsort.c
index bd37d6e..7fd5f40 100644
--- a/src/numericsort.c
+++ b/src/numericsort.c
@@ -1,9 +1,9 @@
/*
- * "$Id: numericsort.c 10236 2014-08-21 12:29:48Z cand $"
+ * "$Id: numericsort.c 11094 2016-01-31 02:49:56Z AlbrechtS $"
*
* Numeric sorting routine for the Fast Light Tool Kit (FLTK).
*
- * Copyright 1998-2010 by Bill Spitzak and others.
+ * Copyright 1998-2016 by Bill Spitzak and others.
*
* This library is free software. Distribution and use rights are outlined in
* the file "COPYING" which should have been included with this file. If this
@@ -29,13 +29,13 @@
# include <dirent.h>
# else
# define dirent direct
-# if HAVE_SYS_NDIR_H
+# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* HAVE_SYS_NDIR_H */
-# if HAVE_SYS_DIR_H
+# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* HAVE_SYS_DIR_H */
-# if HAVE_NDIR_H
+# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif /* HAVE_NDIR_H */
# endif /* HAVE_DIRENT_H */
@@ -98,5 +98,5 @@ int fl_numericsort(struct dirent **A, struct dirent **B) {
}
/*
- * End of "$Id: numericsort.c 10236 2014-08-21 12:29:48Z cand $".
+ * End of "$Id: numericsort.c 11094 2016-01-31 02:49:56Z AlbrechtS $".
*/
diff --git a/src/print_panel.cxx b/src/print_panel.cxx
index ec622ca..975cbc9 100644
--- a/src/print_panel.cxx
+++ b/src/print_panel.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: print_panel.cxx 10234 2014-08-21 12:18:32Z cand $"
+// "$Id: print_panel.cxx 11329 2016-03-09 16:08:39Z manolo $"
//
// Print panel for the Fast Light Tool Kit (FLTK).
//
@@ -513,10 +513,11 @@ void print_cb(Fl_Return_Button *, void *) {
print_panel->hide();
}
-void print_load() {
+printing_style print_load() { // return whether SystemV or BSD printing style is used
FILE *lpstat;
- char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024];
+ char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024], *p;
int i;
+ printing_style style = SystemV;
if (print_choice->size() > 1) {
for (i = 1; print_choice->text(i); i ++) {
@@ -531,8 +532,8 @@ void print_load() {
print_start = 0;
defname[0] = '\0';
-
- if ((lpstat = popen("LC_MESSAGES=C LANG=C lpstat -p -d", "r")) != NULL) {
+// get names of all printers and of default one
+ if ((lpstat = popen("LC_MESSAGES=C LANG=C /bin/sh -c '(lpstat -p -d ) 2>&-'", "r")) != NULL) { // try first with SystemV printing system
while (fgets(line, sizeof(line), lpstat)) {
if (!strncmp(line, "printer ", 8) &&
sscanf(line + 8, "%s", name) == 1) {
@@ -548,18 +549,39 @@ void print_load() {
}
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;
+ *p = 0;
+ print_choice->add(line, 0, 0, (void *)strdup(line), 0);
+ style = BSD;
+ *p = '|';
+ while (1) {
+ p = line + strlen(line) - 1;
+ if (*p == '\n' && p > line) p--;
+ if (*p != '\\') break;
+ if (fgets(line, sizeof(line),lpstat)==0) { /* ignore */ }
+ }
+ }
+ fclose(lpstat);
+ p = getenv("PRINTER"); // get name of default printer
+ if (p == NULL) p = (char*)"lp";
+ strcpy(defname, p);
+ }
- if (defname[0]) {
+ if (print_choice->size() > 2) print_choice->value(1);
+ if (defname[0]) { // select default printer in menu
for (i = 1; print_choice->text(i); i ++) {
if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) {
print_choice->value(i);
break;
}
}
- } else if (print_choice->size() > 2) print_choice->value(1);
+ }
print_update_status();
-
+ return style;
} // print_load()
void print_update_status() {
@@ -568,14 +590,21 @@ void print_update_status() {
static char status[1024];
const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
+ status[0] = 0;
if (print_choice->value()) {
- snprintf(command, sizeof(command), "lpstat -p '%s'", printer);
- if ((lpstat = popen(command, "r")) != NULL) {
- if (fgets(status, sizeof(status), lpstat)==0) { /* ignore */ }
- pclose(lpstat);
- } else strcpy(status, "printer status unavailable");
- } else status[0] = '\0';
-
+ strcpy(status, "printer status unavailable");
+ snprintf(command, sizeof(command), "/bin/sh -c \"(lpstat -p '%s' ) 2>&-\" ", printer); // try first with SystemV printing system
+ if ((lpstat = popen(command, "r")) != NULL) {
+ if (fgets(status, sizeof(status), lpstat) == 0) { // if no reply
+ pclose(lpstat);
+ snprintf(command, sizeof(command), "lpq -P%s 2>&-", printer); // try next with BSD printing system
+ if ((lpstat = popen(command, "r")) != NULL) {
+ if (fgets(status, sizeof(status), lpstat)==0) { /* ignore */ }
+ }
+ }
+ pclose(lpstat);
+ }
+ }
print_status->label(status);
char name[1024];
@@ -591,5 +620,5 @@ void print_update_status() {
}
//
-// End of "$Id: print_panel.cxx 10234 2014-08-21 12:18:32Z cand $".
+// End of "$Id: print_panel.cxx 11329 2016-03-09 16:08:39Z manolo $".
//
diff --git a/src/print_panel.h b/src/print_panel.h
index e6667b0..d13e424 100644
--- a/src/print_panel.h
+++ b/src/print_panel.h
@@ -1,5 +1,5 @@
//
-// "$Id: print_panel.h 8864 2011-07-19 04:49:30Z greg.ercolano $"
+// "$Id: print_panel.h 10619 2015-03-12 15:24:15Z manolo $"
//
// Print panel for the Fast Light Tool Kit (FLTK).
//
@@ -35,12 +35,13 @@
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Return_Button.H>
#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_load();
+static printing_style print_load();
static void print_update_status();
#endif
//
-// End of "$Id: print_panel.h 8864 2011-07-19 04:49:30Z greg.ercolano $".
+// End of "$Id: print_panel.h 10619 2015-03-12 15:24:15Z manolo $".
//
diff --git a/src/ps_image.cxx b/src/ps_image.cxx
index 41dc299..0cee215 100644
--- a/src/ps_image.cxx
+++ b/src/ps_image.cxx
@@ -3,7 +3,7 @@
//
// Postscript image drawing implementation for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -26,6 +26,170 @@
#include <FL/Fl.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Bitmap.H>
+
+
+//
+// Implementation of the /ASCII85Encode PostScript filter
+// as described in "PostScript LANGUAGE REFERENCE third edition" p. 131
+//
+struct struct85 {
+ uchar bytes4[4]; // holds up to 4 input bytes
+ int l4; // # of unencoded input bytes
+ int blocks; // counter to insert newlines after 80 output characters
+ uchar chars5[5]; // holds 5 output characters
+};
+
+
+void *Fl_PostScript_Graphics_Driver::prepare85() // prepare to produce ASCII85-encoded output
+{
+ struct85 *big = new struct85;
+ big->l4 = 0;
+ big->blocks = 0;
+ return big;
+}
+
+// ASCII85-encodes 4 input bytes from bytes4 into chars5 array
+// returns # of output chars
+static int convert85(const uchar *bytes4, uchar *chars5)
+{
+ if (bytes4[0] == 0 && bytes4[1] == 0 && bytes4[2] == 0 && bytes4[3] == 0) {
+ chars5[0] = 'z';
+ return 1;
+ }
+ unsigned val = bytes4[0]*(256*256*256) + bytes4[1]*(256*256) + bytes4[2]*256 + bytes4[3];
+ chars5[0] = val / 52200625 + 33; // 52200625 = 85 to the 4th
+ val = val % 52200625;
+ chars5[1] = val / 614125 + 33; // 614125 = 85 cube
+ val = val % 614125;
+ chars5[2] = val / 7225 + 33; // 7225 = 85 squared
+ val = val % 7225;
+ chars5[3] = val / 85 + 33;
+ chars5[4] = val % 85 + 33;
+ return 5;
+}
+
+
+void Fl_PostScript_Graphics_Driver::write85(void *data, const uchar *p, int len) // sends len input bytes for ASCII85 encoding
+{
+ struct85 *big = (struct85 *)data;
+ const uchar *last = p + len;
+ while (p < last) {
+ int c = 4 - big->l4;
+ if (last-p < c) c = last-p;
+ memcpy(big->bytes4 + big->l4, p, c);
+ p += c;
+ big->l4 += c;
+ if (big->l4 == 4) {
+ c = convert85(big->bytes4, big->chars5);
+ fwrite(big->chars5, c, 1, output);
+ big->l4 = 0;
+ if (++big->blocks >= 16) { fputc('\n', output); big->blocks = 0; }
+ }
+ }
+}
+
+
+void Fl_PostScript_Graphics_Driver::close85(void *data) // stops ASCII85-encoding after processing remaining unencoded input bytes, if any
+{
+ struct85 *big = (struct85 *)data;
+ int l;
+ if (big->l4) { // # of remaining unencoded input bytes
+ l = big->l4;
+ while (l < 4) big->bytes4[l++] = 0; // complete them with 0s
+ l = convert85(big->bytes4, big->chars5); // encode them
+ if (l == 1) memset(big->chars5, '!', 5);
+ fwrite(big->chars5, big->l4 + 1, 1, output);
+ }
+ fputs("~>", output); // write EOD mark
+ delete big;
+}
+
+//
+// End of implementation of the /ASCII85Encode PostScript filter
+//
+
+//
+// Implementation of the /RunLengthEncode + /ASCII85Encode PostScript filter
+// as described in "PostScript LANGUAGE REFERENCE third edition" p. 142
+//
+
+struct struct_rle85 {
+ struct85 *data85; // aux data for ASCII85 encoding
+ uchar buffer[128]; // holds non-run data
+ int count; // current buffer length
+ int run_length; // current length of run
+};
+
+void *Fl_PostScript_Graphics_Driver::prepare_rle85() // prepare to produce RLE+ASCII85-encoded output
+{
+ struct_rle85 *rle = new struct_rle85;
+ rle->count = 0;
+ rle->run_length = 0;
+ rle->data85 = (struct85*)prepare85();
+ return rle;
+}
+
+
+void Fl_PostScript_Graphics_Driver::write_rle85(uchar b, void *data) // sends one input byte to RLE+ASCII85 encoding
+{
+ struct_rle85 *rle = (struct_rle85 *)data;
+ uchar c;
+ if (rle->run_length > 0) { // if within a run
+ if (b == rle->buffer[0] && rle->run_length < 128) { // the run can be extended
+ rle->run_length++;
+ return;
+ } else { // output the run
+ c = (uchar)(257 - rle->run_length);
+ write85(rle->data85, &c, 1); // the run-length info
+ write85(rle->data85, rle->buffer, 1); // the byte of the run
+ rle->run_length = 0;
+ }
+ }
+ if (rle->count >= 2 && b == rle->buffer[rle->count-1] && b == rle->buffer[rle->count-2]) {
+ // about to begin a run
+ if (rle->count > 2) { // there is non-run data before the run in the buffer
+ c = (uchar)(rle->count-2 - 1);
+ write85(rle->data85, &c, 1); // length of non-run data
+ write85(rle->data85, rle->buffer, rle->count-2); // non-run data
+ }
+ rle->run_length = 3;
+ rle->buffer[0] = b;
+ rle->count = 0;
+ return;
+ }
+ if (rle->count >= 128) { // the non-run buffer is full, output it
+ c = (uchar)(rle->count - 1);
+ write85(rle->data85, &c, 1); // length of non-run data
+ write85(rle->data85, rle->buffer, rle->count); // non-run data
+ rle->count = 0;
+ }
+ rle->buffer[rle->count++] = b; // add byte to end of non-run buffer
+}
+
+
+void Fl_PostScript_Graphics_Driver::close_rle85(void *data) // stop doing RLE+ASCII85 encoding
+{
+ struct_rle85 *rle = (struct_rle85 *)data;
+ uchar c;
+ if (rle->run_length > 0) { // if within a run, output it
+ c = (uchar)(257 - rle->run_length);
+ write85(rle->data85, &c, 1);
+ write85(rle->data85, rle->buffer, 1);
+ } else if (rle->count) { // output the non-run buffer, if not empty
+ c = (uchar)(rle->count - 1);
+ write85(rle->data85, &c, 1);
+ write85(rle->data85, rle->buffer, rle->count);
+ }
+ c = (uchar)128;
+ write85(rle->data85, &c, 1); // output EOD mark
+ close85(rle->data85); // close ASCII85 encoding process
+ delete rle;
+}
+
+//
+// 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){
@@ -231,66 +395,61 @@ void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data
else interpol="false";
if (mask && lang_level_ > 2) {
fprintf(output, "%g %g %g %g %i %i %i %i %s CIM\n", x , y+h , w , -h , iw , ih, mx, my, interpol);
- }
+ }
else if (mask && lang_level_ == 2) {
level2_mask = 1; // use method for drawing masked color image with PostScript level 2
fprintf(output, " %g %g %g %g %d %d pixmap_plot\n", x, y, w, h, iw, ih);
}
else {
fprintf(output, "%g %g %g %g %i %i %s CII\n", x , y+h , w , -h , iw , ih, interpol);
- }
+ }
} 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);
uchar *curdata = rgbdata;
for (i=0 ; i<iw ; i++) {
- if (!(i%20)) fputs("\n", output);
- fprintf(output, "%.2x%.2x%.2x", curdata[0], curdata[1], curdata[2]);
- curdata += D;
- }
- fputs("\n", output);
+ write_rle85(curdata[0], big); write_rle85(curdata[1], big); write_rle85(curdata[2], big);
+ curdata += D;
}
- fputs(">\n", output);
+ }
+ close_rle85(big); fputc('\n', output);
+ big = prepare_rle85();
for (j = ih - 1; j >= 0; j--) { // output mask data
curmask = mask + j * (my/ih) * ((mx+7)/8);
for (k=0; k < my/ih; k++) {
- for (i=0; i < ((mx+7)/8); i++) {
- if (!(i%40)) fputs("\n", output);
- fprintf(output, "%.2x",swap_byte(*curmask));
- curmask++;
- }
- fputs("\n", output);
+ for (i=0; i < ((mx+7)/8); i++) {
+ write_rle85(swap_byte(*curmask), big);
+ curmask++;
+ }
}
}
- fputs(">\n", output);
}
else {
for (j=0; j<ih;j++) {
if (mask && lang_level_ > 2) { // InterleaveType 2 mask data
- for (k=0; k<my/ih;k++) { //for alpha pseudo-masking
- for (i=0; i<((mx+7)/8);i++) {
- if (!(i%40)) fputs("\n", output);
- fprintf(output, "%.2x",swap_byte(*curmask));
- curmask++;
- }
- fprintf(output,"\n");
- }
+ for (k=0; k<my/ih;k++) { //for alpha pseudo-masking
+ for (i=0; i<((mx+7)/8);i++) {
+ write_rle85(swap_byte(*curmask), big);
+ curmask++;
+ }
+ }
}
call(data,0,j,iw,rgbdata);
uchar *curdata=rgbdata;
for (i=0 ; i<iw ; i++) {
- uchar r = curdata[0];
- uchar g = curdata[1];
- uchar b = curdata[2];
-
+ 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;
@@ -298,19 +457,15 @@ 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;
}
-
- if (!(i%40)) fputs("\n", output);
- fprintf(output, "%.2x%.2x%.2x", r, g, b);
-
- curdata +=D;
+
+ write_rle85(r, big); write_rle85(g, big); write_rle85(b, big);
+ curdata +=D;
}
- fputs("\n", output);
-
- }
- fputs(">\n", output);
+
}
-
- fprintf(output,"restore\n");
+ }
+ close_rle85(big);
+ fprintf(output,"\nrestore\n");
delete[] rgbdata;
}
@@ -341,20 +496,18 @@ void Fl_PostScript_Graphics_Driver::draw_image_mono(const uchar *data, int ix, i
int bg = (bg_r + bg_g + bg_b)/3;
uchar *curmask=mask;
+ void *big = prepare_rle85();
for (j=0; j<ih;j++){
if (mask){
for (k=0;k<my/ih;k++){
for (i=0; i<((mx+7)/8);i++){
- if (!(i%80)) fprintf(output, "\n");
- fprintf(output, "%.2x",swap_byte(*curmask));
+ write_rle85(swap_byte(*curmask), big);
curmask++;
}
- fprintf(output,"\n");
}
}
const uchar *curdata=data+j*LD;
for (i=0 ; i<iw ; i++) {
- if (!(i%80)) fprintf(output, "\n");
uchar r = curdata[0];
if (lang_level_<3 && D>1) { //can do mixing
@@ -362,16 +515,13 @@ void Fl_PostScript_Graphics_Driver::draw_image_mono(const uchar *data, int ix, i
unsigned int a = 255-a2;
r = (a2 * r + bg * a)/255;
}
- if (!(i%120)) fprintf(output, "\n");
- fprintf(output, "%.2x", r);
+ write_rle85(r, big);
curdata +=D;
}
- fprintf(output,"\n");
}
-
- fprintf(output," >\nrestore\n" );
-
+ close_rle85(big);
+ fprintf(output,"restore\n");
}
@@ -395,29 +545,25 @@ void Fl_PostScript_Graphics_Driver::draw_image_mono(Fl_Draw_Image_Cb call, void
int LD=iw*D;
uchar *rgbdata=new uchar[LD];
uchar *curmask=mask;
+ void *big = prepare_rle85();
for (j=0; j<ih;j++){
if (mask && lang_level_>2){ // InterleaveType 2 mask data
for (k=0; k<my/ih;k++){ //for alpha pseudo-masking
for (i=0; i<((mx+7)/8);i++){
- if (!(i%40)) fprintf(output, "\n");
- fprintf(output, "%.2x",swap_byte(*curmask));
+ write_rle85(swap_byte(*curmask), big);
curmask++;
}
- fprintf(output,"\n");
}
}
call(data,0,j,iw,rgbdata);
uchar *curdata=rgbdata;
for (i=0 ; i<iw ; i++) {
- uchar r = curdata[0];
- if (!(i%120)) fprintf(output, "\n");
- fprintf(output, "%.2x", r);
+ write_rle85(curdata[0], big);
curdata +=D;
}
- fprintf(output,"\n");
}
- fprintf(output,">\n");
+ close_rle85(big);
fprintf(output,"restore\n");
delete[] rgbdata;
}
@@ -456,6 +602,19 @@ void Fl_PostScript_Graphics_Driver::draw(Fl_RGB_Image * rgb,int XP, int YP, int
mask=0;
}
+int Fl_PostScript_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP){
+ int X, Y, W, H;
+ clip_box(XP,YP,WP,HP,X,Y,W,H); // X,Y,W,H will give the unclipped area of XP,YP,WP,HP
+ if (W == 0 || H == 0) return 1;
+ push_no_clip(); // remove the FLTK clip that can't be rescaled
+ clocale_printf("%d %d %i %i CL\n", X, Y, W, H);
+ clocale_printf("GS %d %d TR %f %f SC GS\n", XP, YP, float(WP)/img->w(), float(HP)/img->h());
+ img->draw(0, 0, img->w(), img->h(), 0, 0);
+ clocale_printf("GR GR\n");
+ pop_clip(); // restore FLTK's clip
+ return 1;
+}
+
void Fl_PostScript_Graphics_Driver::draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy){
const uchar * di = bitmap->array;
int w,h;
@@ -479,17 +638,16 @@ void Fl_PostScript_Graphics_Driver::draw(Fl_Bitmap * bitmap,int XP, int YP, int
int i,j;
push_clip(XP, YP, WP, HP);
- fprintf(output , "%i %i %i %i %i %i MI", XP - si, YP + HP , WP , -HP , w , h);
+ fprintf(output , "%i %i %i %i %i %i MI\n", XP - si, YP + HP , WP , -HP , w , h);
+ void *rle85 = prepare_rle85();
for (j=0; j<HP; j++){
for (i=0; i<xx; i++){
- if (!(i%80)) fprintf(output, "\n"); // not have lines longer than 255 chars
- fprintf(output, "%.2x", swap_byte(*di) );
+ write_rle85(swap_byte(*di), rle85);
di++;
}
- fprintf(output,"\n");
}
- fprintf(output,">\n");
+ close_rle85(rle85); fputc('\n', output);
pop_clip();
}
diff --git a/src/scandir.c b/src/scandir.c
index 27d40dc..138e897 100644
--- a/src/scandir.c
+++ b/src/scandir.c
@@ -1,5 +1,5 @@
/*
- * "$Id: scandir.c 9858 2013-04-05 14:14:08Z manolo $"
+ * "$Id: scandir.c 11243 2016-02-27 15:14:42Z AlbrechtS $"
*
* This is a placekeeper stub that pulls in scandir implementations for host
* systems that do not provide a compatible one natively
@@ -27,6 +27,9 @@
# endif /* HAVE_SCANDIR */
#endif
+/* Avoid "ISO C forbids an empty translation unit" warning */
+typedef int dummy;
+
/*
- * End of "$Id: scandir.c 9858 2013-04-05 14:14:08Z manolo $".
+ * End of "$Id: scandir.c 11243 2016-02-27 15:14:42Z AlbrechtS $".
*/
diff --git a/src/screen_xywh.cxx b/src/screen_xywh.cxx
index 67f7ed7..cfce3c0 100644
--- a/src/screen_xywh.cxx
+++ b/src/screen_xywh.cxx
@@ -1,9 +1,9 @@
//
-// "$Id: screen_xywh.cxx 10228 2014-08-21 08:14:19Z cand $"
+// "$Id: screen_xywh.cxx 11889 2016-08-23 16:38:10Z AlbrechtS $"
//
// Screen/monitor bounding box API for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -131,7 +131,7 @@ static void screen_init() {
screens[i].width = int(r.size.width);
screens[i].height = int(r.size.height);
//fprintf(stderr,"screen %d %dx%dx%dx%d\n",i,screens[i].x,screens[i].y,screens[i].width,screens[i].height);
- if (CGDisplayScreenSize != NULL) {
+ if (&CGDisplayScreenSize != NULL) {
CGSize s = CGDisplayScreenSize(displays[i]); // from 10.3
dpi_h[i] = screens[i].width / (s.width/25.4);
dpi_v[i] = screens[i].height / (s.height/25.4);
@@ -142,7 +142,7 @@ static void screen_init() {
num_screens = count;
}
-#else
+#else // X11
#if HAVE_XINERAMA
# include <X11/extensions/Xinerama.h>
@@ -156,10 +156,54 @@ typedef struct {
static FLScreenInfo screens[MAX_SCREENS];
static float dpi[MAX_SCREENS][2];
+#define USE_XRANDR (HAVE_DLSYM && HAVE_DLFCN_H) // means attempt to dynamically load libXrandr.so
+#if USE_XRANDR
+#include <dlfcn.h>
+typedef struct {
+ int width, height;
+ int mwidth, mheight;
+} XRRScreenSize;
+typedef XRRScreenSize* (*XRRSizes_type)(Display *dpy, int screen, int *nsizes);
+#endif // USE_XRANDR
+
static void screen_init() {
if (!fl_display) fl_open_display();
- // FIXME: Rewrite using RandR instead
+
+ int dpi_by_randr = 0;
+ float dpih = 0.0f, dpiv = 0.0f;
+
+#if USE_XRANDR
+
+ static XRRSizes_type XRRSizes_f = NULL;
+ if (!XRRSizes_f) {
+ void *libxrandr_addr = dlopen("libXrandr.so.2", RTLD_LAZY);
+ if (!libxrandr_addr) libxrandr_addr = dlopen("libXrandr.so", RTLD_LAZY);
+# ifdef __APPLE_CC__ // allows testing on Darwin + X11
+ if (!libxrandr_addr) libxrandr_addr = dlopen("/opt/X11/lib/libXrandr.dylib", RTLD_LAZY);
+# endif
+ if (libxrandr_addr) XRRSizes_f = (XRRSizes_type)dlsym(libxrandr_addr, "XRRSizes");
+ }
+ if (XRRSizes_f) {
+ int nscreens;
+ XRRScreenSize *ssize = XRRSizes_f(fl_display, fl_screen, &nscreens);
+
+ //for (int i=0; i<nscreens; i++)
+ // printf("width=%d height=%d mwidth=%d mheight=%d\n",
+ // ssize[i].width,ssize[i].height,ssize[i].mwidth,ssize[i].mheight);
+
+ if (nscreens > 0) { // Note: XRRSizes() *may* return nscreens == 0, see docs
+ int mm = ssize[0].mwidth;
+ dpih = mm ? ssize[0].width*25.4f/mm : 0.0f;
+ mm = ssize[0].mheight;
+ dpiv = mm ? ssize[0].height*25.4f/mm : 0.0f;
+ dpi_by_randr = 1;
+ }
+ }
+
+#endif // USE_XRANDR
+
#if HAVE_XINERAMA
+
if (XineramaIsActive(fl_display)) {
XineramaScreenInfo *xsi = XineramaQueryScreens(fl_display, &num_screens);
if (num_screens > MAX_SCREENS) num_screens = MAX_SCREENS;
@@ -171,33 +215,45 @@ static void screen_init() {
screens[i].width = xsi[i].width;
screens[i].height = xsi[i].height;
- int mm = DisplayWidthMM(fl_display, fl_screen);
- 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;
+ if (dpi_by_randr) {
+ 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;
+ mm = DisplayHeightMM(fl_display, fl_screen);
+ dpi[i][1] = mm ? screens[i].height*25.4f/mm : 0.0f;
+ }
}
if (xsi) XFree(xsi);
- } else
-#endif
- { // ! XineramaIsActive()
+ } else
+
+#endif // HAVE_XINERAMA
+
+ { // ! HAVE_XINERAMA || ! XineramaIsActive()
num_screens = ScreenCount(fl_display);
if (num_screens > MAX_SCREENS) num_screens = MAX_SCREENS;
-
+
for (int i=0; i<num_screens; i++) {
screens[i].x_org = 0;
screens[i].y_org = 0;
screens[i].width = DisplayWidth(fl_display, i);
screens[i].height = DisplayHeight(fl_display, i);
-
- int mm = DisplayWidthMM(fl_display, i);
- dpi[i][0] = mm ? DisplayWidth(fl_display, i)*25.4f/mm : 0.0f;
- mm = DisplayHeightMM(fl_display, i);
- dpi[i][1] = mm ? DisplayHeight(fl_display, i)*25.4f/mm : 0.0f;
+
+ if (dpi_by_randr) {
+ 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;
+ }
}
}
}
-#endif // WIN32
+#endif // ( WIN32 || __APPLE__ || ) X11
#ifndef FL_DOXYGEN
void Fl::call_screen_init() {
@@ -326,7 +382,7 @@ int Fl::screen_num(int x, int y) {
if (num_screens < 0) screen_init();
for (int i = 0; i < num_screens; i ++) {
- int sx, sy, sw, sh;
+ int sx = 0, sy = 0, sw = 0, sh = 0;
Fl::screen_xywh(sx, sy, sw, sh, i);
if ((x >= sx) && (x < (sx+sw)) && (y >= sy) && (y < (sy+sh))) {
screen = i;
@@ -358,7 +414,7 @@ int Fl::screen_num(int x, int y, int w, int h) {
int best_screen = 0;
float best_intersection = 0.;
for (int i = 0; i < Fl::screen_count(); i++) {
- int sx, sy, sw, sh;
+ int sx = 0, sy = 0, sw = 0, sh = 0;
Fl::screen_xywh(sx, sy, sw, sh, i);
float sintersection = fl_intersection(x, y, w, h, sx, sy, sw, sh);
if (sintersection > best_intersection) {
@@ -401,5 +457,5 @@ void Fl::screen_dpi(float &h, float &v, int n)
//
-// End of "$Id: screen_xywh.cxx 10228 2014-08-21 08:14:19Z cand $".
+// End of "$Id: screen_xywh.cxx 11889 2016-08-23 16:38:10Z AlbrechtS $".
//
diff --git a/src/vsnprintf.c b/src/vsnprintf.c
index bbf4229..1dfb069 100644
--- a/src/vsnprintf.c
+++ b/src/vsnprintf.c
@@ -1,5 +1,5 @@
/*
- * "$Id: vsnprintf.c 10229 2014-08-21 12:01:46Z cand $"
+ * "$Id: vsnprintf.c 11243 2016-02-27 15:14:42Z AlbrechtS $"
*
* snprintf() and vsnprintf() functions for the Fast Light Tool Kit (FLTK).
*
@@ -128,7 +128,7 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) {
case 'e' :
case 'f' :
case 'g' :
- if ((width + 2) > sizeof(temp)) break;
+ if ((width + 2) > (int)sizeof(temp)) break;
sprintf(temp, tformat, va_arg(ap, double));
@@ -153,7 +153,7 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) {
case 'o' :
case 'u' :
case 'x' :
- if ((width + 2) > sizeof(temp)) break;
+ if ((width + 2) > (int)sizeof(temp)) break;
#ifdef HAVE_LONG_LONG
if (size == 'L')
@@ -179,7 +179,7 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) {
break;
case 'p' : /* Pointer value */
- if ((width + 2) > sizeof(temp)) break;
+ if ((width + 2) > (int)sizeof(temp)) break;
sprintf(temp, tformat, va_arg(ap, void *));
@@ -254,7 +254,7 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) {
if (bufptr) *bufptr = '\0';
return (bytes);
-#endif //HAVE_VSNPRINTF
+#endif /* HAVE_VSNPRINTF */
}
int fl_snprintf(char* str, size_t size, const char* fmt, ...) {
@@ -271,6 +271,6 @@ int fl_snprintf(char* str, size_t size, const char* fmt, ...) {
#endif
/*
- * End of "$Id: vsnprintf.c 10229 2014-08-21 12:01:46Z cand $".
+ * End of "$Id: vsnprintf.c 11243 2016-02-27 15:14:42Z AlbrechtS $".
*/
diff --git a/src/xutf8/README b/src/xutf8/README
index cc9c51d..6bada4c 100644
--- a/src/xutf8/README
+++ b/src/xutf8/README
@@ -1,50 +1,41 @@
+---------------------------------------------------------------------------
+Important note: this file is outdated (as of FLTK 1.3.x, 2012 and later).
+Many things have been changed meanwhile.
+Use all information with care!
+---------------------------------------------------------------------------
supported encodings :
---------------------
iso10646-1
-iso8859-1
-iso8859-2
-iso8859-3
-iso8859-4
-iso8859-5
-iso8859-6
-iso8859-7
-iso8859-8
-iso8859-9
+iso8859-1
+iso8859-2
+iso8859-3
+iso8859-4
+iso8859-5
+iso8859-6
+iso8859-7
+iso8859-8
+iso8859-9
iso8859-10
iso8859-11
-iso8859-13
-iso8859-14
-iso8859-15
-koi8-r
-koi8-u
-big5-0
+iso8859-13
+iso8859-14
+iso8859-15
+koi8-r
+koi8-u
+big5-0
gbk
-gb2312.1980-0
-jisx0201.1976-0
-jisx0208.1983-0
-jisx0212.1990-0
+gb2312.1980-0
+jisx0201.1976-0
+jisx0208.1983-0
+jisx0212.1990-0
ksc5601.1987-0
-symbol
+symbol
dingbats
-TIPS:
-=====
-
-You must add "-lXutf8" to the library list in your Makefile.
-
-When using "GNU autoconf" add these lines to your "configure.in" :
-
-dnl Test to see if libXutf8 is on this machine:
-XUTFLIB=
-AC_CHECK_LIB(Xutf8, XUtf8IsNonSpacing, \
- AC_DEFINE(HAVE_XUTF8) XUTFLIB=" -lXutf8", ,\
- -lX11 $X_EXTRA_LIBS)
-AC_SUBST(XUTFLIB)
-
ORIGINAL FILES :
================
@@ -64,4 +55,3 @@ export CVSROOT=anoncvs@anoncvs.xfree86.org:/cvs
cvs checkout xc/lib/X11
password: anoncvs
)
-
diff --git a/src/xutf8/case.c b/src/xutf8/case.c
index 6acb915..8efc0e3 100644
--- a/src/xutf8/case.c
+++ b/src/xutf8/case.c
@@ -16,9 +16,13 @@
*/
/*
- * This file is required on all platforms for utf8 support
+ * This file is required on all platforms for UTF-8 support
*/
+#if !defined(WIN32) && !defined(__APPLE__)
+# include "../Xutf8.h"
+#endif /* !defined(WIN32) && !defined(__APPLE__) */
+
#include "headers/case.h"
#include <stdlib.h>
diff --git a/src/xutf8/is_spacing.c b/src/xutf8/is_spacing.c
index c972224..6e3d6ab 100644
--- a/src/xutf8/is_spacing.c
+++ b/src/xutf8/is_spacing.c
@@ -18,6 +18,10 @@
* This file is required on all platforms for utf8 support
*/
+#if !defined(WIN32) && !defined(__APPLE__)
+# include "../Xutf8.h"
+#endif /* !defined(WIN32) && !defined(__APPLE__) */
+
#include "headers/spacing.h"
unsigned short
diff --git a/src/xutf8/stamp-h b/src/xutf8/stamp-h
deleted file mode 100644
index 9788f70..0000000
--- a/src/xutf8/stamp-h
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/src/xutf8/stamp-h.in b/src/xutf8/stamp-h.in
deleted file mode 100644
index 9788f70..0000000
--- a/src/xutf8/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/src/xutf8/utf8Input.c b/src/xutf8/utf8Input.c
index 5682ac7..9a0c2e5 100644
--- a/src/xutf8/utf8Input.c
+++ b/src/xutf8/utf8Input.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <stdlib.h>
-#if HAVE_LIBC_ICONV
+#ifdef HAVE_LIBC_ICONV
#include <iconv.h>
#endif
/*
@@ -56,7 +56,7 @@ typedef struct {
static int
XConvertEucTwToUtf8(char* buffer_return, int len) {
/* FIXME */
-#if HAVE_LIBC_ICONV
+#ifdef HAVE_LIBC_ICONV
iconv_t cd;
int cdl;
#else
@@ -69,7 +69,7 @@ XConvertEucTwToUtf8(char* buffer_return, int len) {
/*b = */ buf = (char*) malloc((unsigned)len);
memcpy(buf, buffer_return, (unsigned) len);
-#if HAVE_LIBC_ICONV
+#ifdef HAVE_LIBC_ICONV
l = cdl = len;
cd = iconv_open("EUC-TW", "UTF-8");
iconv(cd, &b, &len, &buffer_return, &cdl);
diff --git a/src/xutf8/utf8Wrap.c b/src/xutf8/utf8Wrap.c
index d26eba1..bc7742f 100644
--- a/src/xutf8/utf8Wrap.c
+++ b/src/xutf8/utf8Wrap.c
@@ -1,4 +1,4 @@
-/* "$Id: utf8Wrap.c 10248 2014-08-23 08:41:58Z cand $"
+/* "$Id: utf8Wrap.c 11243 2016-02-27 15:14:42Z AlbrechtS $"
*
* Author: Jean-Marc Lienher ( http://oksid.ch )
* Copyright 2000-2003 by O'ksi'D.
@@ -229,11 +229,7 @@ static void
load_fonts(Display *dpy,
XUtf8FontStruct *font_set) {
- int i;
- /* char **list; */
-
- i = 0;
- /* list = NULL; */
+ int i = 0;
font_set->fonts = (XFontStruct**) malloc(sizeof(XFontStruct*) *
font_set->nb_font);
@@ -383,7 +379,7 @@ XUtf8DrawRtlString(Display *display,
ptr = buf + 128;
}
- ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs);
+ ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs);
if (ulen < 1) ulen = 1;
@@ -398,7 +394,7 @@ XUtf8DrawRtlString(Display *display,
while (fnum < nb_font) {
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
if (encodings[fnum] != 0 ||
- (ucs >= ranges[fnum * 2] && ucs <= ranges[fnum * 2 + 1])) {
+ ((int)ucs >= ranges[fnum * 2] && (int)ucs <= ranges[fnum * 2 + 1])) {
break;
}
}
@@ -500,7 +496,7 @@ XUtf8DrawString(Display *display,
i = 0;
}
- ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs);
+ ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs);
if (ulen < 1) ulen = 1;
@@ -515,8 +511,8 @@ XUtf8DrawString(Display *display,
while (fnum < nb_font) {
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
if (encodings[fnum] != 0 ||
- (ucs >= ranges[fnum * 2] &&
- ucs <= ranges[fnum * 2 + 1])) {
+ ((int)ucs >= ranges[fnum * 2] &&
+ (int)ucs <= ranges[fnum * 2 + 1])) {
break;
}
}
@@ -633,7 +629,7 @@ XUtf8_measure_extents(
i = 0;
}
- ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs);
+ ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs);
if (ulen < 1) ulen = 1;
@@ -648,8 +644,8 @@ XUtf8_measure_extents(
while (fnum < nb_font) {
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
if (encodings[fnum] != 0 ||
- (ucs >= ranges[fnum * 2] &&
- ucs <= ranges[fnum * 2 + 1])) {
+ ((int)ucs >= ranges[fnum * 2] &&
+ (int)ucs <= ranges[fnum * 2 + 1])) {
break;
}
}
@@ -756,7 +752,7 @@ XUtf8TextWidth(XUtf8FontStruct *font_set,
i = 0;
}
- ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs);
+ ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs);
if (ulen < 1) ulen = 1;
@@ -773,8 +769,8 @@ XUtf8TextWidth(XUtf8FontStruct *font_set,
while (fnum < nb_font) {
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
if (encodings[fnum] != 0 ||
- (ucs >= ranges[fnum * 2] &&
- ucs <= ranges[fnum * 2 + 1])) {
+ ((int)ucs >= ranges[fnum * 2] &&
+ (int)ucs <= ranges[fnum * 2 + 1])) {
break;
}
}
@@ -816,24 +812,20 @@ XUtf8TextWidth(XUtf8FontStruct *font_set,
/** get the X font and glyph ID of a UCS char **/
/*****************************************************************************/
int
-XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set,
- unsigned int ucs,
- XFontStruct **fnt,
- unsigned short *id) {
+fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set,
+ unsigned int ucs,
+ XFontStruct **fnt,
+ unsigned short *id) {
- /* int x; */
int *encodings; /* encodings array */
XFontStruct **fonts; /* fonts array */
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; */
if (nb_font < 1) {
/* there is no font in the font_set :-( */
@@ -843,7 +835,6 @@ XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set,
ranges = font_set->ranges;
fonts = font_set->fonts;
encodings = font_set->encodings;
- /* i = 0; */
fnum = 0;
while(fnum < nb_font && !fonts[fnum]) fnum++;
@@ -853,18 +844,16 @@ XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set,
}
first = fnum;
- /* last_fnum = fnum; */
/*
- * find the first encoding which can be used to
- * draw the glyph
+ * find the first encoding which can be used to draw the glyph
*/
fnum = first;
while (fnum < nb_font) {
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
if (encodings[fnum] != 0 ||
- (ucs >= ranges[fnum * 2] &&
- ucs <= ranges[fnum * 2 + 1])) {
+ ((int)ucs >= ranges[fnum * 2] &&
+ (int)ucs <= ranges[fnum * 2 + 1])) {
break;
}
}
@@ -895,9 +884,7 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
XFontStruct **fonts; /* fonts array */
Fl_XChar2b buf[8]; /* 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 */
@@ -914,7 +901,6 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
ranges = font_set->ranges;
fonts = font_set->fonts;
encodings = font_set->encodings;
- /* i = 0; */
fnum = 0;
while(fnum < nb_font && !fonts[fnum]) fnum++;
@@ -924,7 +910,6 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
}
first = fnum;
- /* last_fnum = fnum; */
no_spc = XUtf8IsNonSpacing(ucs);
if (no_spc) ucs = no_spc;
@@ -937,8 +922,8 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
while (fnum < nb_font) {
if (fonts[fnum] &&
ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
- if (encodings[fnum] != 0 || (ucs >= ranges[fnum * 2] &&
- ucs <= ranges[fnum * 2 + 1])) {
+ if (encodings[fnum] != 0 || ((int)ucs >= ranges[fnum * 2] &&
+ (int)ucs <= ranges[fnum * 2 + 1])) {
break;
}
}
@@ -1039,5 +1024,5 @@ XFreeUtf8FontStruct(Display *dpy,
#endif /* X11 only */
/*
- * End of "$Id: utf8Wrap.c 10248 2014-08-23 08:41:58Z cand $".
+ * End of "$Id: utf8Wrap.c 11243 2016-02-27 15:14:42Z AlbrechtS $".
*/