mirror of https://github.com/qt/qtbase.git
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
This commit is contained in:
commit
f94ca82e0f
|
@ -296,7 +296,7 @@ Gui, printing, widget options:
|
|||
-kms ............... Enable backends for KMS [auto] (Linux only)
|
||||
-linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
|
||||
-mirclient ......... Enable Mir client support [no] (Linux only)
|
||||
-xcb ............... Select used xcb-* libraries [system/qt/no]
|
||||
-xcb ............... Enable X11 support. Select used xcb-* libraries [system/qt/no]
|
||||
(-qt-xcb still uses system version of libxcb itself)
|
||||
|
||||
Input backends:
|
||||
|
|
|
@ -621,6 +621,9 @@ defineTest(qtConfOutput_prepareOptions) {
|
|||
isEmpty(platform): equals(target_arch, arm64-v8a): \
|
||||
platform = android-21
|
||||
|
||||
isEmpty(platform): equals(target_arch, x86_64): \
|
||||
platform = android-21
|
||||
|
||||
isEmpty(platform): \
|
||||
platform = android-16 ### the windows configure disagrees ...
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ macro.macos = "macOS"
|
|||
macro.menu = "\\b"
|
||||
macro.oslash.HTML = "ø"
|
||||
macro.ouml.HTML = "ö"
|
||||
macro.nullptr = "\\c{nullptr}"
|
||||
macro.QA = "\\e{Qt Assistant}"
|
||||
macro.QD = "\\e{Qt Designer}"
|
||||
macro.QL = "\\e{Qt Linguist}"
|
||||
|
|
|
@ -2,6 +2,7 @@ INCLUDEPATH += $$QMAKE_INCDIR_EGL
|
|||
LIBS_PRIVATE += $$QMAKE_LIBS_EGL
|
||||
QMAKE_CFLAGS += $$QMAKE_CFLAGS_EGL
|
||||
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EGL
|
||||
DEFINES += $$QMAKE_DEFINES_EGL
|
||||
LIBS += $$QMAKE_LFLAGS_EGL
|
||||
for(p, QMAKE_LIBDIR_EGL) {
|
||||
LIBS_PRIVATE += -L$$p
|
||||
|
|
|
@ -67,7 +67,7 @@ qt {
|
|||
# Add the same default rpaths as Xcode does for new projects.
|
||||
# This is especially important for iOS/tvOS/watchOS where no other option is possible.
|
||||
!no_default_rpath {
|
||||
QMAKE_RPATHDIR += @executable_path/Frameworks
|
||||
QMAKE_RPATHDIR += @executable_path/../Frameworks
|
||||
equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
!isEmpty(SOURCES) {
|
||||
QT += qml qmltest
|
||||
load(testcase)
|
||||
DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\"
|
||||
contains(TEMPLATE, vc.*): DEFINES += QUICK_TEST_SOURCE_DIR=\"$$_PRO_FILE_PWD_\"
|
||||
else: DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\"$$_PRO_FILE_PWD_\")
|
||||
} else {
|
||||
# Allow a project to run tests without a CPP stub
|
||||
TEMPLATE = aux
|
||||
|
|
|
@ -209,14 +209,6 @@ for(ever) {
|
|||
!isEmpty(MODULE_MODULE) {
|
||||
contains(MODULE_CONFIG, lib_bundle) {
|
||||
framework = $$MODULE_MODULE
|
||||
qtConfig(debug_and_release):qt_link_suffixed_framework:!macx-xcode {
|
||||
platform_target_suffix = $$qtPlatformTargetSuffix()
|
||||
!isEmpty(platform_target_suffix): \
|
||||
# The -framework linker argument supports a name[,suffix] version,
|
||||
# where if the suffix is specified the framework is first searched
|
||||
# for the library with the suffix and then without.
|
||||
framework = $$framework,$$platform_target_suffix
|
||||
}
|
||||
LIBS$$var_sfx += -framework $$framework
|
||||
} else {
|
||||
!isEmpty(MODULE_LIBS_ADD): \
|
||||
|
|
|
@ -21,15 +21,19 @@ testcase_lowdpi {
|
|||
}
|
||||
}
|
||||
|
||||
# Make sure we explicitly link to the debug version of the Qt libraries if needed
|
||||
macos: CONFIG += qt_link_suffixed_framework
|
||||
|
||||
benchmark: type = benchmark
|
||||
else: type = check
|
||||
|
||||
$${type}.files =
|
||||
$${type}.path = .
|
||||
|
||||
# Make sure we explicitly load the debug version of the Qt libraries if needed
|
||||
macos {
|
||||
dyld_image_suffix.name = DYLD_IMAGE_SUFFIX
|
||||
dyld_image_suffix.value = $$qtPlatformTargetSuffix()
|
||||
QT_TOOL_ENV += dyld_image_suffix
|
||||
}
|
||||
|
||||
# Add environment for non-installed builds. Do this first, so the
|
||||
# 'make' variable expansions don't end up in a batch file/script.
|
||||
QT_TOOL_NAME = target
|
||||
|
|
|
@ -6,6 +6,27 @@
|
|||
|
||||
include(../common/msvc-desktop.conf)
|
||||
|
||||
# clang-cl does not use anything above SSE2 without extra arguments
|
||||
QMAKE_CFLAGS_SSE3 = -msse3
|
||||
QMAKE_CFLAGS_SSSE3 = -mssse3
|
||||
QMAKE_CFLAGS_SSE4_1 = -msse4.1
|
||||
QMAKE_CFLAGS_SSE4_2 = -msse4.2
|
||||
QMAKE_CFLAGS_AVX = -mavx
|
||||
QMAKE_CFLAGS_AVX2 = -mavx2
|
||||
QMAKE_CFLAGS_F16C = -mf16c
|
||||
QMAKE_CFLAGS_RDRND = -mrdrnd
|
||||
QMAKE_CFLAGS_AVX512F = -mavx512f
|
||||
QMAKE_CFLAGS_AVX512ER = -mavx512er
|
||||
QMAKE_CFLAGS_AVX512CD = -mavx512cd
|
||||
QMAKE_CFLAGS_AVX512PF = -mavx512pf
|
||||
QMAKE_CFLAGS_AVX512DQ = -mavx512dq
|
||||
QMAKE_CFLAGS_AVX512BW = -mavx512bw
|
||||
QMAKE_CFLAGS_AVX512VL = -mavx512vl
|
||||
QMAKE_CFLAGS_AVX512IFMA = -mavx512ifma
|
||||
QMAKE_CFLAGS_AVX512VBMI = -mavx512vbmi
|
||||
QMAKE_CFLAGS_AESNI = -maes
|
||||
QMAKE_CFLAGS_SHANI = -msha
|
||||
|
||||
QMAKE_COMPILER += clang_cl llvm
|
||||
|
||||
QMAKE_CC = clang-cl
|
||||
|
|
|
@ -1,48 +1,77 @@
|
|||
Libpng 1.6.35 - July 15, 2018
|
||||
libpng 1.6.36 - December 1, 2018
|
||||
================================
|
||||
|
||||
This is a public release of libpng, intended for use in production code.
|
||||
|
||||
Files available for download:
|
||||
|
||||
Files available for download
|
||||
----------------------------
|
||||
|
||||
Source files with LF line endings (for Unix/Linux):
|
||||
|
||||
libpng-1.6.35.tar.xz (LZMA-compressed, recommended)
|
||||
libpng-1.6.35.tar.gz
|
||||
* libpng-1.6.36.tar.xz (LZMA-compressed, recommended)
|
||||
* libpng-1.6.36.tar.gz
|
||||
|
||||
Source files with CRLF line endings (for Windows):
|
||||
|
||||
lp1635.7z (LZMA-compressed, recommended)
|
||||
lp1635.zip
|
||||
* lp1636.7z (LZMA-compressed, recommended)
|
||||
* lp1636.zip
|
||||
|
||||
Other information:
|
||||
|
||||
libpng-1.6.35-README.txt
|
||||
libpng-1.6.35-LICENSE.txt
|
||||
* README.md
|
||||
* LICENSE.md
|
||||
* AUTHORS.md
|
||||
* TRADEMARK.md
|
||||
|
||||
Changes since the last public release (1.6.34):
|
||||
|
||||
Restored 21 of the contrib/pngsuite/i*.png, which do not cause test
|
||||
failures. Placed the remainder in contrib/pngsuite/interlaced/i*.png.
|
||||
Added calls to png_set_*() transforms commonly used by browsers to
|
||||
the fuzzer.
|
||||
Removed some unnecessary brackets in pngrtran.c
|
||||
Fixed miscellaneous typos (Patch by github user "luzpaz").
|
||||
Change "ASM C" to "C ASM" in CMakeLists.txt
|
||||
Fixed incorrect handling of bKGD chunk in sub-8-bit files (Cosmin)
|
||||
Added hardware optimization directories to zip and 7z distributions.
|
||||
Fixed incorrect bitmask for options.
|
||||
Fixed many spelling typos.
|
||||
Make png_get_iCCP consistent with man page (allow compression-type argument
|
||||
to be NULL, bug report by Lenard Szolnoki).
|
||||
Replaced the remaining uses of png_size_t with size_t (Cosmin)
|
||||
Fixed the calculation of row_factor in png_check_chunk_length
|
||||
(reported by Thuan Pham in SourceForge issue #278)
|
||||
Added missing parentheses to a macro definition
|
||||
(suggested by "irwir" in GitHub issue #216)
|
||||
IMPORTANT licensing update: libpng license v2
|
||||
---------------------------------------------
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
The new libpng license comprises the terms and conditions from the zlib
|
||||
license, and the disclaimer from the Boost license.
|
||||
|
||||
The legacy libpng license, used until libpng-1.6.35, is appended to the
|
||||
new license, following the precedent established in the Python Software
|
||||
Foundation License version 2.
|
||||
|
||||
From now on, the list of contributing authors shall be maintained in a
|
||||
separate AUTHORS file. The lists of previous contributing authors,
|
||||
mentioned in the legacy libpng license and considered to be an integral
|
||||
part of that license, are kept intact, with no further updates.
|
||||
|
||||
|
||||
Changes since the previous public release (version 1.6.35)
|
||||
----------------------------------------------------------
|
||||
|
||||
* Optimized png_do_expand_palette for ARM processors.
|
||||
Improved performance by around 10-22% on a recent ARM Chromebook.
|
||||
(Contributed by Richard Townsend, ARM Holdings)
|
||||
* Fixed manipulation of machine-specific optimization options.
|
||||
(Contributed by Vicki Pfau)
|
||||
* Used memcpy instead of manual pointer arithmetic on Intel SSE2.
|
||||
(Contributed by Samuel Williams)
|
||||
* Fixed build errors with MSVC on ARM64.
|
||||
(Contributed by Zhijie Liang)
|
||||
* Fixed detection of libm in CMakeLists.
|
||||
(Contributed by Cameron Cawley)
|
||||
* Fixed incorrect creation of pkg-config file in CMakeLists.
|
||||
(Contributed by Kyle Bentley)
|
||||
* Fixed the CMake build on Windows MSYS by avoiding symlinks.
|
||||
* Fixed a build warning on OpenBSD.
|
||||
(Contributed by Theo Buehler)
|
||||
* Fixed various typos in comments.
|
||||
(Contributed by "luz.paz")
|
||||
* Raised the minimum required CMake version from 3.0.2 to 3.1.
|
||||
* Removed yet more of the vestigial support for pre-ANSI C compilers.
|
||||
* Removed ancient makefiles for ancient systems that have been broken
|
||||
across all previous libpng-1.6.x versions.
|
||||
* Removed the Y2K compliance statement and the export control
|
||||
information.
|
||||
* Applied various code style and documentation fixes.
|
||||
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||
Subscription is required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe).
|
||||
|
||||
Glenn R-P
|
||||
to subscribe.
|
||||
|
|
|
@ -6063,9 +6063,34 @@ Version 1.6.35 [July 15, 2018]
|
|||
Added missing parentheses to a macro definition
|
||||
(suggested by "irwir" in GitHub issue #216)
|
||||
|
||||
Version 1.6.36 [December 1, 2018]
|
||||
Optimized png_do_expand_palette for ARM processors.
|
||||
Improved performance by around 10-22% on a recent ARM Chromebook.
|
||||
(Contributed by Richard Townsend, ARM Holdings)
|
||||
Fixed manipulation of machine-specific optimization options.
|
||||
(Contributed by Vicki Pfau)
|
||||
Used memcpy instead of manual pointer arithmetic on Intel SSE2.
|
||||
(Contributed by Samuel Williams)
|
||||
Fixed build errors with MSVC on ARM64.
|
||||
(Contributed by Zhijie Liang)
|
||||
Fixed detection of libm in CMakeLists.
|
||||
(Contributed by Cameron Cawley)
|
||||
Fixed incorrect creation of pkg-config file in CMakeLists.
|
||||
(Contributed by Kyle Bentley)
|
||||
Fixed the CMake build on Windows MSYS by avoiding symlinks.
|
||||
Fixed a build warning on OpenBSD.
|
||||
(Contributed by Theo Buehler)
|
||||
Fixed various typos in comments.
|
||||
(Contributed by "luz.paz")
|
||||
Raised the minimum required CMake version from 3.0.2 to 3.1.
|
||||
Removed yet more of the vestigial support for pre-ANSI C compilers.
|
||||
Removed ancient makefiles for ancient systems that have been broken
|
||||
across all previous libpng-1.6.x versions.
|
||||
Removed the Y2K compliance statement and the export control
|
||||
information.
|
||||
Applied various code style and documentation fixes.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe).
|
||||
|
||||
Glenn R-P
|
||||
|
|
|
@ -1,14 +1,43 @@
|
|||
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
||||
=========================================
|
||||
|
||||
This copy of the libpng notices is provided for your convenience. In case of
|
||||
any discrepancy between this copy and the notices in the file png.h that is
|
||||
included in the libpng distribution, the latter shall prevail.
|
||||
PNG Reference Library License version 2
|
||||
---------------------------------------
|
||||
|
||||
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
||||
* Copyright (c) 1995-2018 The PNG Reference Library Authors.
|
||||
* Copyright (c) 2018 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.
|
||||
|
||||
If you modify libpng you may insert additional notices immediately following
|
||||
this sentence.
|
||||
The software is supplied "as is", without warranty of any kind,
|
||||
express or implied, including, without limitation, the warranties
|
||||
of merchantability, fitness for a particular purpose, title, and
|
||||
non-infringement. In no even shall the Copyright owners, or
|
||||
anyone distributing the software, be liable for any damages or
|
||||
other liability, whether in contract, tort or otherwise, arising
|
||||
from, out of, or in connection with the software, or the use or
|
||||
other dealings in the software, even if advised of the possibility
|
||||
of such damage.
|
||||
|
||||
This code is released under the libpng license.
|
||||
Permission is hereby granted to use, copy, modify, and distribute
|
||||
this software, or portions hereof, for any purpose, without fee,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you
|
||||
use this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated, but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
3. This Copyright notice may not be removed or altered from any
|
||||
source or altered source distribution.
|
||||
|
||||
|
||||
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
||||
|
@ -16,38 +45,38 @@ derived from libpng-1.0.6, and are distributed according to the same
|
|||
disclaimer and license as libpng-1.0.6 with the following individuals
|
||||
added to the list of Contributing Authors:
|
||||
|
||||
Simon-Pierre Cadieux
|
||||
Eric S. Raymond
|
||||
Mans Rullgard
|
||||
Cosmin Truta
|
||||
Gilles Vollant
|
||||
James Yu
|
||||
Mandar Sahastrabuddhe
|
||||
Google Inc.
|
||||
Vadim Barkov
|
||||
Simon-Pierre Cadieux
|
||||
Eric S. Raymond
|
||||
Mans Rullgard
|
||||
Cosmin Truta
|
||||
Gilles Vollant
|
||||
James Yu
|
||||
Mandar Sahastrabuddhe
|
||||
Google Inc.
|
||||
Vadim Barkov
|
||||
|
||||
and with the following additions to the disclaimer:
|
||||
|
||||
There is no warranty against interference with your enjoyment of the
|
||||
library or against infringement. There is no warranty that our
|
||||
efforts or the library will fulfill any of your particular purposes
|
||||
or needs. This library is provided with all faults, and the entire
|
||||
risk of satisfactory quality, performance, accuracy, and effort is with
|
||||
the user.
|
||||
There is no warranty against interference with your enjoyment of
|
||||
the library or against infringement. There is no warranty that our
|
||||
efforts or the library will fulfill any of your particular purposes
|
||||
or needs. This library is provided with all faults, and the entire
|
||||
risk of satisfactory quality, performance, accuracy, and effort is
|
||||
with the user.
|
||||
|
||||
Some files in the "contrib" directory and some configure-generated
|
||||
files that are distributed with libpng have other copyright owners and
|
||||
files that are distributed with libpng have other copyright owners, and
|
||||
are released under other open source licenses.
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
||||
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
||||
libpng-0.96, and are distributed according to the same disclaimer and
|
||||
license as libpng-0.96, with the following individuals added to the list
|
||||
of Contributing Authors:
|
||||
license as libpng-0.96, with the following individuals added to the
|
||||
list of Contributing Authors:
|
||||
|
||||
Tom Lane
|
||||
Glenn Randers-Pehrson
|
||||
Willem van Schaik
|
||||
Tom Lane
|
||||
Glenn Randers-Pehrson
|
||||
Willem van Schaik
|
||||
|
||||
libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
||||
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
|
||||
|
@ -55,14 +84,14 @@ and are distributed according to the same disclaimer and license as
|
|||
libpng-0.88, with the following individuals added to the list of
|
||||
Contributing Authors:
|
||||
|
||||
John Bowler
|
||||
Kevin Bracey
|
||||
Sam Bushell
|
||||
Magnus Holmgren
|
||||
Greg Roelofs
|
||||
Tom Tanner
|
||||
John Bowler
|
||||
Kevin Bracey
|
||||
Sam Bushell
|
||||
Magnus Holmgren
|
||||
Greg Roelofs
|
||||
Tom Tanner
|
||||
|
||||
Some files in the "scripts" directory have other copyright owners
|
||||
Some files in the "scripts" directory have other copyright owners,
|
||||
but are released under this license.
|
||||
|
||||
libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
||||
|
@ -71,63 +100,35 @@ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
|||
For the purposes of this copyright and license, "Contributing Authors"
|
||||
is defined as the following set of individuals:
|
||||
|
||||
Andreas Dilger
|
||||
Dave Martindale
|
||||
Guy Eric Schalnat
|
||||
Paul Schmidt
|
||||
Tim Wegner
|
||||
Andreas Dilger
|
||||
Dave Martindale
|
||||
Guy Eric Schalnat
|
||||
Paul Schmidt
|
||||
Tim Wegner
|
||||
|
||||
The PNG Reference Library is supplied "AS IS". The Contributing Authors
|
||||
and Group 42, Inc. disclaim all warranties, expressed or implied,
|
||||
including, without limitation, the warranties of merchantability and of
|
||||
fitness for any purpose. The Contributing Authors and Group 42, Inc.
|
||||
assume no liability for direct, indirect, incidental, special, exemplary,
|
||||
or consequential damages, which may result from the use of the PNG
|
||||
Reference Library, even if advised of the possibility of such damage.
|
||||
The PNG Reference Library is supplied "AS IS". The Contributing
|
||||
Authors and Group 42, Inc. disclaim all warranties, expressed or
|
||||
implied, including, without limitation, the warranties of
|
||||
merchantability and of fitness for any purpose. The Contributing
|
||||
Authors and Group 42, Inc. assume no liability for direct, indirect,
|
||||
incidental, special, exemplary, or consequential damages, which may
|
||||
result from the use of the PNG Reference Library, even if advised of
|
||||
the possibility of such damage.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
source code, or portions hereof, for any purpose, without fee, subject
|
||||
to the following restrictions:
|
||||
|
||||
1. The origin of this source code must not be misrepresented.
|
||||
1. The origin of this source code must not be misrepresented.
|
||||
|
||||
2. Altered versions must be plainly marked as such and must not
|
||||
be misrepresented as being the original source.
|
||||
2. Altered versions must be plainly marked as such and must not
|
||||
be misrepresented as being the original source.
|
||||
|
||||
3. This Copyright notice may not be removed or altered from any
|
||||
source or altered source distribution.
|
||||
3. This Copyright notice may not be removed or altered from any
|
||||
source or altered source distribution.
|
||||
|
||||
The Contributing Authors and Group 42, Inc. specifically permit, without
|
||||
fee, and encourage the use of this source code as a component to
|
||||
supporting the PNG file format in commercial products. If you use this
|
||||
source code in a product, acknowledgment is not required but would be
|
||||
appreciated.
|
||||
|
||||
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
|
||||
|
||||
TRADEMARK:
|
||||
|
||||
The name "libpng" has not been registered by the Copyright owner
|
||||
as a trademark in any jurisdiction. However, because libpng has
|
||||
been distributed and maintained world-wide, continually since 1995,
|
||||
the Copyright owner claims "common-law trademark protection" in any
|
||||
jurisdiction where common-law trademark is recognized.
|
||||
|
||||
OSI CERTIFICATION:
|
||||
|
||||
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
|
||||
a certification mark of the Open Source Initiative. OSI has not addressed
|
||||
the additional disclaimers inserted at version 1.0.7.
|
||||
|
||||
EXPORT CONTROL:
|
||||
|
||||
The Copyright owner believes that the Export Control Classification
|
||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
||||
controls or International Traffic in Arms Regulations (ITAR) because
|
||||
it is open source, publicly available software, that does not contain
|
||||
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
||||
734.7(b).
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
July 15, 2018
|
||||
The Contributing Authors and Group 42, Inc. specifically permit,
|
||||
without fee, and encourage the use of this source code as a component
|
||||
to supporting the PNG file format in commercial products. If you use
|
||||
this source code in a product, acknowledgment is not required but would
|
||||
be appreciated.
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
README for libpng version 1.6.35 - July 15, 2018 (shared library 16.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
README for libpng version 1.6.36 - December 1, 2018
|
||||
===================================================
|
||||
|
||||
See the note about version numbers near the top of png.h.
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
||||
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
|
||||
libpng-*.tar.xz or if you want UNIX-style line endings in the text files,
|
||||
or lpng*.7z or lpng*.zip if you want DOS-style line endings.
|
||||
libpng-*.tar.xz or if you want UNIX-style line endings in the text
|
||||
files, or lpng*.7z or lpng*.zip if you want DOS-style line endings.
|
||||
|
||||
Version 0.89 was the first official release of libpng. Don't let the
|
||||
fact that it's the first release fool you. The libpng library has been in
|
||||
extensive use and testing since mid-1995. By late 1997 it had
|
||||
fact that it's the first release fool you. The libpng library has been
|
||||
in extensive use and testing since mid-1995. By late 1997 it had
|
||||
finally gotten to the stage where there hadn't been significant
|
||||
changes to the API in some time, and people have a bad feeling about
|
||||
libraries with versions < 1.0. Version 1.0.0 was released in
|
||||
|
@ -60,59 +61,37 @@ the library action on the detection of chunk CRC errors. It is possible
|
|||
to set different actions based on whether the CRC error occurred in a
|
||||
critical or an ancillary chunk.
|
||||
|
||||
The changes made to the library, and bugs fixed are based on discussions
|
||||
on the PNG-implement mailing list and not on material submitted
|
||||
privately to Guy, Andreas, or Glenn. They will forward any good
|
||||
suggestions to the list.
|
||||
|
||||
For a detailed description on using libpng, read libpng-manual.txt. For
|
||||
examples of libpng in a program, see example.c and pngtest.c. For usage
|
||||
information and restrictions (what little they are) on libpng, see
|
||||
png.h. For a description on using zlib (the compression library used by
|
||||
libpng) and zlib's restrictions, see zlib.h
|
||||
For a detailed description on using libpng, read libpng-manual.txt.
|
||||
For examples of libpng in a program, see example.c and pngtest.c. For
|
||||
usage information and restrictions (what little they are) on libpng,
|
||||
see png.h. For a description on using zlib (the compression library
|
||||
used by libpng) and zlib's restrictions, see zlib.h
|
||||
|
||||
I have included a general makefile, as well as several machine and
|
||||
compiler specific ones, but you may have to modify one for your own needs.
|
||||
compiler specific ones, but you may have to modify one for your own
|
||||
needs.
|
||||
|
||||
You should use zlib 1.0.4 or later to run this, but it MAY work with
|
||||
versions as old as zlib 0.95. Even so, there are bugs in older zlib
|
||||
versions which can cause the output of invalid compression streams for
|
||||
some images. You will definitely need zlib 1.0.4 or later if you are
|
||||
taking advantage of the MS-DOS "far" structure allocation for the small
|
||||
and medium memory models. You should also note that zlib is a
|
||||
compression library that is useful for more things than just PNG files.
|
||||
You can use zlib as a drop-in replacement for fread() and fwrite() if
|
||||
you are so inclined.
|
||||
some images.
|
||||
|
||||
zlib should be available at the same place that libpng is, or at zlib.net.
|
||||
You should also note that zlib is a compression library that is useful
|
||||
for more things than just PNG files. You can use zlib as a drop-in
|
||||
replacement for fread() and fwrite(), if you are so inclined.
|
||||
|
||||
zlib should be available at the same place that libpng is, or at
|
||||
https://zlib.net.
|
||||
|
||||
You may also want a copy of the PNG specification. It is available
|
||||
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
||||
these at http://www.libpng.org/pub/png/pngdocs.html .
|
||||
|
||||
This code is currently being archived at libpng.sourceforge.io in the
|
||||
[DOWNLOAD] area, and at http://libpng.download/src . If you
|
||||
can't find it in any of those places, e-mail me, and I'll help you find it.
|
||||
[DOWNLOAD] area, and at http://libpng.download/src .
|
||||
|
||||
I am not a lawyer, but I believe that the Export Control Classification
|
||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
||||
controls or International Traffic in Arms Regulations (ITAR) because it
|
||||
is open source, publicly available software, that does not contain any
|
||||
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
|
||||
|
||||
If you have any code changes, requests, problems, etc., please e-mail
|
||||
them to me. Also, I'd appreciate any make files or project files,
|
||||
and any modifications you needed to make to get libpng to compile,
|
||||
along with a #define variable to tell what compiler/system you are on.
|
||||
If you needed to add transformations to libpng, or wish libpng would
|
||||
provide the image in a different way, drop me a note (and code, if
|
||||
possible), so I can consider supporting the transformation.
|
||||
Finally, if you get any warning messages when compiling libpng
|
||||
(note: not zlib), and they are easy to fix, I'd appreciate the
|
||||
fix. Please mention "libpng" somewhere in the subject line. Thanks.
|
||||
|
||||
This release was created and will be supported by myself (of course
|
||||
based in a large way on Guy's and Andreas' earlier work), and the PNG
|
||||
This release, based in a large way on Glenn's, Guy's and Andreas'
|
||||
earlier work, was created and will be supported by myself and the PNG
|
||||
development group.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at
|
||||
|
@ -120,34 +99,21 @@ lists.sourceforge.net (subscription required; visit
|
|||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe).
|
||||
|
||||
You can't reach Guy, the original libpng author, at the addresses
|
||||
given in previous versions of this document. He and Andreas will
|
||||
read mail addressed to the png-implement list, however.
|
||||
|
||||
Please do not send general questions about PNG. Send them to
|
||||
png-mng-misc at lists.sf.net (subscription required; visit
|
||||
Send general questions about the PNG specification to png-mng-misc
|
||||
at lists.sourceforge.net (subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
|
||||
subscribe). If you have a question about something
|
||||
in the PNG specification that is related to using libpng, send it
|
||||
to me. Send me any questions that start with "I was using libpng,
|
||||
and ...". If in doubt, send questions to me. I'll bounce them
|
||||
to others, if necessary.
|
||||
|
||||
Please do not send suggestions on how to change PNG. We have
|
||||
been discussing PNG for twenty years now, and it is official and
|
||||
finished. If you have suggestions for libpng, however, I'll
|
||||
gladly listen. Even if your suggestion is not used immediately,
|
||||
it may be used later.
|
||||
subscribe).
|
||||
|
||||
Files in this distribution:
|
||||
|
||||
ANNOUNCE => Announcement of this version, with recent changes
|
||||
AUTHORS => List of contributing authors
|
||||
CHANGES => Description of changes between libpng versions
|
||||
KNOWNBUG => List of known bugs and deficiencies
|
||||
LICENSE => License to use and redistribute libpng
|
||||
README => This file
|
||||
TODO => Things not implemented in the current library
|
||||
Y2KINFO => Statement of Y2K compliance
|
||||
TRADEMARK => Trademark information
|
||||
example.c => Example code for using libpng functions
|
||||
libpng.3 => manual page for libpng (includes libpng-manual.txt)
|
||||
libpng-manual.txt => Description of libpng and its functions
|
||||
|
@ -208,15 +174,10 @@ Files in this distribution:
|
|||
scripts => Directory containing scripts for building libpng:
|
||||
(see scripts/README.txt for the list of scripts)
|
||||
|
||||
Good luck, and happy coding.
|
||||
Good luck, and happy coding!
|
||||
|
||||
-Glenn Randers-Pehrson (current maintainer, since 1998)
|
||||
Internet: glennrp at users.sourceforge.net
|
||||
|
||||
-Andreas Eric Dilger (former maintainer, 1996-1997)
|
||||
Internet: adilger at enel.ucalgary.ca
|
||||
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
|
||||
|
||||
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
||||
(formerly of Group 42, Inc)
|
||||
Internet: gschal at infinet.com
|
||||
* Cosmin Truta (current maintainer, since 2018)
|
||||
* Glenn Randers-Pehrson (former maintainer, 1998-2018)
|
||||
* Andreas Eric Dilger (former maintainer, 1996-1997)
|
||||
* Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
||||
(formerly of Group 42, Inc.)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.6.35 - July 15, 2018
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 2018 Cosmin Truta
|
||||
Copyright (c) 1998-2018 Glenn Randers-Pehrson
|
||||
|
||||
This document is released under the libpng license.
|
||||
|
@ -10,9 +9,13 @@ libpng-manual.txt - A description on how to use and modify libpng
|
|||
|
||||
Based on:
|
||||
|
||||
libpng version 1.6.36 - December 1, 2018
|
||||
Updated and distributed by Cosmin Truta
|
||||
Copyright (c) 2018 Cosmin Truta
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.6.35 - July 15, 2018
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2017 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2018 Glenn Randers-Pehrson
|
||||
|
||||
libpng 1.0 beta 6 - version 0.96 - May 28, 1997
|
||||
Updated and distributed by Andreas Dilger
|
||||
|
@ -44,7 +47,6 @@ libpng-manual.txt - A description on how to use and modify libpng
|
|||
XIII. Detecting libpng
|
||||
XIV. Source code repository
|
||||
XV. Coding style
|
||||
XVI. Y2K Compliance in libpng
|
||||
|
||||
I. Introduction
|
||||
|
||||
|
@ -65,7 +67,7 @@ file format in application programs.
|
|||
|
||||
The PNG specification (second edition), November 2003, is available as
|
||||
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
|
||||
<https://www.w3.org/TR/2003/REC-PNG-20031110/
|
||||
<https://www.w3.org/TR/2003/REC-PNG-20031110/>.
|
||||
The W3C and ISO documents have identical technical content.
|
||||
|
||||
The PNG-1.2 specification is available at
|
||||
|
@ -73,9 +75,9 @@ The PNG-1.2 specification is available at
|
|||
It is technically equivalent
|
||||
to the PNG specification (second edition) but has some additional material.
|
||||
|
||||
The PNG-1.0 specification is available as RFC 2083
|
||||
The PNG-1.0 specification is available as RFC 2083 at
|
||||
<https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
|
||||
W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
|
||||
W3C Recommendation at <https://www.w3.org/TR/REC-png-961001>.
|
||||
|
||||
Some additional chunks are described in the special-purpose public chunks
|
||||
documents at <http://www.libpng.org/pub/png/spec/register/>
|
||||
|
@ -4054,7 +4056,7 @@ Flags containing additional information about the image are held in
|
|||
the 'flags' field of png_image.
|
||||
|
||||
PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB == 0x01
|
||||
This indicates the the RGB values of the in-memory bitmap do not
|
||||
This indicates that the RGB values of the in-memory bitmap do not
|
||||
correspond to the red, green and blue end-points defined by sRGB.
|
||||
|
||||
PNG_IMAGE_FLAG_FAST == 0x02
|
||||
|
@ -4520,7 +4522,7 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
|
|||
having level = 0 will be printed. There aren't any such statements in
|
||||
this version of libpng, but if you insert some they will be printed.
|
||||
|
||||
VII. MNG support
|
||||
VII. MNG support
|
||||
|
||||
The MNG specification (available at http://www.libpng.org/pub/mng) allows
|
||||
certain extensions to PNG for PNG images that are embedded in MNG datastreams.
|
||||
|
@ -4547,7 +4549,7 @@ or any other MNG chunks; your application must provide its own support for
|
|||
them. You may wish to consider using libmng (available at
|
||||
https://www.libmng.com/) instead.
|
||||
|
||||
VIII. Changes to Libpng from version 0.88
|
||||
VIII. Changes to Libpng from version 0.88
|
||||
|
||||
It should be noted that versions of libpng later than 0.96 are not
|
||||
distributed by the original libpng author, Guy Schalnat, nor by
|
||||
|
@ -4602,7 +4604,7 @@ application:
|
|||
|
||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||
|
||||
IX. Changes to Libpng from version 1.0.x to 1.2.x
|
||||
IX. Changes to Libpng from version 1.0.x to 1.2.x
|
||||
|
||||
Support for user memory management was enabled by default. To
|
||||
accomplish this, the functions png_create_read_struct_2(),
|
||||
|
@ -4699,7 +4701,7 @@ which also expands tRNS to alpha was replaced with
|
|||
png_set_expand_gray_1_2_4_to_8()
|
||||
which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
|
||||
|
||||
X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
|
||||
X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
|
||||
|
||||
Private libpng prototypes and macro definitions were moved from
|
||||
png.h and pngconf.h into a new pngpriv.h header file.
|
||||
|
@ -4809,7 +4811,7 @@ was renamed to PNG_READ_QUANTIZE_SUPPORTED.
|
|||
|
||||
We removed the trailing '.' from the warning and error messages.
|
||||
|
||||
XI. Changes to Libpng from version 1.4.x to 1.5.x
|
||||
XI. Changes to Libpng from version 1.4.x to 1.5.x
|
||||
|
||||
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
||||
function) incorrectly returned a value of type png_uint_32.
|
||||
|
@ -4872,7 +4874,7 @@ to png_bytepp, and in png_set_iCCP, from png_charp to png_const_bytep.
|
|||
There are changes of form in png.h, including new and changed macros to
|
||||
declare parts of the API. Some API functions with arguments that are
|
||||
pointers to data not modified within the function have been corrected to
|
||||
declare these arguments with PNG_CONST.
|
||||
declare these arguments with const.
|
||||
|
||||
Much of the internal use of C macros to control the library build has also
|
||||
changed and some of this is visible in the exported header files, in
|
||||
|
@ -5067,7 +5069,7 @@ even though the default is to use the macros - this allows applications
|
|||
to choose at app buildtime whether or not to use macros (previously
|
||||
impossible because the functions weren't in the default build.)
|
||||
|
||||
XII. Changes to Libpng from version 1.5.x to 1.6.x
|
||||
XII. Changes to Libpng from version 1.5.x to 1.6.x
|
||||
|
||||
A "simplified API" has been added (see documentation in png.h and a simple
|
||||
example in contrib/examples/pngtopng.c). The new publicly visible API
|
||||
|
@ -5230,7 +5232,7 @@ attempt to decode the Exif profile; it simply returns a byte array
|
|||
containing the profile to the calling application which must do its own
|
||||
decoding.
|
||||
|
||||
XIII. Detecting libpng
|
||||
XIII. Detecting libpng
|
||||
|
||||
The png_get_io_ptr() function has been present since libpng-0.88, has never
|
||||
changed, and is unaffected by conditional compilation macros. It is the
|
||||
|
@ -5255,7 +5257,7 @@ or you can browse it with a web browser at
|
|||
https://sourceforge.net/p/libpng/code/ci/libpng16/tree/
|
||||
|
||||
Patches can be sent to png-mng-implement at lists.sourceforge.net or
|
||||
you can upload them to the libpng bug tracker at
|
||||
uploaded to the libpng bug tracker at
|
||||
|
||||
https://libpng.sourceforge.io/
|
||||
|
||||
|
@ -5405,58 +5407,3 @@ We do not use the TAB character for indentation in the C sources.
|
|||
Lines do not exceed 80 characters.
|
||||
|
||||
Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
XVI. Y2K Compliance in libpng
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.6.35 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||
that will hold years up to 65535. The other, which is deprecated,
|
||||
holds the date in text format, and will hold years up to 9999.
|
||||
|
||||
The integer is
|
||||
"png_uint_16 year" in png_time_struct.
|
||||
|
||||
The string is
|
||||
"char time_buffer[29]" in png_struct. This is no longer used
|
||||
in libpng-1.6.x and will be removed from libpng-1.7.0.
|
||||
|
||||
There are seven time-related functions:
|
||||
|
||||
png_convert_to_rfc_1123_buffer() in png.c
|
||||
(formerly png_convert_to_rfc_1152() in error, and
|
||||
also formerly png_convert_to_rfc_1123())
|
||||
png_convert_from_struct_tm() in pngwrite.c, called
|
||||
in pngwrite.c
|
||||
png_convert_from_time_t() in pngwrite.c
|
||||
png_get_tIME() in pngget.c
|
||||
png_handle_tIME() in pngrutil.c, called in pngread.c
|
||||
png_set_tIME() in pngset.c
|
||||
png_write_tIME() in pngwutil.c, called in pngwrite.c
|
||||
|
||||
All appear to handle dates properly in a Y2K environment. The
|
||||
png_convert_from_time_t() function calls gmtime() to convert from system
|
||||
clock time, which returns (year - 1900), which we properly convert to
|
||||
the full 4-digit year. There is a possibility that applications using
|
||||
libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
|
||||
function, or that they are incorrectly passing only a 2-digit year
|
||||
instead of "year - 1900" into the png_convert_from_struct_tm() function,
|
||||
but this is not under our control. The libpng documentation has always
|
||||
stated that it works with 4-digit years, and the APIs have been
|
||||
documented as such.
|
||||
|
||||
The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
|
||||
integer to hold the year, and can hold years as large as 65535.
|
||||
|
||||
zlib, upon which libpng depends, is also Y2K compliant. It contains
|
||||
no date-related code.
|
||||
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
libpng maintainer
|
||||
PNG Development Group
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -14,7 +14,7 @@
|
|||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_6_35 Your_png_h_is_not_version_1_6_35;
|
||||
typedef png_libpng_version_1_6_36 Your_png_h_is_not_version_1_6_36;
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* The version tests may need to be added to, but the problem warning has
|
||||
|
@ -736,7 +736,7 @@ png_save_int_32(png_bytep buf, png_int_32 i)
|
|||
int PNGAPI
|
||||
png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime)
|
||||
{
|
||||
static PNG_CONST char short_months[12][4] =
|
||||
static const char short_months[12][4] =
|
||||
{"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
||||
|
||||
|
@ -814,20 +814,14 @@ png_get_copyright(png_const_structrp png_ptr)
|
|||
#ifdef PNG_STRING_COPYRIGHT
|
||||
return PNG_STRING_COPYRIGHT
|
||||
#else
|
||||
# ifdef __STDC__
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.35 - July 15, 2018" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.36" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 2018 Cosmin Truta" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
|
||||
PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||
PNG_STRING_NEWLINE;
|
||||
# else
|
||||
return "libpng version 1.6.35 - July 15, 2018\
|
||||
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.";
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1121,7 +1115,7 @@ png_colorspace_set_gamma(png_const_structrp png_ptr,
|
|||
png_colorspacerp colorspace, png_fixed_point gAMA)
|
||||
{
|
||||
/* Changed in libpng-1.5.4 to limit the values to ensure overflow can't
|
||||
* occur. Since the fixed point representation is asymetrical it is
|
||||
* occur. Since the fixed point representation is asymmetrical it is
|
||||
* possible for 1/gamma to overflow the limit of 21474 and this means the
|
||||
* gamma value must be at least 5/100000 and hence at most 20000.0. For
|
||||
* safety the limits here are a little narrower. The values are 0.00016 to
|
||||
|
@ -3134,11 +3128,11 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, size_t size,
|
|||
/* The total output count (max) is now 4+precision */
|
||||
|
||||
/* Check for an exponent, if we don't need one we are
|
||||
* done and just need to terminate the string. At
|
||||
* this point exp_b10==(-1) is effectively a flag - it got
|
||||
* to '-1' because of the decrement after outputting
|
||||
* the decimal point above (the exponent required is
|
||||
* *not* -1!)
|
||||
* done and just need to terminate the string. At this
|
||||
* point, exp_b10==(-1) is effectively a flag: it got
|
||||
* to '-1' because of the decrement, after outputting
|
||||
* the decimal point above. (The exponent required is
|
||||
* *not* -1.)
|
||||
*/
|
||||
if (exp_b10 >= (-1) && exp_b10 <= 2)
|
||||
{
|
||||
|
@ -3976,18 +3970,18 @@ png_gamma_correct(png_structrp png_ptr, unsigned int value,
|
|||
*/
|
||||
static void
|
||||
png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable,
|
||||
PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
|
||||
unsigned int shift, png_fixed_point gamma_val)
|
||||
{
|
||||
/* Various values derived from 'shift': */
|
||||
PNG_CONST unsigned int num = 1U << (8U - shift);
|
||||
unsigned int num = 1U << (8U - shift);
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
/* CSE the division and work round wacky GCC warnings (see the comments
|
||||
* in png_gamma_8bit_correct for where these come from.)
|
||||
*/
|
||||
PNG_CONST double fmax = 1./(((png_int_32)1 << (16U - shift))-1);
|
||||
double fmax = 1.0 / (((png_int_32)1 << (16U - shift)) - 1);
|
||||
#endif
|
||||
PNG_CONST unsigned int max = (1U << (16U - shift))-1U;
|
||||
PNG_CONST unsigned int max_by_2 = 1U << (15U-shift);
|
||||
unsigned int max = (1U << (16U - shift)) - 1U;
|
||||
unsigned int max_by_2 = 1U << (15U - shift);
|
||||
unsigned int i;
|
||||
|
||||
png_uint_16pp table = *ptable =
|
||||
|
@ -4053,10 +4047,10 @@ png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable,
|
|||
*/
|
||||
static void
|
||||
png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable,
|
||||
PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
|
||||
unsigned int shift, png_fixed_point gamma_val)
|
||||
{
|
||||
PNG_CONST unsigned int num = 1U << (8U - shift);
|
||||
PNG_CONST unsigned int max = (1U << (16U - shift))-1U;
|
||||
unsigned int num = 1U << (8U - shift);
|
||||
unsigned int max = (1U << (16U - shift))-1U;
|
||||
unsigned int i;
|
||||
png_uint_32 last;
|
||||
|
||||
|
@ -4121,7 +4115,7 @@ png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable,
|
|||
*/
|
||||
static void
|
||||
png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable,
|
||||
PNG_CONST png_fixed_point gamma_val)
|
||||
png_fixed_point gamma_val)
|
||||
{
|
||||
unsigned int i;
|
||||
png_bytep table = *ptable = (png_bytep)png_malloc(png_ptr, 256);
|
||||
|
|
|
@ -1,29 +1,65 @@
|
|||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.6.35, July 15, 2018
|
||||
* libpng version 1.6.36 - December 1, 2018
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license (See LICENSE, below)
|
||||
* This code is released under the libpng license. (See LICENSE, below.)
|
||||
*
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.6.35, July 15, 2018:
|
||||
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
|
||||
* Glenn Randers-Pehrson.
|
||||
* libpng version 1.6.36, December 1, 2018: Cosmin Truta
|
||||
* See also "Contributing Authors", below.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
||||
* COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
||||
* =========================================
|
||||
*
|
||||
* If you modify libpng you may insert additional notices immediately following
|
||||
* this sentence.
|
||||
* PNG Reference Library License version 2
|
||||
* ---------------------------------------
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* * Copyright (c) 1995-2018 The PNG Reference Library Authors.
|
||||
* * Copyright (c) 2018 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.
|
||||
*
|
||||
* The software is supplied "as is", without warranty of any kind,
|
||||
* express or implied, including, without limitation, the warranties
|
||||
* of merchantability, fitness for a particular purpose, title, and
|
||||
* non-infringement. In no even shall the Copyright owners, or
|
||||
* anyone distributing the software, be liable for any damages or
|
||||
* other liability, whether in contract, tort or otherwise, arising
|
||||
* from, out of, or in connection with the software, or the use or
|
||||
* other dealings in the software, even if advised of the possibility
|
||||
* of such damage.
|
||||
*
|
||||
* Permission is hereby granted to use, copy, modify, and distribute
|
||||
* this software, or portions hereof, for any purpose, without fee,
|
||||
* subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you
|
||||
* use this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated, but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and must
|
||||
* not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This Copyright notice may not be removed or altered from any
|
||||
* source or altered source distribution.
|
||||
*
|
||||
*
|
||||
* PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||
* -----------------------------------------------------------------------
|
||||
*
|
||||
* libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
||||
|
@ -31,38 +67,38 @@
|
|||
* disclaimer and license as libpng-1.0.6 with the following individuals
|
||||
* added to the list of Contributing Authors:
|
||||
*
|
||||
* Simon-Pierre Cadieux
|
||||
* Eric S. Raymond
|
||||
* Mans Rullgard
|
||||
* Cosmin Truta
|
||||
* Gilles Vollant
|
||||
* James Yu
|
||||
* Mandar Sahastrabuddhe
|
||||
* Google Inc.
|
||||
* Vadim Barkov
|
||||
* Simon-Pierre Cadieux
|
||||
* Eric S. Raymond
|
||||
* Mans Rullgard
|
||||
* Cosmin Truta
|
||||
* Gilles Vollant
|
||||
* James Yu
|
||||
* Mandar Sahastrabuddhe
|
||||
* Google Inc.
|
||||
* Vadim Barkov
|
||||
*
|
||||
* and with the following additions to the disclaimer:
|
||||
*
|
||||
* There is no warranty against interference with your enjoyment of the
|
||||
* library or against infringement. There is no warranty that our
|
||||
* efforts or the library will fulfill any of your particular purposes
|
||||
* or needs. This library is provided with all faults, and the entire
|
||||
* risk of satisfactory quality, performance, accuracy, and effort is with
|
||||
* the user.
|
||||
* There is no warranty against interference with your enjoyment of
|
||||
* the library or against infringement. There is no warranty that our
|
||||
* efforts or the library will fulfill any of your particular purposes
|
||||
* or needs. This library is provided with all faults, and the entire
|
||||
* risk of satisfactory quality, performance, accuracy, and effort is
|
||||
* with the user.
|
||||
*
|
||||
* Some files in the "contrib" directory and some configure-generated
|
||||
* files that are distributed with libpng have other copyright owners and
|
||||
* files that are distributed with libpng have other copyright owners, and
|
||||
* are released under other open source licenses.
|
||||
*
|
||||
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
||||
* Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
||||
* libpng-0.96, and are distributed according to the same disclaimer and
|
||||
* license as libpng-0.96, with the following individuals added to the list
|
||||
* of Contributing Authors:
|
||||
* license as libpng-0.96, with the following individuals added to the
|
||||
* list of Contributing Authors:
|
||||
*
|
||||
* Tom Lane
|
||||
* Glenn Randers-Pehrson
|
||||
* Willem van Schaik
|
||||
* Tom Lane
|
||||
* Glenn Randers-Pehrson
|
||||
* Willem van Schaik
|
||||
*
|
||||
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
||||
* Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
|
||||
|
@ -70,14 +106,14 @@
|
|||
* libpng-0.88, with the following individuals added to the list of
|
||||
* Contributing Authors:
|
||||
*
|
||||
* John Bowler
|
||||
* Kevin Bracey
|
||||
* Sam Bushell
|
||||
* Magnus Holmgren
|
||||
* Greg Roelofs
|
||||
* Tom Tanner
|
||||
* John Bowler
|
||||
* Kevin Bracey
|
||||
* Sam Bushell
|
||||
* Magnus Holmgren
|
||||
* Greg Roelofs
|
||||
* Tom Tanner
|
||||
*
|
||||
* Some files in the "scripts" directory have other copyright owners
|
||||
* Some files in the "scripts" directory have other copyright owners,
|
||||
* but are released under this license.
|
||||
*
|
||||
* libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
||||
|
@ -86,62 +122,49 @@
|
|||
* For the purposes of this copyright and license, "Contributing Authors"
|
||||
* is defined as the following set of individuals:
|
||||
*
|
||||
* Andreas Dilger
|
||||
* Dave Martindale
|
||||
* Guy Eric Schalnat
|
||||
* Paul Schmidt
|
||||
* Tim Wegner
|
||||
* Andreas Dilger
|
||||
* Dave Martindale
|
||||
* Guy Eric Schalnat
|
||||
* Paul Schmidt
|
||||
* Tim Wegner
|
||||
*
|
||||
* The PNG Reference Library is supplied "AS IS". The Contributing Authors
|
||||
* and Group 42, Inc. disclaim all warranties, expressed or implied,
|
||||
* including, without limitation, the warranties of merchantability and of
|
||||
* fitness for any purpose. The Contributing Authors and Group 42, Inc.
|
||||
* assume no liability for direct, indirect, incidental, special, exemplary,
|
||||
* or consequential damages, which may result from the use of the PNG
|
||||
* Reference Library, even if advised of the possibility of such damage.
|
||||
* The PNG Reference Library is supplied "AS IS". The Contributing
|
||||
* Authors and Group 42, Inc. disclaim all warranties, expressed or
|
||||
* implied, including, without limitation, the warranties of
|
||||
* merchantability and of fitness for any purpose. The Contributing
|
||||
* Authors and Group 42, Inc. assume no liability for direct, indirect,
|
||||
* incidental, special, exemplary, or consequential damages, which may
|
||||
* result from the use of the PNG Reference Library, even if advised of
|
||||
* the possibility of such damage.
|
||||
*
|
||||
* Permission is hereby granted to use, copy, modify, and distribute this
|
||||
* source code, or portions hereof, for any purpose, without fee, subject
|
||||
* to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this source code must not be misrepresented.
|
||||
* 1. The origin of this source code must not be misrepresented.
|
||||
*
|
||||
* 2. Altered versions must be plainly marked as such and must not
|
||||
* be misrepresented as being the original source.
|
||||
* 2. Altered versions must be plainly marked as such and must not
|
||||
* be misrepresented as being the original source.
|
||||
*
|
||||
* 3. This Copyright notice may not be removed or altered from any
|
||||
* source or altered source distribution.
|
||||
* 3. This Copyright notice may not be removed or altered from any
|
||||
* source or altered source distribution.
|
||||
*
|
||||
* The Contributing Authors and Group 42, Inc. specifically permit, without
|
||||
* fee, and encourage the use of this source code as a component to
|
||||
* supporting the PNG file format in commercial products. If you use this
|
||||
* source code in a product, acknowledgment is not required but would be
|
||||
* appreciated.
|
||||
* The Contributing Authors and Group 42, Inc. specifically permit,
|
||||
* without fee, and encourage the use of this source code as a component
|
||||
* to supporting the PNG file format in commercial products. If you use
|
||||
* this source code in a product, acknowledgment is not required but would
|
||||
* be appreciated.
|
||||
*
|
||||
* END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
|
||||
*
|
||||
* TRADEMARK:
|
||||
* TRADEMARK
|
||||
* =========
|
||||
*
|
||||
* The name "libpng" has not been registered by the Copyright owner
|
||||
* The name "libpng" has not been registered by the Copyright owners
|
||||
* as a trademark in any jurisdiction. However, because libpng has
|
||||
* been distributed and maintained world-wide, continually since 1995,
|
||||
* the Copyright owner claims "common-law trademark protection" in any
|
||||
* the Copyright owners claim "common-law trademark protection" in any
|
||||
* jurisdiction where common-law trademark is recognized.
|
||||
*
|
||||
* OSI CERTIFICATION:
|
||||
*
|
||||
* Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
|
||||
* a certification mark of the Open Source Initiative. OSI has not addressed
|
||||
* the additional disclaimers inserted at version 1.0.7.
|
||||
*
|
||||
* EXPORT CONTROL:
|
||||
*
|
||||
* The Copyright owner believes that the Export Control Classification
|
||||
* Number (ECCN) for libpng is EAR99, which means not subject to export
|
||||
* controls or International Traffic in Arms Regulations (ITAR) because
|
||||
* it is open source, publicly available software, that does not contain
|
||||
* any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
||||
* 734.7(b).
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -207,23 +230,25 @@
|
|||
* 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible)
|
||||
* 1.0.7 1 10007 (still compatible)
|
||||
* ...
|
||||
* 1.0.19 10 10019 10.so.0.19[.0]
|
||||
* 1.0.69 10 10069 10.so.0.69[.0]
|
||||
* ...
|
||||
* 1.2.59 13 10257 12.so.0.59[.0]
|
||||
* 1.2.59 13 10259 12.so.0.59[.0]
|
||||
* ...
|
||||
* 1.5.30 15 10527 15.so.15.30[.0]
|
||||
* 1.4.20 14 10420 14.so.0.20[.0]
|
||||
* ...
|
||||
* 1.6.35 16 10635 16.so.16.35[.0]
|
||||
* 1.5.30 15 10530 15.so.15.30[.0]
|
||||
* ...
|
||||
* 1.6.36 16 10636 16.so.16.36[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
* used for changes in backward compatibility, as it is intended. The
|
||||
* PNG_LIBPNG_VER macro, which is not used within libpng but is available
|
||||
* for applications, is an unsigned integer of the form xyyzz corresponding
|
||||
* to the source version x.y.z (leading zeros in y and z). Beta versions
|
||||
* were given the previous public release number plus a letter, until
|
||||
* version 1.0.6j; from then on they were given the upcoming public
|
||||
* release number plus "betaNN" or "rcNN".
|
||||
* Henceforth the source version will match the shared-library major and
|
||||
* minor numbers; the shared-library major version number will be used for
|
||||
* changes in backward compatibility, as it is intended.
|
||||
* The PNG_LIBPNG_VER macro, which is not used within libpng but is
|
||||
* available for applications, is an unsigned integer of the form XYYZZ
|
||||
* corresponding to the source version X.Y.Z (leading zeros in Y and Z).
|
||||
* Beta versions were given the previous public release number plus a
|
||||
* letter, until version 1.0.6j; from then on they were given the upcoming
|
||||
* public release number plus "betaNN" or "rcNN".
|
||||
*
|
||||
* Binary incompatibility exists only when applications make direct access
|
||||
* to the info_ptr or png_ptr members through png.h, and the compiled
|
||||
|
@ -233,65 +258,8 @@
|
|||
* 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 Specification,
|
||||
* <https://www.w3.org/TR/2003/REC-PNG-20031110/
|
||||
*/
|
||||
|
||||
/*
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* July 15, 2018
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.6.35 are Y2K compliant. It is my belief that
|
||||
* earlier versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||
* that will hold years up to 65535. The other, which is deprecated,
|
||||
* holds the date in text format, and will hold years up to 9999.
|
||||
*
|
||||
* The integer is
|
||||
* "png_uint_16 year" in png_time_struct.
|
||||
*
|
||||
* The string is
|
||||
* "char time_buffer[29]" in png_struct. This is no longer used
|
||||
* in libpng-1.6.x and will be removed from libpng-1.7.0.
|
||||
*
|
||||
* There are seven time-related functions:
|
||||
* png.c: png_convert_to_rfc_1123_buffer() in png.c
|
||||
* (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and
|
||||
* png_convert_to_rfc_1152() in error prior to libpng-0.98)
|
||||
* png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
|
||||
* png_convert_from_time_t() in pngwrite.c
|
||||
* png_get_tIME() in pngget.c
|
||||
* png_handle_tIME() in pngrutil.c, called in pngread.c
|
||||
* png_set_tIME() in pngset.c
|
||||
* png_write_tIME() in pngwutil.c, called in pngwrite.c
|
||||
*
|
||||
* All handle dates properly in a Y2K environment. The
|
||||
* png_convert_from_time_t() function calls gmtime() to convert from system
|
||||
* clock time, which returns (year - 1900), which we properly convert to
|
||||
* the full 4-digit year. There is a possibility that libpng applications
|
||||
* are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()
|
||||
* function, or that they are incorrectly passing only a 2-digit year
|
||||
* instead of "year - 1900" into the png_convert_from_struct_tm() function,
|
||||
* but this is not under our control. The libpng documentation has always
|
||||
* stated that it works with 4-digit years, and the APIs have been
|
||||
* documented as such.
|
||||
*
|
||||
* The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
|
||||
* integer to hold the year, and can hold years as large as 65535.
|
||||
*
|
||||
* zlib, upon which libpng depends, is also Y2K compliant. It contains
|
||||
* no date-related code.
|
||||
*
|
||||
* Glenn Randers-Pehrson
|
||||
* libpng maintainer
|
||||
* PNG Development Group
|
||||
* is available as a W3C Recommendation and as an ISO/IEC Standard; see
|
||||
* <https://www.w3.org/TR/2003/REC-PNG-20031110/>
|
||||
*/
|
||||
|
||||
#ifndef PNG_H
|
||||
|
@ -309,8 +277,8 @@
|
|||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.35"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.35 - July 15, 2018\n"
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.36"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.36 - December 1, 2018\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 16
|
||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||
|
@ -318,13 +286,13 @@
|
|||
/* 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 35
|
||||
#define PNG_LIBPNG_VER_RELEASE 36
|
||||
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||
*/
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 02
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
|
||||
/* Release Status */
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
|
@ -341,15 +309,16 @@
|
|||
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
|
||||
PNG_LIBPNG_BUILD_PRIVATE */
|
||||
|
||||
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
|
||||
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
|
||||
|
||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||
* We must not include leading zeros.
|
||||
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
|
||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
||||
/* Careful here. At one time, Guy wanted to use 082, but that
|
||||
* would be octal. We must not include leading zeros.
|
||||
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here
|
||||
* (only version 1.0.0 was mis-numbered 100 instead of 10000).
|
||||
* From version 1.0.1 it is:
|
||||
* XXYYZZ, where XX=major, YY=minor, ZZ=release
|
||||
*/
|
||||
#define PNG_LIBPNG_VER 10635 /* 1.6.35 */
|
||||
#define PNG_LIBPNG_VER 10636 /* 1.6.36 */
|
||||
|
||||
/* Library configuration: these options cannot be changed after
|
||||
* the library has been built.
|
||||
|
@ -459,7 +428,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_35;
|
||||
typedef char* png_libpng_version_1_6_36;
|
||||
|
||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||
*
|
||||
|
@ -2013,12 +1982,12 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
|
|||
PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
|
||||
png_inforp info_ptr, png_bytep *exif));
|
||||
PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
|
||||
png_inforp info_ptr, const png_bytep exif));
|
||||
png_inforp info_ptr, png_bytep exif));
|
||||
|
||||
PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
|
||||
png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
|
||||
PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
|
||||
png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif));
|
||||
png_inforp info_ptr, png_uint_32 num_exif, png_bytep exif));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_gAMA_SUPPORTED
|
||||
|
@ -2764,7 +2733,7 @@ typedef struct
|
|||
*
|
||||
* When the simplified API needs to convert between sRGB and linear colorspaces,
|
||||
* the actual sRGB transfer curve defined in the sRGB specification (see the
|
||||
* article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
|
||||
* article at <https://en.wikipedia.org/wiki/SRGB>) is used, not the gamma=1/2.2
|
||||
* approximation used elsewhere in libpng.
|
||||
*
|
||||
* When an alpha channel is present it is expected to denote pixel coverage
|
||||
|
@ -2967,7 +2936,7 @@ typedef struct
|
|||
* 'flags' field of png_image.
|
||||
*/
|
||||
#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01
|
||||
/* This indicates the the RGB values of the in-memory bitmap do not
|
||||
/* This indicates that the RGB values of the in-memory bitmap do not
|
||||
* correspond to the red, green and blue end-points defined by sRGB.
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.35, July 15, 2018
|
||||
* libpng version 1.6.36
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -57,14 +58,13 @@
|
|||
|
||||
#endif /* PNG_BUILDING_SYMBOL_TABLE */
|
||||
|
||||
/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
|
||||
* PNG_NO_CONST; this is no longer supported except for data declarations which
|
||||
* apparently still cause problems in 2011 on some compilers.
|
||||
/* Prior to 1.6.0, it was possible to turn off 'const' in declarations,
|
||||
* using PNG_NO_CONST. This is no longer supported.
|
||||
*/
|
||||
#define PNG_CONST const /* backward compatibility only */
|
||||
|
||||
/* This controls optimization of the reading of 16-bit and 32-bit values
|
||||
* from PNG files. It can be set on a per-app-file basis - it
|
||||
/* This controls optimization of the reading of 16-bit and 32-bit
|
||||
* values from PNG files. It can be set on a per-app-file basis: it
|
||||
* just changes whether a macro is used when the function is called.
|
||||
* The library builder sets the default; if read functions are not
|
||||
* built into the library the macro implementation is forced on.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
|
||||
*
|
||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.6.31 [July 27, 2017]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -425,7 +425,7 @@ png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
|
|||
* if the character is invalid.
|
||||
*/
|
||||
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
|
||||
static PNG_CONST char png_digit[16] = {
|
||||
static const char png_digit[16] = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'A', 'B', 'C', 'D', 'E', 'F'
|
||||
};
|
||||
|
@ -885,7 +885,7 @@ PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI
|
|||
png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN)
|
||||
{
|
||||
const png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
|
||||
|
||||
/* An error is always logged here, overwriting anything (typically a warning)
|
||||
|
@ -920,7 +920,7 @@ png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
|
|||
void /* PRIVATE */ PNGCBAPI
|
||||
png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
|
||||
{
|
||||
const png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
|
||||
|
||||
/* A warning is only logged if there is no prior warning or error. */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pnginfo.h - header file for PNG reference library
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
/* libpng 1.6.35 STANDARD API DEFINITION */
|
||||
|
||||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* Libpng version 1.6.35 - July 15, 2018 */
|
||||
/* libpng version 1.6.36 */
|
||||
|
||||
/* Copyright (c) 1998-2018 Glenn Randers-Pehrson */
|
||||
/* Copyright (c) 2018 Cosmin Truta */
|
||||
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
|
||||
|
||||
/* This code is released under the libpng license. */
|
||||
/* For conditions of distribution and use, see the disclaimer */
|
||||
|
@ -20,8 +19,6 @@
|
|||
#define PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
|
||||
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
|
||||
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
|
||||
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
|
||||
#define PNG_BENIGN_ERRORS_SUPPORTED
|
||||
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
|
||||
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
|
||||
|
@ -46,6 +43,8 @@
|
|||
#define PNG_IO_STATE_SUPPORTED
|
||||
#define PNG_MNG_FEATURES_SUPPORTED
|
||||
#define PNG_POINTER_INDEXING_SUPPORTED
|
||||
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
|
||||
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
|
||||
#define PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
#define PNG_READ_16BIT_SUPPORTED
|
||||
#define PNG_READ_ALPHA_MODE_SUPPORTED
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.6.26 [October 20, 2016]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -972,20 +972,20 @@ png_read_push_finish_row(png_structrp png_ptr)
|
|||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
static PNG_CONST png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
|
||||
static const png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
/* Start of interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
|
||||
static const png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
|
||||
|
||||
/* Offset to next interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
|
||||
static const png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
/* Height of interlace block. This is not currently used - if you need
|
||||
* it, uncomment it here and in png.h
|
||||
static PNG_CONST png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
*/
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -180,7 +180,10 @@
|
|||
# else /* !defined __ARM_NEON__ */
|
||||
/* The 'intrinsics' code simply won't compile without this -mfpu=neon:
|
||||
*/
|
||||
# define PNG_ARM_NEON_IMPLEMENTATION 2
|
||||
# if !defined(__aarch64__)
|
||||
/* The assembler code currently does not work on ARM64 */
|
||||
# define PNG_ARM_NEON_IMPLEMENTATION 2
|
||||
# endif /* __aarch64__ */
|
||||
# endif /* __ARM_NEON__ */
|
||||
# endif /* !PNG_ARM_NEON_IMPLEMENTATION */
|
||||
|
||||
|
@ -1548,10 +1551,10 @@ PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr,
|
|||
#endif
|
||||
|
||||
PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
|
||||
const png_uint_32 chunk_name),PNG_EMPTY);
|
||||
png_uint_32 chunk_name),PNG_EMPTY);
|
||||
|
||||
PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
|
||||
const png_uint_32 chunk_length),PNG_EMPTY);
|
||||
png_uint_32 chunk_length),PNG_EMPTY);
|
||||
|
||||
PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
|
||||
png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
|
||||
|
@ -2128,6 +2131,29 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
|||
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
|
||||
png_const_charp key, png_bytep new_key), PNG_EMPTY);
|
||||
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1
|
||||
PNG_INTERNAL_FUNCTION(void,
|
||||
png_riffle_palette_rgba,
|
||||
(png_structrp, png_row_infop),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(int,
|
||||
png_do_expand_palette_neon_rgba,
|
||||
(png_structrp,
|
||||
png_row_infop,
|
||||
png_const_bytep,
|
||||
const png_bytepp,
|
||||
const png_bytepp),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(int,
|
||||
png_do_expand_palette_neon_rgb,
|
||||
(png_structrp,
|
||||
png_row_infop,
|
||||
png_const_bytep,
|
||||
const png_bytepp,
|
||||
const png_bytepp),
|
||||
PNG_EMPTY);
|
||||
#endif
|
||||
|
||||
/* Maintainer: Put new private prototypes here ^ */
|
||||
|
||||
#include "pngdebug.h"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -1621,7 +1621,7 @@ png_image_skip_unused_chunks(png_structrp png_ptr)
|
|||
* errors (which are unfortunately quite common.)
|
||||
*/
|
||||
{
|
||||
static PNG_CONST png_byte chunks_to_process[] = {
|
||||
static const png_byte chunks_to_process[] = {
|
||||
98, 75, 71, 68, '\0', /* bKGD */
|
||||
99, 72, 82, 77, '\0', /* cHRM */
|
||||
103, 65, 77, 65, '\0', /* gAMA */
|
||||
|
@ -1758,9 +1758,9 @@ png_create_colormap_entry(png_image_read_control *display,
|
|||
png_uint_32 alpha, int encoding)
|
||||
{
|
||||
png_imagep image = display->image;
|
||||
const int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
|
||||
int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
|
||||
P_LINEAR : P_sRGB;
|
||||
const int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 &&
|
||||
int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 &&
|
||||
(red != green || green != blue);
|
||||
|
||||
if (ip > 255)
|
||||
|
@ -1869,13 +1869,13 @@ png_create_colormap_entry(png_image_read_control *display,
|
|||
/* Store the value. */
|
||||
{
|
||||
# ifdef PNG_FORMAT_AFIRST_SUPPORTED
|
||||
const int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
|
||||
int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
|
||||
(image->format & PNG_FORMAT_FLAG_ALPHA) != 0;
|
||||
# else
|
||||
# define afirst 0
|
||||
# endif
|
||||
# ifdef PNG_FORMAT_BGR_SUPPORTED
|
||||
const int bgr = (image->format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
|
||||
int bgr = (image->format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
|
||||
# else
|
||||
# define bgr 0
|
||||
# endif
|
||||
|
@ -2085,11 +2085,11 @@ png_image_read_colormap(png_voidp argument)
|
|||
{
|
||||
png_image_read_control *display =
|
||||
png_voidcast(png_image_read_control*, argument);
|
||||
const png_imagep image = display->image;
|
||||
png_imagep image = display->image;
|
||||
|
||||
const png_structrp png_ptr = image->opaque->png_ptr;
|
||||
const png_uint_32 output_format = image->format;
|
||||
const int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
|
||||
png_structrp png_ptr = image->opaque->png_ptr;
|
||||
png_uint_32 output_format = image->format;
|
||||
int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
|
||||
P_LINEAR : P_sRGB;
|
||||
|
||||
unsigned int cmap_entries;
|
||||
|
@ -2802,7 +2802,7 @@ png_image_read_colormap(png_voidp argument)
|
|||
unsigned int num_trans = png_ptr->num_trans;
|
||||
png_const_bytep trans = num_trans > 0 ? png_ptr->trans_alpha : NULL;
|
||||
png_const_colorp colormap = png_ptr->palette;
|
||||
const int do_background = trans != NULL &&
|
||||
int do_background = trans != NULL &&
|
||||
(output_format & PNG_FORMAT_FLAG_ALPHA) == 0;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -3946,7 +3946,7 @@ png_image_read_direct(png_voidp argument)
|
|||
*/
|
||||
if (linear != 0)
|
||||
{
|
||||
PNG_CONST png_uint_16 le = 0x0001;
|
||||
png_uint_16 le = 0x0001;
|
||||
|
||||
if ((*(png_const_bytep) & le) != 0)
|
||||
png_set_swap(png_ptr);
|
||||
|
@ -4108,7 +4108,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
|
|||
* original PNG format because it may not occur in the output PNG format
|
||||
* and libpng deals with the issues of reading the original.
|
||||
*/
|
||||
const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
|
||||
unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
|
||||
|
||||
/* The following checks just the 'row_stride' calculation to ensure it
|
||||
* fits in a signed 32-bit value. Because channels/components can be
|
||||
|
@ -4119,7 +4119,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
|
|||
if (image->width <= 0x7fffffffU/channels) /* no overflow */
|
||||
{
|
||||
png_uint_32 check;
|
||||
const png_uint_32 png_row_stride = image->width * channels;
|
||||
png_uint_32 png_row_stride = image->width * channels;
|
||||
|
||||
if (row_stride == 0)
|
||||
row_stride = (png_int_32)/*SAFE*/png_row_stride;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -18,6 +18,17 @@
|
|||
|
||||
#include "pngpriv.h"
|
||||
|
||||
#ifdef PNG_ARM_NEON_IMPLEMENTATION
|
||||
# if PNG_ARM_NEON_IMPLEMENTATION == 1
|
||||
# define PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
# if defined(_MSC_VER) && defined(_M_ARM64)
|
||||
# include <arm64_neon.h>
|
||||
# else
|
||||
# include <arm_neon.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
/* Set the action on getting a CRC error for an ancillary or critical chunk. */
|
||||
|
@ -2986,7 +2997,6 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
|||
*/
|
||||
static int
|
||||
png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
|
||||
{
|
||||
int rgb_error = 0;
|
||||
|
||||
|
@ -2995,12 +3005,11 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
|
|||
if ((row_info->color_type & PNG_COLOR_MASK_PALETTE) == 0 &&
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR) != 0)
|
||||
{
|
||||
PNG_CONST png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
|
||||
PNG_CONST png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
|
||||
PNG_CONST png_uint_32 bc = 32768 - rc - gc;
|
||||
PNG_CONST png_uint_32 row_width = row_info->width;
|
||||
PNG_CONST int have_alpha =
|
||||
(row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0;
|
||||
png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
|
||||
png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
|
||||
png_uint_32 bc = 32768 - rc - gc;
|
||||
png_uint_32 row_width = row_info->width;
|
||||
int have_alpha = (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0;
|
||||
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
|
@ -4143,12 +4152,11 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||
{
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
PNG_CONST png_bytep table = png_ptr->gamma_from_1;
|
||||
png_bytep table = png_ptr->gamma_from_1;
|
||||
|
||||
if (table != NULL)
|
||||
{
|
||||
PNG_CONST int step =
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2;
|
||||
int step = (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2;
|
||||
|
||||
/* The alpha channel is the last component: */
|
||||
row += step - 1;
|
||||
|
@ -4162,13 +4170,12 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||
|
||||
else if (row_info->bit_depth == 16)
|
||||
{
|
||||
PNG_CONST png_uint_16pp table = png_ptr->gamma_16_from_1;
|
||||
PNG_CONST int gamma_shift = png_ptr->gamma_shift;
|
||||
png_uint_16pp table = png_ptr->gamma_16_from_1;
|
||||
int gamma_shift = png_ptr->gamma_shift;
|
||||
|
||||
if (table != NULL)
|
||||
{
|
||||
PNG_CONST int step =
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4;
|
||||
int step = (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4;
|
||||
|
||||
/* The alpha channel is the last component: */
|
||||
row += step - 2;
|
||||
|
@ -4199,8 +4206,9 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||
* upon whether you supply trans and num_trans.
|
||||
*/
|
||||
static void
|
||||
png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||
png_const_colorp palette, png_const_bytep trans_alpha, int num_trans)
|
||||
png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_bytep row, png_const_colorp palette, png_const_bytep trans_alpha,
|
||||
int num_trans)
|
||||
{
|
||||
int shift, value;
|
||||
png_bytep sp, dp;
|
||||
|
@ -4304,14 +4312,25 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
|||
sp = row + (size_t)row_width - 1;
|
||||
dp = row + ((size_t)row_width << 2) - 1;
|
||||
|
||||
for (i = 0; i < row_width; i++)
|
||||
i = 0;
|
||||
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
if (png_ptr->riffled_palette != NULL)
|
||||
{
|
||||
/* The RGBA optimization works with png_ptr->bit_depth == 8
|
||||
* but sometimes row_info->bit_depth has been changed to 8.
|
||||
* In these cases, the palette hasn't been riffled.
|
||||
*/
|
||||
i = png_do_expand_palette_neon_rgba(png_ptr, row_info, row,
|
||||
&sp, &dp);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (; i < row_width; i++)
|
||||
{
|
||||
if ((int)(*sp) >= num_trans)
|
||||
*dp-- = 0xff;
|
||||
|
||||
else
|
||||
*dp-- = trans_alpha[*sp];
|
||||
|
||||
*dp-- = palette[*sp].blue;
|
||||
*dp-- = palette[*sp].green;
|
||||
*dp-- = palette[*sp].red;
|
||||
|
@ -4328,8 +4347,13 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
|||
{
|
||||
sp = row + (size_t)row_width - 1;
|
||||
dp = row + (size_t)(row_width * 3) - 1;
|
||||
i = 0;
|
||||
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
i = png_do_expand_palette_neon_rgb(png_ptr, row_info, row,
|
||||
&sp, &dp);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < row_width; i++)
|
||||
for (; i < row_width; i++)
|
||||
{
|
||||
*dp-- = palette[*sp].blue;
|
||||
*dp-- = palette[*sp].green;
|
||||
|
@ -4743,8 +4767,22 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
|||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
png_do_expand_palette(row_info, png_ptr->row_buf + 1,
|
||||
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
|
||||
{
|
||||
/* Allocate space for the decompressed full palette. */
|
||||
if (png_ptr->riffled_palette == NULL)
|
||||
{
|
||||
png_ptr->riffled_palette = png_malloc(png_ptr, 256*4);
|
||||
if (png_ptr->riffled_palette == NULL)
|
||||
png_error(png_ptr, "NULL row buffer");
|
||||
/* Build the RGBA palette. */
|
||||
png_riffle_palette_rgba(png_ptr, row_info);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
png_do_expand_palette(png_ptr, row_info, png_ptr->row_buf + 1,
|
||||
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||
}
|
||||
|
||||
else
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -1461,8 +1461,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
|||
{
|
||||
/* We have the ICC profile header; do the basic header checks.
|
||||
*/
|
||||
const png_uint_32 profile_length =
|
||||
png_get_uint_32(profile_header);
|
||||
png_uint_32 profile_length = png_get_uint_32(profile_header);
|
||||
|
||||
if (png_icc_check_length(png_ptr, &png_ptr->colorspace,
|
||||
keyword, profile_length) != 0)
|
||||
|
@ -1479,8 +1478,8 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
|||
* profile. The header check has already validated
|
||||
* that none of this stuff will overflow.
|
||||
*/
|
||||
const png_uint_32 tag_count = png_get_uint_32(
|
||||
profile_header+128);
|
||||
png_uint_32 tag_count =
|
||||
png_get_uint_32(profile_header + 128);
|
||||
png_bytep profile = png_read_buffer(png_ptr,
|
||||
profile_length, 2/*silent*/);
|
||||
|
||||
|
@ -3132,7 +3131,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
|
|||
*/
|
||||
|
||||
void /* PRIVATE */
|
||||
png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
|
||||
png_check_chunk_name(png_const_structrp png_ptr, png_uint_32 chunk_name)
|
||||
{
|
||||
int i;
|
||||
png_uint_32 cn=chunk_name;
|
||||
|
@ -3151,7 +3150,7 @@ png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
|
|||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
|
||||
png_check_chunk_length(png_const_structrp png_ptr, png_uint_32 length)
|
||||
{
|
||||
png_alloc_size_t limit = PNG_UINT_31_MAX;
|
||||
|
||||
|
@ -3363,7 +3362,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
|
|||
/* Hence the pre-compiled masks indexed by PACKSWAP (or not), depth and
|
||||
* then pass:
|
||||
*/
|
||||
static PNG_CONST png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] =
|
||||
static const png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] =
|
||||
{
|
||||
/* Little-endian byte masks for PACKSWAP */
|
||||
{ S_MASKS(1,0), S_MASKS(2,0), S_MASKS(4,0) },
|
||||
|
@ -3374,7 +3373,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
|
|||
/* display_mask has only three entries for the odd passes, so index by
|
||||
* pass>>1.
|
||||
*/
|
||||
static PNG_CONST png_uint_32 display_mask[2][3][3] =
|
||||
static const png_uint_32 display_mask[2][3][3] =
|
||||
{
|
||||
/* Little-endian byte masks for PACKSWAP */
|
||||
{ B_MASKS(1,0), B_MASKS(2,0), B_MASKS(4,0) },
|
||||
|
@ -3687,7 +3686,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
|
|||
{
|
||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
png_debug(1, "in png_do_read_interlace");
|
||||
if (row != NULL && row_info != NULL)
|
||||
|
@ -4329,16 +4328,16 @@ png_read_finish_row(png_structrp png_ptr)
|
|||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
/* Start of interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
|
||||
/* Offset to next interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
png_debug(1, "in png_read_finish_row");
|
||||
png_ptr->row_number++;
|
||||
|
@ -4394,16 +4393,16 @@ png_read_start_row(png_structrp png_ptr)
|
|||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
/* Start of interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
|
||||
/* Offset to next interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
unsigned int max_pixel_depth;
|
||||
size_t row_bytes;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -137,7 +137,7 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
|
|||
#ifdef PNG_eXIf_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
const png_bytep eXIf_buf)
|
||||
png_bytep eXIf_buf)
|
||||
{
|
||||
png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1");
|
||||
PNG_UNUSED(info_ptr)
|
||||
|
@ -146,7 +146,7 @@ png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
|
|||
|
||||
void PNGAPI
|
||||
png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
const png_uint_32 num_exif, const png_bytep eXIf_buf)
|
||||
png_uint_32 num_exif, png_bytep eXIf_buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1399,7 +1399,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
|
|||
/* Ignore all unknown chunks and all chunks recognized by
|
||||
* libpng except for IHDR, PLTE, tRNS, IDAT, and IEND
|
||||
*/
|
||||
static PNG_CONST png_byte chunks_to_ignore[] = {
|
||||
static const png_byte chunks_to_ignore[] = {
|
||||
98, 75, 71, 68, '\0', /* bKGD */
|
||||
99, 72, 82, 77, '\0', /* cHRM */
|
||||
101, 88, 73, 102, '\0', /* eXIf */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngstruct.h - header file for PNG reference library
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -228,6 +228,10 @@ struct png_struct_def
|
|||
* big_row_buf; while writing it is separately
|
||||
* allocated.
|
||||
*/
|
||||
#ifdef PNG_READ_EXPAND_SUPPORTED
|
||||
/* Buffer to accelerate palette transformations. */
|
||||
png_bytep riffled_palette;
|
||||
#endif
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_bytep try_row; /* buffer to save trial row when filtering */
|
||||
png_bytep tst_row; /* buffer to save best trial row when filtering */
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -345,7 +345,7 @@ png_do_swap(png_row_infop row_info, png_bytep row)
|
|||
#endif
|
||||
|
||||
#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)
|
||||
static PNG_CONST png_byte onebppswaptable[256] = {
|
||||
static const png_byte onebppswaptable[256] = {
|
||||
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
|
||||
0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
|
||||
0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
|
||||
|
@ -380,7 +380,7 @@ static PNG_CONST png_byte onebppswaptable[256] = {
|
|||
0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
|
||||
};
|
||||
|
||||
static PNG_CONST png_byte twobppswaptable[256] = {
|
||||
static const png_byte twobppswaptable[256] = {
|
||||
0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0,
|
||||
0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0,
|
||||
0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4,
|
||||
|
@ -415,7 +415,7 @@ static PNG_CONST png_byte twobppswaptable[256] = {
|
|||
0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF
|
||||
};
|
||||
|
||||
static PNG_CONST png_byte fourbppswaptable[256] = {
|
||||
static const png_byte fourbppswaptable[256] = {
|
||||
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,
|
||||
0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
|
||||
0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -469,7 +469,7 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
|
|||
|
||||
#ifdef PNG_CONVERT_tIME_SUPPORTED
|
||||
void PNGAPI
|
||||
png_convert_from_struct_tm(png_timep ptime, PNG_CONST struct tm * ttime)
|
||||
png_convert_from_struct_tm(png_timep ptime, const struct tm * ttime)
|
||||
{
|
||||
png_debug(1, "in png_convert_from_struct_tm");
|
||||
|
||||
|
@ -948,6 +948,10 @@ png_write_destroy(png_structrp png_ptr)
|
|||
png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list);
|
||||
png_free(png_ptr, png_ptr->row_buf);
|
||||
png_ptr->row_buf = NULL;
|
||||
#ifdef PNG_READ_EXPANDED_SUPPORTED
|
||||
png_free(png_ptr, png_ptr->riffled_palette);
|
||||
png_ptr->riffled_palette = NULL;
|
||||
#endif
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
png_free(png_ptr, png_ptr->try_row);
|
||||
|
@ -1536,7 +1540,7 @@ png_write_image_16bit(png_voidp argument)
|
|||
display->first_row);
|
||||
png_uint_16p output_row = png_voidcast(png_uint_16p, display->local_row);
|
||||
png_uint_16p row_end;
|
||||
const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
|
||||
unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
|
||||
3 : 1;
|
||||
int aindex = 0;
|
||||
png_uint_32 y = image->height;
|
||||
|
@ -1573,7 +1577,7 @@ png_write_image_16bit(png_voidp argument)
|
|||
|
||||
while (out_ptr < row_end)
|
||||
{
|
||||
const png_uint_16 alpha = in_ptr[aindex];
|
||||
png_uint_16 alpha = in_ptr[aindex];
|
||||
png_uint_32 reciprocal = 0;
|
||||
int c;
|
||||
|
||||
|
@ -1695,7 +1699,7 @@ png_write_image_8bit(png_voidp argument)
|
|||
display->first_row);
|
||||
png_bytep output_row = png_voidcast(png_bytep, display->local_row);
|
||||
png_uint_32 y = image->height;
|
||||
const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
|
||||
unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
|
||||
3 : 1;
|
||||
|
||||
if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0)
|
||||
|
@ -1783,25 +1787,25 @@ png_write_image_8bit(png_voidp argument)
|
|||
static void
|
||||
png_image_set_PLTE(png_image_write_control *display)
|
||||
{
|
||||
const png_imagep image = display->image;
|
||||
png_imagep image = display->image;
|
||||
const void *cmap = display->colormap;
|
||||
const int entries = image->colormap_entries > 256 ? 256 :
|
||||
int entries = image->colormap_entries > 256 ? 256 :
|
||||
(int)image->colormap_entries;
|
||||
|
||||
/* NOTE: the caller must check for cmap != NULL and entries != 0 */
|
||||
const png_uint_32 format = image->format;
|
||||
const unsigned int channels = PNG_IMAGE_SAMPLE_CHANNELS(format);
|
||||
png_uint_32 format = image->format;
|
||||
unsigned int channels = PNG_IMAGE_SAMPLE_CHANNELS(format);
|
||||
|
||||
# if defined(PNG_FORMAT_BGR_SUPPORTED) &&\
|
||||
defined(PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED)
|
||||
const int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
|
||||
int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
|
||||
(format & PNG_FORMAT_FLAG_ALPHA) != 0;
|
||||
# else
|
||||
# define afirst 0
|
||||
# endif
|
||||
|
||||
# ifdef PNG_FORMAT_BGR_SUPPORTED
|
||||
const int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
|
||||
int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
|
||||
# else
|
||||
# define bgr 0
|
||||
# endif
|
||||
|
@ -1951,12 +1955,12 @@ png_image_write_main(png_voidp argument)
|
|||
* and total image size to ensure that they are within the system limits.
|
||||
*/
|
||||
{
|
||||
const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
|
||||
unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
|
||||
|
||||
if (image->width <= 0x7fffffffU/channels) /* no overflow */
|
||||
{
|
||||
png_uint_32 check;
|
||||
const png_uint_32 png_row_stride = image->width * channels;
|
||||
png_uint_32 png_row_stride = image->width * channels;
|
||||
|
||||
if (display->row_stride == 0)
|
||||
display->row_stride = (png_int_32)/*SAFE*/png_row_stride;
|
||||
|
@ -2052,7 +2056,7 @@ png_image_write_main(png_voidp argument)
|
|||
*/
|
||||
if (write_16bit != 0)
|
||||
{
|
||||
PNG_CONST png_uint_16 le = 0x0001;
|
||||
png_uint_16 le = 0x0001;
|
||||
|
||||
if ((*(png_const_bytep) & le) != 0)
|
||||
png_set_swap(png_ptr);
|
||||
|
@ -2166,7 +2170,7 @@ image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data, size_t size)
|
|||
{
|
||||
png_image_write_control *display = png_voidcast(png_image_write_control*,
|
||||
png_ptr->io_ptr/*backdoor: png_get_io_ptr(png_ptr)*/);
|
||||
const png_alloc_size_t ob = display->output_bytes;
|
||||
png_alloc_size_t ob = display->output_bytes;
|
||||
|
||||
/* Check for overflow; this should never happen: */
|
||||
if (size <= ((png_alloc_size_t)-1) - ob)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -254,8 +254,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
|||
|
||||
for (i = 0; i < istop; i++, bp++)
|
||||
{
|
||||
|
||||
const unsigned int c = i%channels;
|
||||
unsigned int c = i%channels;
|
||||
int j;
|
||||
unsigned int v, out;
|
||||
|
||||
|
@ -283,7 +282,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
|||
|
||||
for (bp = row, i = 0; i < istop; i++)
|
||||
{
|
||||
const unsigned int c = i%channels;
|
||||
unsigned int c = i%channels;
|
||||
int j;
|
||||
unsigned int value, v;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -1893,16 +1893,16 @@ png_write_start_row(png_structrp png_ptr)
|
|||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
/* Start of interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
|
||||
/* Offset to next interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
#endif
|
||||
|
||||
png_alloc_size_t buf_size;
|
||||
|
@ -2008,16 +2008,16 @@ png_write_finish_row(png_structrp png_ptr)
|
|||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
/* Start of interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
|
||||
/* Offset to next interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
#endif
|
||||
|
||||
png_debug(1, "in png_write_finish_row");
|
||||
|
@ -2098,10 +2098,10 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
|||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
png_debug(1, "in png_do_write_interlace");
|
||||
|
||||
|
@ -2276,7 +2276,7 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
|
|||
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
static size_t /* PRIVATE */
|
||||
png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
png_setup_sub_row(png_structrp png_ptr, png_uint_32 bpp,
|
||||
size_t row_bytes, size_t lmins)
|
||||
{
|
||||
png_bytep rp, dp, lp;
|
||||
|
@ -2315,7 +2315,7 @@ png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp,
|
|||
}
|
||||
|
||||
static void /* PRIVATE */
|
||||
png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
png_setup_sub_row_only(png_structrp png_ptr, png_uint_32 bpp,
|
||||
size_t row_bytes)
|
||||
{
|
||||
png_bytep rp, dp, lp;
|
||||
|
@ -2380,7 +2380,7 @@ png_setup_up_row_only(png_structrp png_ptr, size_t row_bytes)
|
|||
}
|
||||
|
||||
static size_t /* PRIVATE */
|
||||
png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
png_setup_avg_row(png_structrp png_ptr, png_uint_32 bpp,
|
||||
size_t row_bytes, size_t lmins)
|
||||
{
|
||||
png_bytep rp, dp, pp, lp;
|
||||
|
@ -2420,7 +2420,7 @@ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp,
|
|||
return (sum);
|
||||
}
|
||||
static void /* PRIVATE */
|
||||
png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
png_setup_avg_row_only(png_structrp png_ptr, png_uint_32 bpp,
|
||||
size_t row_bytes)
|
||||
{
|
||||
png_bytep rp, dp, pp, lp;
|
||||
|
@ -2442,7 +2442,7 @@ png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
|||
}
|
||||
|
||||
static size_t /* PRIVATE */
|
||||
png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
png_setup_paeth_row(png_structrp png_ptr, png_uint_32 bpp,
|
||||
size_t row_bytes, size_t lmins)
|
||||
{
|
||||
png_bytep rp, dp, pp, cp, lp;
|
||||
|
@ -2503,7 +2503,7 @@ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp,
|
|||
return (sum);
|
||||
}
|
||||
static void /* PRIVATE */
|
||||
png_setup_paeth_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
png_setup_paeth_row_only(png_structrp png_ptr, png_uint_32 bpp,
|
||||
size_t row_bytes)
|
||||
{
|
||||
png_bytep rp, dp, pp, cp, lp;
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
"Description": "libpng is the official PNG reference library.",
|
||||
"Homepage": "http://www.libpng.org/pub/png/libpng.html",
|
||||
"Version": "1.6.35",
|
||||
"License": "libpng License",
|
||||
"LicenseId": "Libpng",
|
||||
"Version": "1.6.36",
|
||||
"License": "libpng License and libpng License 2",
|
||||
"LicenseId": "Libpng AND Libpng2",
|
||||
"LicenseFile": "LICENSE",
|
||||
"Copyright": "Copyright (c) 1998-2018 Glenn Randers-Pehrson
|
||||
Copyright (c) 2000-2017 Simon-Pierre Cadieux
|
||||
|
|
|
@ -506,7 +506,8 @@ public class QtActivityDelegate
|
|||
m_rightSelectionHandle = null;
|
||||
m_leftSelectionHandle = null;
|
||||
}
|
||||
m_editPopupMenu.hide();
|
||||
if (m_editPopupMenu != null)
|
||||
m_editPopupMenu.hide();
|
||||
break;
|
||||
|
||||
case CursorHandleShowNormal:
|
||||
|
@ -561,7 +562,8 @@ public class QtActivityDelegate
|
|||
}
|
||||
m_editPopupMenu.setPosition(editX, editY, editButtons);
|
||||
} else {
|
||||
m_editPopupMenu.hide();
|
||||
if (m_editPopupMenu != null)
|
||||
m_editPopupMenu.hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2933,18 +2933,18 @@ enum {
|
|||
QByteArray QSysInfo::machineUniqueId()
|
||||
{
|
||||
#ifdef Q_OS_BSD4
|
||||
char uuid[UuidStringLen];
|
||||
char uuid[UuidStringLen + 1];
|
||||
size_t uuidlen = sizeof(uuid);
|
||||
# ifdef KERN_HOSTUUID
|
||||
int name[] = { CTL_KERN, KERN_HOSTUUID };
|
||||
if (sysctl(name, sizeof name / sizeof name[0], &uuid, &uuidlen, nullptr, 0) == 0
|
||||
&& uuidlen == sizeof(uuid))
|
||||
return QByteArray(uuid, uuidlen);
|
||||
return QByteArray(uuid, uuidlen - 1);
|
||||
|
||||
# else
|
||||
// Darwin: no fixed value, we need to search by name
|
||||
if (sysctlbyname("kern.uuid", uuid, &uuidlen, nullptr, 0) == 0 && uuidlen == sizeof(uuid))
|
||||
return QByteArray(uuid, uuidlen);
|
||||
return QByteArray(uuid, uuidlen - 1);
|
||||
# endif
|
||||
#elif defined(Q_OS_UNIX)
|
||||
// The modern name on Linux is /etc/machine-id, but that path is
|
||||
|
@ -2967,7 +2967,7 @@ QByteArray QSysInfo::machineUniqueId()
|
|||
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
// Let's poke at the registry
|
||||
HKEY key = NULL;
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ, &key)
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ | KEY_WOW64_64KEY, &key)
|
||||
== ERROR_SUCCESS) {
|
||||
wchar_t buffer[UuidStringLen + 1];
|
||||
DWORD size = sizeof(buffer);
|
||||
|
@ -3008,11 +3008,11 @@ QByteArray QSysInfo::bootUniqueId()
|
|||
}
|
||||
#elif defined(Q_OS_DARWIN)
|
||||
// "kern.bootsessionuuid" is only available by name
|
||||
char uuid[UuidStringLen];
|
||||
char uuid[UuidStringLen + 1];
|
||||
size_t uuidlen = sizeof(uuid);
|
||||
if (sysctlbyname("kern.bootsessionuuid", uuid, &uuidlen, nullptr, 0) == 0
|
||||
&& uuidlen == sizeof(uuid))
|
||||
return QByteArray(uuid, uuidlen);
|
||||
return QByteArray(uuid, uuidlen - 1);
|
||||
#endif
|
||||
return QByteArray();
|
||||
};
|
||||
|
|
|
@ -1054,14 +1054,20 @@ for (auto _container_ = QtPrivate::qMakeForeachContainer(container); \
|
|||
template <typename T> inline T *qGetPtrHelper(T *ptr) { return ptr; }
|
||||
template <typename Ptr> inline auto qGetPtrHelper(const Ptr &ptr) -> decltype(ptr.operator->()) { return ptr.operator->(); }
|
||||
|
||||
// The body must be a statement:
|
||||
#define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
|
||||
#define Q_DECLARE_PRIVATE(Class) \
|
||||
inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
|
||||
inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
|
||||
inline Class##Private* d_func() \
|
||||
{ Q_CAST_IGNORE_ALIGN(return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr));) } \
|
||||
inline const Class##Private* d_func() const \
|
||||
{ Q_CAST_IGNORE_ALIGN(return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr));) } \
|
||||
friend class Class##Private;
|
||||
|
||||
#define Q_DECLARE_PRIVATE_D(Dptr, Class) \
|
||||
inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(Dptr)); } \
|
||||
inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(Dptr)); } \
|
||||
inline Class##Private* d_func() \
|
||||
{ Q_CAST_IGNORE_ALIGN(return reinterpret_cast<Class##Private *>(qGetPtrHelper(Dptr));) } \
|
||||
inline const Class##Private* d_func() const \
|
||||
{ Q_CAST_IGNORE_ALIGN(return reinterpret_cast<const Class##Private *>(qGetPtrHelper(Dptr));) } \
|
||||
friend class Class##Private;
|
||||
|
||||
#define Q_DECLARE_PUBLIC(Class) \
|
||||
|
|
|
@ -2104,9 +2104,13 @@ static void replacePercentN(QString *result, int n)
|
|||
int len = 0;
|
||||
while ((percentPos = result->indexOf(QLatin1Char('%'), percentPos + len)) != -1) {
|
||||
len = 1;
|
||||
if (percentPos + len == result->length())
|
||||
break;
|
||||
QString fmt;
|
||||
if (result->at(percentPos + len) == QLatin1Char('L')) {
|
||||
++len;
|
||||
if (percentPos + len == result->length())
|
||||
break;
|
||||
fmt = QLatin1String("%L1");
|
||||
} else {
|
||||
fmt = QLatin1String("%1");
|
||||
|
|
|
@ -1374,6 +1374,10 @@ void QObject::customEvent(QEvent * /* event */)
|
|||
might have reimplemented eventFilter() for its own internal
|
||||
purposes.
|
||||
|
||||
Some events, such as \l QEvent::ShortcutOverride must be explicitly
|
||||
accepted (by calling \l {QEvent::}{accept()} on them) in order to prevent
|
||||
propagation.
|
||||
|
||||
\warning If you delete the receiver object in this function, be
|
||||
sure to return true. Otherwise, Qt will forward the event to the
|
||||
deleted object and the program might crash.
|
||||
|
|
|
@ -67,7 +67,13 @@ Q_REQUIRED_RESULT static bool qWaitFor(Functor predicate, int timeout = 5000)
|
|||
QDeadlineTimer deadline(remaining, Qt::PreciseTimer);
|
||||
|
||||
do {
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
||||
// We explicitly do not pass the remaining time to processEvents, as
|
||||
// that would keep spinning processEvents for the whole duration if
|
||||
// new events were posted as part of processing events, and we need
|
||||
// to return back to this function to check the predicate between
|
||||
// each pass of processEvents. Our own timer will take care of the
|
||||
// timeout.
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents);
|
||||
QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
|
||||
|
||||
remaining = deadline.remainingTime();
|
||||
|
|
|
@ -2371,6 +2371,8 @@ QString QLocale::toString(double i, char f, int prec) const
|
|||
QLocale QLocale::system()
|
||||
{
|
||||
QT_PREPEND_NAMESPACE(systemData)(); // trigger updating of the system data if necessary
|
||||
if (systemLocalePrivate.isDestroyed())
|
||||
return QLocale(QLocale::C);
|
||||
return QLocale(*systemLocalePrivate->data());
|
||||
}
|
||||
|
||||
|
|
|
@ -654,7 +654,7 @@ void QAccessible::removeActivationObserver(ActivationObserver *observer)
|
|||
/*!
|
||||
If a QAccessibleInterface implementation exists for the given \a object,
|
||||
this function returns a pointer to the implementation; otherwise it
|
||||
returns 0.
|
||||
returns \nullptr.
|
||||
|
||||
The function calls all installed factory functions (from most
|
||||
recently installed to least recently installed) until one is found
|
||||
|
@ -770,7 +770,7 @@ QAccessible::Id QAccessible::uniqueId(QAccessibleInterface *iface)
|
|||
/*!
|
||||
Returns the QAccessibleInterface belonging to the \a id.
|
||||
|
||||
Returns 0 if the id is invalid.
|
||||
Returns \nullptr if the id is invalid.
|
||||
*/
|
||||
QAccessibleInterface *QAccessible::accessibleInterface(Id id)
|
||||
{
|
||||
|
@ -1119,7 +1119,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const
|
|||
\fn QAccessibleInterface *QAccessibleInterface::childAt(int x, int y) const
|
||||
|
||||
Returns the QAccessibleInterface of a child that contains the screen coordinates (\a x, \a y).
|
||||
If there are no children at this position this function returns 0.
|
||||
If there are no children at this position this function returns \nullptr.
|
||||
The returned accessible must be a child, but not necessarily a direct child.
|
||||
|
||||
This function is only relyable for visible objects (invisible
|
||||
|
@ -1139,7 +1139,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const
|
|||
|
||||
Returns the QAccessibleInterface of the parent in the accessible object hierarchy.
|
||||
|
||||
Returns 0 if no parent exists (e.g. for the top level application object).
|
||||
Returns \nullptr if no parent exists (e.g. for the top level application object).
|
||||
|
||||
\sa child()
|
||||
*/
|
||||
|
@ -1150,7 +1150,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const
|
|||
Returns the accessible child with index \a index.
|
||||
0-based index. The number of children of an object can be checked with childCount.
|
||||
|
||||
Returns 0 when asking for an invalid child (e.g. when the child became invalid in the meantime).
|
||||
Returns \nullptr when asking for an invalid child (e.g. when the child became invalid in the meantime).
|
||||
|
||||
\sa childCount(), parent()
|
||||
*/
|
||||
|
@ -1356,7 +1356,7 @@ QAccessibleEvent::~QAccessibleEvent()
|
|||
\internal
|
||||
Returns the uniqueId of the QAccessibleInterface represented by this event.
|
||||
|
||||
In case the object() function returns 0 this is the only way to access the
|
||||
In case the object() function returns \nullptr, this is the only way to access the
|
||||
interface.
|
||||
*/
|
||||
QAccessible::Id QAccessibleEvent::uniqueId() const
|
||||
|
@ -1786,7 +1786,7 @@ QAccessibleInterface *QAccessibleEvent::accessibleInterface() const
|
|||
(This means that at least one interface among the ancestors should
|
||||
return a valid QWindow pointer).
|
||||
|
||||
The default implementation returns 0.
|
||||
The default implementation returns \nullptr.
|
||||
*/
|
||||
QWindow *QAccessibleInterface::window() const
|
||||
{
|
||||
|
|
|
@ -250,7 +250,7 @@
|
|||
"test": {
|
||||
"tail": [
|
||||
"#ifndef FC_RGBA_UNKNOWN",
|
||||
"# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define",
|
||||
"# error This version of fontconfig is too old, it is missing the FC_RGBA_UNKNOWN define",
|
||||
"#endif"
|
||||
],
|
||||
"main": [
|
||||
|
@ -1830,8 +1830,7 @@ or may depend on your system and XQuartz setup."
|
|||
"condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient",
|
||||
"message": "No QPA platform plugin enabled! This will
|
||||
produce a Qt that cannot run GUI applications.
|
||||
The dependencies needed for xcb to build are listed in
|
||||
src/plugins/platforms/xcb/README"
|
||||
See \"Platform backends\" in the output of --help."
|
||||
},
|
||||
{
|
||||
"type": "warning",
|
||||
|
|
|
@ -113,7 +113,7 @@ QImageData::QImageData()
|
|||
\internal
|
||||
|
||||
Creates a new image data.
|
||||
Returns 0 if invalid parameters are give or anything else failed.
|
||||
Returns \nullptr if invalid parameters are give or anything else failed.
|
||||
*/
|
||||
QImageData * QImageData::create(const QSize &size, QImage::Format format)
|
||||
{
|
||||
|
|
|
@ -879,8 +879,8 @@ QStandardItem::~QStandardItem()
|
|||
}
|
||||
|
||||
/*!
|
||||
Returns the item's parent item, or 0 if the item has no parent.
|
||||
\note For toplevel items parent() returns 0. To receive toplevel
|
||||
Returns the item's parent item, or \nullptr if the item has no parent.
|
||||
\note For toplevel items parent() returns \nullptr. To receive toplevel
|
||||
item's parent use QStandardItemModel::invisibleRootItem() instead.
|
||||
|
||||
\sa child(), QStandardItemModel::invisibleRootItem()
|
||||
|
@ -1548,7 +1548,7 @@ QModelIndex QStandardItem::index() const
|
|||
Returns the QStandardItemModel that this item belongs to.
|
||||
|
||||
If the item is not a child of another item that belongs to the model, this
|
||||
function returns 0.
|
||||
function returns \nullptr.
|
||||
|
||||
\sa index()
|
||||
*/
|
||||
|
@ -1865,7 +1865,7 @@ void QStandardItem::setChild(int row, int column, QStandardItem *item)
|
|||
|
||||
/*!
|
||||
Returns the child item at (\a row, \a column) if one has been set; otherwise
|
||||
returns 0.
|
||||
returns \nullptr.
|
||||
|
||||
\sa setChild(), takeChild(), parent()
|
||||
*/
|
||||
|
@ -1881,7 +1881,7 @@ QStandardItem *QStandardItem::child(int row, int column) const
|
|||
/*!
|
||||
Removes the child item at (\a row, \a column) without deleting it, and returns
|
||||
a pointer to the item. If there was no child at the given location, then
|
||||
this function returns 0.
|
||||
this function returns \nullptr.
|
||||
|
||||
Note that this function, unlike takeRow() and takeColumn(), does not affect
|
||||
the dimensions of the child table.
|
||||
|
@ -2283,7 +2283,7 @@ void QStandardItemModel::clear()
|
|||
itemPrototype()), and set it in the parent item's child table, if no item
|
||||
already exists at that index.
|
||||
|
||||
If \a index is an invalid index, this function returns 0.
|
||||
If \a index is an invalid index, this function returns \nullptr.
|
||||
|
||||
\sa indexFromItem()
|
||||
*/
|
||||
|
@ -2380,7 +2380,7 @@ void QStandardItemModel::setItem(int row, int column, QStandardItem *item)
|
|||
\since 4.2
|
||||
|
||||
Returns the item for the given \a row and \a column if one has been set;
|
||||
otherwise returns 0.
|
||||
otherwise returns \nullptr.
|
||||
|
||||
\sa setItem(), takeItem(), itemFromIndex()
|
||||
*/
|
||||
|
@ -2453,7 +2453,7 @@ void QStandardItemModel::setHorizontalHeaderItem(int column, QStandardItem *item
|
|||
\since 4.2
|
||||
|
||||
Returns the horizontal header item for \a column if one has been set;
|
||||
otherwise returns 0.
|
||||
otherwise returns \nullptr.
|
||||
|
||||
\sa setHorizontalHeaderItem(), verticalHeaderItem()
|
||||
*/
|
||||
|
@ -2509,7 +2509,7 @@ void QStandardItemModel::setVerticalHeaderItem(int row, QStandardItem *item)
|
|||
\since 4.2
|
||||
|
||||
Returns the vertical header item for row \a row if one has been set;
|
||||
otherwise returns 0.
|
||||
otherwise returns \nullptr.
|
||||
|
||||
\sa setVerticalHeaderItem(), horizontalHeaderItem()
|
||||
*/
|
||||
|
|
|
@ -3072,7 +3072,7 @@ QDropEvent::~QDropEvent()
|
|||
/*!
|
||||
If the source of the drag operation is a widget in this
|
||||
application, this function returns that source; otherwise it
|
||||
returns 0. The source of the operation is the first parameter to
|
||||
returns \nullptr. The source of the operation is the first parameter to
|
||||
the QDrag object used instantiate the drag.
|
||||
|
||||
This is useful if your widget needs special behavior when dragging
|
||||
|
@ -3514,7 +3514,7 @@ QActionEvent::~QActionEvent()
|
|||
\fn QAction *QActionEvent::before() const
|
||||
|
||||
If type() is \l ActionAdded, returns the action that should
|
||||
appear before action(). If this function returns 0, the action
|
||||
appear before action(). If this function returns \nullptr, the action
|
||||
should be appended to already existing actions on the same
|
||||
widget.
|
||||
|
||||
|
|
|
@ -3755,7 +3755,7 @@ Qt::LayoutDirection QGuiApplication::layoutDirection()
|
|||
|
||||
Returns the active application override cursor.
|
||||
|
||||
This function returns 0 if no application cursor has been defined (i.e. the
|
||||
This function returns \nullptr if no application cursor has been defined (i.e. the
|
||||
internal cursor stack is empty).
|
||||
|
||||
\sa setOverrideCursor(), restoreOverrideCursor()
|
||||
|
@ -3991,6 +3991,9 @@ void QGuiApplicationPrivate::notifyThemeChanged()
|
|||
!QCoreApplication::testAttribute(Qt::AA_SetPalette)) {
|
||||
clearPalette();
|
||||
initPalette();
|
||||
emit qGuiApp->paletteChanged(*app_pal);
|
||||
if (is_app_running && !is_app_closing)
|
||||
sendApplicationPaletteChange();
|
||||
}
|
||||
if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) {
|
||||
QMutexLocker locker(&applicationFontMutex);
|
||||
|
@ -3999,6 +4002,15 @@ void QGuiApplicationPrivate::notifyThemeChanged()
|
|||
}
|
||||
}
|
||||
|
||||
void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className)
|
||||
{
|
||||
Q_UNUSED(toAllWidgets)
|
||||
Q_UNUSED(className)
|
||||
|
||||
QEvent event(QEvent::ApplicationPaletteChange);
|
||||
QGuiApplication::sendEvent(QGuiApplication::instance(), &event);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(draganddrop)
|
||||
void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag)
|
||||
{
|
||||
|
|
|
@ -315,6 +315,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void notifyThemeChanged();
|
||||
virtual void sendApplicationPaletteChange(bool toAllWidgets = false, const char *className = nullptr);
|
||||
bool tryCloseRemainingWindows(QWindowList processedWindows);
|
||||
#if QT_CONFIG(draganddrop)
|
||||
virtual void notifyDragStarted(const QDrag *);
|
||||
|
|
|
@ -1118,7 +1118,7 @@ void QOpenGLContext::swapBuffers(QSurface *surface)
|
|||
/*!
|
||||
Resolves the function pointer to an OpenGL extension function, identified by \a procName
|
||||
|
||||
Returns 0 if no such function can be found.
|
||||
Returns \nullptr if no such function can be found.
|
||||
*/
|
||||
QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName) const
|
||||
{
|
||||
|
|
|
@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
\a windowCursor is a pointer to the QCursor that should be displayed.
|
||||
|
||||
To unset the cursor of \a window, 0 is passed. This means \a window does not have
|
||||
To unset the cursor of \a window, \nullptr is passed. This means \a window does not have
|
||||
a cursor set and the cursor of a the first parent window which has a cursor explicitly
|
||||
set or the system default cursor should take effect.
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ void QPlatformIntegration::destroy()
|
|||
/*!
|
||||
Returns the platforms input context.
|
||||
|
||||
The default implementation returns 0, implying no input method support.
|
||||
The default implementation returns \nullptr, implying no input method support.
|
||||
*/
|
||||
QPlatformInputContext *QPlatformIntegration::inputContext() const
|
||||
{
|
||||
|
|
|
@ -370,7 +370,7 @@ QString QPlatformScreen::serialNumber() const
|
|||
/*!
|
||||
Reimplement this function in subclass to return the cursor of the screen.
|
||||
|
||||
The default implementation returns 0.
|
||||
The default implementation returns \nullptr.
|
||||
*/
|
||||
QPlatformCursor *QPlatformScreen::cursor() const
|
||||
{
|
||||
|
|
|
@ -2599,6 +2599,8 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
|
|||
return;
|
||||
|
||||
Q_Q(QWindow);
|
||||
if (!q->isTopLevel())
|
||||
return;
|
||||
// Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent
|
||||
bool quitOnClose = QGuiApplication::quitOnLastWindowClosed() && !q->parent();
|
||||
QWindowList list = QGuiApplication::topLevelWindows();
|
||||
|
@ -2655,7 +2657,7 @@ QOpenGLContext *QWindowPrivate::shareContext() const
|
|||
native window, or to embed a native window inside a QWindow.
|
||||
|
||||
If foreign windows are not supported or embedding the native window
|
||||
failed in the platform plugin, this function returns 0.
|
||||
failed in the platform plugin, this function returns \nullptr.
|
||||
|
||||
\note The resulting QWindow should not be used to manipulate the underlying
|
||||
native window (besides re-parenting), or to observe state changes of the
|
||||
|
|
|
@ -3914,8 +3914,7 @@ bool QOpenGLTexture::isAutoMipMapGenerationEnabled() const
|
|||
have disabled automatic mipmap generation then you need to call this function
|
||||
or the overload to create the mipmap chain.
|
||||
|
||||
\note Mipmap generation is not supported for compressed textures with OpenGL
|
||||
ES 2.0.
|
||||
\note Mipmap generation is not supported for compressed textures with OpenGL ES.
|
||||
|
||||
\sa setAutoMipMapGenerationEnabled(), setMipLevels(), mipLevels()
|
||||
*/
|
||||
|
@ -3926,7 +3925,7 @@ void QOpenGLTexture::generateMipMaps()
|
|||
Q_ASSERT(d->textureId);
|
||||
if (isCompressedFormat(d->format)) {
|
||||
if (QOpenGLContext *ctx = QOpenGLContext::currentContext())
|
||||
if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3)
|
||||
if (ctx->isOpenGLES())
|
||||
return;
|
||||
}
|
||||
d->texFuncs->glGenerateTextureMipmap(d->textureId, d->target, d->bindingTarget);
|
||||
|
@ -3951,7 +3950,7 @@ void QOpenGLTexture::generateMipMaps(int baseLevel, bool resetBaseLevel)
|
|||
Q_ASSERT(d->textureId);
|
||||
if (isCompressedFormat(d->format)) {
|
||||
if (QOpenGLContext *ctx = QOpenGLContext::currentContext())
|
||||
if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3)
|
||||
if (ctx->isOpenGLES())
|
||||
return;
|
||||
}
|
||||
int oldBaseLevel;
|
||||
|
|
|
@ -913,7 +913,7 @@ void QPaintEngine::setPaintDevice(QPaintDevice *device)
|
|||
|
||||
/*!
|
||||
Returns the device that this engine is painting on, if painting is
|
||||
active; otherwise returns 0.
|
||||
active; otherwise returns \nullptr.
|
||||
*/
|
||||
QPaintDevice *QPaintEngine::paintDevice() const
|
||||
{
|
||||
|
|
|
@ -266,10 +266,10 @@ inline QRgba64 rgbBlend(QRgba64 d, QRgba64 s, uint rgbAlpha)
|
|||
const int mr = qRed(rgbAlpha);
|
||||
const int mg = qGreen(rgbAlpha);
|
||||
const int mb = qBlue(rgbAlpha);
|
||||
blend.setRed (qt_div_255(s.red() * mr + d.red() * (255 - mr)));
|
||||
blend.setGreen(qt_div_255(s.green() * mg + d.green() * (255 - mg)));
|
||||
blend.setBlue (qt_div_255(s.blue() * mb + d.blue() * (255 - mb)));
|
||||
blend.setAlpha(s.alpha());
|
||||
blend = qRgba64(qt_div_255(s.red() * mr + d.red() * (255 - mr)),
|
||||
qt_div_255(s.green() * mg + d.green() * (255 - mg)),
|
||||
qt_div_255(s.blue() * mb + d.blue() * (255 - mb)),
|
||||
s.alpha());
|
||||
#endif
|
||||
return blend;
|
||||
}
|
||||
|
|
|
@ -376,6 +376,7 @@ void QSyntaxHighlighter::rehighlight()
|
|||
|
||||
QTextCursor cursor(d->doc);
|
||||
d->rehighlight(cursor, QTextCursor::End);
|
||||
d->rehighlightPending = false; // user manually did a full rehighlight
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -2116,7 +2116,7 @@ QTextList *QTextCursor::createList(QTextListFormat::Style style)
|
|||
|
||||
/*!
|
||||
Returns the current list if the cursor position() is inside a
|
||||
block that is part of a list; otherwise returns 0.
|
||||
block that is part of a list; otherwise returns \nullptr.
|
||||
|
||||
\sa insertList(), createList()
|
||||
*/
|
||||
|
@ -2176,7 +2176,7 @@ QTextTable *QTextCursor::insertTable(int rows, int cols, const QTextTableFormat
|
|||
|
||||
/*!
|
||||
Returns a pointer to the current table if the cursor position()
|
||||
is inside a block that is part of a table; otherwise returns 0.
|
||||
is inside a block that is part of a table; otherwise returns \nullptr.
|
||||
|
||||
\sa insertTable()
|
||||
*/
|
||||
|
@ -2213,7 +2213,7 @@ QTextFrame *QTextCursor::insertFrame(const QTextFrameFormat &format)
|
|||
}
|
||||
|
||||
/*!
|
||||
Returns a pointer to the current frame. Returns 0 if the cursor is invalid.
|
||||
Returns a pointer to the current frame. Returns \nullptr if the cursor is invalid.
|
||||
|
||||
\sa insertFrame()
|
||||
*/
|
||||
|
|
|
@ -1301,7 +1301,7 @@ const QTextDocument *QTextBlock::document() const
|
|||
|
||||
/*!
|
||||
If the block represents a list item, returns the list that the item belongs
|
||||
to; otherwise returns 0.
|
||||
to; otherwise returns \nullptr.
|
||||
*/
|
||||
QTextList *QTextBlock::textList() const
|
||||
{
|
||||
|
|
|
@ -2154,7 +2154,7 @@ QFtp::Command QFtp::currentCommand() const
|
|||
\internal
|
||||
Returns the QIODevice pointer that is used by the FTP command to read data
|
||||
from or store data to. If there is no current FTP command being executed or
|
||||
if the command does not use an IO device, this function returns 0.
|
||||
if the command does not use an IO device, this function returns \nullptr.
|
||||
|
||||
This function can be used to delete the QIODevice in the slot connected to
|
||||
the commandFinished() signal.
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
private Q_SLOTS:
|
||||
void fileOpenFinished(bool isOpen);
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QNetworkReplyFileImpl)
|
||||
};
|
||||
|
||||
|
|
|
@ -1879,11 +1879,9 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation()
|
|||
{
|
||||
Q_Q(QNetworkReplyHttpImpl);
|
||||
|
||||
// ensure this function is only being called once
|
||||
if (state == Working) {
|
||||
qDebug() << "QNetworkReplyHttpImplPrivate::_q_startOperation was called more than once" << url;
|
||||
if (state == Working) // ensure this function is only being called once
|
||||
return;
|
||||
}
|
||||
|
||||
state = Working;
|
||||
|
||||
#ifndef QT_NO_BEARERMANAGEMENT
|
||||
|
|
|
@ -102,6 +102,8 @@ static void q_loadCallback(val event)
|
|||
return;
|
||||
}
|
||||
QString statusText = QString::fromStdString(xhr["statusText"].as<std::string>());
|
||||
int readyState = xhr["readyState"].as<int>();
|
||||
|
||||
if (status == 200 || status == 203) {
|
||||
QString responseString;
|
||||
const std::string responseType = xhr["responseType"].as<std::string>();
|
||||
|
@ -112,13 +114,15 @@ static void q_loadCallback(val event)
|
|||
QString::fromStdWString(val::global("JSON").call<std::wstring>("stringify", xhr["response"]));
|
||||
} else if (responseType == "arraybuffer" || responseType == "blob") {
|
||||
// handle this data in the FileReader, triggered by the call to readAsArrayBuffer
|
||||
val blob = xhr["response"];
|
||||
|
||||
val reader = val::global("FileReader").new_();
|
||||
reader.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_readBinary"));
|
||||
reader.set("data-handler", xhr["data-handler"]);
|
||||
reader.call<void>("readAsArrayBuffer", xhr["response"]);
|
||||
|
||||
reader.call<void>("readAsArrayBuffer", blob);
|
||||
}
|
||||
|
||||
int readyState = xhr["readyState"].as<int>();
|
||||
|
||||
if (readyState == 4) { // done
|
||||
reply->setReplyAttributes(xhr["data-handler"].as<quintptr>(), status, statusText);
|
||||
|
@ -167,9 +171,9 @@ static void q_readBinary(val event)
|
|||
reinterpret_cast<quintptr>(buffer.data()), size);
|
||||
destinationTypedArray.call<void>("set", sourceTypedArray);
|
||||
reply->dataReceived(buffer, buffer.size());
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
|
||||
|
||||
EMSCRIPTEN_BINDINGS(network_module) {
|
||||
function("QNetworkReplyWasmImplPrivate_requestErrorCallback", q_requestErrorCallback);
|
||||
function("QNetworkReplyWasmImplPrivate_progressCallback", q_progressCallback);
|
||||
|
@ -240,9 +244,6 @@ qint64 QNetworkReplyWasmImpl::bytesAvailable() const
|
|||
{
|
||||
Q_D(const QNetworkReplyWasmImpl);
|
||||
|
||||
if (!d->isFinished)
|
||||
return QNetworkReply::bytesAvailable();
|
||||
|
||||
return QNetworkReply::bytesAvailable() + d->downloadBufferCurrentSize - d->downloadBufferReadPosition;
|
||||
}
|
||||
|
||||
|
@ -357,8 +358,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
|
|||
m_xhr.set("responseType", val("json"));
|
||||
dataToSend = val(extraDataString.toStdString());
|
||||
}
|
||||
}
|
||||
if (contentType.contains("form")) { //construct form data
|
||||
} else if (contentType.contains("form")) { //construct form data
|
||||
if (!extraDataString.isEmpty()) {
|
||||
val formData = val::global("FormData").new_();
|
||||
QStringList formList = extraDataString.split('&');
|
||||
|
@ -368,6 +368,8 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
|
|||
}
|
||||
dataToSend = formData;
|
||||
}
|
||||
} else {
|
||||
m_xhr.set("responseType", val("blob"));
|
||||
}
|
||||
// set request headers
|
||||
for (auto header : request.rawHeaderList()) {
|
||||
|
@ -417,10 +419,13 @@ void QNetworkReplyWasmImplPrivate::dataReceived(const QByteArray &buffer, int bu
|
|||
|
||||
downloadBuffer.append(buffer, bufferSize);
|
||||
|
||||
emit q->readyRead();
|
||||
|
||||
if (downloadBufferCurrentSize == totalDownloadSize) {
|
||||
q->setFinished(true);
|
||||
emit q->finished();
|
||||
}
|
||||
q->setFinished(true);
|
||||
emit q->readChannelFinished();
|
||||
emit q->finished();
|
||||
}
|
||||
}
|
||||
|
||||
//taken from qnetworkrequest.cpp
|
||||
|
|
|
@ -714,7 +714,7 @@ void QNetworkRequest::setOriginatingObject(QObject *object)
|
|||
\since 4.6
|
||||
|
||||
Returns a reference to the object that initiated this
|
||||
network request; returns 0 if not set or the object has
|
||||
network request; returns \nullptr if not set or the object has
|
||||
been destroyed.
|
||||
|
||||
\sa setOriginatingObject()
|
||||
|
|
|
@ -574,7 +574,8 @@ QHostAddress &QHostAddress::operator=(SpecialAddress address)
|
|||
*/
|
||||
|
||||
/*!
|
||||
Sets the host address to null.
|
||||
Sets the host address to null and sets the protocol to
|
||||
QAbstractSocket::UnknownNetworkLayerProtocol.
|
||||
|
||||
\sa QHostAddress::Null
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB)
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
** This file is part of the QtOpenGLExtensions module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** Commercial License Usage
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB)
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
** This file is part of the QtOpenGLExtensions module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** Commercial License Usage
|
||||
|
|
|
@ -52,7 +52,9 @@
|
|||
//
|
||||
|
||||
#ifdef QT_EGL_NO_X11
|
||||
# define MESA_EGL_NO_X11_HEADERS // MESA
|
||||
# ifndef MESA_EGL_NO_X11_HEADERS
|
||||
# define MESA_EGL_NO_X11_HEADERS // MESA
|
||||
# endif
|
||||
# if !defined(Q_OS_INTEGRITY)
|
||||
# define WIN_INTERFACE_CUSTOM // NV
|
||||
# endif // Q_OS_INTEGRITY
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
#include "qxcbconnection.h"
|
||||
#include "qxcbkeyboard.h"
|
||||
|
@ -818,7 +819,7 @@ xcb_window_t QXcbConnection::getQtSelectionOwner()
|
|||
0); // value list
|
||||
|
||||
QXcbWindow::setWindowTitle(connection(), m_qtSelectionOwner,
|
||||
QStringLiteral("Qt Selection Window"));
|
||||
QLatin1String("Qt Selection Owner for ") + QCoreApplication::applicationName());
|
||||
}
|
||||
return m_qtSelectionOwner;
|
||||
}
|
||||
|
|
|
@ -130,6 +130,7 @@
|
|||
#include <QtWidgets/qgraphicsview.h>
|
||||
#endif
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qvarlengtharray.h>
|
||||
#include <private/qstylehelper_p.h>
|
||||
#include <private/qstyleanimation_p.h>
|
||||
#include <qpa/qplatformfontdatabase.h>
|
||||
|
@ -314,6 +315,26 @@ static QLinearGradient titlebarGradientInactive()
|
|||
return qt_mac_applicationIsInDarkMode() ? darkGradient : lightGradient;
|
||||
}
|
||||
|
||||
static void clipTabBarFrame(const QStyleOption *option, const QMacStyle *style, CGContextRef ctx)
|
||||
{
|
||||
Q_ASSERT(option);
|
||||
Q_ASSERT(style);
|
||||
Q_ASSERT(ctx);
|
||||
|
||||
if (qt_mac_applicationIsInDarkMode()) {
|
||||
QTabWidget *tabWidget = qobject_cast<QTabWidget *>(option->styleObject);
|
||||
Q_ASSERT(tabWidget);
|
||||
|
||||
const QRect tabBarRect = style->subElementRect(QStyle::SE_TabWidgetTabBar, option, tabWidget).adjusted(2, 2, -3, -2);
|
||||
const QRegion clipPath = QRegion(option->rect) - tabBarRect;
|
||||
QVarLengthArray<CGRect, 3> cgRects;
|
||||
for (const QRect &qtRect : clipPath)
|
||||
cgRects.push_back(qtRect.toCGRect());
|
||||
if (cgRects.size())
|
||||
CGContextClipToRects(ctx, &cgRects[0], size_t(cgRects.size()));
|
||||
}
|
||||
}
|
||||
|
||||
static const QColor titlebarSeparatorLineActive(111, 111, 111);
|
||||
static const QColor titlebarSeparatorLineInactive(131, 131, 131);
|
||||
static const QColor darkModeSeparatorLine(88, 88, 88);
|
||||
|
@ -2976,6 +2997,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
|
|||
// QDarkNSBox, of type NSBoxCustom. Its appearance is close enough to the real thing so
|
||||
// we can use this for now.
|
||||
d->drawNSViewInRect(box, opt->rect, p, ^(CGContextRef ctx, const CGRect &rect) {
|
||||
if (QTabWidget *tabWidget = qobject_cast<QTabWidget *>(opt->styleObject))
|
||||
clipTabBarFrame(opt, this, ctx);
|
||||
CGContextTranslateCTM(ctx, 0, rect.origin.y + rect.size.height);
|
||||
CGContextScaleCTM(ctx, 1, -1);
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSMojave
|
||||
|
@ -3699,6 +3722,12 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||
// inFrame:withView:], -[drawRect:] or anything in between. Besides,
|
||||
// there's no public API do draw the pressed state, AFAICS. We'll use
|
||||
// a push NSButton instead and clip the CGContext.
|
||||
// NOTE/TODO: this is not true. On 10.13 NSSegmentedControl works with
|
||||
// some (black?) magic/magic dances, on 10.14 it simply works (was
|
||||
// it fixed in AppKit?). But, indeed, we cannot make a tab 'pressed'
|
||||
// with NSSegmentedControl (only selected), so we stay with buttons
|
||||
// (mixing buttons and NSSegmentedControl for such a simple thing
|
||||
// is too much work).
|
||||
|
||||
const auto cs = d->effectiveAquaSizeConstrain(opt, w);
|
||||
// Extra hacks to get the proper pressed appreance when not selected or selected and inactive
|
||||
|
|
|
@ -109,11 +109,11 @@ QWidget *createEditor(QWidget *aParent,
|
|||
// to present the DisplayRole and not the EditRole which
|
||||
// is the id reference to the related model
|
||||
QVariant v = index.data(Qt::DisplayRole);
|
||||
QByteArray n = editor->metaObject()->userProperty().name();
|
||||
const QByteArray n = editor->metaObject()->userProperty().name();
|
||||
if (!n.isEmpty()) {
|
||||
if (!v.isValid())
|
||||
v = QVariant(editor->property(n).userType(), nullptr);
|
||||
editor->setProperty(n, v);
|
||||
v = QVariant(editor->property(n.data()).userType(), nullptr);
|
||||
editor->setProperty(n.data(), v);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -959,7 +959,7 @@
|
|||
\overload
|
||||
\since 5.8
|
||||
|
||||
Returns a string containing \c{nullptr}.
|
||||
Returns a string containing \nullptr.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
@ -12,6 +12,7 @@ unix:!embedded:QMAKE_PKGCONFIG_DESCRIPTION = Qt \
|
|||
QMAKE_DOCS = $$PWD/doc/qttestlib.qdocconf
|
||||
|
||||
HEADERS = \
|
||||
qabstracttestlogger_p.h \
|
||||
qbenchmark.h \
|
||||
qbenchmark_p.h \
|
||||
qbenchmarkmeasurement_p.h \
|
||||
|
@ -21,10 +22,16 @@ HEADERS = \
|
|||
qbenchmarkperfevents_p.h \
|
||||
qbenchmarkmetric.h \
|
||||
qbenchmarkmetric_p.h \
|
||||
qcsvbenchmarklogger_p.h \
|
||||
qplaintestlogger_p.h \
|
||||
qsignaldumper_p.h \
|
||||
qsignalspy.h \
|
||||
qteamcitylogger_p.h \
|
||||
qtestaccessible.h \
|
||||
qtestassert.h \
|
||||
qtestcase.h \
|
||||
qtestcoreelement_p.h \
|
||||
qtestcorelist_p.h \
|
||||
qtestdata.h \
|
||||
qtestevent.h \
|
||||
qtesteventloop.h \
|
||||
|
@ -32,15 +39,23 @@ HEADERS = \
|
|||
qtest_network.h \
|
||||
qtest_widgets.h \
|
||||
qtest.h \
|
||||
qtestelement_p.h \
|
||||
qtestelementattribute_p.h \
|
||||
qtestkeyboard.h \
|
||||
qtestlog_p.h \
|
||||
qtestmouse.h \
|
||||
qtestresult_p.h \
|
||||
qtestspontaneevent.h \
|
||||
qtestsystem.h \
|
||||
qtesttable_p.h \
|
||||
qtesttouch.h \
|
||||
qtestblacklist_p.h \
|
||||
qtesthelpers_p.h \
|
||||
qttestglobal.h \
|
||||
qtaptestlogger_p.h
|
||||
qtestxunitstreamer_p.h \
|
||||
qtaptestlogger_p.h \
|
||||
qxmltestlogger_p.h \
|
||||
qxunittestlogger_p.h
|
||||
|
||||
SOURCES = \
|
||||
qtestcase.cpp \
|
||||
|
|
|
@ -128,6 +128,7 @@ struct Options
|
|||
bool build;
|
||||
bool gradle;
|
||||
bool auxMode;
|
||||
bool stripLibraries = true;
|
||||
QTime timer;
|
||||
|
||||
// External tools
|
||||
|
@ -437,6 +438,8 @@ Options parseOptions()
|
|||
options.generateAssetsFileList = false;
|
||||
} else if (argument.compare(QLatin1String("--aux-mode"), Qt::CaseInsensitive) == 0) {
|
||||
options.auxMode = true;
|
||||
} else if (argument.compare(QLatin1String("--no-strip"), Qt::CaseInsensitive) == 0) {
|
||||
options.stripLibraries = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -525,6 +528,7 @@ void printHelp()
|
|||
" --aux-mode: Operate in auxiliary mode. This will only copy the\n"
|
||||
" dependencies into the build directory and update the XML templates.\n"
|
||||
" The project will not be built or installed.\n"
|
||||
" --no-strip: Do not strip debug symbols from libraries.\n"
|
||||
" --help: Displays this information.\n\n",
|
||||
qPrintable(QCoreApplication::arguments().at(0))
|
||||
);
|
||||
|
@ -1897,6 +1901,8 @@ bool stripFile(const Options &options, const QString &fileName)
|
|||
|
||||
bool stripLibraries(const Options &options)
|
||||
{
|
||||
if (!options.stripLibraries)
|
||||
return true;
|
||||
if (options.verbose)
|
||||
fprintf(stdout, "Stripping libraries to minimize size.\n");
|
||||
|
||||
|
|
|
@ -988,7 +988,7 @@ Qt::Orientation QDialog::orientation() const
|
|||
|
||||
Sets the widget, \a extension, to be the dialog's extension,
|
||||
deleting any previous extension. The dialog takes ownership of the
|
||||
extension. Note that if 0 is passed any existing extension will be
|
||||
extension. Note that if \nullptr is passed, any existing extension will be
|
||||
deleted. This function must only be called while the dialog is hidden.
|
||||
|
||||
Instead of using this functionality, we recommend that you simply call
|
||||
|
|
|
@ -393,7 +393,7 @@ void QProgressDialog::setLabelText(const QString &text)
|
|||
Sets the cancel button to the push button, \a cancelButton. The
|
||||
progress dialog takes ownership of this button which will be deleted
|
||||
when necessary, so do not pass the address of an object that is on
|
||||
the stack, i.e. use new() to create the button. If 0 is passed then
|
||||
the stack, i.e. use new() to create the button. If \nullptr is passed,
|
||||
no cancel button will be shown.
|
||||
|
||||
\sa setCancelButtonText()
|
||||
|
|
|
@ -178,7 +178,7 @@ QRectF QGraphicsEffect::sourceBoundingRect(Qt::CoordinateSystem system) const
|
|||
|
||||
/*!
|
||||
Returns a pointer to the item if this source is a QGraphicsItem; otherwise
|
||||
returns 0.
|
||||
returns \nullptr.
|
||||
|
||||
\sa widget()
|
||||
*/
|
||||
|
@ -189,7 +189,7 @@ const QGraphicsItem *QGraphicsEffectSource::graphicsItem() const
|
|||
|
||||
/*!
|
||||
Returns a pointer to the widget if this source is a QWidget; otherwise
|
||||
returns 0.
|
||||
returns \nullptr.
|
||||
|
||||
\sa graphicsItem()
|
||||
*/
|
||||
|
@ -200,7 +200,7 @@ const QWidget *QGraphicsEffectSource::widget() const
|
|||
|
||||
/*!
|
||||
Returns a pointer to the style options (used when drawing the source) if
|
||||
available; otherwise returns 0.
|
||||
available; otherwise returns \nullptr.
|
||||
|
||||
\sa graphicsItem(), widget()
|
||||
*/
|
||||
|
|
|
@ -1726,8 +1726,8 @@ QGraphicsItem *QGraphicsItem::topLevelItem() const
|
|||
/*!
|
||||
\since 4.6
|
||||
|
||||
Returns a pointer to the item's parent, cast to a QGraphicsObject. returns 0 if the parent item
|
||||
is not a QGraphicsObject.
|
||||
Returns a pointer to the item's parent, cast to a QGraphicsObject. Returns
|
||||
\nullptr if the parent item is not a QGraphicsObject.
|
||||
|
||||
\sa parentItem(), childItems()
|
||||
*/
|
||||
|
|
|
@ -369,7 +369,7 @@ bool QGraphicsLayoutItemPrivate::hasWidthForHeight() const
|
|||
protected constructor, or by calling setParentLayoutItem(). The
|
||||
parentLayoutItem() function returns a pointer to the item's layoutItem
|
||||
parent. If the item's parent is 0 or if the parent does not inherit
|
||||
from QGraphicsItem, the parentLayoutItem() function then returns 0.
|
||||
from QGraphicsItem, the parentLayoutItem() function then returns \nullptr.
|
||||
isLayout() returns \c true if the QGraphicsLayoutItem subclass is itself a
|
||||
layout, or false otherwise.
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ QAbstractItemDelegate::~QAbstractItemDelegate()
|
|||
model being used. The editor's parent widget is specified by \a parent,
|
||||
and the item options by \a option.
|
||||
|
||||
The base implementation returns 0. If you want custom editing you
|
||||
The base implementation returns \nullptr. If you want custom editing you
|
||||
will need to reimplement this function.
|
||||
|
||||
The returned editor widget should have Qt::StrongFocus;
|
||||
|
|
|
@ -1454,7 +1454,7 @@ void QListWidget::setSelectionModel(QItemSelectionModel *selectionModel)
|
|||
|
||||
/*!
|
||||
Returns the item that occupies the given \a row in the list if one has been
|
||||
set; otherwise returns 0.
|
||||
set; otherwise returns \nullptr.
|
||||
|
||||
\sa row()
|
||||
*/
|
||||
|
@ -1521,7 +1521,7 @@ void QListWidget::insertItems(int row, const QStringList &labels)
|
|||
|
||||
/*!
|
||||
Removes and returns the item from the given \a row in the list widget;
|
||||
otherwise returns 0.
|
||||
otherwise returns \nullptr.
|
||||
|
||||
Items removed from a list widget will not be managed by Qt, and will need
|
||||
to be deleted manually.
|
||||
|
|
|
@ -1983,7 +1983,7 @@ int QTableWidget::column(const QTableWidgetItem *item) const
|
|||
|
||||
/*!
|
||||
Returns the item for the given \a row and \a column if one has been set; otherwise
|
||||
returns 0.
|
||||
returns \nullptr.
|
||||
|
||||
\sa setItem()
|
||||
*/
|
||||
|
@ -2076,7 +2076,7 @@ QTableWidgetItem *QTableWidget::takeVerticalHeaderItem(int row)
|
|||
|
||||
/*!
|
||||
Returns the horizontal header item for column, \a column, if one has been
|
||||
set; otherwise returns 0.
|
||||
set; otherwise returns \nullptr.
|
||||
*/
|
||||
QTableWidgetItem *QTableWidget::horizontalHeaderItem(int column) const
|
||||
{
|
||||
|
@ -2481,7 +2481,7 @@ int QTableWidget::visualColumn(int logicalColumn) const
|
|||
/*!
|
||||
\fn QTableWidgetItem *QTableWidget::itemAt(const QPoint &point) const
|
||||
|
||||
Returns a pointer to the item at the given \a point, or returns 0 if
|
||||
Returns a pointer to the item at the given \a point, or returns \nullptr if
|
||||
\a point is not covered by an item in the table widget.
|
||||
|
||||
\sa item()
|
||||
|
|
|
@ -2779,7 +2779,7 @@ void QTreeWidget::addTopLevelItem(QTreeWidgetItem *item)
|
|||
|
||||
/*!
|
||||
Removes the top-level item at the given \a index in the tree and
|
||||
returns it, otherwise returns 0;
|
||||
returns it, otherwise returns \nullptr;
|
||||
|
||||
\sa insertTopLevelItem(), topLevelItem(), topLevelItemCount()
|
||||
*/
|
||||
|
|
|
@ -360,7 +360,7 @@ void QApplicationPrivate::createEventDispatcher()
|
|||
/*!
|
||||
\fn QWidget *QApplication::topLevelAt(const QPoint &point)
|
||||
|
||||
Returns the top-level widget at the given \a point; returns 0 if
|
||||
Returns the top-level widget at the given \a point; returns \nullptr if
|
||||
there is no such widget.
|
||||
*/
|
||||
QWidget *QApplication::topLevelAt(const QPoint &pos)
|
||||
|
@ -1226,7 +1226,7 @@ void QApplication::setStyle(QStyle *style)
|
|||
"windows", "windowsvista", "fusion", or "macintosh". Style
|
||||
names are case insensitive.
|
||||
|
||||
Returns 0 if an unknown \a style is passed, otherwise the QStyle object
|
||||
Returns \nullptr if an unknown \a style is passed, otherwise the QStyle object
|
||||
returned is set as the application's GUI style.
|
||||
|
||||
\warning To ensure that the application's style is set correctly, it is
|
||||
|
@ -1420,24 +1420,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
|
|||
|
||||
if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) {
|
||||
// Send ApplicationPaletteChange to qApp itself, and to the widgets.
|
||||
QEvent e(QEvent::ApplicationPaletteChange);
|
||||
QApplication::sendEvent(QApplication::instance(), &e);
|
||||
|
||||
QWidgetList wids = QApplication::allWidgets();
|
||||
for (QWidgetList::ConstIterator it = wids.constBegin(), cend = wids.constEnd(); it != cend; ++it) {
|
||||
QWidget *w = *it;
|
||||
if (all || (!className && w->isWindow()) || w->inherits(className)) // matching class
|
||||
QApplication::sendEvent(w, &e);
|
||||
}
|
||||
|
||||
// Send to all scenes as well.
|
||||
#if QT_CONFIG(graphicsview)
|
||||
QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
|
||||
for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin();
|
||||
it != scenes.constEnd(); ++it) {
|
||||
QApplication::sendEvent(*it, &e);
|
||||
}
|
||||
#endif // QT_CONFIG(graphicsview)
|
||||
qApp->d_func()->sendApplicationPaletteChange(all, className);
|
||||
}
|
||||
if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal))) {
|
||||
if (!QApplicationPrivate::set_pal)
|
||||
|
@ -2195,7 +2178,7 @@ void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous)
|
|||
|
||||
/*!internal
|
||||
* Helper function that returns the new focus widget, but does not set the focus reason.
|
||||
* Returns 0 if a new focus widget could not be found.
|
||||
* Returns \nullptr if a new focus widget could not be found.
|
||||
* Shared with QGraphicsProxyWidgetPrivate::findFocusChild()
|
||||
*/
|
||||
QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next,
|
||||
|
@ -4511,6 +4494,23 @@ void QApplicationPrivate::notifyThemeChanged()
|
|||
qt_init_tooltip_palette();
|
||||
}
|
||||
|
||||
void QApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className)
|
||||
{
|
||||
QGuiApplicationPrivate::sendApplicationPaletteChange();
|
||||
|
||||
QEvent event(QEvent::ApplicationPaletteChange);
|
||||
const QWidgetList widgets = QApplication::allWidgets();
|
||||
for (auto widget : widgets) {
|
||||
if (toAllWidgets || (!className && widget->isWindow()) || (className && widget->inherits(className)))
|
||||
QApplication::sendEvent(widget, &event);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(graphicsview)
|
||||
for (auto scene : qAsConst(scene_list))
|
||||
QApplication::sendEvent(scene, &event);
|
||||
#endif // QT_CONFIG(graphicsview)
|
||||
}
|
||||
|
||||
#if QT_CONFIG(draganddrop)
|
||||
void QApplicationPrivate::notifyDragStarted(const QDrag *drag)
|
||||
{
|
||||
|
|
|
@ -177,6 +177,9 @@ public:
|
|||
|
||||
protected:
|
||||
void notifyThemeChanged() override;
|
||||
void sendApplicationPaletteChange(bool toAllWidgets = false,
|
||||
const char *className = nullptr) override;
|
||||
|
||||
#if QT_CONFIG(draganddrop)
|
||||
void notifyDragStarted(const QDrag *) override;
|
||||
#endif // QT_CONFIG(draganddrop)
|
||||
|
|
|
@ -1827,7 +1827,7 @@ int QFormLayout::rowCount() const
|
|||
|
||||
/*!
|
||||
Returns the layout item in the given \a row with the specified \a
|
||||
role (column). Returns 0 if there is no such item.
|
||||
role (column). Returns \nullptr if there is no such item.
|
||||
|
||||
\sa QLayout::itemAt(), setItem()
|
||||
*/
|
||||
|
|
|
@ -10412,7 +10412,7 @@ bool QWidget::hasHeightForWidth() const
|
|||
|
||||
Returns the visible child widget at the position (\a{x}, \a{y})
|
||||
in the widget's coordinate system. If there is no visible child
|
||||
widget at the specified position, the function returns 0.
|
||||
widget at the specified position, the function returns \nullptr.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -12376,7 +12376,7 @@ Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget)
|
|||
\since 4.5
|
||||
|
||||
Returns the proxy widget for the corresponding embedded widget in a graphics
|
||||
view; otherwise returns 0.
|
||||
view; otherwise returns \nullptr.
|
||||
|
||||
\sa QGraphicsProxyWidget::createProxyForChildWidget(),
|
||||
QGraphicsScene::addWidget()
|
||||
|
|
|
@ -77,7 +77,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
|||
|
||||
/*!
|
||||
Creates and returns a QStyle object that matches the given \a key, or
|
||||
returns 0 if no matching style is found.
|
||||
returns \nullptr if no matching style is found.
|
||||
|
||||
Both built-in styles and styles from style plugins are queried for a
|
||||
matching style.
|
||||
|
|
|
@ -242,7 +242,7 @@ void QUndoGroup::setActiveStack(QUndoStack *stack)
|
|||
Returns the active stack of this group.
|
||||
|
||||
If none of the stacks are active, or if the group is empty, this function
|
||||
returns 0.
|
||||
returns \nullptr.
|
||||
|
||||
\sa setActiveStack(), QUndoStack::setActive()
|
||||
*/
|
||||
|
|
|
@ -412,7 +412,7 @@ void QUndoView::setGroup(QUndoGroup *group)
|
|||
/*!
|
||||
Returns the group displayed by this view.
|
||||
|
||||
If the view is not looking at group, this function returns 0.
|
||||
If the view is not looking at group, this function returns \nullptr.
|
||||
|
||||
\sa setGroup(), setStack()
|
||||
*/
|
||||
|
|
|
@ -805,7 +805,7 @@ bool QAbstractButton::autoExclusive() const
|
|||
Returns the group that this button belongs to.
|
||||
|
||||
If the button is not a member of any QButtonGroup, this function
|
||||
returns 0.
|
||||
returns \nullptr.
|
||||
|
||||
\sa QButtonGroup
|
||||
*/
|
||||
|
|
|
@ -692,7 +692,7 @@ QLineEdit *QAbstractSpinBox::lineEdit() const
|
|||
|
||||
QAbstractSpinBox takes ownership of the new lineEdit
|
||||
|
||||
If QLineEdit::validator() for the \a lineEdit returns 0, the internal
|
||||
If QLineEdit::validator() for the \a lineEdit returns \nullptr, the internal
|
||||
validator of the spinbox will be set on the line edit.
|
||||
*/
|
||||
|
||||
|
|
|
@ -2255,7 +2255,7 @@ int QMenu::columnCount() const
|
|||
}
|
||||
|
||||
/*!
|
||||
Returns the item at \a pt; returns 0 if there is no item there.
|
||||
Returns the item at \a pt; returns \nullptr if there is no item there.
|
||||
*/
|
||||
QAction *QMenu::actionAt(const QPoint &pt) const
|
||||
{
|
||||
|
|
|
@ -1581,7 +1581,7 @@ bool QMenuBar::eventFilter(QObject *object, QEvent *event)
|
|||
}
|
||||
|
||||
/*!
|
||||
Returns the QAction at \a pt. Returns 0 if there is no action at \a pt or if
|
||||
Returns the QAction at \a pt. Returns \nullptr if there is no action at \a pt or if
|
||||
the location has a separator.
|
||||
|
||||
\sa addAction(), addSeparator()
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "qpixmap.h"
|
||||
#include "qtextdocument.h"
|
||||
#include "qtextcursor.h"
|
||||
#include <QtGui/qscreen.h>
|
||||
#include <QtGui/qwindow.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
#include <QtCore/qelapsedtimer.h>
|
||||
|
@ -69,6 +70,10 @@ public:
|
|||
int currAlign;
|
||||
|
||||
inline QSplashScreenPrivate();
|
||||
|
||||
void setPixmap(const QPixmap &p, const QScreen *screen = nullptr);
|
||||
|
||||
static const QScreen *screenFor(const QWidget *w);
|
||||
};
|
||||
|
||||
/*!
|
||||
|
@ -143,8 +148,9 @@ QSplashScreen::QSplashScreen(const QPixmap &pixmap, Qt::WindowFlags f)
|
|||
QSplashScreen::QSplashScreen(QWidget *parent, const QPixmap &pixmap, Qt::WindowFlags f)
|
||||
: QWidget(*new QSplashScreenPrivate, parent, Qt::SplashScreen | Qt::FramelessWindowHint | f)
|
||||
{
|
||||
d_func()->pixmap = pixmap;
|
||||
setPixmap(d_func()->pixmap); // Does an implicit repaint
|
||||
// Does an implicit repaint. Explicitly pass parent as QObject::parent()
|
||||
// is still 0 here due to QWidget's special handling.
|
||||
d_func()->setPixmap(pixmap, QSplashScreenPrivate::screenFor(parent));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -276,16 +282,47 @@ void QSplashScreen::finish(QWidget *mainWin)
|
|||
*/
|
||||
void QSplashScreen::setPixmap(const QPixmap &pixmap)
|
||||
{
|
||||
Q_D(QSplashScreen);
|
||||
d_func()->setPixmap(pixmap, QSplashScreenPrivate::screenFor(this));
|
||||
}
|
||||
|
||||
d->pixmap = pixmap;
|
||||
setAttribute(Qt::WA_TranslucentBackground, pixmap.hasAlpha());
|
||||
// In setPixmap(), resize and try to position on a screen according to:
|
||||
// 1) If a QDesktopScreenWidget is found in the parent hierarchy, use that (see docs on
|
||||
// QSplashScreen(QWidget *, QPixmap).
|
||||
// 2) If a widget with associated QWindow is found, use that
|
||||
// 3) When nothing can be found, do not position the widget, allowing for
|
||||
// QPlatformWindow::initialGeometry() to center it over the cursor
|
||||
|
||||
QRect r(QPoint(), d->pixmap.size() / d->pixmap.devicePixelRatio());
|
||||
resize(r.size());
|
||||
move(QDesktopWidgetPrivate::screenGeometry().center() - r.center());
|
||||
if (isVisible())
|
||||
repaint();
|
||||
static inline int screenNumberOf(const QDesktopScreenWidget *dsw)
|
||||
{
|
||||
auto desktopWidgetPrivate =
|
||||
static_cast<QDesktopWidgetPrivate *>(qt_widget_private(QApplication::desktop()));
|
||||
return desktopWidgetPrivate->screens.indexOf(const_cast<QDesktopScreenWidget *>(dsw));
|
||||
}
|
||||
|
||||
const QScreen *QSplashScreenPrivate::screenFor(const QWidget *w)
|
||||
{
|
||||
for (const QWidget *p = w; p !=nullptr ; p = p->parentWidget()) {
|
||||
if (auto dsw = qobject_cast<const QDesktopScreenWidget *>(p))
|
||||
return QGuiApplication::screens().value(screenNumberOf(dsw));
|
||||
if (QWindow *window = p->windowHandle())
|
||||
return window->screen();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void QSplashScreenPrivate::setPixmap(const QPixmap &p, const QScreen *screen)
|
||||
{
|
||||
Q_Q(QSplashScreen);
|
||||
|
||||
pixmap = p;
|
||||
q->setAttribute(Qt::WA_TranslucentBackground, pixmap.hasAlpha());
|
||||
|
||||
QRect r(QPoint(), pixmap.size() / pixmap.devicePixelRatio());
|
||||
q->resize(r.size());
|
||||
if (screen)
|
||||
q->move(screen->geometry().center() - r.center());
|
||||
if (q->isVisible())
|
||||
q->repaint();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -928,6 +928,12 @@ void tst_QCoreApplication::threadedEventDelivery()
|
|||
thread.start();
|
||||
QVERIFY(thread.wait(1000));
|
||||
QCOMPARE(receiver.recordedEvents.contains(QEvent::User + 1), eventsReceived);
|
||||
|
||||
}
|
||||
|
||||
void tst_QCoreApplication::testTrWithPercantegeAtTheEnd()
|
||||
{
|
||||
QCoreApplication::translate("testcontext", "this will crash%", "testdisamb", 3);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(library)
|
||||
|
|
|
@ -59,6 +59,7 @@ private slots:
|
|||
void applicationEventFilters_auxThread();
|
||||
void threadedEventDelivery_data();
|
||||
void threadedEventDelivery();
|
||||
void testTrWithPercantegeAtTheEnd();
|
||||
#if QT_CONFIG(library)
|
||||
void addRemoveLibPaths();
|
||||
#endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue