From d67218d6123ce8becf5778922d5ae2424143e329 Mon Sep 17 00:00:00 2001
From: dannye <33dannye@gmail.com>
Date: Tue, 22 Oct 2024 22:07:17 -0500
Subject: [PATCH] Update FLTK to 1.4.0rc1
---
.github/workflows/main.yml | 9 +-
.gitignore | 1 -
INSTALL.md | 29 +-
Makefile | 18 +-
ide/tilemap-studio.vcxproj | 8 +-
include/png.h | 65 ++--
include/pngconf.h | 8 +-
include/pnglibconf.h | 266 +++++++++++++++-
include/zconf.h | 299 +++++++++---------
include/zlib.h | 620 +++++++++++++++++++------------------
src/hex-spinner.cpp | 4 +-
src/main-window.h | 1 +
src/main.cpp | 2 +
src/modal-dialog.cpp | 6 +-
src/option-dialogs.cpp | 7 +
src/preferences.cpp | 8 +-
src/themes.cpp | 33 +-
src/widgets.cpp | 54 ++--
18 files changed, 880 insertions(+), 558 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c5ec3d4..e3192ab 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -19,19 +19,18 @@ jobs:
- name: Checkout FLTK
uses: actions/checkout@master
with:
- path: fltk
+ path: lib/fltk
repository: fltk/fltk
- ref: release-1.3.7
+ ref: release-1.4.0rc1
fetch-depth: 1
- name: Install FLTK
- working-directory: fltk
+ working-directory: lib/fltk
run: |
- ./autogen.sh --prefix="$PWD/.." --with-abiversion=10307
+ cmake -D CMAKE_INSTALL_PREFIX="$(realpath "$PWD/../..")" -D CMAKE_BUILD_TYPE=Release -D FLTK_GRAPHICS_CAIRO=1 -D FLTK_BACKEND_WAYLAND=0 -D FLTK_USE_SYSTEM_LIBPNG=0 -D FLTK_USE_SYSTEM_ZLIB=0
make
make install
- name: Build
run: |
- export PATH="$PWD/bin:$PATH"
make
diff --git a/.gitignore b/.gitignore
index 65e32c2..cb04198 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,6 @@ bin/
lib/
share/
tmp/
-fltk/
# no FL includes
include/FL/
diff --git a/INSTALL.md b/INSTALL.md
index 8e61e4b..1c41d62 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -18,14 +18,14 @@ If the pre-built release already works for you, you don't have to build it yours
1. On GitHub, click the green "**Code**" button and click "**Download ZIP**". This will download **tilemap-studio-master.zip**.
2. Unzip tilemap-studio-master.zip. This will create the **tilemap-studio-master** folder.
3. Navigate to the tilemap-studio-master folder in Explorer.
-4. Download fltk-1.3.7-source.tar.bz2 or fltk-1.3.7-source.tar.gz from [**fltk.org**](https://www.fltk.org/software.php) to a new **tilemap-studio-master\lib** subfolder.
-5. Extract fltk-1.3.7-source.tar (you may need a program such as [7-Zip](https://www.7-zip.org/)). This will create the lib\**fltk-1.3.7** folder.
-6. Open lib\fltk-1.3.7\abi-version.ide in a text editor such as Notepad and replace "`#undef FL_ABI_VERSION`" with "`#define FL_ABI_VERSION 10307`". Save it.
-7. Open lib\fltk-1.3.7\ide\VisualC2010\fltk.sln in Visual Studio 2019. (Other versions may or may not work, I haven't tried.)
-8. A "Retarget Projects" dialog will open, since fltk.sln was made for Visual Studio 2010. Click OK to upgrade the Windows SDK version and platform toolset.
-9. Go to **Build → Batch Build…**, check the projects **fltk**, **fltkimages**, **fltkpng**, **fltkjpeg**, and **fltkzlib** in the Release configuration, and click the **Build** button.
-10. Move all the .lib files from lib\fltk-1.3.7\lib\\\*.lib up to lib\\\*.lib.
-11. Copy the lib\FL folder up to include\FL.
+4. Download fltk-1.4.0rc1-source.tar.bz2 or fltk-1.4.0rc1-source.tar.gz from [**fltk.org**](https://www.fltk.org/software.php) to a new **tilemap-studio-master\lib** subfolder.
+5. Extract fltk-1.4.0rc1-source.tar (you may need a program such as [7-Zip](https://www.7-zip.org/)). This will create the lib\\**fltk-1.4.0rc1** folder.
+6. Open Visual Studio, select **Open a local folder**, and open the lib\fltk-1.4.0rc1 folder. This will automatically generate the CMake project with a configuration named **x64-Debug** by default.
+7. From the Configuration dropdown, select **Manage Configurations...**, click the green plus sign to add a new configuration, and select **x86-Release** from the list. Set the **Configuration type** to **Release**, set the **Toolset** to **msvc_x86_x64**, and uncheck the **FLTK_GRAPHICS_GDIPLUS** option in the list of CMake variables.
+8. Set the active Configuration to **x86-Release**.
+9. In the **Solution Explorer**, switch to the **CMake Targets View**, right-click on **fltk_images**, and select **Build fltk_images**. This will also build the other required libraries: fltk, fltk_png, and fltk_z.
+10. Move all the .lib files from lib\fltk-1.4.0rc1\out\build\x86-Release\lib\\\*.lib up to lib\\\*.lib.
+11. Copy the lib\fltk-1.4.0rc1\\**FL** folder to a new include\\**FL** folder. Also copy lib\fltk-1.4.0rc1\out\build\x86-Release\FL\fl_config.h into include\FL.
12. Open ide\tilemap-studio.sln in Visual Studio 2019.
13. If the Solution Configuration dropdown on the toolbar says Debug, set it to **Release**.
14. Go to **Build → Build Solution** or press F7 to build the project. This will create bin\Release\**tilemapstudio.exe**.
@@ -38,6 +38,8 @@ If the pre-built release already works for you, you don't have to build it yours
You need at least g++ 7 for C++17 support.
+CMake (version 3.15 or later) is required for building FLTK 1.4.
+
#### Ubuntu/Debian
Run the following commands:
@@ -65,18 +67,15 @@ Run the following commands:
git clone https://github.com/Rangi42/tilemap-studio.git
cd tilemap-studio
-# Build FLTK 1.3.7 with the latest ABI enabled
-# (even if you already have libfltk1.3-dev installed)
-git clone --branch release-1.3.7 --depth 1 https://github.com/fltk/fltk.git
-pushd fltk
-./autogen.sh --prefix="$PWD/.." --with-abiversion=10307
+# Build FLTK 1.4.0
+git clone --branch release-1.4.0rc1 --depth 1 https://github.com/fltk/fltk.git lib/fltk
+pushd lib/fltk
+cmake -D CMAKE_INSTALL_PREFIX="$(realpath "$PWD/../..")" -D CMAKE_BUILD_TYPE=Release -D FLTK_GRAPHICS_CAIRO=1 -D FLTK_BACKEND_WAYLAND=0 -D FLTK_USE_SYSTEM_LIBPNG=0 -D FLTK_USE_SYSTEM_ZLIB=0
make
make install
popd
# Build Tilemap Studio
-# ("export PATH" is needed if bin/fltk-config is not already in your PATH)
-export PATH="$PWD/bin:$PATH"
make
# Install Tilemap Studio
diff --git a/Makefile b/Makefile
index c11f0a5..b38ee90 100644
--- a/Makefile
+++ b/Makefile
@@ -14,13 +14,15 @@ tmpdir = tmp
debugdir = tmp/debug
bindir = bin
-CXXFLAGS = -std=c++17 -I$(srcdir) -I$(resdir) $(shell fltk-config --use-images --cxxflags)
-LDFLAGS = $(shell fltk-config --use-images --ldflags) $(shell pkg-config --libs libpng xpm)
+fltk-config = $(bindir)/fltk-config
-RELEASEFLAGS = -DNDEBUG -O3 -flto -march=native
+CXXFLAGS := -std=c++17 -I$(srcdir) -I$(resdir) $(shell $(fltk-config) --use-images --cxxflags) $(CXXFLAGS)
+LDFLAGS := $(shell $(fltk-config) --use-images --ldstaticflags) $(shell pkg-config --libs xpm) $(LDFLAGS)
+
+RELEASEFLAGS = -DNDEBUG -O3 -flto
DEBUGFLAGS = -DDEBUG -D_DEBUG -O0 -g -ggdb3 -Wall -Wextra -pedantic -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter
-COMMON = $(wildcard $(srcdir)/*.h) $(wildcard $(resdir)/*.xpm)
+COMMON = $(wildcard $(srcdir)/*.h) $(wildcard $(resdir)/*.xpm) $(resdir)/help.html
SOURCES = $(wildcard $(srcdir)/*.cpp)
OBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(tmpdir)/%.o)
DEBUGOBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(debugdir)/%.o)
@@ -37,19 +39,19 @@ all: $(tilemapstudio)
$(tilemapstudio): release
$(tilemapstudiod): debug
-release: CXXFLAGS += $(RELEASEFLAGS)
+release: CXXFLAGS := $(RELEASEFLAGS) $(CXXFLAGS)
release: $(TARGET)
-debug: CXXFLAGS += $(DEBUGFLAGS)
+debug: CXXFLAGS := $(DEBUGFLAGS) $(CXXFLAGS)
debug: $(DEBUGTARGET)
$(TARGET): $(OBJECTS)
@mkdir -p $(@D)
- $(LD) -o $@ $^ $(LDFLAGS)
+ $(LD) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
$(DEBUGTARGET): $(DEBUGOBJECTS)
@mkdir -p $(@D)
- $(LD) -o $@ $^ $(LDFLAGS)
+ $(LD) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
$(tmpdir)/%.o: $(srcdir)/%.cpp $(COMMON)
@mkdir -p $(@D)
diff --git a/ide/tilemap-studio.vcxproj b/ide/tilemap-studio.vcxproj
index ae12f22..d46d5bf 100644
--- a/ide/tilemap-studio.vcxproj
+++ b/ide/tilemap-studio.vcxproj
@@ -21,13 +21,13 @@
Applicationtrue
- v142
+ v143UnicodeApplicationfalse
- v142
+ v143trueUnicode
@@ -74,7 +74,7 @@
WindowsDebugFull
- fltkimagesd.lib;fltkpngd.lib;fltkzlibd.lib;fltkd.lib;opengl32.lib;glu32.lib;comctl32.lib;%(AdditionalDependencies)
+ fltk_imagesd.lib;fltk_pngd.lib;fltk_zd.lib;fltkd.lib;opengl32.lib;glu32.lib;comctl32.lib;Ws2_32.lib;%(AdditionalDependencies)libcmtd.lib;%(IgnoreSpecificDefaultLibraries)..\lib\Debug/ignore:4099 %(AdditionalOptions)
@@ -103,7 +103,7 @@
falsetruetrue
- fltkimages.lib;fltkpng.lib;fltkzlib.lib;fltk.lib;opengl32.lib;glu32.lib;comctl32.lib;%(AdditionalDependencies)
+ fltk_images.lib;fltk_png.lib;fltk_z.lib;fltk.lib;opengl32.lib;glu32.lib;comctl32.lib;Ws2_32.lib;%(AdditionalDependencies)libcmt.lib;%(IgnoreSpecificDefaultLibraries)..\lib/ignore:4099 %(AdditionalOptions)
diff --git a/include/png.h b/include/png.h
index 139eb0d..83d3903 100644
--- a/include/png.h
+++ b/include/png.h
@@ -1,9 +1,9 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.37 - April 14, 2019
+ * libpng version 1.6.43
*
- * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -15,7 +15,7 @@
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson
- * libpng versions 1.6.36, December 2018, through 1.6.37, April 2019:
+ * libpng versions 1.6.36, December 2018, through 1.6.43, February 2024:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@@ -27,8 +27,8 @@
* PNG Reference Library License version 2
* ---------------------------------------
*
- * * Copyright (c) 1995-2019 The PNG Reference Library Authors.
- * * Copyright (c) 2018-2019 Cosmin Truta.
+ * * Copyright (c) 1995-2024 The PNG Reference Library Authors.
+ * * Copyright (c) 2018-2024 Cosmin Truta.
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* * Copyright (c) 1996-1997 Andreas Dilger.
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -239,7 +239,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
- * 1.6.37 16 10637 16.so.16.37[.0]
+ * 1.6.43 16 10643 16.so.16.43[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@@ -255,9 +255,6 @@
* to the info_ptr or png_ptr members through png.h, and the compiled
* application is loaded with a different version of the library.
*
- * DLLNUM will change each time there are forward or backward changes
- * in binary compatibility (e.g., when a new feature is added).
- *
* See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO/IEC Standard; see
*
@@ -278,19 +275,21 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.37"
-#define PNG_HEADER_VERSION_STRING " libpng version 1.6.37 - April 14, 2019\n"
+#define PNG_LIBPNG_VER_STRING "1.6.43"
+#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
-#define PNG_LIBPNG_VER_SONUM 16
-#define PNG_LIBPNG_VER_DLLNUM 16
+/* The versions of shared library builds should stay in sync, going forward */
+#define PNG_LIBPNG_VER_SHAREDLIB 16
+#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
+#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
-#define PNG_LIBPNG_VER_RELEASE 37
+#define PNG_LIBPNG_VER_RELEASE 43
/* This should be zero for a public release, or non-zero for a
- * development version. [Deprecated]
+ * development version.
*/
#define PNG_LIBPNG_VER_BUILD 0
@@ -318,7 +317,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
-#define PNG_LIBPNG_VER 10637 /* 1.6.37 */
+#define PNG_LIBPNG_VER 10643 /* 1.6.43 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -428,7 +427,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char* png_libpng_version_1_6_37;
+typedef char* png_libpng_version_1_6_43;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -849,7 +848,7 @@ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */
/* Added to libpng-1.5.4 */
#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */
-#if INT_MAX >= 0x8000 /* else this might break */
+#if ~0U > 0xffffU /* or else this might break on a 16-bit machine */
#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */
#endif
@@ -908,15 +907,15 @@ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
* PNG file. Returns zero if the supplied bytes match the 8-byte PNG
* signature, and non-zero otherwise. Having num_to_check == 0 or
- * start > 7 will always fail (ie return non-zero).
+ * start > 7 will always fail (i.e. return non-zero).
*/
PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, size_t start,
size_t num_to_check));
/* Simple signature checking function. This is the same as calling
- * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
+ * png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) == 0).
*/
-#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))
+#define png_check_sig(sig, n) (png_sig_cmp((sig), 0, (n)) == 0) /* DEPRECATED */
/* Allocate and initialize png_ptr struct for reading, and any other memory. */
PNG_EXPORTA(4, png_structp, png_create_read_struct,
@@ -1446,7 +1445,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
* mainly useful for testing, as the defaults should work with most users.
* Those users who are tight on memory or want faster performance at the
* expense of compression can modify them. See the compression library
- * header file (zlib.h) for an explination of the compression functions.
+ * header file (zlib.h) for an explanation of the compression functions.
*/
/* Set the filtering method(s) used by libpng. Currently, the only valid
@@ -1501,7 +1500,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9
* (0 - no compression, 9 - "maximal" compression). Note that tests have
* shown that zlib compression levels 3-6 usually perform as well as level 9
- * for PNG images, and do considerably fewer caclulations. In the future,
+ * for PNG images, and do considerably fewer calculations. In the future,
* these values may not correspond directly to the zlib compression levels.
*/
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
@@ -1730,12 +1729,9 @@ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));
PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,
png_inforp info_ptr, png_uint_32 free_me, int num));
-/* Reassign responsibility for freeing existing data, whether allocated
+/* Reassign the responsibility for freeing existing data, whether allocated
* by libpng or by the application; this works on the png_info structure passed
- * in, it does not change the state for other png_info structures.
- *
- * It is unlikely that this function works correctly as of 1.6.0 and using it
- * may result either in memory leaks or double free of allocated data.
+ * in, without changing the state for other png_info structures.
*/
PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
png_inforp info_ptr, int freer, png_uint_32 mask));
@@ -3207,11 +3203,18 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
#ifdef PNG_MIPS_MSA_API_SUPPORTED
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
#endif
-#define PNG_IGNORE_ADLER32 8
+#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
+# define PNG_IGNORE_ADLER32 8 /* SOFTWARE: disable Adler32 check on IDAT */
+#endif
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions supported */
+# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions
+ * supported */
#endif
-#define PNG_OPTION_NEXT 12 /* Next option - numbers must be even */
+#ifdef PNG_MIPS_MMI_API_SUPPORTED
+# define PNG_MIPS_MMI 12 /* HARDWARE: MIPS MMI SIMD instructions supported */
+#endif
+
+#define PNG_OPTION_NEXT 14 /* Next option - numbers must be even */
/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
diff --git a/include/pngconf.h b/include/pngconf.h
index 927a769..000d7b1 100644
--- a/include/pngconf.h
+++ b/include/pngconf.h
@@ -1,9 +1,9 @@
/* pngconf.h - machine-configurable file for libpng
*
- * libpng version 1.6.37
+ * libpng version 1.6.43
*
- * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -180,8 +180,8 @@
* compiler-specific macros to the values required to change the calling
* conventions of the various functions.
*/
-#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
- defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \
+ defined(__CYGWIN__)
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
* MinGW on any architecture currently supported by Windows. Also includes
* Watcom builds but these need special treatment because they are not
diff --git a/include/pnglibconf.h b/include/pnglibconf.h
index c78ba4d..55014e2 100644
--- a/include/pnglibconf.h
+++ b/include/pnglibconf.h
@@ -1,12 +1,17 @@
/*
** FLTK specific PNG lib configuration file -- see README.bundled-libs.txt
+**
+** This file must be generated on Linux in a libpng distribution using:
+** $ ./configure --with-libpng-prefix=fltk_
+** $ make
+** All lines including the 'fltk_' prefix must be upgraded with libpng.
*/
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.37 */
+/* libpng version 1.6.43 */
-/* Copyright (c) 2018-2019 Cosmin Truta */
+/* Copyright (c) 2018-2024 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
@@ -31,6 +36,7 @@
#define PNG_COLORSPACE_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
#define PNG_CONVERT_tIME_SUPPORTED
+/*#undef PNG_DISABLE_ADLER32_CHECK_SUPPORTED*/
#define PNG_EASY_ACCESS_SUPPORTED
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
#define PNG_ERROR_TEXT_SUPPORTED
@@ -45,6 +51,10 @@
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_IO_STATE_SUPPORTED
+/*#undef PNG_MIPS_MMI_API_SUPPORTED*/
+/*#undef PNG_MIPS_MMI_CHECK_SUPPORTED*/
+/*#undef PNG_MIPS_MSA_API_SUPPORTED*/
+/*#undef PNG_MIPS_MSA_CHECK_SUPPORTED*/
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
@@ -203,6 +213,7 @@
#define PNG_LINKAGE_DATA extern
#define PNG_LINKAGE_FUNCTION extern
#define PNG_MAX_GAMMA_8 11
+#define PNG_PREFIX fltk_
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_QUANTIZE_GREEN_BITS 5
#define PNG_QUANTIZE_RED_BITS 5
@@ -213,11 +224,260 @@
#define PNG_USER_HEIGHT_MAX 1000000
#define PNG_USER_WIDTH_MAX 1000000
#define PNG_ZBUF_SIZE 8192
-#define PNG_ZLIB_VERNUM 0x12b0
+#define PNG_ZLIB_VERNUM 0x1310
#define PNG_Z_DEFAULT_COMPRESSION (-1)
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
#define PNG_Z_DEFAULT_STRATEGY 1
#define PNG_sCAL_PRECISION 5
#define PNG_sRGB_PROFILE_CHECKS 2
/* end of settings */
+#define png_access_version_number fltk_png_access_version_number
+#define png_benign_error fltk_png_benign_error
+#define png_build_grayscale_palette fltk_png_build_grayscale_palette
+#define png_calloc fltk_png_calloc
+#define png_chunk_benign_error fltk_png_chunk_benign_error
+#define png_chunk_error fltk_png_chunk_error
+#define png_chunk_warning fltk_png_chunk_warning
+#define png_convert_from_struct_tm fltk_png_convert_from_struct_tm
+#define png_convert_from_time_t fltk_png_convert_from_time_t
+#define png_convert_to_rfc1123 fltk_png_convert_to_rfc1123
+#define png_convert_to_rfc1123_buffer fltk_png_convert_to_rfc1123_buffer
+#define png_create_info_struct fltk_png_create_info_struct
+#define png_create_read_struct fltk_png_create_read_struct
+#define png_create_read_struct_2 fltk_png_create_read_struct_2
+#define png_create_write_struct fltk_png_create_write_struct
+#define png_create_write_struct_2 fltk_png_create_write_struct_2
+#define png_data_freer fltk_png_data_freer
+#define png_destroy_info_struct fltk_png_destroy_info_struct
+#define png_destroy_read_struct fltk_png_destroy_read_struct
+#define png_destroy_write_struct fltk_png_destroy_write_struct
+#define png_error fltk_png_error
+#define png_free fltk_png_free
+#define png_free_data fltk_png_free_data
+#define png_free_default fltk_png_free_default
+#define png_get_IHDR fltk_png_get_IHDR
+#define png_get_PLTE fltk_png_get_PLTE
+#define png_get_bKGD fltk_png_get_bKGD
+#define png_get_bit_depth fltk_png_get_bit_depth
+#define png_get_cHRM fltk_png_get_cHRM
+#define png_get_cHRM_XYZ fltk_png_get_cHRM_XYZ
+#define png_get_cHRM_XYZ_fixed fltk_png_get_cHRM_XYZ_fixed
+#define png_get_cHRM_fixed fltk_png_get_cHRM_fixed
+#define png_get_channels fltk_png_get_channels
+#define png_get_chunk_cache_max fltk_png_get_chunk_cache_max
+#define png_get_chunk_malloc_max fltk_png_get_chunk_malloc_max
+#define png_get_color_type fltk_png_get_color_type
+#define png_get_compression_buffer_size fltk_png_get_compression_buffer_size
+#define png_get_compression_type fltk_png_get_compression_type
+#define png_get_copyright fltk_png_get_copyright
+#define png_get_current_pass_number fltk_png_get_current_pass_number
+#define png_get_current_row_number fltk_png_get_current_row_number
+#define png_get_eXIf fltk_png_get_eXIf
+#define png_get_eXIf_1 fltk_png_get_eXIf_1
+#define png_get_error_ptr fltk_png_get_error_ptr
+#define png_get_filter_type fltk_png_get_filter_type
+#define png_get_gAMA fltk_png_get_gAMA
+#define png_get_gAMA_fixed fltk_png_get_gAMA_fixed
+#define png_get_hIST fltk_png_get_hIST
+#define png_get_header_ver fltk_png_get_header_ver
+#define png_get_header_version fltk_png_get_header_version
+#define png_get_iCCP fltk_png_get_iCCP
+#define png_get_image_height fltk_png_get_image_height
+#define png_get_image_width fltk_png_get_image_width
+#define png_get_int_32 fltk_png_get_int_32
+#define png_get_interlace_type fltk_png_get_interlace_type
+#define png_get_io_chunk_type fltk_png_get_io_chunk_type
+#define png_get_io_ptr fltk_png_get_io_ptr
+#define png_get_io_state fltk_png_get_io_state
+#define png_get_libpng_ver fltk_png_get_libpng_ver
+#define png_get_mem_ptr fltk_png_get_mem_ptr
+#define png_get_oFFs fltk_png_get_oFFs
+#define png_get_pCAL fltk_png_get_pCAL
+#define png_get_pHYs fltk_png_get_pHYs
+#define png_get_pHYs_dpi fltk_png_get_pHYs_dpi
+#define png_get_palette_max fltk_png_get_palette_max
+#define png_get_pixel_aspect_ratio fltk_png_get_pixel_aspect_ratio
+#define png_get_pixel_aspect_ratio_fixed fltk_png_get_pixel_aspect_ratio_fixed
+#define png_get_pixels_per_inch fltk_png_get_pixels_per_inch
+#define png_get_pixels_per_meter fltk_png_get_pixels_per_meter
+#define png_get_progressive_ptr fltk_png_get_progressive_ptr
+#define png_get_rgb_to_gray_status fltk_png_get_rgb_to_gray_status
+#define png_get_rowbytes fltk_png_get_rowbytes
+#define png_get_rows fltk_png_get_rows
+#define png_get_sBIT fltk_png_get_sBIT
+#define png_get_sCAL fltk_png_get_sCAL
+#define png_get_sCAL_fixed fltk_png_get_sCAL_fixed
+#define png_get_sCAL_s fltk_png_get_sCAL_s
+#define png_get_sPLT fltk_png_get_sPLT
+#define png_get_sRGB fltk_png_get_sRGB
+#define png_get_signature fltk_png_get_signature
+#define png_get_tIME fltk_png_get_tIME
+#define png_get_tRNS fltk_png_get_tRNS
+#define png_get_text fltk_png_get_text
+#define png_get_uint_16 fltk_png_get_uint_16
+#define png_get_uint_31 fltk_png_get_uint_31
+#define png_get_uint_32 fltk_png_get_uint_32
+#define png_get_unknown_chunks fltk_png_get_unknown_chunks
+#define png_get_user_chunk_ptr fltk_png_get_user_chunk_ptr
+#define png_get_user_height_max fltk_png_get_user_height_max
+#define png_get_user_transform_ptr fltk_png_get_user_transform_ptr
+#define png_get_user_width_max fltk_png_get_user_width_max
+#define png_get_valid fltk_png_get_valid
+#define png_get_x_offset_inches fltk_png_get_x_offset_inches
+#define png_get_x_offset_inches_fixed fltk_png_get_x_offset_inches_fixed
+#define png_get_x_offset_microns fltk_png_get_x_offset_microns
+#define png_get_x_offset_pixels fltk_png_get_x_offset_pixels
+#define png_get_x_pixels_per_inch fltk_png_get_x_pixels_per_inch
+#define png_get_x_pixels_per_meter fltk_png_get_x_pixels_per_meter
+#define png_get_y_offset_inches fltk_png_get_y_offset_inches
+#define png_get_y_offset_inches_fixed fltk_png_get_y_offset_inches_fixed
+#define png_get_y_offset_microns fltk_png_get_y_offset_microns
+#define png_get_y_offset_pixels fltk_png_get_y_offset_pixels
+#define png_get_y_pixels_per_inch fltk_png_get_y_pixels_per_inch
+#define png_get_y_pixels_per_meter fltk_png_get_y_pixels_per_meter
+#define png_handle_as_unknown fltk_png_handle_as_unknown
+#define png_image_begin_read_from_file fltk_png_image_begin_read_from_file
+#define png_image_begin_read_from_memory fltk_png_image_begin_read_from_memory
+#define png_image_begin_read_from_stdio fltk_png_image_begin_read_from_stdio
+#define png_image_finish_read fltk_png_image_finish_read
+#define png_image_free fltk_png_image_free
+#define png_image_write_to_file fltk_png_image_write_to_file
+#define png_image_write_to_memory fltk_png_image_write_to_memory
+#define png_image_write_to_stdio fltk_png_image_write_to_stdio
+#define png_info_init_3 fltk_png_info_init_3
+#define png_init_io fltk_png_init_io
+#define png_longjmp fltk_png_longjmp
+#define png_malloc fltk_png_malloc
+#define png_malloc_default fltk_png_malloc_default
+#define png_malloc_warn fltk_png_malloc_warn
+#define png_permit_mng_features fltk_png_permit_mng_features
+#define png_process_data fltk_png_process_data
+#define png_process_data_pause fltk_png_process_data_pause
+#define png_process_data_skip fltk_png_process_data_skip
+#define png_progressive_combine_row fltk_png_progressive_combine_row
+#define png_read_end fltk_png_read_end
+#define png_read_image fltk_png_read_image
+#define png_read_info fltk_png_read_info
+#define png_read_png fltk_png_read_png
+#define png_read_row fltk_png_read_row
+#define png_read_rows fltk_png_read_rows
+#define png_read_update_info fltk_png_read_update_info
+#define png_reset_zstream fltk_png_reset_zstream
+#define png_save_int_32 fltk_png_save_int_32
+#define png_save_uint_16 fltk_png_save_uint_16
+#define png_save_uint_32 fltk_png_save_uint_32
+#define png_set_IHDR fltk_png_set_IHDR
+#define png_set_PLTE fltk_png_set_PLTE
+#define png_set_add_alpha fltk_png_set_add_alpha
+#define png_set_alpha_mode fltk_png_set_alpha_mode
+#define png_set_alpha_mode_fixed fltk_png_set_alpha_mode_fixed
+#define png_set_bKGD fltk_png_set_bKGD
+#define png_set_background fltk_png_set_background
+#define png_set_background_fixed fltk_png_set_background_fixed
+#define png_set_benign_errors fltk_png_set_benign_errors
+#define png_set_bgr fltk_png_set_bgr
+#define png_set_cHRM fltk_png_set_cHRM
+#define png_set_cHRM_XYZ fltk_png_set_cHRM_XYZ
+#define png_set_cHRM_XYZ_fixed fltk_png_set_cHRM_XYZ_fixed
+#define png_set_cHRM_fixed fltk_png_set_cHRM_fixed
+#define png_set_check_for_invalid_index fltk_png_set_check_for_invalid_index
+#define png_set_chunk_cache_max fltk_png_set_chunk_cache_max
+#define png_set_chunk_malloc_max fltk_png_set_chunk_malloc_max
+#define png_set_compression_buffer_size fltk_png_set_compression_buffer_size
+#define png_set_compression_level fltk_png_set_compression_level
+#define png_set_compression_mem_level fltk_png_set_compression_mem_level
+#define png_set_compression_method fltk_png_set_compression_method
+#define png_set_compression_strategy fltk_png_set_compression_strategy
+#define png_set_compression_window_bits fltk_png_set_compression_window_bits
+#define png_set_crc_action fltk_png_set_crc_action
+#define png_set_eXIf fltk_png_set_eXIf
+#define png_set_eXIf_1 fltk_png_set_eXIf_1
+#define png_set_error_fn fltk_png_set_error_fn
+#define png_set_expand fltk_png_set_expand
+#define png_set_expand_16 fltk_png_set_expand_16
+#define png_set_expand_gray_1_2_4_to_8 fltk_png_set_expand_gray_1_2_4_to_8
+#define png_set_filler fltk_png_set_filler
+#define png_set_filter fltk_png_set_filter
+#define png_set_filter_heuristics fltk_png_set_filter_heuristics
+#define png_set_filter_heuristics_fixed fltk_png_set_filter_heuristics_fixed
+#define png_set_flush fltk_png_set_flush
+#define png_set_gAMA fltk_png_set_gAMA
+#define png_set_gAMA_fixed fltk_png_set_gAMA_fixed
+#define png_set_gamma fltk_png_set_gamma
+#define png_set_gamma_fixed fltk_png_set_gamma_fixed
+#define png_set_gray_to_rgb fltk_png_set_gray_to_rgb
+#define png_set_hIST fltk_png_set_hIST
+#define png_set_iCCP fltk_png_set_iCCP
+#define png_set_interlace_handling fltk_png_set_interlace_handling
+#define png_set_invalid fltk_png_set_invalid
+#define png_set_invert_alpha fltk_png_set_invert_alpha
+#define png_set_invert_mono fltk_png_set_invert_mono
+#define png_set_keep_unknown_chunks fltk_png_set_keep_unknown_chunks
+#define png_set_longjmp_fn fltk_png_set_longjmp_fn
+#define png_set_mem_fn fltk_png_set_mem_fn
+#define png_set_oFFs fltk_png_set_oFFs
+#define png_set_option fltk_png_set_option
+#define png_set_pCAL fltk_png_set_pCAL
+#define png_set_pHYs fltk_png_set_pHYs
+#define png_set_packing fltk_png_set_packing
+#define png_set_packswap fltk_png_set_packswap
+#define png_set_palette_to_rgb fltk_png_set_palette_to_rgb
+#define png_set_progressive_read_fn fltk_png_set_progressive_read_fn
+#define png_set_quantize fltk_png_set_quantize
+#define png_set_read_fn fltk_png_set_read_fn
+#define png_set_read_status_fn fltk_png_set_read_status_fn
+#define png_set_read_user_chunk_fn fltk_png_set_read_user_chunk_fn
+#define png_set_read_user_transform_fn fltk_png_set_read_user_transform_fn
+#define png_set_rgb_to_gray fltk_png_set_rgb_to_gray
+#define png_set_rgb_to_gray_fixed fltk_png_set_rgb_to_gray_fixed
+#define png_set_rows fltk_png_set_rows
+#define png_set_sBIT fltk_png_set_sBIT
+#define png_set_sCAL fltk_png_set_sCAL
+#define png_set_sCAL_fixed fltk_png_set_sCAL_fixed
+#define png_set_sCAL_s fltk_png_set_sCAL_s
+#define png_set_sPLT fltk_png_set_sPLT
+#define png_set_sRGB fltk_png_set_sRGB
+#define png_set_sRGB_gAMA_and_cHRM fltk_png_set_sRGB_gAMA_and_cHRM
+#define png_set_scale_16 fltk_png_set_scale_16
+#define png_set_shift fltk_png_set_shift
+#define png_set_sig_bytes fltk_png_set_sig_bytes
+#define png_set_strip_16 fltk_png_set_strip_16
+#define png_set_strip_alpha fltk_png_set_strip_alpha
+#define png_set_swap fltk_png_set_swap
+#define png_set_swap_alpha fltk_png_set_swap_alpha
+#define png_set_tIME fltk_png_set_tIME
+#define png_set_tRNS fltk_png_set_tRNS
+#define png_set_tRNS_to_alpha fltk_png_set_tRNS_to_alpha
+#define png_set_text fltk_png_set_text
+#define png_set_text_compression_level fltk_png_set_text_compression_level
+#define png_set_text_compression_mem_level fltk_png_set_text_compression_mem_level
+#define png_set_text_compression_method fltk_png_set_text_compression_method
+#define png_set_text_compression_strategy fltk_png_set_text_compression_strategy
+#define png_set_text_compression_window_bits fltk_png_set_text_compression_window_bits
+#define png_set_unknown_chunk_location fltk_png_set_unknown_chunk_location
+#define png_set_unknown_chunks fltk_png_set_unknown_chunks
+#define png_set_user_limits fltk_png_set_user_limits
+#define png_set_user_transform_info fltk_png_set_user_transform_info
+#define png_set_write_fn fltk_png_set_write_fn
+#define png_set_write_status_fn fltk_png_set_write_status_fn
+#define png_set_write_user_transform_fn fltk_png_set_write_user_transform_fn
+#define png_sig_cmp fltk_png_sig_cmp
+#define png_start_read_image fltk_png_start_read_image
+#define png_warning fltk_png_warning
+#define png_write_chunk fltk_png_write_chunk
+#define png_write_chunk_data fltk_png_write_chunk_data
+#define png_write_chunk_end fltk_png_write_chunk_end
+#define png_write_chunk_start fltk_png_write_chunk_start
+#define png_write_end fltk_png_write_end
+#define png_write_flush fltk_png_write_flush
+#define png_write_image fltk_png_write_image
+#define png_write_info fltk_png_write_info
+#define png_write_info_before_PLTE fltk_png_write_info_before_PLTE
+#define png_write_png fltk_png_write_png
+#define png_write_row fltk_png_write_row
+#define png_write_rows fltk_png_write_rows
+#define png_write_sig fltk_png_write_sig
+#define fltk_png_get_uint_32(buf) PNG_get_uint_32(buf)
+#define fltk_png_get_uint_16(buf) PNG_get_uint_16(buf)
+#define fltk_png_get_int_32(buf) PNG_get_int_32(buf)
#endif /* PNGLCONF_H */
diff --git a/include/zconf.h b/include/zconf.h
index 9ab9caa..821aa56 100644
--- a/include/zconf.h
+++ b/include/zconf.h
@@ -4,7 +4,7 @@
/* FLTK *************************************************************** */
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -13,6 +13,10 @@
#ifndef ZCONF_H
#define ZCONF_H
+/* FLTK: enable symbol prefixes, see README.bundled-libs.txt */
+#define Z_PREFIX 1
+#define z_errmsg fltk_z_errmsg
+
#if ! (defined(_WIN32) || defined(WIN32)) /* FLTK */
# define HAVE_UNISTD_H /* FLTK */
#endif /* FLTK */
@@ -27,152 +31,155 @@
# define Z_PREFIX_SET
/* all linked symbols and init macros */
-# define _dist_code z__dist_code
-# define _length_code z__length_code
-# define _tr_align z__tr_align
-# define _tr_flush_bits z__tr_flush_bits
-# define _tr_flush_block z__tr_flush_block
-# define _tr_init z__tr_init
-# define _tr_stored_block z__tr_stored_block
-# define _tr_tally z__tr_tally
-# define adler32 z_adler32
-# define adler32_combine z_adler32_combine
-# define adler32_combine64 z_adler32_combine64
-# define adler32_z z_adler32_z
+# define _dist_code fltk_z__dist_code
+# define _length_code fltk_z__length_code
+# define _tr_align fltk_z__tr_align
+# define _tr_flush_bits fltk_z__tr_flush_bits
+# define _tr_flush_block fltk_z__tr_flush_block
+# define _tr_init fltk_z__tr_init
+# define _tr_stored_block fltk_z__tr_stored_block
+# define _tr_tally fltk_z__tr_tally
+# define adler32 fltk_z_adler32
+# define adler32_combine fltk_z_adler32_combine
+# define adler32_combine64 fltk_z_adler32_combine64
+# define adler32_z fltk_z_adler32_z
# ifndef Z_SOLO
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
+# define compress fltk_z_compress
+# define compress2 fltk_z_compress2
+# define compressBound fltk_z_compressBound
# endif
-# define crc32 z_crc32
-# define crc32_combine z_crc32_combine
-# define crc32_combine64 z_crc32_combine64
-# define crc32_z z_crc32_z
-# define deflate z_deflate
-# define deflateBound z_deflateBound
-# define deflateCopy z_deflateCopy
-# define deflateEnd z_deflateEnd
-# define deflateGetDictionary z_deflateGetDictionary
-# define deflateInit z_deflateInit
-# define deflateInit2 z_deflateInit2
-# define deflateInit2_ z_deflateInit2_
-# define deflateInit_ z_deflateInit_
-# define deflateParams z_deflateParams
-# define deflatePending z_deflatePending
-# define deflatePrime z_deflatePrime
-# define deflateReset z_deflateReset
-# define deflateResetKeep z_deflateResetKeep
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateSetHeader z_deflateSetHeader
-# define deflateTune z_deflateTune
-# define deflate_copyright z_deflate_copyright
-# define get_crc_table z_get_crc_table
+# define crc32 fltk_z_crc32
+# define crc32_combine fltk_z_crc32_combine
+# define crc32_combine64 fltk_z_crc32_combine64
+# define crc32_combine_gen fltk_z_crc32_combine_gen
+# define crc32_combine_gen64 fltk_z_crc32_combine_gen64
+# define crc32_combine_op fltk_z_crc32_combine_op
+# define crc32_z fltk_z_crc32_z
+# define deflate fltk_z_deflate
+# define deflateBound fltk_z_deflateBound
+# define deflateCopy fltk_z_deflateCopy
+# define deflateEnd fltk_z_deflateEnd
+# define deflateGetDictionary fltk_z_deflateGetDictionary
+# define deflateInit fltk_z_deflateInit
+# define deflateInit2 fltk_z_deflateInit2
+# define deflateInit2_ fltk_z_deflateInit2_
+# define deflateInit_ fltk_z_deflateInit_
+# define deflateParams fltk_z_deflateParams
+# define deflatePending fltk_z_deflatePending
+# define deflatePrime fltk_z_deflatePrime
+# define deflateReset fltk_z_deflateReset
+# define deflateResetKeep fltk_z_deflateResetKeep
+# define deflateSetDictionary fltk_z_deflateSetDictionary
+# define deflateSetHeader fltk_z_deflateSetHeader
+# define deflateTune fltk_z_deflateTune
+# define deflate_copyright fltk_z_deflate_copyright
+# define get_crc_table fltk_z_get_crc_table
# ifndef Z_SOLO
-# define gz_error z_gz_error
-# define gz_intmax z_gz_intmax
-# define gz_strwinerror z_gz_strwinerror
-# define gzbuffer z_gzbuffer
-# define gzclearerr z_gzclearerr
-# define gzclose z_gzclose
-# define gzclose_r z_gzclose_r
-# define gzclose_w z_gzclose_w
-# define gzdirect z_gzdirect
-# define gzdopen z_gzdopen
-# define gzeof z_gzeof
-# define gzerror z_gzerror
-# define gzflush z_gzflush
-# define gzfread z_gzfread
-# define gzfwrite z_gzfwrite
-# define gzgetc z_gzgetc
-# define gzgetc_ z_gzgetc_
-# define gzgets z_gzgets
-# define gzoffset z_gzoffset
-# define gzoffset64 z_gzoffset64
-# define gzopen z_gzopen
-# define gzopen64 z_gzopen64
+# define gz_error fltk_z_gz_error
+# define gz_intmax fltk_z_gz_intmax
+# define gz_strwinerror fltk_z_gz_strwinerror
+# define gzbuffer fltk_z_gzbuffer
+# define gzclearerr fltk_z_gzclearerr
+# define gzclose fltk_z_gzclose
+# define gzclose_r fltk_z_gzclose_r
+# define gzclose_w fltk_z_gzclose_w
+# define gzdirect fltk_z_gzdirect
+# define gzdopen fltk_z_gzdopen
+# define gzeof fltk_z_gzeof
+# define gzerror fltk_z_gzerror
+# define gzflush fltk_z_gzflush
+# define gzfread fltk_z_gzfread
+# define gzfwrite fltk_z_gzfwrite
+# define gzgetc fltk_z_gzgetc
+# define gzgetc_ fltk_z_gzgetc_
+# define gzgets fltk_z_gzgets
+# define gzoffset fltk_z_gzoffset
+# define gzoffset64 fltk_z_gzoffset64
+# define gzopen fltk_z_gzopen
+# define gzopen64 fltk_z_gzopen64
# ifdef _WIN32
-# define gzopen_w z_gzopen_w
+# define gzopen_w fltk_z_gzopen_w
# endif
-# define gzprintf z_gzprintf
-# define gzputc z_gzputc
-# define gzputs z_gzputs
-# define gzread z_gzread
-# define gzrewind z_gzrewind
-# define gzseek z_gzseek
-# define gzseek64 z_gzseek64
-# define gzsetparams z_gzsetparams
-# define gztell z_gztell
-# define gztell64 z_gztell64
-# define gzungetc z_gzungetc
-# define gzvprintf z_gzvprintf
-# define gzwrite z_gzwrite
+# define gzprintf fltk_z_gzprintf
+# define gzputc fltk_z_gzputc
+# define gzputs fltk_z_gzputs
+# define gzread fltk_z_gzread
+# define gzrewind fltk_z_gzrewind
+# define gzseek fltk_z_gzseek
+# define gzseek64 fltk_z_gzseek64
+# define gzsetparams fltk_z_gzsetparams
+# define gztell fltk_z_gztell
+# define gztell64 fltk_z_gztell64
+# define gzungetc fltk_z_gzungetc
+# define gzvprintf fltk_z_gzvprintf
+# define gzwrite fltk_z_gzwrite
# endif
-# define inflate z_inflate
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define inflateBackInit z_inflateBackInit
-# define inflateBackInit_ z_inflateBackInit_
-# define inflateCodesUsed z_inflateCodesUsed
-# define inflateCopy z_inflateCopy
-# define inflateEnd z_inflateEnd
-# define inflateGetDictionary z_inflateGetDictionary
-# define inflateGetHeader z_inflateGetHeader
-# define inflateInit z_inflateInit
-# define inflateInit2 z_inflateInit2
-# define inflateInit2_ z_inflateInit2_
-# define inflateInit_ z_inflateInit_
-# define inflateMark z_inflateMark
-# define inflatePrime z_inflatePrime
-# define inflateReset z_inflateReset
-# define inflateReset2 z_inflateReset2
-# define inflateResetKeep z_inflateResetKeep
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateUndermine z_inflateUndermine
-# define inflateValidate z_inflateValidate
-# define inflate_copyright z_inflate_copyright
-# define inflate_fast z_inflate_fast
-# define inflate_table z_inflate_table
+# define inflate fltk_z_inflate
+# define inflateBack fltk_z_inflateBack
+# define inflateBackEnd fltk_z_inflateBackEnd
+# define inflateBackInit fltk_z_inflateBackInit
+# define inflateBackInit_ fltk_z_inflateBackInit_
+# define inflateCodesUsed fltk_z_inflateCodesUsed
+# define inflateCopy fltk_z_inflateCopy
+# define inflateEnd fltk_z_inflateEnd
+# define inflateGetDictionary fltk_z_inflateGetDictionary
+# define inflateGetHeader fltk_z_inflateGetHeader
+# define inflateInit fltk_z_inflateInit
+# define inflateInit2 fltk_z_inflateInit2
+# define inflateInit2_ fltk_z_inflateInit2_
+# define inflateInit_ fltk_z_inflateInit_
+# define inflateMark fltk_z_inflateMark
+# define inflatePrime fltk_z_inflatePrime
+# define inflateReset fltk_z_inflateReset
+# define inflateReset2 fltk_z_inflateReset2
+# define inflateResetKeep fltk_z_inflateResetKeep
+# define inflateSetDictionary fltk_z_inflateSetDictionary
+# define inflateSync fltk_z_inflateSync
+# define inflateSyncPoint fltk_z_inflateSyncPoint
+# define inflateUndermine fltk_z_inflateUndermine
+# define inflateValidate fltk_z_inflateValidate
+# define inflate_copyright fltk_z_inflate_copyright
+# define inflate_fast fltk_z_inflate_fast
+# define inflate_table fltk_z_inflate_table
# ifndef Z_SOLO
-# define uncompress z_uncompress
-# define uncompress2 z_uncompress2
+# define uncompress fltk_z_uncompress
+# define uncompress2 fltk_z_uncompress2
# endif
-# define zError z_zError
+# define zError fltk_z_zError
# ifndef Z_SOLO
-# define zcalloc z_zcalloc
-# define zcfree z_zcfree
+# define zcalloc fltk_z_zcalloc
+# define zcfree fltk_z_zcfree
# endif
-# define zlibCompileFlags z_zlibCompileFlags
-# define zlibVersion z_zlibVersion
+# define zlibCompileFlags fltk_z_zlibCompileFlags
+# define zlibVersion fltk_z_zlibVersion
/* all zlib typedefs in zlib.h and zconf.h */
-# define Byte z_Byte
-# define Bytef z_Bytef
-# define alloc_func z_alloc_func
-# define charf z_charf
-# define free_func z_free_func
+# define Byte fltk_z_Byte
+# define Bytef fltk_z_Bytef
+# define alloc_func fltk_z_alloc_func
+# define charf fltk_z_charf
+# define free_func fltk_z_free_func
# ifndef Z_SOLO
-# define gzFile z_gzFile
+# define gzFile fltk_z_gzFile
# endif
-# define gz_header z_gz_header
-# define gz_headerp z_gz_headerp
-# define in_func z_in_func
-# define intf z_intf
-# define out_func z_out_func
-# define uInt z_uInt
-# define uIntf z_uIntf
-# define uLong z_uLong
-# define uLongf z_uLongf
-# define voidp z_voidp
-# define voidpc z_voidpc
-# define voidpf z_voidpf
+# define gz_header fltk_z_gz_header
+# define gz_headerp fltk_z_gz_headerp
+# define in_func fltk_z_in_func
+# define intf fltk_z_intf
+# define out_func fltk_z_out_func
+# define uInt fltk_z_uInt
+# define uIntf fltk_z_uIntf
+# define uLong fltk_z_uLong
+# define uLongf fltk_z_uLongf
+# define voidp fltk_z_voidp
+# define voidpc fltk_z_voidpc
+# define voidpf fltk_z_voidpf
/* all zlib structs in zlib.h and zconf.h */
-# define gz_header_s z_gz_header_s
-# define internal_state z_internal_state
+# define gz_header_s fltk_z_gz_header_s
+# define internal_state fltk_z_internal_state
-#endif
+#endif /* Z_PREFIX */ /* FLTK */
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
@@ -247,7 +254,11 @@
#endif
#ifdef Z_SOLO
- typedef unsigned long z_size_t;
+# ifdef _WIN64
+ typedef unsigned long long z_size_t;
+# else
+ typedef unsigned long z_size_t;
+# endif
#else
# define z_longlong long long
# if defined(NO_SIZE_T)
@@ -302,14 +313,6 @@
# endif
#endif
-#ifndef Z_ARG /* function prototypes for stdarg */
-# if defined(STDC) || defined(Z_HAVE_STDARG_H)
-# define Z_ARG(args) args
-# else
-# define Z_ARG(args) ()
-# endif
-#endif
-
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
@@ -358,6 +361,9 @@
# ifdef FAR
# undef FAR
# endif
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# include
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -476,11 +482,18 @@ typedef uLong FAR uLongf;
# undef _LARGEFILE64_SOURCE
#endif
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-# define Z_HAVE_UNISTD_H
+#ifndef Z_HAVE_UNISTD_H
+# ifdef __WATCOMC__
+# define Z_HAVE_UNISTD_H
+# endif
+#endif
+#ifndef Z_HAVE_UNISTD_H
+# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+# define Z_HAVE_UNISTD_H
+# endif
#endif
#ifndef Z_SOLO
-# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# if defined(Z_HAVE_UNISTD_H)
# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include /* for off_t */
@@ -516,7 +529,7 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
-# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+# if defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
diff --git a/include/zlib.h b/include/zlib.h
index f09cdaf..277fccf 100644
--- a/include/zlib.h
+++ b/include/zlib.h
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.11, January 15th, 2017
+ version 1.3.1, January 22nd, 2024
- Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -37,11 +37,11 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.2.11"
-#define ZLIB_VERNUM 0x12b0
+#define ZLIB_VERSION "1.3.1"
+#define ZLIB_VERNUM 0x1310
#define ZLIB_VER_MAJOR 1
-#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 11
+#define ZLIB_VER_MINOR 3
+#define ZLIB_VER_REVISION 1
#define ZLIB_VER_SUBREVISION 0
/*
@@ -78,8 +78,8 @@ extern "C" {
even in the case of corrupted input.
*/
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
+typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
+typedef void (*free_func)(voidpf opaque, voidpf address);
struct internal_state;
@@ -217,7 +217,7 @@ typedef gz_header FAR *gz_headerp;
/* basic functions */
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+ZEXTERN const char * ZEXPORT zlibVersion(void);
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is not
compatible with the zlib.h header file used by the application. This check
@@ -225,12 +225,12 @@ ZEXTERN const char * ZEXPORT zlibVersion OF((void));
*/
/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level);
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller. If
zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
- allocation functions.
+ allocation functions. total_in, total_out, adler, and msg are initialized.
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
1 gives best speed, 9 gives best compression, 0 gives no compression at all
@@ -247,7 +247,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
*/
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush);
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce
@@ -276,7 +276,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
== 0), or after each call of deflate(). If deflate returns Z_OK and with
zero avail_out, it must be called again after making room in the output
buffer because there might be more output pending. See deflatePending(),
- which can be used if desired to determine whether or not there is more ouput
+ which can be used if desired to determine whether or not there is more output
in that case.
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
@@ -320,8 +320,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
- avail_out is greater than six to avoid repeated flush markers due to
- avail_out == 0 on return.
+ avail_out is greater than six when the flush marker begins, in order to avoid
+ repeated flush markers upon calling deflate() again when avail_out == 0.
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there was
@@ -360,7 +360,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
*/
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+ZEXTERN int ZEXPORT deflateEnd(z_streamp strm);
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any pending
@@ -375,7 +375,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateInit(z_streamp strm);
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
@@ -383,7 +383,8 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
read or consumed. The allocation of a sliding window will be deferred to
the first call of inflate (if the decompression does not complete on the
first call). If zalloc and zfree are set to Z_NULL, inflateInit updates
- them to use default allocation functions.
+ them to use default allocation functions. total_in, total_out, adler, and
+ msg are initialized.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
@@ -397,7 +398,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
*/
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush);
/*
inflate decompresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce
@@ -517,7 +518,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
*/
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateEnd(z_streamp strm);
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any pending
@@ -535,16 +536,15 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
*/
/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
+ZEXTERN int ZEXPORT deflateInit2(z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy);
This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by the
- caller.
+ fields zalloc, zfree and opaque must be initialized before by the caller.
The method parameter is the compression method. It must be Z_DEFLATED in
this version of the library.
@@ -608,9 +608,9 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
compression: this will be done by deflate().
*/
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
+ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength);
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. When using the zlib format, this
@@ -652,16 +652,16 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
not perform any compression: this will be done by deflate().
*/
-ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
- Bytef *dictionary,
- uInt *dictLength));
+ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength);
/*
Returns the sliding dictionary being maintained by deflate. dictLength is
set to the number of bytes in the dictionary, and that many bytes are copied
to dictionary. dictionary must have enough space, where 32768 bytes is
always enough. If deflateGetDictionary() is called with dictionary equal to
Z_NULL, then only the dictionary length is returned, and nothing is copied.
- Similary, if dictLength is Z_NULL, then it is not set.
+ Similarly, if dictLength is Z_NULL, then it is not set.
deflateGetDictionary() may return a length less than the window size, even
when more than the window size in input has been provided. It may return up
@@ -674,8 +674,8 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
stream state is inconsistent.
*/
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
+ZEXTERN int ZEXPORT deflateCopy(z_streamp dest,
+ z_streamp source);
/*
Sets the destination stream as a complete copy of the source stream.
@@ -692,31 +692,32 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
destination.
*/
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+ZEXTERN int ZEXPORT deflateReset(z_streamp strm);
/*
This function is equivalent to deflateEnd followed by deflateInit, but
does not free and reallocate the internal compression state. The stream
will leave the compression level and any other attributes that may have been
- set unchanged.
+ set unchanged. total_in, total_out, adler, and msg are initialized.
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
+ZEXTERN int ZEXPORT deflateParams(z_streamp strm,
+ int level,
+ int strategy);
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2(). This can be
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy.
If the compression approach (which is a function of the level) or the
- strategy is changed, and if any input has been consumed in a previous
- deflate() call, then the input available so far is compressed with the old
- level and strategy using deflate(strm, Z_BLOCK). There are three approaches
- for the compression levels 0, 1..3, and 4..9 respectively. The new level
- and strategy will take effect at the next call of deflate().
+ strategy is changed, and if there have been any deflate() calls since the
+ state was initialized or reset, then the input available so far is
+ compressed with the old level and strategy using deflate(strm, Z_BLOCK).
+ There are three approaches for the compression levels 0, 1..3, and 4..9
+ respectively. The new level and strategy will take effect at the next call
+ of deflate().
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not
@@ -729,7 +730,7 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
Then no more input data should be provided before the deflateParams() call.
If this is done, the old level and strategy will be applied to the data
compressed before deflateParams(), and the new level and strategy will be
- applied to the the data compressed after deflateParams().
+ applied to the data compressed after deflateParams().
deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
@@ -740,11 +741,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
retried with more output space.
*/
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
- int good_length,
- int max_lazy,
- int nice_length,
- int max_chain));
+ZEXTERN int ZEXPORT deflateTune(z_streamp strm,
+ int good_length,
+ int max_lazy,
+ int nice_length,
+ int max_chain);
/*
Fine tune deflate's internal compression parameters. This should only be
used by someone who understands the algorithm used by zlib's deflate for
@@ -757,8 +758,8 @@ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
*/
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
- uLong sourceLen));
+ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm,
+ uLong sourceLen);
/*
deflateBound() returns an upper bound on the compressed size after
deflation of sourceLen bytes. It must be called after deflateInit() or
@@ -772,9 +773,9 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
than Z_FINISH or Z_NO_FLUSH are used.
*/
-ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
- unsigned *pending,
- int *bits));
+ZEXTERN int ZEXPORT deflatePending(z_streamp strm,
+ unsigned *pending,
+ int *bits);
/*
deflatePending() returns the number of bytes and bits of output that have
been generated, but not yet provided in the available output. The bytes not
@@ -787,9 +788,9 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
stream state was inconsistent.
*/
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
- int bits,
- int value));
+ZEXTERN int ZEXPORT deflatePrime(z_streamp strm,
+ int bits,
+ int value);
/*
deflatePrime() inserts bits in the deflate output stream. The intent
is that this function is used to start off the deflate output with the bits
@@ -804,8 +805,8 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
source stream state was inconsistent.
*/
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
- gz_headerp head));
+ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm,
+ gz_headerp head);
/*
deflateSetHeader() provides gzip header information for when a gzip
stream is requested by deflateInit2(). deflateSetHeader() may be called
@@ -821,16 +822,17 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
gzip file" and give up.
If deflateSetHeader is not used, the default gzip header has text false,
- the time set to zero, and os set to 255, with no extra, name, or comment
- fields. The gzip header is returned to the default state by deflateReset().
+ the time set to zero, and os set to the current operating system, with no
+ extra, name, or comment fields. The gzip header is returned to the default
+ state by deflateReset().
deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
+ZEXTERN int ZEXPORT inflateInit2(z_streamp strm,
+ int windowBits);
This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
@@ -865,9 +867,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
detection, or add 16 to decode only the gzip format (the zlib format will
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
- below), inflate() will not automatically decode concatenated gzip streams.
- inflate() will return Z_STREAM_END at the end of the gzip stream. The state
- would need to be reset to continue decoding a subsequent gzip stream.
+ below), inflate() will *not* automatically decode concatenated gzip members.
+ inflate() will return Z_STREAM_END at the end of the gzip member. The state
+ would need to be reset to continue decoding a subsequent gzip member. This
+ *must* be done if there is more data after a gzip member, in order for the
+ decompression to be compliant with the gzip standard (RFC 1952).
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
@@ -881,9 +885,9 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
deferred until inflate() is called.
*/
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
+ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength);
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate,
@@ -904,22 +908,22 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
inflate().
*/
-ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
- Bytef *dictionary,
- uInt *dictLength));
+ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength);
/*
Returns the sliding dictionary being maintained by inflate. dictLength is
set to the number of bytes in the dictionary, and that many bytes are copied
to dictionary. dictionary must have enough space, where 32768 bytes is
always enough. If inflateGetDictionary() is called with dictionary equal to
Z_NULL, then only the dictionary length is returned, and nothing is copied.
- Similary, if dictLength is Z_NULL, then it is not set.
+ Similarly, if dictLength is Z_NULL, then it is not set.
inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
stream state is inconsistent.
*/
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateSync(z_streamp strm);
/*
Skips invalid compressed data until a possible full flush point (see above
for the description of deflate with Z_FULL_FLUSH) can be found, or until all
@@ -932,14 +936,14 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
inflateSync returns Z_OK if a possible full flush point has been found,
Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
- In the success case, the application may save the current current value of
- total_in which indicates where valid compressed data was found. In the
- error case, the application may repeatedly call inflateSync, providing more
- input each time, until success or end of the input data.
+ In the success case, the application may save the current value of total_in
+ which indicates where valid compressed data was found. In the error case,
+ the application may repeatedly call inflateSync, providing more input each
+ time, until success or end of the input data.
*/
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
- z_streamp source));
+ZEXTERN int ZEXPORT inflateCopy(z_streamp dest,
+ z_streamp source);
/*
Sets the destination stream as a complete copy of the source stream.
@@ -954,18 +958,19 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
destination.
*/
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateReset(z_streamp strm);
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate the internal decompression state. The
stream will keep attributes that may have been set by inflateInit2.
+ total_in, total_out, adler, and msg are initialized.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
-ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
- int windowBits));
+ZEXTERN int ZEXPORT inflateReset2(z_streamp strm,
+ int windowBits);
/*
This function is the same as inflateReset, but it also permits changing
the wrap and window size requests. The windowBits parameter is interpreted
@@ -978,9 +983,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
the windowBits parameter is invalid.
*/
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
- int bits,
- int value));
+ZEXTERN int ZEXPORT inflatePrime(z_streamp strm,
+ int bits,
+ int value);
/*
This function inserts bits in the inflate input stream. The intent is
that this function is used to start inflating at a bit position in the
@@ -999,7 +1004,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
stream state was inconsistent.
*/
-ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+ZEXTERN long ZEXPORT inflateMark(z_streamp strm);
/*
This function returns two values, one in the lower 16 bits of the return
value, and the other in the remaining upper bits, obtained by shifting the
@@ -1027,8 +1032,8 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
source stream state was inconsistent.
*/
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- gz_headerp head));
+ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm,
+ gz_headerp head);
/*
inflateGetHeader() requests that gzip header information be stored in the
provided gz_header structure. inflateGetHeader() may be called after
@@ -1068,8 +1073,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
*/
/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
- unsigned char FAR *window));
+ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits,
+ unsigned char FAR *window);
Initialize the internal stream state for decompression using inflateBack()
calls. The fields zalloc, zfree and opaque in strm must be initialized
@@ -1089,13 +1094,13 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
the version of the header file.
*/
-typedef unsigned (*in_func) OF((void FAR *,
- z_const unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+typedef unsigned (*in_func)(void FAR *,
+ z_const unsigned char FAR * FAR *);
+typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned);
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
- in_func in, void FAR *in_desc,
- out_func out, void FAR *out_desc));
+ZEXTERN int ZEXPORT inflateBack(z_streamp strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc);
/*
inflateBack() does a raw inflate with a single call using a call-back
interface for input and output. This is potentially more efficient than
@@ -1163,7 +1168,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
cannot return Z_OK.
*/
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm);
/*
All memory allocated by inflateBackInit() is freed.
@@ -1171,7 +1176,7 @@ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
state was inconsistent.
*/
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+ZEXTERN uLong ZEXPORT zlibCompileFlags(void);
/* Return flags indicating compile-time options.
Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
@@ -1224,8 +1229,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
you need special options.
*/
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
+ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen);
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total size
@@ -1239,9 +1244,9 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
buffer.
*/
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
+ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level);
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
@@ -1255,15 +1260,15 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
Z_STREAM_ERROR if the level parameter is invalid.
*/
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen);
/*
compressBound() returns an upper bound on the compressed size after
compress() or compress2() on sourceLen bytes. It would be used before a
compress() or compress2() call to allocate the destination buffer.
*/
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
+ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen);
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total size
@@ -1280,8 +1285,8 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
buffer with the uncompressed data up to that point.
*/
-ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong *sourceLen));
+ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen);
/*
Same as uncompress, except that sourceLen is a pointer, where the
length of the source is *sourceLen. On return, *sourceLen is the number of
@@ -1300,16 +1305,16 @@ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
/*
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode);
- Opens a gzip (.gz) file for reading or writing. The mode parameter is as
- in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
- a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
- compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
- for fixed code compression as in "wb9F". (See the description of
- deflateInit2 for more information about the strategy parameter.) 'T' will
- request transparent writing or appending with no compression and not using
- the gzip format.
+ Open the gzip (.gz) file at path for reading and decompressing, or
+ compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
+ but can also include a compression level ("wb9") or a strategy: 'f' for
+ filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
+ 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
+ as in "wb9F". (See the description of deflateInit2 for more information
+ about the strategy parameter.) 'T' will request transparent writing or
+ appending with no compression and not using the gzip format.
"a" can be used instead of "w" to request that the gzip stream that will
be written be appended to the file. "+" will result in an error, since
@@ -1337,11 +1342,11 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
file could not be opened.
*/
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);
/*
- gzdopen associates a gzFile with the file descriptor fd. File descriptors
- are obtained from calls like open, dup, creat, pipe or fileno (if the file
- has been previously opened with fopen). The mode parameter is as in gzopen.
+ Associate a gzFile with the file descriptor fd. File descriptors are
+ obtained from calls like open, dup, creat, pipe or fileno (if the file has
+ been previously opened with fopen). The mode parameter is as in gzopen.
The next call of gzclose on the returned gzFile will also close the file
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
@@ -1360,15 +1365,15 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
will not detect if fd is invalid (unless fd is -1).
*/
-ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+ZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size);
/*
- Set the internal buffer size used by this library's functions. The
- default buffer size is 8192 bytes. This function must be called after
- gzopen() or gzdopen(), and before any other calls that read or write the
- file. The buffer memory allocation is always deferred to the first read or
- write. Three times that size in buffer space is allocated. A larger buffer
- size of, for example, 64K or 128K bytes will noticeably increase the speed
- of decompression (reading).
+ Set the internal buffer size used by this library's functions for file to
+ size. The default buffer size is 8192 bytes. This function must be called
+ after gzopen() or gzdopen(), and before any other calls that read or write
+ the file. The buffer memory allocation is always deferred to the first read
+ or write. Three times that size in buffer space is allocated. A larger
+ buffer size of, for example, 64K or 128K bytes will noticeably increase the
+ speed of decompression (reading).
The new buffer size also affects the maximum length for gzprintf().
@@ -1376,20 +1381,20 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
too late.
*/
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+ZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy);
/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters. Previously provided
- data is flushed before the parameter change.
+ Dynamically update the compression level and strategy for file. See the
+ description of deflateInit2 for the meaning of these parameters. Previously
+ provided data is flushed before applying the parameter changes.
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
opened for writing, Z_ERRNO if there is an error writing the flushed data,
or Z_MEM_ERROR if there is a memory allocation error.
*/
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len);
/*
- Reads the given number of uncompressed bytes from the compressed file. If
+ Read and decompress up to len uncompressed bytes from file into buf. If
the input file is not in gzip format, gzread copies the given number of
bytes into the buffer directly from the file.
@@ -1417,14 +1422,14 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
Z_STREAM_ERROR.
*/
-ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
- gzFile file));
+ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
+ gzFile file);
/*
- Read up to nitems items of size size from file to buf, otherwise operating
- as gzread() does. This duplicates the interface of stdio's fread(), with
- size_t request and return types. If the library defines size_t, then
- z_size_t is identical to size_t. If not, then z_size_t is an unsigned
- integer type that can contain a pointer.
+ Read and decompress up to nitems items of size size from file into buf,
+ otherwise operating as gzread() does. This duplicates the interface of
+ stdio's fread(), with size_t request and return types. If the library
+ defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
+ is an unsigned integer type that can contain a pointer.
gzfread() returns the number of full items read of size size, or zero if
the end of the file was reached and a full item could not be read, or if
@@ -1435,26 +1440,24 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
In the event that the end of file is reached and only a partial item is
available at the end, i.e. the remaining uncompressed data length is not a
- multiple of size, then the final partial item is nevetheless read into buf
+ multiple of size, then the final partial item is nevertheless read into buf
and the end-of-file flag is set. The length of the partial item read is not
provided, but could be inferred from the result of gztell(). This behavior
is the same as the behavior of fread() implementations in common libraries,
but it prevents the direct use of gzfread() to read a concurrently written
- file, reseting and retrying on end-of-file, when size is not 1.
+ file, resetting and retrying on end-of-file, when size is not 1.
*/
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- voidpc buf, unsigned len));
+ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len);
/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes written or 0 in case of
- error.
+ Compress and write the len uncompressed bytes at buf to file. gzwrite
+ returns the number of uncompressed bytes written or 0 in case of error.
*/
-ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
- z_size_t nitems, gzFile file));
+ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size,
+ z_size_t nitems, gzFile file);
/*
- gzfwrite() writes nitems items of size size from buf to file, duplicating
+ Compress and write nitems items of size size from buf to file, duplicating
the interface of stdio's fwrite(), with size_t request and return types. If
the library defines size_t, then z_size_t is identical to size_t. If not,
then z_size_t is an unsigned integer type that can contain a pointer.
@@ -1465,61 +1468,62 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
is returned, and the error state is set to Z_STREAM_ERROR.
*/
-ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
+ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...);
/*
- Converts, formats, and writes the arguments to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
+ Convert, format, compress, and write the arguments (...) to file under
+ control of the string format, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written, or a negative zlib error code in case
of error. The number of uncompressed bytes written is limited to 8191, or
one less than the buffer size given to gzbuffer(). The caller should assure
that this limit is not exceeded. If it is exceeded, then gzprintf() will
return an error (0) with nothing written. In this case, there may also be a
buffer overflow with unpredictable consequences, which is possible only if
- zlib was compiled with the insecure functions sprintf() or vsprintf()
+ zlib was compiled with the insecure functions sprintf() or vsprintf(),
because the secure snprintf() or vsnprintf() functions were not available.
This can be determined using zlibCompileFlags().
*/
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s);
/*
- Writes the given null-terminated string to the compressed file, excluding
+ Compress and write the given null-terminated string s to file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
/*
- Reads bytes from the compressed file until len-1 characters are read, or a
- newline character is read and transferred to buf, or an end-of-file
- condition is encountered. If any characters are read or if len == 1, the
- string is terminated with a null character. If no characters are read due
- to an end-of-file or len < 1, then the buffer is left untouched.
+ Read and decompress bytes from file into buf, until len-1 characters are
+ read, or until a newline character is read and transferred to buf, or an
+ end-of-file condition is encountered. If any characters are read or if len
+ is one, the string is terminated with a null character. If no characters
+ are read due to an end-of-file or len is less than one, then the buffer is
+ left untouched.
gzgets returns buf which is a null-terminated string, or it returns NULL
for end-of-file or in case of error. If there was an error, the contents at
buf are indeterminate.
*/
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+ZEXTERN int ZEXPORT gzputc(gzFile file, int c);
/*
- Writes c, converted to an unsigned char, into the compressed file. gzputc
+ Compress and write c, converted to an unsigned char, into file. gzputc
returns the value that was written, or -1 in case of error.
*/
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+ZEXTERN int ZEXPORT gzgetc(gzFile file);
/*
- Reads one byte from the compressed file. gzgetc returns this byte or -1
+ Read and decompress one byte from file. gzgetc returns this byte or -1
in case of end of file or error. This is implemented as a macro for speed.
As such, it does not do all of the checking the other functions do. I.e.
it does not check to see if file is NULL, nor whether the structure file
points to has been clobbered or not.
*/
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+ZEXTERN int ZEXPORT gzungetc(int c, gzFile file);
/*
- Push one character back onto the stream to be read as the first character
- on the next read. At least one character of push-back is allowed.
+ Push c back onto the stream for file to be read as the first character on
+ the next read. At least one character of push-back is always allowed.
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
fail if c is -1, and may fail if a character has been pushed but not read
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
@@ -1528,11 +1532,11 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
gzseek() or gzrewind().
*/
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+ZEXTERN int ZEXPORT gzflush(gzFile file, int flush);
/*
- Flushes all pending output into the compressed file. The parameter flush
- is as in the deflate() function. The return value is the zlib error number
- (see function gzerror below). gzflush is only permitted when writing.
+ Flush all pending output to file. The parameter flush is as in the
+ deflate() function. The return value is the zlib error number (see function
+ gzerror below). gzflush is only permitted when writing.
If the flush parameter is Z_FINISH, the remaining data is written and the
gzip stream is completed in the output. If gzwrite() is called again, a new
@@ -1544,11 +1548,11 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
*/
/*
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
+ZEXTERN z_off_t ZEXPORT gzseek(gzFile file,
+ z_off_t offset, int whence);
- Sets the starting position for the next gzread or gzwrite on the given
- compressed file. The offset represents a number of bytes in the
+ Set the starting position to offset relative to whence for the next gzread
+ or gzwrite on file. The offset represents a number of bytes in the
uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
@@ -1563,52 +1567,52 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
would be before the current position.
*/
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+ZEXTERN int ZEXPORT gzrewind(gzFile file);
/*
- Rewinds the given file. This function is supported only for reading.
+ Rewind file. This function is supported only for reading.
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
*/
/*
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+ZEXTERN z_off_t ZEXPORT gztell(gzFile file);
- Returns the starting position for the next gzread or gzwrite on the given
- compressed file. This position represents a number of bytes in the
- uncompressed data stream, and is zero when starting, even if appending or
- reading a gzip stream from the middle of a file using gzdopen().
+ Return the starting position for the next gzread or gzwrite on file.
+ This position represents a number of bytes in the uncompressed data stream,
+ and is zero when starting, even if appending or reading a gzip stream from
+ the middle of a file using gzdopen().
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
*/
/*
-ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+ZEXTERN z_off_t ZEXPORT gzoffset(gzFile file);
- Returns the current offset in the file being read or written. This offset
- includes the count of bytes that precede the gzip stream, for example when
- appending or when using gzdopen() for reading. When reading, the offset
- does not include as yet unused buffered input. This information can be used
- for a progress indicator. On error, gzoffset() returns -1.
+ Return the current compressed (actual) read or write offset of file. This
+ offset includes the count of bytes that precede the gzip stream, for example
+ when appending or when using gzdopen() for reading. When reading, the
+ offset does not include as yet unused buffered input. This information can
+ be used for a progress indicator. On error, gzoffset() returns -1.
*/
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+ZEXTERN int ZEXPORT gzeof(gzFile file);
/*
- Returns true (1) if the end-of-file indicator has been set while reading,
- false (0) otherwise. Note that the end-of-file indicator is set only if the
- read tried to go past the end of the input, but came up short. Therefore,
- just like feof(), gzeof() may return false even if there is no more data to
- read, in the event that the last read request was for the exact number of
- bytes remaining in the input file. This will happen if the input file size
- is an exact multiple of the buffer size.
+ Return true (1) if the end-of-file indicator for file has been set while
+ reading, false (0) otherwise. Note that the end-of-file indicator is set
+ only if the read tried to go past the end of the input, but came up short.
+ Therefore, just like feof(), gzeof() may return false even if there is no
+ more data to read, in the event that the last read request was for the exact
+ number of bytes remaining in the input file. This will happen if the input
+ file size is an exact multiple of the buffer size.
If gzeof() returns true, then the read functions will return no more data,
unless the end-of-file indicator is reset by gzclearerr() and the input file
has grown since the previous end of file was detected.
*/
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+ZEXTERN int ZEXPORT gzdirect(gzFile file);
/*
- Returns true (1) if file is being copied directly while reading, or false
+ Return true (1) if file is being copied directly while reading, or false
(0) if file is a gzip stream being decompressed.
If the input file is empty, gzdirect() will return true, since the input
@@ -1627,10 +1631,10 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
gzip file reading and decompression, which may not be desired.)
*/
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose(gzFile file);
/*
- Flushes all pending output if necessary, closes the compressed file and
- deallocates the (de)compression state. Note that once file is closed, you
+ Flush all pending output for file, if necessary, close file and
+ deallocate the (de)compression state. Note that once file is closed, you
cannot call gzerror with file, since its structures have been deallocated.
gzclose must not be called more than once on the same file, just as free
must not be called more than once on the same allocation.
@@ -1640,8 +1644,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file));
last read ended in the middle of a gzip stream, or Z_OK on success.
*/
-ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
-ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_r(gzFile file);
+ZEXTERN int ZEXPORT gzclose_w(gzFile file);
/*
Same as gzclose(), but gzclose_r() is only for use when reading, and
gzclose_w() is only for use when writing or appending. The advantage to
@@ -1652,12 +1656,12 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
zlib library.
*/
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
/*
- Returns the error message for the last error which occurred on the given
- compressed file. errnum is set to zlib error number. If an error occurred
- in the file system and not in the compression library, errnum is set to
- Z_ERRNO and the application may consult errno to get the exact error code.
+ Return the error message for the last error which occurred on file.
+ errnum is set to zlib error number. If an error occurred in the file system
+ and not in the compression library, errnum is set to Z_ERRNO and the
+ application may consult errno to get the exact error code.
The application must not modify the returned string. Future calls to
this function may invalidate the previously returned string. If file is
@@ -1668,9 +1672,9 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
functions above that do not distinguish those cases in their return values.
*/
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+ZEXTERN void ZEXPORT gzclearerr(gzFile file);
/*
- Clears the error and end-of-file flags for file. This is analogous to the
+ Clear the error and end-of-file flags for file. This is analogous to the
clearerr() function in stdio. This is useful for continuing to read a gzip
file that is being written concurrently.
*/
@@ -1685,11 +1689,12 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
library.
*/
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is Z_NULL, this function returns the
- required initial value for the checksum.
+ return the updated checksum. An Adler-32 value is in the range of a 32-bit
+ unsigned integer. If buf is Z_NULL, this function returns the required
+ initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
much faster.
@@ -1704,15 +1709,15 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (adler != original_adler) error();
*/
-ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf,
- z_size_t len));
+ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf,
+ z_size_t len);
/*
Same as adler32(), but with a size_t length.
*/
/*
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
- z_off_t len2));
+ZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2,
+ z_off_t len2);
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
@@ -1722,12 +1727,13 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
negative, the result has no meaning or utility.
*/
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
/*
Update a running CRC-32 with the bytes buf[0..len-1] and return the
- updated CRC-32. If buf is Z_NULL, this function returns the required
- initial value for the crc. Pre- and post-conditioning (one's complement) is
- performed within this function so it shouldn't be done by the application.
+ updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
+ If buf is Z_NULL, this function returns the required initial value for the
+ crc. Pre- and post-conditioning (one's complement) is performed within this
+ function so it shouldn't be done by the application.
Usage example:
@@ -1739,20 +1745,34 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
if (crc != original_crc) error();
*/
-ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
- z_size_t len));
+ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf,
+ z_size_t len);
/*
Same as crc32(), but with a size_t length.
*/
/*
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
Combine two CRC-32 check values into one. For two sequences of bytes,
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
- len2.
+ len2. len2 must be non-negative.
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
+
+ Return the operator corresponding to length len2, to be used with
+ crc32_combine_op(). len2 must be non-negative.
+*/
+
+ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
+/*
+ Give the same result as crc32_combine(), using op in place of len2. op is
+ is generated from len2 by crc32_combine_gen(). This will be faster than
+ crc32_combine() if the generated op is used more than once.
*/
@@ -1761,32 +1781,32 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- unsigned char FAR *window,
- const char *version,
- int stream_size));
+ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level,
+ const char *version, int stream_size);
+ZEXTERN int ZEXPORT inflateInit_(z_streamp strm,
+ const char *version, int stream_size);
+ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size);
+ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
+ const char *version, int stream_size);
+ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size);
#ifdef Z_PREFIX_SET
-# define z_deflateInit(strm, level) \
+# define fltk_z_deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
-# define z_inflateInit(strm) \
+# define fltk_z_inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
-# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+# define fltk_z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
-# define z_inflateInit2(strm, windowBits) \
+# define fltk_z_inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
(int)sizeof(z_stream))
-# define z_inflateBackInit(strm, windowBits, window) \
+# define fltk_z_inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
ZLIB_VERSION, (int)sizeof(z_stream))
#else
@@ -1819,10 +1839,10 @@ struct gzFile_s {
unsigned char *next;
z_off64_t pos;
};
-ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
+ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */
#ifdef Z_PREFIX_SET
-# undef z_gzgetc
-# define z_gzgetc(g) \
+# undef fltk_z_gzgetc
+# define fltk_z_gzgetc(g) \
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
#else
# define gzgetc(g) \
@@ -1836,22 +1856,24 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
* without large file support, _LFS64_LARGEFILE must also be true
*/
#ifdef Z_LARGE64
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
- ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+ ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
+ ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int);
+ ZEXTERN z_off64_t ZEXPORT gztell64(gzFile);
+ ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile);
+ ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
+ ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
#endif
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
# ifdef Z_PREFIX_SET
-# define z_gzopen z_gzopen64
-# define z_gzseek z_gzseek64
-# define z_gztell z_gztell64
-# define z_gzoffset z_gzoffset64
-# define z_adler32_combine z_adler32_combine64
-# define z_crc32_combine z_crc32_combine64
+# define fltk_z_gzopen fltk_z_gzopen64
+# define fltk_z_gzseek fltk_z_gzseek64
+# define fltk_z_gztell fltk_z_gztell64
+# define fltk_z_gzoffset fltk_z_gzoffset64
+# define fltk_z_adler32_combine fltk_z_adler32_combine64
+# define fltk_z_crc32_combine fltk_z_crc32_combine64
+# define fltk_z_crc32_combine_gen fltk_z_crc32_combine_gen64
# else
# define gzopen gzopen64
# define gzseek gzseek64
@@ -1859,49 +1881,53 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
# define gzoffset gzoffset64
# define adler32_combine adler32_combine64
# define crc32_combine crc32_combine64
+# define crc32_combine_gen crc32_combine_gen64
# endif
# ifndef Z_LARGE64
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
- ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
+ ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int);
+ ZEXTERN z_off_t ZEXPORT gztell64(gzFile);
+ ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile);
+ ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
+ ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
# endif
#else
- ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
- ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
- ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
- ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *);
+ ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int);
+ ZEXTERN z_off_t ZEXPORT gztell(gzFile);
+ ZEXTERN z_off_t ZEXPORT gzoffset(gzFile);
+ ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
+ ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
+ ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
#endif
#else /* Z_SOLO */
- ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
+ ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
+ ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
#endif /* !Z_SOLO */
/* undocumented functions */
-ZEXTERN const char * ZEXPORT zError OF((int));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
-ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
-ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
-ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
-ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
-ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
-#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
-ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
- const char *mode));
+ZEXTERN const char * ZEXPORT zError(int);
+ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp);
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
+ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int);
+ZEXTERN int ZEXPORT inflateValidate(z_streamp, int);
+ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp);
+ZEXTERN int ZEXPORT inflateResetKeep(z_streamp);
+ZEXTERN int ZEXPORT deflateResetKeep(z_streamp);
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path,
+ const char *mode);
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO
-ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
- const char *format,
- va_list va));
+ZEXTERN int ZEXPORTVA gzvprintf(gzFile file,
+ const char *format,
+ va_list va);
# endif
#endif
diff --git a/src/hex-spinner.cpp b/src/hex-spinner.cpp
index 461b58f..28ef987 100644
--- a/src/hex-spinner.cpp
+++ b/src/hex-spinner.cpp
@@ -45,13 +45,13 @@ int Hex_Input::handle_key() {
}
Fl::compose_reset();
char a = Fl::event_text()[0];
- int ip = std::min(position(), mark());
+ int ip = std::min(insert_position(), mark());
if (isxdigit((unsigned char)a) || (!ip && (a == '+' || a == '-'))) {
if (readonly()) {
fl_beep();
}
else {
- replace(position(), mark(), &a, 1);
+ replace(insert_position(), mark(), &a, 1);
}
}
return 1;
diff --git a/src/main-window.h b/src/main-window.h
index f023c28..1e88aaf 100644
--- a/src/main-window.h
+++ b/src/main-window.h
@@ -8,6 +8,7 @@
#include
#include
#include
+#include
#pragma warning(pop)
#include "utils.h"
diff --git a/src/main.cpp b/src/main.cpp
index a91217e..e1c69d4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -68,7 +68,9 @@ int main(int argc, char **argv) {
#ifdef _WIN32
SetCurrentProcessExplicitAppUserModelID(MAKE_WSTR(PROGRAM_AUTHOR) L"." MAKE_WSTR(PROGRAM_NAME));
#endif
+ Fl::keyboard_screen_scaling(0);
Fl::visual(FL_DOUBLE | FL_RGB);
+ fl_contrast_level(50);
#ifdef _WIN32
OS::Theme default_theme = OS::Theme::BLUE;
diff --git a/src/modal-dialog.cpp b/src/modal-dialog.cpp
index ca5eda2..77c8a01 100644
--- a/src/modal-dialog.cpp
+++ b/src/modal-dialog.cpp
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
#pragma warning(pop)
#include "themes.h"
@@ -48,7 +49,7 @@ void Modal_Dialog::initialize() {
// Initialize dialog
_dialog->box(OS_BG_BOX);
_dialog->resizable(NULL);
- _dialog->callback((Fl_Callback *)close_cb, this);
+ _dialog->callback((Fl_Callback *)cancel_cb, this);
_dialog->set_modal();
// Initialize dialog's children
_icon->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
@@ -149,6 +150,8 @@ void Modal_Dialog::refresh() {
void Modal_Dialog::show(const Fl_Widget *p) {
initialize();
refresh();
+ Fl_Window *prev_grab = Fl::grab();
+ Fl::grab(NULL);
int x = p->x() + (p->w() - _dialog->w()) / 2;
int y = p->y() + (p->h() - _dialog->h()) / 2;
_dialog->position(x, y);
@@ -169,6 +172,7 @@ void Modal_Dialog::show(const Fl_Widget *p) {
}
#endif
while (_dialog->shown()) { Fl::wait(); }
+ Fl::grab(prev_grab);
}
void Modal_Dialog::close_cb(Fl_Widget *, Modal_Dialog *md) {
diff --git a/src/option-dialogs.cpp b/src/option-dialogs.cpp
index 3dc1577..8421c6b 100644
--- a/src/option-dialogs.cpp
+++ b/src/option-dialogs.cpp
@@ -4,6 +4,7 @@
#pragma warning(push, 0)
#include
#include
+#include
#pragma warning(pop)
#include "preferences.h"
@@ -76,12 +77,15 @@ void Option_Dialog::refresh() {
}
void Option_Dialog::reveal(const Fl_Widget *p) {
+ Fl_Window *prev_grab = Fl::grab();
+ Fl::grab(NULL);
int x = p->x() + (p->w() - _dialog->w()) / 2;
int y = p->y() + (p->h() - _dialog->h()) / 2;
_dialog->position(x, y);
_ok_button->take_focus();
_dialog->show();
while (_dialog->shown()) { Fl::wait(); }
+ Fl::grab(prev_grab);
}
void Option_Dialog::close_cb(Fl_Widget *, Option_Dialog *od) {
@@ -363,12 +367,15 @@ void Print_Options_Dialog::refresh() {
void Print_Options_Dialog::show(const Fl_Widget *p) {
initialize();
refresh();
+ Fl_Window *prev_grab = Fl::grab();
+ Fl::grab(NULL);
int x = p->x() + (p->w() - _dialog->w()) / 2;
int y = p->y() + (p->h() - _dialog->h()) / 2;
_dialog->position(x, y);
_export_button->take_focus();
_dialog->show();
while (_dialog->shown()) { Fl::wait(); }
+ Fl::grab(prev_grab);
}
void Print_Options_Dialog::close_cb(Fl_Widget *, Print_Options_Dialog *pd) {
diff --git a/src/preferences.cpp b/src/preferences.cpp
index 76bf60f..34230ac 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -14,6 +14,8 @@
#include
#endif
+#include
+
Fl_Preferences *Preferences::_preferences = NULL;
static void get_program_file_dir(char *path, size_t n, const char *argv0) {
@@ -53,7 +55,7 @@ void Preferences::initialize(const char *argv0) {
strcpy(prefs, dirname);
strcat(prefs, DIR_SEP PROGRAM_EXE_NAME PREFS_EXT);
if (file_exists(prefs)) {
- _preferences = new Fl_Preferences(dirname, PROGRAM_AUTHOR, PROGRAM_EXE_NAME);
+ _preferences = new Fl_Preferences(dirname, PROGRAM_AUTHOR, PROGRAM_EXE_NAME, Fl_Preferences::C_LOCALE);
return;
}
@@ -61,12 +63,12 @@ void Preferences::initialize(const char *argv0) {
strcpy(prefs, dirname);
strcat(prefs, DIR_SEP PROGRAM_NAME PREFS_EXT);
if (file_exists(prefs)) {
- _preferences = new Fl_Preferences(dirname, PROGRAM_AUTHOR, PROGRAM_NAME);
+ _preferences = new Fl_Preferences(dirname, PROGRAM_AUTHOR, PROGRAM_NAME, Fl_Preferences::C_LOCALE);
return;
}
// Use the user's FLTK preferences
- _preferences = new Fl_Preferences(Fl_Preferences::USER, PROGRAM_AUTHOR, PROGRAM_NAME);
+ _preferences = new Fl_Preferences(Fl_Preferences::USER_L, PROGRAM_AUTHOR, PROGRAM_NAME);
}
void Preferences::close() {
diff --git a/src/themes.cpp b/src/themes.cpp
index 7a0456b..3e4ba81 100644
--- a/src/themes.cpp
+++ b/src/themes.cpp
@@ -6,6 +6,7 @@
#include
#include
#include
+#include
#pragma warning(pop)
#ifdef _WIN32
@@ -604,7 +605,7 @@ static void use_aero_colors() {
Fl::background2(0xFF, 0xFF, 0xFF);
Fl::foreground(0x00, 0x00, 0x00);
Fl::set_color(FL_INACTIVE_COLOR, 0x6F, 0x6F, 0x6F);
- Fl::set_color(FL_SELECTION_COLOR, 0x33, 0x99, 0xFF);
+ Fl::set_color(FL_SELECTION_COLOR, 0x2A, 0x7D, 0xDD);
Fl::set_color(OS_TAB_COLOR, 0xFF, 0xFF, 0xFF);
Fl_Tooltip::color(fl_rgb_color(0xFF, 0xFF, 0xF0));
Fl_Tooltip::textcolor(FL_FOREGROUND_COLOR);
@@ -749,7 +750,7 @@ static void use_metro_colors() {
Fl::background2(0xFF, 0xFF, 0xFF);
Fl::foreground(0x00, 0x00, 0x00);
Fl::set_color(FL_INACTIVE_COLOR, 0x6F, 0x6F, 0x6F);
- Fl::set_color(FL_SELECTION_COLOR, 0x33, 0x99, 0xFF);
+ Fl::set_color(FL_SELECTION_COLOR, 0x2A, 0x7D, 0xDD);
Fl::set_color(OS_TAB_COLOR, 0xFF, 0xFF, 0xFF);
Fl_Tooltip::color(fl_rgb_color(0xFF, 0xFF, 0xFF));
Fl_Tooltip::textcolor(FL_FOREGROUND_COLOR);
@@ -1420,7 +1421,7 @@ static void use_greybird_colors() {
Fl::background2(0xFC, 0xFC, 0xFC);
Fl::foreground(0x3C, 0x3C, 0x3C);
Fl::set_color(FL_INACTIVE_COLOR, 0x55, 0x55, 0x55);
- Fl::set_color(FL_SELECTION_COLOR, 0x50, 0xA0, 0xF4);
+ Fl::set_color(FL_SELECTION_COLOR, 0x3D, 0x7B, 0xBB);
Fl::set_color(OS_TAB_COLOR, 0xD9, 0xD9, 0xD9);
Fl_Tooltip::color(fl_rgb_color(0x0A, 0x0A, 0x0A));
Fl_Tooltip::textcolor(fl_rgb_color(0xFF, 0xFF, 0xFF));
@@ -2533,7 +2534,7 @@ static void use_rose_gold_colors() {
Fl::background2(0xFF, 0xFF, 0xFF);
Fl::foreground(0x4C, 0x1E, 0x12);
Fl::set_color(FL_INACTIVE_COLOR, 0x60, 0x4C, 0x4C);
- Fl::set_color(FL_SELECTION_COLOR, 0x15, 0x81, 0xFA);
+ Fl::set_color(FL_SELECTION_COLOR, 0x14, 0x79, 0xEA);
Fl::set_color(OS_TAB_COLOR, 0xFA, 0xEA, 0xF7);
Fl_Tooltip::color(fl_rgb_color(0xFF, 0xFF, 0xFF));
Fl_Tooltip::textcolor(FL_FOREGROUND_COLOR);
@@ -3189,8 +3190,9 @@ void OS::use_brushed_metal_theme() {
static void high_contrast_button_up_frame(int x, int y, int w, int h, Fl_Color) {
fl_color(activated_color(fl_rgb_color(0x00, 0xFF, 0xFF)));
- fl_rect(x, y, w, h);
- fl_rect(x+1, y+1, w-2, h-2);
+ fl_line_style(FL_SOLID, 2);
+ fl_rect(x+1, y+1, w-1, h-1);
+ fl_line_style(FL_SOLID);
}
static void high_contrast_button_up_box(int x, int y, int w, int h, Fl_Color c) {
@@ -3201,8 +3203,9 @@ static void high_contrast_button_up_box(int x, int y, int w, int h, Fl_Color c)
static void high_contrast_check_down_frame(int x, int y, int w, int h, Fl_Color) {
fl_color(activated_color(fl_rgb_color(0x00, 0x80, 0x80)));
- fl_rect(x, y, w, h);
- fl_rect(x+1, y+1, w-2, h-2);
+ fl_line_style(FL_SOLID, 2);
+ fl_rect(x+1, y+1, w-1, h-1);
+ fl_line_style(FL_SOLID);
}
static void high_contrast_check_down_box(int x, int y, int w, int h, Fl_Color c) {
@@ -3235,8 +3238,9 @@ static void high_contrast_spacer_thin_down_box(int x, int y, int w, int h, Fl_Co
static void high_contrast_default_button_up_frame(int x, int y, int w, int h, Fl_Color) {
fl_color(activated_color(fl_rgb_color(0xFF, 0xFF, 0xFF)));
- fl_rect(x, y, w, h);
- fl_rect(x+1, y+1, w-2, h-2);
+ fl_line_style(FL_SOLID, 2);
+ fl_rect(x+1, y+1, w-1, h-1);
+ fl_line_style(FL_SOLID);
}
static void high_contrast_default_button_up_box(int x, int y, int w, int h, Fl_Color c) {
@@ -3259,8 +3263,9 @@ static void high_contrast_radio_round_down_box(int x, int y, int w, int h, Fl_Co
static void high_contrast_hovered_up_frame(int x, int y, int w, int h, Fl_Color) {
fl_color(activated_color(fl_rgb_color(0xFF, 0xFF, 0xFF)));
- fl_rect(x, y, w, h);
- fl_rect(x+1, y+1, w-2, h-2);
+ fl_line_style(FL_SOLID, 2);
+ fl_rect(x+1, y+1, w-1, h-1);
+ fl_line_style(FL_SOLID);
}
static void high_contrast_hovered_up_box(int x, int y, int w, int h, Fl_Color c) {
@@ -3340,7 +3345,7 @@ void OS::use_native_fonts() {
metrics.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &metrics, 0);
char system_font[256] = {};
- int n = wcstombs(system_font, metrics.lfMessageFont.lfFaceName, sizeof(system_font));
+ size_t n = wcstombs(system_font, metrics.lfMessageFont.lfFaceName, sizeof(system_font));
if (n == sizeof(system_font)) {
system_font[sizeof(system_font)-1] = '\0';
}
@@ -3384,7 +3389,7 @@ void OS::use_native_fonts() {
use_any_font(FL_COURIER, monospace_fonts, _countof(monospace_fonts));
// Use common bold monospace font
const char *bold_monospace_fonts[] = {
- "Ubuntu Mono bold", "Noto Sans Mono bold", "Droid Sans Mono bold", "DejaVu Sans Mono bold"
+ "Ubuntu Mono Bold", "Noto Sans Mono Bold", "Droid Sans Mono Bold", "DejaVu Sans Mono Bold"
};
use_any_font(FL_COURIER_BOLD, bold_monospace_fonts, _countof(bold_monospace_fonts));
// Use common italic monospace font
diff --git a/src/widgets.cpp b/src/widgets.cpp
index 03e7121..d7d6bf0 100644
--- a/src/widgets.cpp
+++ b/src/widgets.cpp
@@ -357,44 +357,45 @@ Dropdown::Dropdown(int x, int y, int w, int h, const char *l) : Fl_Choice(x, y,
void Dropdown::draw() {
// Based on Fl_Choice::draw()
- Fl_Boxtype bb = OS::current_theme() == OS::Theme::OCEAN || OS::current_theme() == OS::Theme::HIGH_CONTRAST ?
- OS_INPUT_THIN_DOWN_BOX : OS::current_theme() == OS::Theme::OLIVE ? OS_SWATCH_BOX : FL_DOWN_BOX;
- int dx = Fl::box_dx(bb);
- int dy = Fl::box_dy(bb);
+ Fl_Boxtype btype = OS::current_theme() == OS::Theme::OCEAN || OS::current_theme() == OS::Theme::HIGH_CONTRAST ?
+ OS_INPUT_THIN_DOWN_BOX : OS::current_theme() == OS::Theme::OLIVE ? OS_SWATCH_BOX : Fl::scheme() ? FL_UP_BOX : FL_DOWN_BOX;
+ int dx = Fl::box_dx(btype);
+ int dy = Fl::box_dy(btype);
int H = h() - 2 * dy;
int W = std::min(H, 20);
int X = x() + w() - W - std::max(dx, dy);
int Y = y() + dy;
- int w1 = std::max((W - 4) / 3, 1);
- int x1 = X + (W - 2 * w1 - 1) / 2;
- int y1 = Y + (H - w1 - 1) / 2;
+ Fl_Rect ab(X, Y, W, H);
+ int active = active_r();
+ Fl_Color arrow_color = active ? labelcolor() : fl_inactive(labelcolor());
+ Fl_Color box_color = color();
+ if (!Fl::scheme()) {
+ box_color = fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) == textcolor() ? FL_BACKGROUND2_COLOR : fl_lighter(color());
+ }
+ draw_box(btype, box_color);
if (Fl::scheme()) {
- draw_box(FL_UP_BOX, color());
- fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
- x1 = x() + w() - 13 - dx;
- y1 = y() + h() / 2;
- fl_polygon(x1, y1 - 2, x1 + 3, y1 - 5, x1 + 6, y1 - 2);
- fl_polygon(x1, y1 + 2, x1 + 3, y1 + 5, x1 + 6, y1 + 2);
- fl_color(active_r() ? fl_darker(color()) : fl_inactive(fl_darker(color())));
- fl_yxline(x1 - 7, y1 - 8, y1 + 8);
- fl_color(active_r() ? fl_lighter(color()) : fl_inactive(fl_lighter(color())));
- fl_yxline(x1 - 6, y1 - 8, y1 + 8);
+ int x1 = x() + w() - W - 1;
+ int y1 = y() + 3;
+ int y2 = y() + h() - 3;
+ fl_color(active ? fl_darker(color()) : fl_inactive(fl_darker(color())));
+ fl_yxline(x1, y1, y2);
+ fl_color(active ? fl_lighter(color()) : fl_inactive(fl_lighter(color())));
+ fl_yxline(x1 + 1, y1, y2);
}
else {
- draw_box(bb, fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) == textcolor() ? FL_BACKGROUND2_COLOR : fl_lighter(color()));
draw_box(OS_MINI_BUTTON_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);
+ ab.inset(OS_MINI_BUTTON_UP_BOX);
+ ab.inset(OS_MINI_BUTTON_UP_BOX);
}
+ fl_draw_arrow(ab, FL_ARROW_CHOICE, FL_ORIENT_NONE, arrow_color);
W += 2 * dx;
if (mvalue()) {
Fl_Menu_Item m = *mvalue();
- if (active_r()) { m.activate(); }
+ if (active) { m.activate(); }
else { m.deactivate(); }
int xx = x() + dx, yy = y() + dy + 1, ww = w() - W, hh = H - 2;
+ fl_push_clip(xx, yy, ww, hh);
if (Fl::scheme()) {
- ww += x1 - X - 5;
- fl_push_clip(xx, yy, ww-4, hh);
Fl_Label l;
l.value = m.text;
l.image = 0;
@@ -403,20 +404,19 @@ void Dropdown::draw() {
l.font = m.labelsize_ || m.labelfont_ ? m.labelfont_ : textfont();
l.size = m.labelsize_ ? m.labelsize_ : textsize();
l.color= m.labelcolor_ ? m.labelcolor_ : textcolor();
+ l.h_margin_ = l.v_margin_ = l.spacing = 0;
if (!m.active()) l.color = fl_inactive((Fl_Color)l.color);
fl_draw_shortcut = 2; // hack value to make '&' disappear
- l.draw(xx+3, yy, ww, hh, FL_ALIGN_LEFT);
+ l.draw(xx+3, yy, ww>6 ? ww-6 : 0, hh, FL_ALIGN_LEFT);
fl_draw_shortcut = 0;
- fl_pop_clip();
if (Fl::focus() == this) { draw_focus(box(), xx, yy, ww, hh); }
}
else {
- fl_push_clip(xx, yy, ww, hh);
fl_draw_shortcut = 2; // hack value to make '&' disappear
m.draw(xx, yy, ww, hh, this, Fl::focus() == this);
fl_draw_shortcut = 0;
- fl_pop_clip();
}
+ fl_pop_clip();
}
draw_label();
}