Skip to content

Commit

Permalink
Update bundled FLTK
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Jun 4, 2024
1 parent b361d0f commit 1947edf
Show file tree
Hide file tree
Showing 323 changed files with 15,504 additions and 6,619 deletions.
23 changes: 16 additions & 7 deletions source_files/fltk/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Changes in FLTK 1.4.0 Released: Feb ?? 2024
the starting scaling factor of all FLTK apps.
- New Fl_Grid class to layout multiple columns and rows of widgets.
- New Fl_Flex class to layout one row or one column of widgets.
- New Fl_Terminal widget supporting Unicode/utf-8, ANSI/xterm escape codes
with full RGB color control.
- New Fl::keyboard_screen_scaling(0) call stops recognition of ctrl/+/-/0/
keystrokes as scaling all windows of a screen.
- New member function Fl_Image::scale(int width, int height) to set
Expand All @@ -54,8 +56,8 @@ Changes in FLTK 1.4.0 Released: Feb ?? 2024
- New Fl_SVG_Image class: gives support of scalable vector graphics images
to FLTK using the nanosvg software.
- New Fl_ICO_Image class to read Windows .ico icon files.
- New classes Fl_SVG_File_Surface and Fl_EPS_File_Surface to save any FLTK
graphics to SVG or EPS files, respectively.
- New classes Fl_PDF_File_Surface, Fl_SVG_File_Surface and Fl_EPS_File_Surface
to save any FLTK graphics to PDF, SVG or EPS files, respectively.
- New member functions Fl_Window::maximize(), Fl_Window::un_maximize() and
Fl_Window::maximize_active() to programmatically manage window maximization.
- Fl_Button now supports a compact flag that visually groups closely set
Expand Down Expand Up @@ -103,6 +105,8 @@ Changes in FLTK 1.4.0 Released: Feb ?? 2024
hardware support is present (a backup mechanism is available in absence
of this support). Thus, all text drawable in Fl_Window's can be drawn
in Fl_Gl_Window's (STR#3450).
- New member function Fl_Menu_Bar::play_menu(const char *title) to
programmatically open a menu of a menubar.
- New member functions Fl::program_should_quit(void),
and Fl::program_should_quit(int) to support detection by the library
of a request to terminate cleanly the program.
Expand Down Expand Up @@ -135,6 +139,13 @@ Changes in FLTK 1.4.0 Released: Feb ?? 2024
- New macros for easy function and method callbacks with multiple
type safe arguments (see FL_METHOD_CALLBACK_1 etc.) .

Removed Features

- X11 platform: Support of XDBE, the configure option '--enable-xdbe'
and the CMake option 'OPTION_USE_XDBE' have been removed because XDBE
was unreliable and rarely supported by X servers. Double buffering
support in Fl_Double_Window is not affected.

New Configuration Options (ABI Version)

- X11 platform: Added support for drawing text with the pango library
Expand Down Expand Up @@ -175,11 +186,9 @@ Changes in FLTK 1.4.0 Released: Feb ?? 2024
Other Improvements

- (add new items here)
- Reported support of macOS 14.0 "Sonoma".
- Added support for macOS 13.0 "Ventura".
- Added support for macOS 12.0 "Monterey".
- Added support for macOS 11.0 "Big Sur" and for building for
the arm64 architecture.
- Added support of macOS 14.0 "Sonoma", 13.0 "Ventura", 12.0 "Monterey",
and 11.0 "Big Sur".
- Added macOS support for the arm64 architecture since 11.0 (Big Sur).
- Added support for macOS 10.15 "Catalina"
- Added support for macOS 10.14 "Mojave": all drawing to windows is done
through "layer-backed views" when the app is linked to SDK 10.14.
Expand Down
6 changes: 6 additions & 0 deletions source_files/fltk/CMake/FLTKConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ else(CMAKE_CROSSCOMPILING)
function(_fltk_make_alias target from)
if(TARGET ${from} AND NOT TARGET ${target})
# message(STATUS "FLTKConfig.cmake - create alias: ${target} from ${from}")

# promote imported target to global visibility (CMake < 3.18 only)
if(CMAKE_VERSION VERSION_LESS "3.18")
set_target_properties(${from} PROPERTIES IMPORTED_GLOBAL TRUE)
endif()

get_target_property(ttype ${from} TYPE)
if(ttype STREQUAL "EXECUTABLE")
add_executable(${target} ALIAS ${from})
Expand Down
6 changes: 4 additions & 2 deletions source_files/fltk/CMake/fl_add_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ function(fl_add_library LIBNAME LIBTYPE SOURCES)
)

if(APPLE AND NOT FLTK_BACKEND_X11)
target_link_libraries(${TARGET_NAME} PUBLIC "-framework Cocoa")
foreach(item ${FLTK_COCOA_FRAMEWORKS})
target_link_libraries(${TARGET_NAME} PUBLIC "${item}")
endforeach()
endif()

# we must link fltk with cairo if Cairo or Wayland is enabled (or both)
Expand Down Expand Up @@ -195,7 +197,7 @@ function(fl_add_library LIBNAME LIBTYPE SOURCES)
OUTPUT_NAME_DEBUG ${LIBNAME}_dlld
OUTPUT_NAME_RELEASE ${LIBNAME}_dll
)
target_compile_definitions(${TARGET_NAME} PRIVATE FL_DLL)
target_compile_definitions(${TARGET_NAME} PUBLIC FL_DLL)
endif(MSVC)
endif(LIBTYPE STREQUAL "SHARED")

Expand Down
52 changes: 38 additions & 14 deletions source_files/fltk/CMake/fl_debug_var.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ function(fl_expand_name out in min_len)
set(temp "${in}${spaces}${spaces}")
string(SUBSTRING "${temp}" 0 ${min_len} temp)
set(${out} "${temp}" PARENT_SCOPE)
else()
set(${out} "${in}" PARENT_SCOPE)
endif()
endfunction(fl_expand_name)

Expand Down Expand Up @@ -94,22 +96,44 @@ function(fl_debug_target name)
message(STATUS "+++ fl_debug_target(${name})")
set(var "${name}")
fl_expand_name(var "${name}" 40)
if(TARGET ${name})
message(STATUS "${var} = <target>")
foreach(prop
ALIASED_TARGET
INTERFACE_INCLUDE_DIRECTORIES
INTERFACE_LINK_DIRECTORIES
INTERFACE_LINK_LIBRARIES)
get_target_property(${prop} ${name} ${prop})
if(NOT ${prop})
set(${prop} "")
endif()
fl_debug_var(${prop})
endforeach()
else()

if(NOT TARGET ${name})
message(STATUS "${var} = <not a target>")
message(STATUS "")
return()
endif()

get_target_property(_type ${name} TYPE)
# message(STATUS "${var} = target, type = ${_type}")

# these properties are always supported:
set(_props NAME TYPE ALIASED_TARGET)

# these properties can't be read from executable target types
### if(NOT _type STREQUAL "EXECUTABLE")
### list(APPEND _props
### LOCATION
### IMPORTED_LOCATION
### INTERFACE_LOCATION)
### endif()

list(APPEND _props
INCLUDE_DIRECTORIES
LINK_DIRECTORIES
LINK_LIBRARIES
COMPILE_DEFINITIONS
INTERFACE_COMPILE_DEFINITIONS
INTERFACE_INCLUDE_DIRECTORIES
INTERFACE_LINK_DIRECTORIES
INTERFACE_LINK_LIBRARIES)

foreach(prop ${_props})
get_target_property(${prop} ${name} ${prop})
if(NOT ${prop})
set(${prop} "")
endif()
fl_debug_var(${prop})
endforeach()
message(STATUS "")

endfunction(fl_debug_target)
89 changes: 89 additions & 0 deletions source_files/fltk/CMake/fl_summary.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#
# Macros used by the CMake build system for the Fast Light Tool Kit (FLTK).
#
# Copyright 2024 by Bill Spitzak and others.
#
# This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this
# file is missing or damaged, see the license at:
#
# https://www.fltk.org/COPYING.php
#
# Please see the following page on how to report bugs and issues:
#
# https://www.fltk.org/bugs.php
#

########################################################################
# The macros in this file are used to generate the CMake build summary.
# Fixed widths of title fields are intentionally hard coded in two of
# these macros so we can easily change the alignment.
########################################################################

include(${CMAKE_CURRENT_LIST_DIR}/fl_debug_var.cmake)

########################################################################
# Output a summary line like "<title> <value>"
########################################################################
# <title> will be expanded to a fixed width (can be empty)
# <value> text to be displayed
########################################################################

macro(fl_summary title value)
fl_expand_name(label "${title}" 24)
message(STATUS "${label} ${value}")
endmacro(fl_summary title value)

########################################################################
# Output a summary line like "<title> will be built ..."
# or "<title> will not be built ..."
########################################################################
# title will be expanded to a fixed width (must not be empty)
# subdir = relative build directory (e.g. lib or bin/test)
# build = CMake variable name (bool): whether <title> is built
# option = option name the user can set to build <title>
########################################################################

macro(fl_summary_build title subdir build option)
if(${build})
set(value "will be built in: ${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
else()
set(value "will not be built (set ${option}=ON to build)")
endif()
fl_expand_name(label "${title}" 19)
message(STATUS "${label} ${value}")
endmacro(fl_summary_build title var subdir)

########################################################################
# Output a simple summary line like "<title> {Yes|No}"
########################################################################
# title will be expanded to a fixed width (must not be empty)
# var = CMake variable name, must evaluate to true or false
########################################################################

macro(fl_summary_yn title var)
if(${var})
set(value "Yes")
else()
set(value "No")
endif()
fl_summary("${title}" ${value})
endmacro(fl_summary_yn title var)

########################################################################
# Output summary line for image libs (bundled or system libs)
########################################################################
# title = "Image Libraries" or empty
# name = displayed name = { JPEG | PNG | ZLIB }
# lib = CMake library name (system library, if it was found)
########################################################################

macro(fl_summary_image title name lib)
fl_expand_name(name4 "${name}" 8)
if(FLTK_USE_BUNDLED_${name})
set(value "${name4} = Bundled")
else()
set(value "${name4} = System: ${${lib}}")
endif()
fl_summary("${title}" "${value}")
endmacro(fl_summary_image title name lib)
Loading

0 comments on commit 1947edf

Please sign in to comment.