Compare commits

..

No commits in common. "master" and "GIMP_3_2_0-windows-fixes" have entirely different histories.

312 changed files with 115492 additions and 117463 deletions

View file

@ -131,7 +131,7 @@ stages:
- <<: *CI_RELEASE
before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install-${RUNNER}"
timeout: 40m
timeout: 30m
.debian_environ: &ENVIRON
# See: https://testing.developer.gimp.org/core/setup/build/#preparing-for-building
@ -161,25 +161,25 @@ deps-debian-nonreloc:
# Install deps
- echo "FROM debian:${DEB_VERSION}" > Dockerfile
- echo "WORKDIR $CI_PROJECT_DIR" >> Dockerfile
## 'ca-certificates' and 'git' are NOT gimp deps, they are installed only to our Docker image work
- echo "RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends ca-certificates git \\" >> Dockerfile
## 'ca-certificates' is NOT a gimp dep, it is installed only to our Docker image work
- echo "RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends ca-certificates \\" >> Dockerfile
## Build-time only dependencies
- echo "${TOOLCHAIN:-build-essential}
appstream
bison
desktop-file-utils
flex
gettext
gi-docgen
git
gobject-introspection
libgtk-3-bin
locales
meson
valac
xsltproc \\" >> Dockerfile
## Runtime dependencies
- echo "at-spi2-core
ffmpeg
gettext
gjs
glib-networking
graphviz
@ -214,19 +214,19 @@ deps-debian-nonreloc:
libqoi-dev
librsvg2-dev
libsuitesparse-dev
$UMFPACK
libtiff-dev
$UMFPACK
libunwind-dev
libwebp-dev
libwmf-dev
libxmu-dev
libxpm-dev
locales
mypaint-brushes
poppler-data
python3
python3-gi
python3-gi-cairo
xdg-utils" >> Dockerfile
python3-gi-cairo" >> Dockerfile
- echo "RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen" >> Dockerfile
# Prepare environ
- echo "FROM $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}" > Dockerfile2;
@ -245,9 +245,7 @@ deps-debian-nonreloc:
## Build babl
- echo "RUN printf \"\e[0Ksection_start:\`date +%s\`:babl_build[collapsed=true]\r\e[0KBuilding babl\n\"" >> Dockerfile2;
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/babl.git | grep -oi \"BABL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git" babl >> Dockerfile2;
# TODO: remove this line once we have a babl 0.1.126. Takes care of an option name change.
- export BABL_RELOCATABLE_OPTION=$(([ $CI_COMMIT_TAG ] && (([ $RELOCATABLE_OPTION ] && echo -Drelocatable=enabled) || true)) || echo $RELOCATABLE_OPTION)
- echo "RUN meson setup babl/_build-${RUNNER} babl -Dprefix=\"${GIMP_PREFIX}\" $BABL_RELOCATABLE_OPTION $PKGCONF_RELOCATABLE_OPTION $WARN_AS_ERROR_ON_CI" >> Dockerfile2;
- echo "RUN meson setup babl/_build-${RUNNER} babl -Dprefix=\"${GIMP_PREFIX}\" $RELOCATABLE_OPTION $PKGCONF_RELOCATABLE_OPTION $WARN_AS_ERROR_ON_CI" >> Dockerfile2;
- echo "RUN ninja -C babl/_build-${RUNNER}" >> Dockerfile2;
- echo "RUN ninja -C babl/_build-${RUNNER} install" >> Dockerfile2;
- echo "RUN printf \"\e[0Ksection_end:\`date +%s\`:babl_build\r\e[0K\n\"" >> Dockerfile2;
@ -271,7 +269,7 @@ deps-debian-nonreloc:
- babl/_build-${RUNNER}/config.h
- gegl/_build-${RUNNER}/meson-logs/meson-log.txt
- gegl/_build-${RUNNER}/config.h
expire_in: 4 hours
expire_in: 2 hours
gimp-debian-nonreloc:
extends: .debian-nonreloc
@ -285,7 +283,7 @@ gimp-debian-nonreloc:
- printf "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP\n"
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
-Dfile-plug-ins-test=true
$MESON_OPTIONS $WARN_AS_ERROR_ON_CI
$MESON_OPTIONS
- cd _build-${RUNNER}
- ninja
- printf "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K\n"
@ -344,8 +342,7 @@ deps-debian:
image: !reference [deps-debian-nonreloc, image]
variables:
GIT_STRATEGY: none
RELOCATABLE_OPTION: '-Drelocatable-bundle=yes'
#meson.build forces non-relocatable .pc. See: https://github.com/mesonbuild/meson/issues/14346
RELOCATABLE_OPTION: '-Drelocatable=enabled'
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
script:
- !reference [deps-debian-nonreloc, script]
@ -406,8 +403,8 @@ gimp-debian:
MESON_DIST: 0
before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install"
#40min is enough only if no module was updated/rebuilt, we need more time in case of module bumps
timeout: 240m
#30min is enough only if no module was updated/rebuilt, we need more time in case of module bumps
timeout: 90m
deps-flatpak:
extends: .flatpak
@ -420,7 +417,7 @@ deps-flatpak:
- flatpak-builder.log
- babl-meson-log.txt
- gegl-meson-log.txt
expire_in: 4 hours
expire_in: 2 hours
gimp-flatpak:
extends: .flatpak
@ -456,7 +453,7 @@ gimp-flatpak:
variables:
SNAPCRAFT_BASE_VERSION: "8_core24"
RUNNER: x86_64_v3
timeout: 40m
timeout: 30m
deps-snap:
extends: .snap
@ -494,7 +491,7 @@ deps-snap:
- _build-$RUNNER.tar
- babl-meson-log.tar
- gegl-meson-log.tar
expire_in: 4 hours
expire_in: 2 hours
gimp-snap:
extends: .snap
@ -529,7 +526,7 @@ gimp-snap:
interruptible: true
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
- if: '($CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/ || $CI_MERGE_REQUEST_DESCRIPTION =~ /.*Package:Microsoft Store.*/) && $CI_JOB_NAME !~ /.*installer.*/'
- if: '($CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/ || $CI_MERGE_REQUEST_DESCRIPTION =~ /.*Package:Microsoft Store.*/) && $CI_JOB_NAME !~ /.*eol.*/ && $CI_JOB_NAME !~ /.*installer.*/'
interruptible: true
variables:
STORE_OPTION: '-Dms-store=true'
@ -540,12 +537,11 @@ gimp-snap:
- if: '($GIMP_CI_WIN_INSTALLER != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_WIN_INSTALLER.*/) && $CI_JOB_NAME !~ /.*store.*/'
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
- if: '($GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/) && $CI_JOB_NAME !~ /.*installer.*/'
- if: '($GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/) && $CI_JOB_NAME !~ /.*eol.*/ && $CI_JOB_NAME !~ /.*installer.*/'
variables:
STORE_OPTION: '-Dms-store=true'
- if: '($GIMP_CI_MESON_MSVC != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_MSVC.*/) && $CI_JOB_NAME !~ /.*installer.*/ && $CI_JOB_NAME !~ /.*store.*/ && $CI_JOB_NAME !~ /.*aarch64.*/'
- if: '($GIMP_CI_MESON_MSVC != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_MSVC.*/) && $CI_JOB_NAME !~ /.*installer.*/ && $CI_JOB_NAME !~ /.*store.*/ && $CI_JOB_NAME !~ /.*eol.*/ && $CI_JOB_NAME !~ /.*aarch64.*/'
variables:
MSYS_ROOT: ""
VCPKG_ROOT: "$CI_PROJECT_DIR/vcpkg"
WARN_AS_ERROR_ON_CI: '-Dwerror=true'
VARIANT: "-msvc"
@ -566,23 +562,23 @@ gimp-snap:
#meson.build forces non-relocatable .pc. See: https://github.com/mesonbuild/meson/issues/14346
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
before_script:
- $GIMP_PREFIX = "$PWD\_install-$(((Get-WmiObject Win32_ComputerSystem).SystemType).Split('-')[0].Trim().ToLower())"
- if ("$VARIANT" -eq '-msvc') { if (-not (Test-Path $env:VCPKG_ROOT)) { git clone --depth 1 https://github.com/microsoft/vcpkg; .\vcpkg\bootstrap-vcpkg.bat }; pip install --upgrade meson }
- $GIMP_PREFIX = "$PWD\_install-$(if (-not $env:MSYSTEM_PREFIX) { $(((Get-WmiObject Win32_ComputerSystem).SystemType).Split('-')[0].Trim().ToLower()) } else { $env:MSYSTEM_PREFIX })"
- if ("$VARIANT" -eq '-msvc') { if (-not (Test-Path $env:VCPKG_ROOT)) { git clone --depth 1 https://github.com/microsoft/vcpkg; .\vcpkg\bootstrap-vcpkg.bat }; pip install meson }
- if ("$VARIANT" -eq '-msvc') { $VSINSTALLDIR = $(vswhere -products * -latest -property installationPath); Import-Module "$VSINSTALLDIR\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"; Enter-VsDevShell -VsInstallPath "$VSINSTALLDIR" -SkipAutomaticLocation -DevCmdArguments "-arch=$(((Get-WmiObject Win32_ComputerSystem).SystemType).Split('-')[0].Trim().ToLower())" }
#40min is enough only on msys2 or if no vcpkg port was updated/rebuilt, we need more time in case of port bumps
timeout: 240m
#30min is enough only on msys2 or if no vcpkg port was updated/rebuilt, we need more time in case of port bumps
timeout: 150m
.win_environ: &WIN_ENVIRON
# See: https://testing.developer.gimp.org/core/setup/build/windows/#prepare-for-building
- Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):win_environ[collapsed=true]$([char]13)$([char]27)[0KPreparing build environment"
## Build-time vars
- $env:PKG_CONFIG_PATH = "$GIMP_PREFIX/lib/pkgconfig;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_HOST_TRIPLET/lib/pkgconfig;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_HOST_TRIPLET/share/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share/pkgconfig"
- $env:XDG_DATA_DIRS = "$GIMP_PREFIX/share;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_HOST_TRIPLET/share;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share"
- $env:PKG_CONFIG_PATH = "$GIMP_PREFIX/lib/pkgconfig;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_TRIPLET/lib/pkgconfig;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_TRIPLET/share/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share/pkgconfig"
- $env:XDG_DATA_DIRS = "$GIMP_PREFIX/share;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_TRIPLET/share;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share"
## Runtime vars
- $env:PATH = "$GIMP_PREFIX/bin;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_HOST_TRIPLET/bin;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/bin;$env:PATH"
- $env:GI_TYPELIB_PATH = "$GIMP_PREFIX/lib/girepository-1.0;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_HOST_TRIPLET/lib/girepository-1.0;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/girepository-1.0"
- $env:PATH = "$GIMP_PREFIX/bin;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_TRIPLET/bin;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/bin;$env:PATH"
- $env:GI_TYPELIB_PATH = "$GIMP_PREFIX/lib/girepository-1.0;$env:VCPKG_ROOT/installed/$env:VCPKG_DEFAULT_TRIPLET/lib/girepository-1.0;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/girepository-1.0"
## MSVC-specific vars
- if ($env:VCPKG_ROOT) { $env:CC='clang-cl'; $env:CXX='clang-cl'; $env:PKG_CONFIG="$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_HOST_TRIPLET\tools\pkgconf\pkgconf.exe"; $env:PATH="$((Get-ChildItem "$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_HOST_TRIPLET\tools" -Recurse -Filter *.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty DirectoryName -Unique) -join ';');$(Resolve-Path $env:VCPKG_ROOT\downloads\tools\perl\*.*\perl\bin -ErrorAction SilentlyContinue);$env:PATH"; $env:GIO_MODULE_DIR="$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_HOST_TRIPLET\plugins\glib-networking"; $env:LIBHEIF_PLUGIN_PATH="$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_HOST_TRIPLET\plugins\libheif" }
- if ($env:VCPKG_ROOT) { $env:CC='clang-cl'; $env:CXX='clang-cl'; $env:PKG_CONFIG="$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\pkgconf\pkgconf.exe"; $env:PATH="$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\glib;$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\gdk-pixbuf;$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\gettext\bin;$(Resolve-Path $env:VCPKG_ROOT\downloads\tools\perl\*.*\perl\bin -ErrorAction SilentlyContinue);$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\libxml2;$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\libxslt;$env:PATH"; $env:GIO_MODULE_DIR="$env:VCPKG_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\plugins\glib-networking" }
- Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):win_environ$([char]13)$([char]27)[0K"
deps-win:
@ -595,7 +591,7 @@ deps-win:
- _install-*/
- babl/_build-*/meson-logs/meson-log.txt
- gegl/_build-*/meson-logs/meson-log.txt
expire_in: 4 hours
expire_in: 2 hours
gimp-win:
extends: .win
@ -621,6 +617,35 @@ gimp-win:
expire_in: 2 days
## WINDOWS x86 legacy CI (native MSYS2) ##
.win-eol:
extends: .win
parallel:
matrix:
- RUNNER: [win32-ps]
variables:
MSYSTEM_PREFIX: mingw32
MINGW_PACKAGE_PREFIX: mingw-w64-i686
deps-win-eol:
extends: .win-eol
stage: !reference [deps-win, stage]
script:
- !reference [deps-win, script]
artifacts: !reference [deps-win, artifacts]
gimp-win-eol:
extends: .win-eol
needs: ["deps-win-eol"]
stage: !reference [gimp-win, stage]
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- $env:PATH = "C:/msys64/usr/bin;" + $env:PATH
- !reference [gimp-win, script]
artifacts: !reference [gimp-win, artifacts]
## macOS pipelines (MacPorts) ##
.macos-inhouse:
extends: .default
@ -634,27 +659,22 @@ gimp-win:
variables:
OPT_PREFIX: /opt/macports
DMG_OPTION: '-Ddmg=true'
- if: '($GIMP_CI_MESON_APPLECLANG != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_APPLECLANG.*/) && $CI_JOB_NAME !~ /.*x86_64.*/ && $CI_JOB_NAME !~ /.*dist-mac-.*/'
- if: '($GIMP_CI_MESON_APPLECLANG != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_APPLECLANG.*/) && $CI_JOB_NAME !~ /.*-part.*/ && $CI_JOB_NAME !~ /.*dist-mac-.*/'
variables:
OPT_PREFIX: /opt/homebrew
WARN_AS_ERROR_ON_CI: '-Dwerror=true'
VARIANT: -homebrew
parallel:
matrix:
- ARCH: [arm64, x86_64]
tags:
- macos
- marathon
variables:
ARCH: arm64
ORKA_RUNNER: tahoe-1
#meson.build forces non-relocatable .pc. See: https://github.com/mesonbuild/meson/issues/14346
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
before_script:
- export GIMP_PREFIX="$PWD/_install-$ARCH"
- export GIMP_PREFIX="$PWD/_install-$(uname -m)"
- export PATH="$OPT_PREFIX/bin:$PATH"
- if [ "$ARCH" = 'x86_64' ]; then softwareupdate --install-rosetta --agree-to-license; fi
#4h is enough only on arm64 or if no macports port was updated/rebuilt, we need more time in case of port bumps
timeout: 24h
timeout: 4h
.macos_environ: &MAC_ENVIRON
- printf "\e[0Ksection_start:`date +%s`:macos_environ[collapsed=true]\r\e[0KPreparing build environment\n"
@ -670,39 +690,36 @@ deps-macos-inhouse:
extends: .macos-inhouse
stage: dependencies
cache:
- key: $CI_PROJECT_NAMESPACE-$ARCH${VARIANT}
- key: $CI_PROJECT_NAMESPACE-$ARCH
unprotect: true
paths:
- macports-cached-$ARCH
script:
# Do not call sh since it is old bash on macOS, not the default zsh
- arch -${ARCH} zsh build/macos/1_build-deps-macports.sh
- zsh build/macos/1_build-deps-macports.sh
artifacts:
paths:
- _install-*
# The full build dir is needed due to its .o for .dSYM creation on next job
- babl/_build-*
- gegl/_build-*
expire_in: 4 hours
expire_in: 2 hours
gimp-macos-inhouse:
extends: .macos-inhouse
needs:
- job: deps-macos-inhouse
#to allow running Homebrew builds
optional: true
needs: ["deps-macos-inhouse"]
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
cache:
- key: $CI_PROJECT_NAMESPACE-$ARCH${VARIANT}
- key: $CI_PROJECT_NAMESPACE-$ARCH
unprotect: true
paths:
- macports-cached-$ARCH
policy: pull
script:
# Do not call sh since it is old bash on macOS, not the default zsh
- arch -${ARCH} zsh build/macos/2_build-gimp-macports.sh
- zsh build/macos/2_build-gimp-macports.sh
artifacts:
paths:
- gimp-*.app
@ -757,6 +774,7 @@ file-plug-in-tests:
reports:
junit: "_log/import-tests.xml"
expire_in: 2 days
timeout: 30m
meson-health:
extends: .default
@ -794,7 +812,6 @@ branches-check:
extends: .default
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
interruptible: true
stage: analysis
variables:
GIT_DEPTH: "0"
@ -821,33 +838,6 @@ cppcheck:
- report/
expire_in: 8 days
issue-bot:
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && ($GIMP_CI_MESON_CLANG != null || $GIMP_CI_MESON_MSVC != null || $GIMP_CI_MESON_APPLECLANG != null)
when: on_failure
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && ($GIMP_CI_RASTER_ICONS != null || $GIMP_CI_CPPCHECK != null)
when: on_failure
needs:
- job: gimp-debian-nonreloc
optional: true
- job: gimp-win
optional: true
- job: gimp-macos-inhouse
optional: true
- job: cppcheck
optional: true
stage: analysis
image: registry.gitlab.com/gitlab-org/distribution/issue-bot:latest
variables:
ISSUE_BOT_API_TOKEN: $WILBER_BOT
script:
- LATEST_API_TOKEN=20270330
- printf "(INFO) Token expire date is $(date -d "$LATEST_API_TOKEN" +"%x")\n"
- if [ "$(date +%Y%m%d)" -ge "$LATEST_API_TOKEN" ]; then
printf '\033[31m(ERROR)\033[0m API token for bot expired. Please ask the maintainer to issue a new one then save its value on WILBER_BOT protected var.\n';
exit 1;
fi
- /issue-bot
## Ready-to-distribute ##
@ -948,8 +938,7 @@ include:
project: GNOME/citemplates
file: flatpak/flatpak_ci_initiative.yml
#flatpak_ci_initiative.yml is extremely pervasive. See: https://gitlab.gnome.org/GNOME/citemplates/-/issues/35
#keep 'ref:' synced with submission section of build/linux/flatpak/3_dist-gimp-flatpakbuilder.sh
ref: b8e6f8f5a6d2f39b2852d165cc2ab3550ac9e3fb
ref: 42fbc2526a7680b6a4f284a210e63e3973ea6dae
dist-flatpak-weekly:
extends:
@ -994,6 +983,7 @@ dist-installer-weekly:
- job: gimp-win
#to allow running outside 'GNOME/gimp' namespace (on MRs)
optional: true
- job: gimp-win-eol
stage: distribution
tags:
- win32-ps

View file

@ -212,7 +212,7 @@ help in that regard:
15. GObject Introspection requires the following dependencies to be
built and installed with introspection as well: babl, cairo,
GdkPixbuf, GEGL, GIO, GLib, GObject, GTK and Gexiv2.
GdkPixbuf, GEGL, GIO, GLib, GObject and GTK.
16. Windows builds can now generate backtrace logs upon a crash.
The logs will be available in: %APPDATA%\GIMP\@GIMP_APP_VERSION@\CrashLog\
@ -282,8 +282,7 @@ help in that regard:
mypaint-brushes-2.0
pangocairo @PANGO_REQUIRED_VERSION@
poppler-data @POPPLER_DATA_REQUIRED_VERSION@
Pycairo
PyGObject @PYGOBJECT_REQUIRED_VERSION@
PyGObject
Python @PYTHON3_REQUIRED_VERSION@
zlib
@ -311,6 +310,7 @@ help in that regard:
openexr @OPENEXR_REQUIRED_VERSION@ OpenEXR
OpenJPEG @OPENJPEG_REQUIRED_VERSION@ JPEG 2000
qoi - QOI
webkit @WEBKITGTK_REQUIRED_VERSION@ Help browser & webpage
vala - Vala plug-ins
24. Summary of optional runtime dependencies:

1179
NEWS

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -65,19 +65,8 @@ main (int argc,
if (AttachConsole (ATTACH_PARENT_PROCESS) != 0 && ! g_getenv ("TERM") && ! g_getenv ("SHELL"))
{
/* 'r' is needed to prevent interleaving and '+' to support colors */
#ifndef _UCRT
freopen ("CONOUT$", "r+", stdout);
freopen ("CONOUT$", "r+", stderr);
#else
FILE* fileOut;
FILE* fileErr;
errno_t errOut = freopen_s (&fileOut, "CONOUT$", "r+", stdout);
errno_t errErr = freopen_s (&fileErr, "CONOUT$", "r+", stderr);
if (errOut != 0 || errErr != 0)
g_warning ("Failed to redirect streams to CONOUT$. stdout: %d, stderr: %d", errOut, errErr);
#endif
_flushall ();
{

View file

@ -37,15 +37,11 @@
#include "core/gimplayer.h"
#include "core/gimplayer-new.h"
#include "core/gimplayermask.h"
#include "core/gimplinklayer.h"
#include "core/gimplist.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "path/gimppath-import.h"
#include "path/gimpvectorlayer.h"
#include "text/gimptextlayer.h"
#include "widgets/gimpclipboard.h"
#include "widgets/gimphelp-ids.h"
@ -590,60 +586,7 @@ edit_fill_cmd_callback (GimpAction *action,
gimp_fill_options_get_undo_desc (options));
for (iter = drawables; iter; iter = iter->next)
{
/* Skip layers that can't be filled, like pixel-locked layers */
if (gimp_item_is_content_locked (GIMP_ITEM (iter->data), NULL) ||
gimp_item_is_link_layer (GIMP_ITEM (iter->data)))
continue;
if (gimp_item_is_text_layer (iter->data) ||
gimp_item_is_vector_layer (iter->data))
{
GimpPattern *pattern = NULL;
GeglColor *color = NULL;
if (gimp_fill_options_get_style (options) == GIMP_FILL_STYLE_FG_COLOR)
color = gimp_context_get_foreground (GIMP_CONTEXT (options));
else if (gimp_fill_options_get_style (options) == GIMP_FILL_STYLE_BG_COLOR)
color = gimp_context_get_background (GIMP_CONTEXT (options));
else
pattern = gimp_context_get_pattern (GIMP_CONTEXT (options));
if (color)
{
if (gimp_item_is_vector_layer (iter->data))
{
gimp_vector_layer_set (GIMP_VECTOR_LAYER (iter->data),
NULL,
"fill-style",
GIMP_CUSTOM_STYLE_SOLID_COLOR,
"fill-color",
color, NULL);
gimp_vector_layer_refresh (iter->data);
}
else
{
gimp_text_layer_set (iter->data, NULL, "color", color,
NULL);
}
}
else if (pattern &&
gimp_item_is_vector_layer (iter->data))
{
gimp_vector_layer_set (GIMP_VECTOR_LAYER (iter->data), NULL,
"fill-style",
GIMP_CUSTOM_STYLE_PATTERN,
"fill-pattern",
pattern,
NULL);
gimp_vector_layer_refresh (iter->data);
}
}
else
{
gimp_drawable_edit_fill (iter->data, options, NULL);
}
}
gimp_drawable_edit_fill (iter->data, options, NULL);
gimp_image_undo_group_end (image);
gimp_image_flush (image);

View file

@ -76,7 +76,7 @@ gradient_editor_left_color_type_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, &left, NULL);
if (gradient &&
(gint) color_type >= 0 &&
color_type >= 0 &&
color_type !=
gimp_gradient_segment_get_left_color_type (gradient, left))
{
@ -197,7 +197,7 @@ gradient_editor_right_color_type_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, NULL, &right);
if (gradient &&
(gint) color_type >= 0 &&
color_type >= 0 &&
color_type !=
gimp_gradient_segment_get_right_color_type (gradient, right))
{

View file

@ -321,15 +321,15 @@ app_run (const gchar *full_prog_name,
if (gimp->be_verbose)
g_print ("EXIT: %s\n", G_STRFUNC);
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, TRUE);
g_clear_object (&app);
gimp_gegl_exit (gimp);
errors_exit ();
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, TRUE);
g_object_unref (gimp);
gimp_debug_instances ();

View file

@ -181,9 +181,8 @@ dump_gimprc_system (GimpConfig *rc,
}
else if (! strcmp (prop_spec->name, "mypaint-brush-path"))
{
gchar *path = g_strdup_printf ("%s%s"
gchar *path = g_strdup_printf ("@mypaint_brushes_dir@%s"
"~/.mypaint/brushes",
MYPAINT_BRUSHES_DIR,
G_SEARCHPATH_SEPARATOR_S);
gimp_config_writer_open (writer, "mypaint-brush-path");
@ -216,7 +215,7 @@ static const gchar man_page_header[] =
".B gimprc\n"
"file is a configuration file read by GIMP when it starts up. There\n"
"are two of these: one system-wide one stored in\n"
"%s/gimprc and a per-user %s/gimprc\n"
"@gimpsysconfdir@/gimprc and a per-user @manpage_gimpdir@/gimprc\n"
"which may override system settings.\n"
"\n"
"Comments are introduced by a hash sign (#), and continue until the end\n"
@ -258,22 +257,22 @@ static const gchar *man_page_path =
".TP\n"
".I gimp_dir\n"
"The personal gimp directory which is set to the value of the environment\n"
"variable GIMP3_DIRECTORY or to %s.\n"
"variable GIMP3_DIRECTORY or to @manpage_gimpdir@.\n"
".TP\n"
".I gimp_data_dir\n"
"Base for paths to shareable data, which is set to the value of the\n"
"environment variable GIMP3_DATADIR or to the compiled-in default value\n"
"%s.\n"
"@gimpdatadir@.\n"
".TP\n"
".I gimp_plug_in_dir\n"
"Base to paths for architecture-specific plug-ins and modules, which is set\n"
"to the value of the environment variable GIMP3_PLUGINDIR or to the\n"
"compiled-in default value %s.\n"
"compiled-in default value @gimpplugindir@.\n"
".TP\n"
".I gimp_sysconf_dir\n"
"Path to configuration files, which is set to the value of the environment\n"
"variable GIMP3_SYSCONFDIR or to the compiled-in default value \n"
"%s.\n"
"@gimpsysconfdir@.\n"
".TP\n"
".I gimp_cache_dir\n"
"Path to cached files, which is set to the value of the environment\n"
@ -287,10 +286,10 @@ static const gchar *man_page_path =
static const gchar man_page_footer[] =
".SH FILES\n"
".TP\n"
".I %s/gimprc\n"
".I @gimpsysconfdir@/gimprc\n"
"System-wide configuration file\n"
".TP\n"
".I %s/gimprc\n"
".I @manpage_gimpdir@/gimprc\n"
"Per-user configuration file\n"
"\n"
".SH \"SEE ALSO\"\n"
@ -308,9 +307,7 @@ dump_gimprc_manpage (GimpConfig *rc,
guint i;
g_output_stream_printf (output, NULL, NULL, NULL,
man_page_header,
GIMPSYSCONFDIR,
"$XDG_CONFIG_HOME" G_DIR_SEPARATOR_S GIMPDIR G_DIR_SEPARATOR_S GIMP_USER_VERSION);
"%s", man_page_header);
klass = G_OBJECT_GET_CLASS (rc);
property_specs = g_object_class_list_properties (klass, &n_property_specs);
@ -356,9 +353,8 @@ dump_gimprc_manpage (GimpConfig *rc,
}
else if (! strcmp (prop_spec->name, "mypaint-brush-path"))
{
gchar *path = g_strdup_printf ("%s%s"
gchar *path = g_strdup_printf ("@mypaint_brushes_dir@%s"
"~/.mypaint/brushes",
MYPAINT_BRUSHES_DIR,
G_SEARCHPATH_SEPARATOR_S);
gimp_config_writer_open (writer, "mypaint-brush-path");
@ -393,15 +389,9 @@ dump_gimprc_manpage (GimpConfig *rc,
g_free (property_specs);
g_output_stream_printf (output, NULL, NULL, NULL,
man_page_path,
"$XDG_CONFIG_HOME" G_DIR_SEPARATOR_S GIMPDIR G_DIR_SEPARATOR_S GIMP_USER_VERSION,
GIMPDATADIR,
GIMPPLUGINDIR,
GIMPSYSCONFDIR);
"%s", man_page_path);
g_output_stream_printf (output, NULL, NULL, NULL,
man_page_footer,
GIMPSYSCONFDIR,
"$XDG_CONFIG_HOME" G_DIR_SEPARATOR_S GIMPDIR G_DIR_SEPARATOR_S GIMP_USER_VERSION);
"%s", man_page_footer);
}

View file

@ -198,8 +198,8 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_CONFIG_PROP_STRING (object_class, PROP_PREV_LANGUAGE,
"prev-language",
"Language used in previous run",
PREV_LANGUAGE_BLURB,
NULL, GIMP_PARAM_STATIC_STRINGS);
NULL, NULL,
GIMP_PARAM_STATIC_STRINGS);
/* This is the version of the config files, which must map to the
* version of GIMP. It is used right now only to detect the last run
@ -682,7 +682,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_CONFIG_PROP_STRING (object_class, PROP_LAST_RELEASE_COMMENT,
"last-release-comment",
"Comment for last release",
LAST_RELEASE_COMMENT_BLURB,
LAST_KNOWN_RELEASE_BLURB,
NULL,
GIMP_PARAM_STATIC_STRINGS);

View file

@ -525,7 +525,7 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_SHOW_WELCOME_DIALOG,
"show-welcome-dialog",
"Show Welcome Dialog each time",
SHOW_WELCOME_DIALOG_BLURB, TRUE,
NULL, TRUE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
GIMP_PARAM_STATIC_STRINGS);

View file

@ -20,15 +20,6 @@ _("When enabled, an image will become the active image when its image " \
#define DYNAMICS_PATH_BLURB \
_("Sets the dynamics search path.")
#define PREV_LANGUAGE_BLURB \
_("Specifies the language the user interface was previously displayed in.")
#define LAST_RELEASE_COMMENT_BLURB \
_("The comment for the last known release.")
#define SHOW_WELCOME_DIALOG_BLURB \
_("Show a welcome dialog when GIMP starts.")
#define DYNAMICS_PATH_WRITABLE_BLURB ""
#define TOOL_PRESET_PATH_BLURB \
@ -82,7 +73,7 @@ _("Context-dependent mouse pointers are helpful. They are enabled by " \
#define DEFAULT_TOOL_PRESET_BLURB \
"Specify a default tool preset. The tool preset is searched for in the " \
"specified tool presets path."
"specified tool prests path."
#define CUSTOM_TITLE_BAR_BLURB \
_("Merge menu and title bar (client-side decoration)")

View file

@ -1224,7 +1224,6 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_EDIT_PASTE, "GIMP_UNDO_GROUP_EDIT_PASTE", "group-edit-paste" },
{ GIMP_UNDO_GROUP_EDIT_CUT, "GIMP_UNDO_GROUP_EDIT_CUT", "group-edit-cut" },
{ GIMP_UNDO_GROUP_TEXT, "GIMP_UNDO_GROUP_TEXT", "group-text" },
{ GIMP_UNDO_GROUP_VECTOR, "GIMP_UNDO_GROUP_VECTOR", "group-vector" },
{ GIMP_UNDO_GROUP_TRANSFORM, "GIMP_UNDO_GROUP_TRANSFORM", "group-transform" },
{ GIMP_UNDO_GROUP_PAINT, "GIMP_UNDO_GROUP_PAINT", "group-paint" },
{ GIMP_UNDO_GROUP_PARASITE_ATTACH, "GIMP_UNDO_GROUP_PARASITE_ATTACH", "group-parasite-attach" },
@ -1340,7 +1339,6 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_EDIT_PASTE, NC_("undo-type", "Paste"), NULL },
{ GIMP_UNDO_GROUP_EDIT_CUT, NC_("undo-type", "Cut"), NULL },
{ GIMP_UNDO_GROUP_TEXT, NC_("undo-type", "Text"), NULL },
{ GIMP_UNDO_GROUP_VECTOR, NC_("undo-type", "Vector"), NULL },
{ GIMP_UNDO_GROUP_TRANSFORM, NC_("undo-type", "Transform"), NULL },
{ GIMP_UNDO_GROUP_PAINT, NC_("undo-type", "Paint"), NULL },
{ GIMP_UNDO_GROUP_PARASITE_ATTACH, NC_("undo-type", "Attach parasite"), NULL },

View file

@ -571,7 +571,6 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_GROUP_EDIT_PASTE, /*< desc="Paste" >*/
GIMP_UNDO_GROUP_EDIT_CUT, /*< desc="Cut" >*/
GIMP_UNDO_GROUP_TEXT, /*< desc="Text" >*/
GIMP_UNDO_GROUP_VECTOR, /*< desc="Vector" >*/
GIMP_UNDO_GROUP_TRANSFORM, /*< desc="Transform" >*/
GIMP_UNDO_GROUP_PAINT, /*< desc="Paint" >*/
GIMP_UNDO_GROUP_PARASITE_ATTACH, /*< desc="Attach parasite" >*/

View file

@ -30,7 +30,7 @@
/* former base/ defines */
#define MAX_CHANNELS 5
#define MAX_CHANNELS 4
#define RED 0
#define GREEN 1

View file

@ -38,10 +38,6 @@
#include <io.h>
#endif
#ifdef __APPLE__
#include <spawn.h>
#endif
#include "core-types.h"
#include "gimp-spawn.h"
@ -171,7 +167,7 @@ gimp_spawn_async (gchar **argv,
g_return_val_if_fail (argv != NULL, FALSE);
g_return_val_if_fail (argv[0] != NULL, FALSE);
#if defined(HAVE_VFORK) && !defined(__APPLE__)
#ifdef HAVE_VFORK
if (flags == (G_SPAWN_LEAVE_DESCRIPTORS_OPEN |
G_SPAWN_DO_NOT_REAP_CHILD |
G_SPAWN_CHILD_INHERITS_STDIN))
@ -236,36 +232,7 @@ gimp_spawn_async (gchar **argv,
return TRUE;
}
}
#elif defined(__APPLE__)
if (flags == (G_SPAWN_LEAVE_DESCRIPTORS_OPEN |
G_SPAWN_DO_NOT_REAP_CHILD |
G_SPAWN_CHILD_INHERITS_STDIN))
{
pid_t pid;
int status;
extern char **environ;
char **child_env = envp ? envp : environ;
/* posix_spawn combines fork and exec */
status = posix_spawn (&pid, argv[0], NULL, NULL, argv, child_env);
if (status != 0)
{
g_set_error (error,
G_SPAWN_ERROR,
exec_err_to_g_error (status),
_("Failed to execute child process “%s” (%s)"),
argv[0],
g_strerror (status));
return FALSE;
}
if (child_pid) *child_pid = pid;
return TRUE;
}
#endif
#endif /* HAVE_VFORK */
return g_spawn_async (NULL, argv, envp, flags, NULL, NULL, child_pid, error);
}

View file

@ -398,7 +398,6 @@ user_install_detect_old (GimpUserInstall *install,
migrate = g_file_test (snap_dir, G_FILE_TEST_IS_DIR);
if (! migrate &&
g_getenv ("SNAP") != NULL &&
g_file_test (g_getenv ("SNAP"), G_FILE_TEST_IS_DIR) &&
g_getenv ("SNAP_USER_DATA") != NULL)
{

View file

@ -165,17 +165,17 @@ gimp_get_default_language (const gchar *category)
#ifdef G_OS_WIN32
p = (gchar *) g_getenv ("LC_ALL");
p = getenv ("LC_ALL");
if (p != NULL)
lang = g_strdup (p);
else
{
p = (gchar *) g_getenv ("LANG");
p = getenv ("LANG");
if (p != NULL)
lang = g_strdup (p);
else
{
p = (gchar *) g_getenv (category);
p = getenv (category);
if (p != NULL)
lang = g_strdup (p);
else
@ -428,11 +428,7 @@ unescape_gstring (GString *string)
{
gchar buf[8];
char_str (l, buf);
#ifndef _UCRT
strcpy (to, buf);
#else
strcpy_s (to, 8, buf);
#endif
to += strlen (buf) - 1;
from = end;
}

View file

@ -28,8 +28,6 @@
#include "core-types.h"
#include "gimpcoreapp.h"
#include "config/gimprc.h"
#include "gegl/gimp-babl.h"
@ -1275,9 +1273,8 @@ gimp_image_opened (Gimp *gimp,
}
GFile *
gimp_get_temp_file (Gimp *gimp,
const gchar *extension,
GError **error)
gimp_get_temp_file (Gimp *gimp,
const gchar *extension)
{
static gint id = 0;
static gint pid;
@ -1296,24 +1293,13 @@ gimp_get_temp_file (Gimp *gimp,
basename = g_strdup_printf ("gimp-temp-%d%d", pid, id++);
dir = gimp_file_new_for_config_path (GIMP_GEGL_CONFIG (gimp->config)->temp_path,
error);
if (dir == NULL)
{
g_free (basename);
return NULL;
}
NULL);
if (! g_file_query_exists (dir, NULL))
{
/* Try to make the temp directory if it doesn't exist.
* Ignore any error.
*/
if (! g_file_make_directory_with_parents (dir, NULL, error))
{
g_free (basename);
g_object_unref (dir);
return NULL;
}
g_file_make_directory_with_parents (dir, NULL, NULL);
}
file = g_file_get_child (dir, basename);
g_free (basename);
@ -1370,20 +1356,9 @@ gimp_exit_idle_cleanup_stray_images (Gimp *gimp)
{
GimpImage *image = image_iter->data;
/* Plug-in developers are expected to free the images they
* created, unless they add a display (while in GUI mode), in
* which case the user gets ownership of the image and it will be
* freed as any other image by the GUI.
* On the other hand, images created from command lines are very
* likely to still exist when the software exits, if it was closed
* by the --quit argument, or run without an interface. This is
* normal use case.
*/
if (! gimp_image_get_from_command_line (image) ||
(! gimp->no_interface && ! gimp_core_app_get_quit (GIMP_CORE_APP (gimp->app))))
/* TODO: localize after string freeze. */
g_printerr ("INFO: a stray image seems to have been left around by a plug-in: \"%s\"\n",
gimp_image_get_display_name (image));
/* TODO: localize after string freeze. */
g_printerr ("INFO: a stray image seems to have been left around by a plug-in: \"%s\"",
gimp_image_get_display_name (image));
g_object_unref (image);
}

View file

@ -256,8 +256,7 @@ void gimp_image_opened (Gimp *gimp,
GFile *file);
GFile * gimp_get_temp_file (Gimp *gimp,
const gchar *extension,
GError **error);
const gchar *extension);
GimpDataFactory *
gimp_get_data_factory (Gimp *gimp,

View file

@ -237,7 +237,7 @@ gimp_backtrace_exception_handler (PEXCEPTION_POINTERS info)
if (info->ExceptionRecord != NULL &&
info->ExceptionRecord->ExceptionCode == EXCEPTION_SET_THREAD_NAME &&
info->ExceptionRecord->NumberParameters *
info->ExceptionRecord->NumberParameters *
sizeof (ULONG_PTR) == sizeof (THREADNAME_INFO))
{
THREADNAME_INFO name_info;
@ -644,11 +644,7 @@ utf8_copy_sized (char *dest,
if (size == 0)
return;
#ifndef _UCRT
strncpy (dest, src, size);
#else
strncpy_s (dest, sizeof (dest), src, size);
#endif
if (dest[size - 1] != 0)
{

View file

@ -841,9 +841,6 @@ gimp_brush_transform_blur (GimpTempBuf *buf,
if (rw <= 0 || rh <= 0)
return;
/* Making sure we have enough elements for acc array. */
g_return_if_fail (components <= MAX_CHANNELS);
sums = g_new (Sums, width * height * components);
gegl_parallel_distribute_range (
@ -869,7 +866,7 @@ gimp_brush_transform_blur (GimpTempBuf *buf,
gint weighted_sum;
gint leading_sum;
gint leading_weighted_sum;
} acc[MAX_CHANNELS];
} acc[components];
memset (acc, 0, sizeof (acc));
@ -949,7 +946,7 @@ gimp_brush_transform_blur (GimpTempBuf *buf,
gfloat weighted_sum;
gint leading_sum;
gint trailing_sum;
} acc[MAX_CHANNELS];
} acc[components];
memset (acc, 0, sizeof (acc));

View file

@ -142,6 +142,8 @@ static void gimp_channel_convert_type (GimpDrawable *drawable,
gboolean push_undo,
GimpProgress *progress);
static void gimp_channel_invalidate_boundary (GimpDrawable *drawable);
static void gimp_channel_get_active_components (GimpDrawable *drawable,
gboolean *active);
static void gimp_channel_set_buffer (GimpDrawable *drawable,
gboolean push_undo,
@ -272,6 +274,7 @@ gimp_channel_class_init (GimpChannelClass *klass)
drawable_class->convert_type = gimp_channel_convert_type;
drawable_class->invalidate_boundary = gimp_channel_invalidate_boundary;
drawable_class->get_active_components = gimp_channel_get_active_components;
drawable_class->set_buffer = gimp_channel_set_buffer;
klass->boundary = gimp_channel_real_boundary;
@ -940,6 +943,15 @@ gimp_channel_invalidate_boundary (GimpDrawable *drawable)
channel->bounds_known = FALSE;
}
static void
gimp_channel_get_active_components (GimpDrawable *drawable,
gboolean *active)
{
/* Make sure that the alpha channel is not valid. */
active[GRAY] = TRUE;
active[ALPHA_G] = FALSE;
}
static void
gimp_channel_set_buffer (GimpDrawable *drawable,
gboolean push_undo,

View file

@ -48,7 +48,6 @@
#include "gimpdrawablefilter.h"
#include "gimpdrawablefiltermask.h"
#include "gimpfilterstack.h"
#include "gimpgrouplayer.h"
#include "gimpimage.h"
#include "gimpimage-colormap.h"
#include "gimpimage-undo-push.h"
@ -323,6 +322,7 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
klass->estimate_memsize = gimp_drawable_real_estimate_memsize;
klass->update_all = gimp_drawable_real_update_all;
klass->invalidate_boundary = NULL;
klass->get_active_components = NULL;
klass->get_active_mask = gimp_drawable_real_get_active_mask;
klass->supports_alpha = gimp_drawable_real_supports_alpha;
klass->convert_type = gimp_drawable_real_convert_type;
@ -1033,24 +1033,21 @@ gimp_drawable_real_set_buffer (GimpDrawable *drawable,
old_has_alpha = gimp_drawable_has_alpha (drawable);
}
if (! GIMP_IS_GROUP_LAYER (drawable) && (extent->x != 0 || extent->y != 0))
if (extent->x != 0 || extent->y != 0)
{
/* Drawable buffers are always stored with a (0, 0) origin. When
* setting a buffer with a different origin, we will assume we
* instead want to update the offset a bit.
* This may happen for instance when merging filters which may
* render in negative coordinates.
*
* The only exception to this is group layers. Group layer's
* boundaries will be determined by children layers, but the
* render may extend outside the boundaries (if children have
* effects).
*/
buffer = g_object_new (GEGL_TYPE_BUFFER,
"source", buffer,
"shift-x", extent->x,
"shift-y", extent->y,
NULL);
GeglBuffer *buffer2;
GeglRectangle extent2 = { 0, 0, extent->width, extent->height };
buffer2 = gegl_buffer_new (&extent2, gegl_buffer_get_format (buffer));
gimp_gegl_buffer_copy (buffer, extent, GEGL_ABYSS_NONE, buffer2, &extent2);
buffer = buffer2;
free_buffer = TRUE;
}
@ -1066,10 +1063,7 @@ gimp_drawable_real_set_buffer (GimpDrawable *drawable,
"buffer", gimp_drawable_get_buffer (drawable),
NULL);
if (GIMP_IS_GROUP_LAYER (drawable))
gimp_item_set_offset (item, bounds->x, bounds->y);
else
gimp_item_set_offset (item, bounds->x + extent->x, bounds->y + extent->y);
gimp_item_set_offset (item, bounds->x + extent->x, bounds->y + extent->y);
gimp_item_set_size (item,
bounds->width ? bounds->width :
gegl_buffer_get_width (buffer),
@ -1363,6 +1357,21 @@ gimp_drawable_invalidate_boundary (GimpDrawable *drawable)
drawable_class->invalidate_boundary (drawable);
}
void
gimp_drawable_get_active_components (GimpDrawable *drawable,
gboolean *active)
{
GimpDrawableClass *drawable_class;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (active != NULL);
drawable_class = GIMP_DRAWABLE_GET_CLASS (drawable);
if (drawable_class->get_active_components)
drawable_class->get_active_components (drawable, active);
}
GimpComponentMask
gimp_drawable_get_active_mask (GimpDrawable *drawable)
{

View file

@ -60,6 +60,8 @@ struct _GimpDrawableClass
gint height);
void (* update_all) (GimpDrawable *drawable);
void (* invalidate_boundary) (GimpDrawable *drawable);
void (* get_active_components) (GimpDrawable *drawable,
gboolean *active);
GimpComponentMask (* get_active_mask) (GimpDrawable *drawable);
gboolean (* supports_alpha) (GimpDrawable *drawable);
void (* convert_type) (GimpDrawable *drawable,
@ -133,6 +135,8 @@ void gimp_drawable_update_all (GimpDrawable *drawa
void gimp_drawable_filters_changed (GimpDrawable *drawable);
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
void gimp_drawable_get_active_components (GimpDrawable *drawable,
gboolean *active);
GimpComponentMask gimp_drawable_get_active_mask (GimpDrawable *drawable);
gboolean gimp_drawable_supports_alpha (GimpDrawable *drawable);

View file

@ -89,13 +89,13 @@ gimp_drawable_undo_class_init (GimpDrawableUndoClass *klass)
g_object_class_install_property (object_class, PROP_X,
g_param_spec_int ("x", NULL, NULL,
-GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE, 0,
0, GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_Y,
g_param_spec_int ("y", NULL, NULL,
-GIMP_MAX_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE, 0,
0, GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
}

View file

@ -135,7 +135,6 @@ gimp_gradient_load (GimpContext *context,
gint right_color_type;
gdouble left_rgba[4];
gdouble right_rgba[4];
gint n_matched;
seg = gimp_gradient_segment_new ();
@ -176,16 +175,9 @@ gimp_gradient_load (GimpContext *context,
gegl_color_set_pixel (seg->left_color, babl_format ("R'G'B'A double"), left_rgba);
gegl_color_set_pixel (seg->right_color, babl_format ("R'G'B'A double"), right_rgba);
#ifndef _UCRT
n_matched = sscanf (end, "%d %d %d %d",
&type, &color,
&left_color_type, &right_color_type);
#else
n_matched = sscanf_s (end, "%d %d %d %d",
&type, &color,
&left_color_type, &right_color_type);
#endif
switch (n_matched)
switch (sscanf (end, "%d %d %d %d",
&type, &color,
&left_color_type, &right_color_type))
{
case 4:
seg->left_color_type = (GimpGradientColor) left_color_type;

View file

@ -37,13 +37,12 @@
#include "gimp-atomic.h"
#include "gimp-parallel.h"
#include "gimpasync.h"
#include "gimpchannel.h"
#include "gimpdrawable.h"
#include "gimphistogram.h"
#include "gimpimage.h"
#include "gimpwaitable.h"
#define MAX_N_COMPONENTS 4
#define N_DERIVED_CHANNELS 2
#define PIXELS_PER_THREAD \
@ -145,7 +144,7 @@ gimp_histogram_class_init (GimpHistogramClass *klass)
g_object_class_install_property (object_class, PROP_N_COMPONENTS,
g_param_spec_int ("n-components", NULL, NULL,
0, MAX_CHANNELS, 0,
0, MAX_N_COMPONENTS, 0,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_N_BINS,
@ -1282,29 +1281,19 @@ gimp_histogram_calculate_async_callback (GimpAsync *async,
guint
gimp_histogram_unique_colors (GimpDrawable *drawable)
{
GimpImage *image;
const Babl *format;
guint bpp;
GeglBufferIterator *iter;
GHashTable *hash_table;
guint uniques = 0;
gboolean selection_empty;
GeglRectangle area;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0);
image = gimp_item_get_image (GIMP_ITEM (drawable));
format = gimp_drawable_get_format (drawable);
bpp = babl_format_get_bytes_per_pixel (format);
selection_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
if (! selection_empty)
gimp_item_mask_intersect (GIMP_ITEM (drawable), &area.x, &area.y,
&area.width, &area.height);
iter = gegl_buffer_iterator_new (gimp_drawable_get_buffer (drawable),
selection_empty ? NULL : &area,
0, format,
NULL, 0, format,
GEGL_ACCESS_READ, GEGL_ABYSS_NONE, 1);

View file

@ -993,18 +993,19 @@ gimp_image_convert_profile_colormap (GimpImage *image,
GimpProgress *progress)
{
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
/*GimpColorTransformFlags flags = 0;*/
GimpColorTransformFlags flags = 0;
GimpPalette *palette;
const Babl *space;
const Babl *format;
/* TODO: current implementation ignores the black point compensation
* choice because babl doesn't have BCP support yet.
* Previous code was using gimp_color_transform_new() which used
* LittleCMS directly instead.
* This should be fixed.
if (bpc)
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION; */
/* TODO: current implementation ignores the black point compensation
* choice because babl doesn't have BCP support yet.
* Previous code was using gimp_color_transform_new() which used
* LittleCMS directly instead.
* This should be fixed.
*/
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
palette = gimp_image_get_colormap_palette (image);
space = gimp_image_get_layer_space (image);

View file

@ -22,8 +22,6 @@
#include "core-types.h"
#include "path/gimpvectorlayer.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpguide.h"
@ -122,9 +120,6 @@ gimp_image_crop (GimpImage *image,
list = g_list_next (list);
if (gimp_item_is_vector_layer (item))
continue;
gimp_item_translate (item, -x, -y, TRUE);
if (crop_layers && ! gimp_item_is_content_locked (item, NULL))

View file

@ -336,11 +336,6 @@ gimp_image_duplicate_paths (GimpImage *image,
GimpPath *path = list->data;
GimpPath *new_path;
/* If the path is attached to a vector layer, it will be
* duplicated already */
if (gimp_path_attached_to_vector_layer (path, image))
continue;
new_path = GIMP_PATH (gimp_image_duplicate_item (GIMP_ITEM (path),
new_image));

View file

@ -24,8 +24,6 @@
#include "core-types.h"
#include "path/gimpvectorlayer.h"
#include "gimp.h"
#include "gimpchannel.h"
#include "gimpcontainer.h"
@ -236,10 +234,6 @@ gimp_image_flip_full (GimpImage *image,
while ((item = gimp_object_queue_pop (queue)))
{
gboolean clip = FALSE;
/* Non-rasterized vector layers will be transformed when their path is */
if (gimp_item_is_vector_layer (item))
continue;
if (GIMP_IS_CHANNEL (item))
clip = clip_result;

View file

@ -148,8 +148,6 @@ struct _GimpImagePrivate
/* Signal emission accumulator */
GimpImageFlushAccumulator flush_accum;
gboolean from_command_line;
};
#define GIMP_IMAGE_GET_PRIVATE(image) (((GimpImage *) (image))->priv)

View file

@ -42,8 +42,6 @@
#include "text/gimptextlayer.h"
#include "path/gimpvectorlayer.h"
#include "gimp-intl.h"
@ -117,9 +115,6 @@ gimp_image_resize_with_layers (GimpImage *image,
{
GimpItem *item = list->data;
if (gimp_item_is_vector_layer (item))
continue;
gimp_item_translate (item, offset_x, offset_y, TRUE);
}

View file

@ -44,7 +44,6 @@
#include "gimpsamplepoint.h"
#include "path/gimppath.h"
#include "path/gimpvectorlayer.h"
static void gimp_image_rotate_item_offset (GimpImage *image,
@ -139,10 +138,6 @@ gimp_image_rotate (GimpImage *image,
gint off_x;
gint off_y;
/* Non-rasterized vector layers will be rotated when their path is */
if (gimp_item_is_vector_layer (item))
continue;
gimp_item_get_offset (item, &off_x, &off_y);
gimp_item_rotate (item, context, rotate_type, center_x, center_y, FALSE);

View file

@ -22,8 +22,6 @@
#include "core-types.h"
#include "path/gimpvectorlayer.h"
#include "gimp.h"
#include "gimpcontainer.h"
#include "gimpguide.h"
@ -108,10 +106,6 @@ gimp_image_scale (GimpImage *image,
/* Scale all layers, channels (including selection mask), and paths */
while ((item = gimp_object_queue_pop (queue)))
{
/* Non-rasterized vector layers will be transformed when their path is */
if (gimp_item_is_vector_layer (item))
continue;
if (! gimp_item_scale_by_factors (item,
img_scale_w, img_scale_h,
interpolation_type, progress))

View file

@ -28,7 +28,6 @@
#include "core-types.h"
#include "path/gimppath.h"
#include "path/gimpvectorlayer.h"
#include "gimp.h"
#include "gimp-transform-resize.h"
@ -285,10 +284,6 @@ gimp_image_transform (GimpImage *image,
{
GimpTransformResize clip = GIMP_TRANSFORM_RESIZE_ADJUST;
/* Non-rasterized vector layers will be transformed when their path is */
if (gimp_item_is_vector_layer (item))
continue;
if (GIMP_IS_CHANNEL (item))
clip = clip_result;

View file

@ -909,8 +909,6 @@ gimp_image_init (GimpImage *image)
private->flush_accum.mask_changed = FALSE;
private->flush_accum.floating_selection_changed = FALSE;
private->flush_accum.preview_invalidated = FALSE;
private->from_command_line = FALSE;
}
static void
@ -1390,8 +1388,6 @@ static void
gimp_image_real_mode_changed (GimpImage *image)
{
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (image));
}
static void
@ -3698,6 +3694,22 @@ gimp_image_get_component_active (GimpImage *image,
return FALSE;
}
void
gimp_image_get_active_array (GimpImage *image,
gboolean *components)
{
GimpImagePrivate *private;
gint i;
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (components != NULL);
private = GIMP_IMAGE_GET_PRIVATE (image);
for (i = 0; i < MAX_CHANNELS; i++)
components[i] = private->active[i];
}
GimpComponentMask
gimp_image_get_active_mask (GimpImage *image)
{
@ -3782,6 +3794,22 @@ gimp_image_get_component_visible (GimpImage *image,
return FALSE;
}
void
gimp_image_get_visible_array (GimpImage *image,
gboolean *components)
{
GimpImagePrivate *private;
gint i;
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (components != NULL);
private = GIMP_IMAGE_GET_PRIVATE (image);
for (i = 0; i < MAX_CHANNELS; i++)
components[i] = private->visible[i];
}
GimpComponentMask
gimp_image_get_visible_mask (GimpImage *image)
{
@ -6410,28 +6438,3 @@ gimp_image_get_converting (GimpImage *image)
return private->converting;
}
void
gimp_image_set_from_command_line (GimpImage *image,
gboolean from_command_line)
{
GimpImagePrivate *private;
g_return_if_fail (GIMP_IS_IMAGE (image));
private = GIMP_IMAGE_GET_PRIVATE (image);
private->from_command_line = from_command_line;
}
gboolean
gimp_image_get_from_command_line (GimpImage *image)
{
GimpImagePrivate *private;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
private = GIMP_IMAGE_GET_PRIVATE (image);
return private->from_command_line;
}

View file

@ -237,6 +237,8 @@ void gimp_image_set_component_active (GimpImage *image,
gboolean active);
gboolean gimp_image_get_component_active (GimpImage *image,
GimpChannelType type);
void gimp_image_get_active_array (GimpImage *image,
gboolean *components);
GimpComponentMask gimp_image_get_active_mask (GimpImage *image);
void gimp_image_set_component_visible (GimpImage *image,
@ -244,6 +246,8 @@ void gimp_image_set_component_visible (GimpImage *image,
gboolean visible);
gboolean gimp_image_get_component_visible (GimpImage *image,
GimpChannelType type);
void gimp_image_get_visible_array (GimpImage *image,
gboolean *components);
GimpComponentMask gimp_image_get_visible_mask (GimpImage *image);
@ -508,7 +512,3 @@ void gimp_image_invalidate_previews (GimpImage *image);
void gimp_image_set_converting (GimpImage *image,
gboolean converting);
gboolean gimp_image_get_converting (GimpImage *image);
void gimp_image_set_from_command_line (GimpImage *image,
gboolean from_command_line);
gboolean gimp_image_get_from_command_line (GimpImage *image);

View file

@ -194,6 +194,8 @@ static void gimp_layer_convert_type (GimpDrawable *drawable,
gboolean push_undo,
GimpProgress *progress);
static void gimp_layer_invalidate_boundary (GimpDrawable *drawable);
static void gimp_layer_get_active_components (GimpDrawable *drawable,
gboolean *active);
static GimpComponentMask
gimp_layer_get_active_mask (GimpDrawable *drawable);
static void gimp_layer_set_buffer (GimpDrawable *drawable,
@ -446,6 +448,7 @@ gimp_layer_class_init (GimpLayerClass *klass)
drawable_class->supports_alpha = gimp_layer_supports_alpha;
drawable_class->convert_type = gimp_layer_convert_type;
drawable_class->invalidate_boundary = gimp_layer_invalidate_boundary;
drawable_class->get_active_components = gimp_layer_get_active_components;
drawable_class->get_active_mask = gimp_layer_get_active_mask;
drawable_class->set_buffer = gimp_layer_set_buffer;
drawable_class->get_bounding_box = gimp_layer_get_bounding_box;
@ -1508,6 +1511,22 @@ gimp_layer_invalidate_boundary (GimpDrawable *drawable)
floating_sel_invalidate (layer);
}
static void
gimp_layer_get_active_components (GimpDrawable *drawable,
gboolean *active)
{
GimpLayer *layer = GIMP_LAYER (drawable);
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
const Babl *format = gimp_drawable_get_format (drawable);
/* first copy the image active channels */
gimp_image_get_active_array (image, active);
if (gimp_drawable_has_alpha (drawable) &&
gimp_layer_is_alpha_locked (layer, NULL))
active[babl_format_get_n_components (format) - 1] = FALSE;
}
static GimpComponentMask
gimp_layer_get_active_mask (GimpDrawable *drawable)
{

View file

@ -198,15 +198,8 @@ gimp_palette_load (GimpContext *context,
{
GeglColor *color = gegl_color_new ("black");
guint8 rgb[3] = { 0 };
#ifdef _UCRT
gchar *context = NULL;
#endif
#ifndef _UCRT
tok = strtok (str, " \t");
#else
tok = strtok_s (str, " \t", &context);
#endif
if (tok)
{
if (atoi (tok) < 0 || atoi (tok) > 255)
@ -223,12 +216,7 @@ gimp_palette_load (GimpContext *context,
gimp_file_get_utf8_name (file), linenum);
}
#ifndef _UCRT
tok = strtok (NULL, " \t");
#else
tok = strtok_s (NULL, " \t", &context);
#endif
if (tok)
{
if (atoi (tok) < 0 || atoi (tok) > 255)
@ -245,11 +233,7 @@ gimp_palette_load (GimpContext *context,
gimp_file_get_utf8_name (file), linenum);
}
#ifndef _UCRT
tok = strtok (NULL, " \t");
#else
tok = strtok_s (NULL, " \t", &context);
#endif
if (tok)
{
if (atoi (tok) < 0 || atoi (tok) > 255)
@ -267,11 +251,7 @@ gimp_palette_load (GimpContext *context,
}
/* optional name */
#ifndef _UCRT
tok = strtok (NULL, "\n");
#else
tok = strtok_s (NULL, "\n", &context);
#endif
/* Historical .gpl format is sRGB. */
gegl_color_set_pixel (color, babl_format ("R'G'B' u8"), rgb);
@ -1411,51 +1391,28 @@ gimp_palette_load_sbz (GimpContext *context,
if ((a = archive_read_new ()))
{
const gchar *name = gimp_file_get_utf8_name (file);
int archive_ret;
archive_read_support_format_all (a);
r = archive_read_open_filename (a, name, 10240);
if (r != ARCHIVE_OK)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to read SBZ file: %s"),
archive_error_string (a));
archive_read_free (a);
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to read SBZ file"));
return NULL;
}
while ((archive_ret = archive_read_next_header (a, &entry)) != ARCHIVE_EOF)
while (archive_read_next_header (a, &entry) == ARCHIVE_OK)
{
const char *pathname;
gchar *lower;
const gchar *lower = g_ascii_strdown (archive_entry_pathname (entry), -1);
if (archive_ret == ARCHIVE_RETRY)
continue;
else if (archive_ret == ARCHIVE_FATAL)
break;
pathname = archive_entry_pathname (entry);
lower = g_ascii_strdown (pathname, -1);
if (g_str_has_suffix (lower, ".xml"))
{
if (xml_data == NULL)
{
entry_size = archive_entry_size (entry);
xml_data = (gchar *) g_malloc (entry_size);
entry_size = archive_entry_size (entry);
xml_data = (gchar *) g_malloc (entry_size);
r = archive_read_data (a, xml_data, entry_size);
}
else
{
/* This format only seems to allow for 1 XML in the
* zip, so if there are several, let's ignore it, yet
* not completely silently.
*/
g_printerr ("Ignoring second XML file '%s' in SBZ palette: %s",
pathname, gimp_file_get_utf8_name (file));
}
r = archive_read_data (a, xml_data, entry_size);
}
else if (g_str_has_suffix (lower, ".icc") || g_str_has_suffix (lower, ".icm"))
{
@ -1481,18 +1438,6 @@ gimp_palette_load_sbz (GimpContext *context,
g_list_append (sbz_data.embedded_profiles, sbz_profile);
}
}
g_free (lower);
}
if (archive_ret == ARCHIVE_FATAL)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to read SBZ file: %s"),
archive_error_string (a));
archive_read_free (a);
return NULL;
}
if (xml_data)
@ -1513,15 +1458,6 @@ gimp_palette_load_sbz (GimpContext *context,
g_free (xml_data);
}
else
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to open SBZ file"));
archive_read_free (a);
return NULL;
}
r = archive_read_free (a);
}
@ -1555,55 +1491,30 @@ gimp_palette_load_procreate (GimpContext *context,
if ((a = archive_read_new ()))
{
const gchar *name = gimp_file_get_utf8_name (file);
int archive_ret;
archive_read_support_format_all (a);
r = archive_read_open_filename (a, name, 10240);
if (r != ARCHIVE_OK)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to read Procreate swatches file: %s"),
archive_error_string (a));
archive_read_free (a);
/* TODO: Translate after string freeze */
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
"Unable to read Procreate swatches file");
return NULL;
}
while ((archive_ret = archive_read_next_header (a, &entry)) != ARCHIVE_EOF)
while (archive_read_next_header (a, &entry) == ARCHIVE_OK)
{
gchar *lower;
const gchar *lower = g_ascii_strdown (archive_entry_pathname (entry), -1);
if (archive_ret == ARCHIVE_RETRY)
continue;
else if (archive_ret == ARCHIVE_FATAL)
break;
/* Here we returned either with ARCHIVE_OK or ARCHIVE_WARN
* which are both successes (we ignore the non-critical error
* in the WARN case).
*/
lower = g_ascii_strdown (archive_entry_pathname (entry), -1);
if (g_str_has_suffix (lower, ".json"))
{
entry_size = archive_entry_size (entry);
json_data = (gchar *) g_malloc (entry_size);
r = archive_read_data (a, json_data, entry_size);
g_free (lower);
break;
}
g_free (lower);
}
if (archive_ret == ARCHIVE_FATAL)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to read Procreate swatches file: %s"),
archive_error_string (a));
archive_read_free (a);
return NULL;
}
if (json_data)
@ -1745,8 +1656,8 @@ gimp_palette_load_procreate (GimpContext *context,
GeglColor *color = gegl_color_new (NULL);
const Babl *space = NULL;
if (json_reader_read_member (reader, "colorProfile") &&
profiles &&
if (profiles &&
json_reader_read_member (reader, "colorProfile") &&
json_reader_is_value (reader))
{
GList *profile_list;
@ -1801,21 +1712,14 @@ gimp_palette_load_procreate (GimpContext *context,
g_clear_object (&reader);
g_clear_object (&parser);
}
else
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to read Procreate swatches file"));
archive_read_free (a);
return NULL;
}
r = archive_read_free (a);
}
else
{
/* TODO: Translate after string freeze */
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Unable to read Procreate swatches file"));
"Unable to read Procreate swatches file");
return NULL;
}
@ -1831,77 +1735,69 @@ swatchbooker_load_start_element (GMarkupParseContext *context,
GError **error)
{
SwatchBookerData *sbz_data = user_data;
gchar *lower_elt_name;
sbz_data->copy_values = FALSE;
sbz_data->color_model = NULL;
sbz_data->color_space = NULL;
lower_elt_name = g_ascii_strdown (element_name, -1);
if (! strcmp (lower_elt_name, "color"))
if (! strcmp (g_ascii_strdown (element_name, -1), "color"))
{
sbz_data->in_color_tag = TRUE;
}
else if (! strcmp (lower_elt_name, "dc:identifier"))
else if (! strcmp (g_ascii_strdown (element_name, -1), "dc:identifier"))
{
if (sbz_data->in_color_tag)
sbz_data->copy_name = TRUE;
}
else if (! strcmp (lower_elt_name, "values"))
else if (! strcmp (g_ascii_strdown (element_name, -1), "values"))
{
while (*attribute_names)
{
gchar *lower_att_name = g_ascii_strdown (*attribute_names, -1);
if (! strcmp (lower_att_name, "model"))
sbz_data->color_model = g_ascii_strdown (*attribute_values, -1);
else if (! strcmp (lower_att_name, "space"))
sbz_data->color_space = g_strdup (*attribute_values);
if (! strcmp (g_ascii_strdown (*attribute_names, -1), "model"))
{
sbz_data->color_model =
g_strdup (g_ascii_strdown (*attribute_values, -1));
}
else if (! strcmp (g_ascii_strdown (*attribute_names, -1), "space"))
{
sbz_data->color_space = g_strdup (*attribute_values);
}
attribute_names++;
attribute_values++;
g_free (lower_att_name);
}
sbz_data->copy_values = TRUE;
}
else if (! strcmp (lower_elt_name, "book"))
else if (! strcmp (g_ascii_strdown (element_name, -1), "book"))
{
sbz_data->in_book_tag = TRUE;
while (*attribute_names)
{
gchar *lower_att_name = g_ascii_strdown (*attribute_names, -1);
if (! strcmp (lower_att_name, "columns"))
if (! strcmp (g_ascii_strdown (*attribute_names, -1), "columns"))
{
gint columns = atoi (*attribute_values);
if (columns > 0)
gimp_palette_set_columns (sbz_data->palette, columns);
g_free (lower_att_name);
break;
}
attribute_names++;
attribute_values++;
g_free (lower_att_name);
}
}
else if (! strcmp (lower_elt_name, "swatch") &&
else if (! strcmp (g_ascii_strdown (element_name, -1), "swatch") &&
sbz_data->in_book_tag)
{
while (*attribute_names)
{
gchar *lower_att_name = g_ascii_strdown (*attribute_names, -1);
if (! strcmp (lower_att_name, "material"))
if (! strcmp (g_ascii_strdown (*attribute_names, -1), "material"))
{
GList *cols;
/*gint original_id = 0;*/
gint original_id = 0;
for (cols = gimp_palette_get_colors (sbz_data->palette);
cols;
@ -1917,21 +1813,15 @@ swatchbooker_load_start_element (GMarkupParseContext *context,
sbz_data->sorted_position++;
break;
}
/*original_id++;*/
original_id++;
}
g_free (lower_att_name);
break;
}
attribute_names++;
attribute_values++;
g_free (lower_att_name);
}
}
g_free (lower_elt_name);
}
static void
@ -1941,15 +1831,11 @@ swatchbooker_load_end_element (GMarkupParseContext *context,
GError **error)
{
SwatchBookerData *sbz_data = user_data;
gchar *lower_elt_name;
lower_elt_name = g_ascii_strdown (element_name, -1);
if (! strcmp (lower_elt_name, "color"))
if (! strcmp (g_ascii_strdown (element_name, -1), "color"))
sbz_data->in_color_tag = FALSE;
else if (! strcmp (lower_elt_name, "book"))
else if (! strcmp (g_ascii_strdown (element_name, -1), "book"))
sbz_data->in_book_tag = FALSE;
g_free (lower_elt_name);
}
static void

View file

@ -72,7 +72,7 @@ gimp_pickable_auto_shrink (GimpPickable *pickable,
GeglBuffer *buffer;
GeglRectangle rect;
ColorsEqualFunc colors_equal_func;
guchar bgcolor[MAX_CHANNELS] = { 0 };
guchar bgcolor[MAX_CHANNELS] = { 0, 0, 0, 0 };
guchar *buf = NULL;
gint x1, y1, x2, y2;
gint width, height;

View file

@ -48,9 +48,6 @@ extern "C"
(/* each thread costs as much as */ 64.0 * 64.0 /* pixels */)
static gfloat *mask_row_buf = NULL;
static gsize mask_row_buf_size = 0;
typedef struct
{
gint x;
@ -151,9 +148,6 @@ gimp_pickable_contiguous_region_by_seed (GimpPickable *pickable,
format = choose_format (src_buffer, select_criterion,
&n_components, &has_alpha);
g_return_val_if_fail (n_components <= MAX_CHANNELS, NULL);
gegl_buffer_sample (src_buffer, x, y, NULL, start_col, format,
GEGL_SAMPLER_NEAREST, GEGL_ABYSS_NONE);
@ -192,9 +186,6 @@ gimp_pickable_contiguous_region_by_seed (GimpPickable *pickable,
}
g_clear_object (&src_buffer);
g_clear_pointer (&mask_row_buf, g_free);
mask_row_buf_size = 0;
return mask_buffer;
}
@ -237,8 +228,6 @@ gimp_pickable_contiguous_region_by_color (GimpPickable *pickable,
format = choose_format (src_buffer, select_criterion,
&n_components, &has_alpha);
g_return_val_if_fail (n_components <= MAX_CHANNELS, NULL);
gegl_color_get_pixel (color, format, start_col);
if (has_alpha)
@ -700,9 +689,6 @@ gimp_pickable_contiguous_region_by_line_art (GimpPickable *pickable,
if (free_src_buffer)
g_object_unref (src_buffer);
g_clear_pointer (&mask_row_buf, g_free);
mask_row_buf_size = 0;
return mask_buffer;
}
@ -999,19 +985,10 @@ find_contiguous_segment (const gfloat *col,
gfloat *row)
{
gfloat *s;
gfloat *mask_row;
gfloat mask_row_buf[src_extent->width];
gfloat *mask_row = mask_row_buf - src_extent->x;
gfloat diff;
if (mask_row_buf == NULL ||
(gsize) src_extent->width > mask_row_buf_size)
{
mask_row_buf_size = src_extent->width;
mask_row_buf = (gfloat *) g_realloc_n ((gpointer) mask_row_buf,
mask_row_buf_size,
sizeof (gfloat));
}
mask_row = mask_row_buf - src_extent->x;
#ifdef FETCH_ROW
gegl_buffer_get (src_buffer, GEGL_RECTANGLE (0, initial_y, width, 1), 1.0,
src_format,

View file

@ -43,18 +43,14 @@
#include "gimp-intl.h"
static GimpMetadataRotationPolicy gimp_image_metadata_rotate_dialog (GimpImage *image,
GimpContext *context,
GtkWidget *parent,
GExiv2Orientation orientation,
gboolean *dont_ask);
static GdkPixbuf * gimp_image_metadata_rotate_pixbuf (GdkPixbuf *pixbuf,
GExiv2Orientation orientation);
static gboolean gimp_image_metadata_rotate_release (GtkWidget *widget,
GdkEvent *event,
GtkDialog *dialog);
static GimpMetadataRotationPolicy gimp_image_metadata_rotate_dialog (GimpImage *image,
GimpContext *context,
GtkWidget *parent,
GExiv2Orientation orientation,
gboolean *dont_ask);
static GdkPixbuf * gimp_image_metadata_rotate_pixbuf (GdkPixbuf *pixbuf,
GExiv2Orientation orientation);
static void gimp_image_metadata_rotate_realize (GtkWidget *widget);
/* public functions */
@ -173,7 +169,6 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
GdkPixbuf *rotated;
GtkWidget *hbox;
GtkWidget *image;
GtkWidget *event_box;
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
@ -192,22 +187,9 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
gtk_box_pack_end (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
event_box = gtk_event_box_new ();
image = gtk_image_new_from_pixbuf (pixbuf);
gtk_container_add (GTK_CONTAINER (event_box), image);
gtk_box_pack_end (GTK_BOX (vbox), event_box, FALSE, FALSE, 0);
gtk_widget_set_visible (image, TRUE);
gtk_widget_set_visible (event_box, TRUE);
g_object_set_data (G_OBJECT (event_box), "metadata-rotation-response",
GINT_TO_POINTER (GTK_RESPONSE_CANCEL));
g_signal_connect_object (event_box, "button-release-event",
G_CALLBACK (gimp_image_metadata_rotate_release),
dialog, 0);
g_signal_connect (event_box, "realize",
G_CALLBACK (gimp_image_metadata_rotate_realize),
NULL);
image = gtk_image_new_from_pixbuf (pixbuf);
gtk_box_pack_end (GTK_BOX (vbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
@ -222,23 +204,11 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
rotated = gimp_image_metadata_rotate_pixbuf (pixbuf, orientation);
event_box = gtk_event_box_new ();
image = gtk_image_new_from_pixbuf (rotated);
image = gtk_image_new_from_pixbuf (rotated);
g_object_unref (rotated);
gtk_container_add (GTK_CONTAINER (event_box), image);
gtk_box_pack_end (GTK_BOX (vbox), event_box, FALSE, FALSE, 0);
gtk_widget_set_visible (image, TRUE);
gtk_widget_set_visible (event_box, TRUE);
g_object_set_data (G_OBJECT (event_box), "metadata-rotation-response",
GINT_TO_POINTER (GTK_RESPONSE_OK));
g_signal_connect_object (event_box, "button-release-event",
G_CALLBACK (gimp_image_metadata_rotate_release),
dialog, 0);
g_signal_connect (event_box, "realize",
G_CALLBACK (gimp_image_metadata_rotate_realize),
NULL);
gtk_box_pack_end (GTK_BOX (vbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
}
label = g_object_new (GTK_TYPE_LABEL,
@ -265,8 +235,8 @@ gimp_image_metadata_rotate_dialog (GimpImage *image,
gtk_widget_destroy (dialog);
return (response == GTK_RESPONSE_OK) ?
GIMP_METADATA_ROTATION_POLICY_ROTATE :
GIMP_METADATA_ROTATION_POLICY_KEEP;
GIMP_METADATA_ROTATION_POLICY_ROTATE :
GIMP_METADATA_ROTATION_POLICY_KEEP;
}
static GdkPixbuf *
@ -321,29 +291,3 @@ gimp_image_metadata_rotate_pixbuf (GdkPixbuf *pixbuf,
return rotated;
}
static gboolean
gimp_image_metadata_rotate_release (GtkWidget *widget,
GdkEvent *event,
GtkDialog *dialog)
{
gint response_id;
response_id =
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
"metadata-rotation-response"));
gtk_dialog_response (dialog, response_id);
return FALSE;
}
static void
gimp_image_metadata_rotate_realize (GtkWidget *widget)
{
GdkCursor *cursor;
cursor = gdk_cursor_new_from_name (gtk_widget_get_display (widget),
"pointer");
gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
g_object_unref (cursor);
}

View file

@ -51,6 +51,7 @@
#include "path/gimppath.h"
#include "path/gimppath-import.h"
#include "path/gimpvectorlayer.h"
#include "path/gimpvectorlayeroptions.h"
#include "text/gimptext.h"
#include "text/gimptextlayer.h"
@ -437,8 +438,15 @@ gimp_display_shell_dnd_fill (GimpDisplayShell *shell,
if (gimp_item_is_text_layer (iter->data) ||
gimp_item_is_vector_layer (iter->data))
{
GimpPattern *pattern = NULL;
GeglColor *color = NULL;
GimpVectorLayerOptions *vector_options = NULL;
GimpFillOptions *vector_fill = NULL;
GimpPattern *pattern = NULL;
GeglColor *color = NULL;
if (gimp_item_is_vector_layer (iter->data))
vector_options = gimp_vector_layer_get_options (iter->data);
if (vector_options)
vector_fill = vector_options->fill_options;
if (gimp_fill_options_get_style (options) == GIMP_FILL_STYLE_FG_COLOR)
color = gimp_context_get_foreground (GIMP_CONTEXT (options));
@ -449,13 +457,12 @@ gimp_display_shell_dnd_fill (GimpDisplayShell *shell,
if (color)
{
if (gimp_item_is_vector_layer (iter->data))
if (vector_fill)
{
gimp_vector_layer_set (GIMP_VECTOR_LAYER (iter->data), NULL,
"fill-style",
GIMP_CUSTOM_STYLE_SOLID_COLOR,
"fill-color",
color, NULL);
gimp_context_set_foreground (GIMP_CONTEXT (vector_fill),
color);
gimp_fill_options_set_custom_style (vector_fill,
GIMP_CUSTOM_STYLE_SOLID_COLOR);
gimp_vector_layer_refresh (iter->data);
}
else
@ -463,14 +470,16 @@ gimp_display_shell_dnd_fill (GimpDisplayShell *shell,
gimp_text_layer_set (iter->data, NULL, "color", color, NULL);
}
}
else if (pattern &&
gimp_item_is_vector_layer (iter->data))
else if (pattern)
{
gimp_vector_layer_set (GIMP_VECTOR_LAYER (iter->data), NULL,
"fill-style", GIMP_CUSTOM_STYLE_PATTERN,
"fill-pattern", pattern,
NULL);
gimp_vector_layer_refresh (iter->data);
if (vector_fill)
{
gimp_context_set_pattern (GIMP_CONTEXT (vector_fill),
pattern);
gimp_fill_options_set_custom_style (vector_fill,
GIMP_CUSTOM_STYLE_PATTERN);
gimp_vector_layer_refresh (iter->data);
}
}
}
else

View file

@ -2005,7 +2005,7 @@ gimp_display_shell_rotate_gesture_maybe_get_state (GtkGestureRotate *gesture,
* last_event happens to not have it. Thus we store the last valid state
* and only update it if we get a valid state from last_event.
*/
GdkModifierType state = 0;
guint state = 0;
const GdkEvent *last_event;
last_event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);

View file

@ -371,9 +371,7 @@ gimp_image_window_constructed (GObject *object)
GimpGuiConfig *config;
GimpDeviceManager *device_manager;
gboolean use_gtk_menubar = TRUE;
#ifndef GDK_WINDOWING_QUARTZ
gboolean use_app_menu = TRUE;
#endif
G_OBJECT_CLASS (parent_class)->constructed (object);
@ -1146,11 +1144,7 @@ gimp_image_window_set_aux_info (GimpSessionManaged *session_managed,
maximized = TRUE;
if (width)
#ifndef _UCRT
sscanf (aux->value, "%d", width);
#else
sscanf_s (aux->value, "%d", width);
#endif
/* compat handling for right docks */
if (! strcmp (aux->name, GIMP_IMAGE_WINDOW_RIGHT_DOCKS_POS))

View file

@ -1944,13 +1944,7 @@ gimp_statusbar_shell_scaled (GimpDisplayShell *shell,
sizeof (statusbar->cursor_format_str),
"%%s%%.%df%%s%%.%df%%s",
w_digits, h_digits);
#ifndef _UCRT
strcpy (statusbar->cursor_format_str_f, statusbar->cursor_format_str);
#else
strcpy_s (statusbar->cursor_format_str_f,
sizeof (statusbar->cursor_format_str_f),
statusbar->cursor_format_str);
#endif
g_snprintf (statusbar->length_format_str,
sizeof (statusbar->length_format_str),
"%%s%%.%df%%s", MAX (w_digits, h_digits));

View file

@ -293,9 +293,7 @@ gimp_eek (const gchar *reason,
gboolean use_handler)
{
GimpCoreConfig *config = the_errors_gimp->config;
#if !defined(G_OS_WIN32) || !defined(GIMP_CONSOLE_COMPILATION)
gboolean eek_handled = FALSE;
#endif
GimpDebugPolicy debug_policy;
GList *iter;
gint num_idx;

View file

@ -690,12 +690,11 @@ file_open_from_command_line (Gimp *gimp,
{
success = TRUE;
gimp_image_set_from_command_line (image, TRUE);
g_object_set_data_full (G_OBJECT (gimp), GIMP_FILE_OPEN_LAST_FILE_KEY,
g_object_ref (file),
(GDestroyNotify) g_object_unref);
}
else if (status != GIMP_PDB_SUCCESS && status != GIMP_PDB_CANCEL)
else if (status != GIMP_PDB_SUCCESS && status != GIMP_PDB_CANCEL && display)
{
gimp_message (gimp, G_OBJECT (display), GIMP_MESSAGE_ERROR,
_("Opening '%s' failed: %s"),
@ -1008,7 +1007,8 @@ file_open_pre_check (Gimp *gimp,
g_clear_error (error);
if (error && ! *error)
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Circular reference detected with '%s'."),
/* TODO: localize after string freeze ends. */
"Cycling link detected with %s.",
g_file_peek_path (file));
return FALSE;

View file

@ -258,13 +258,13 @@ file_remote_get_temp_file (Gimp *gimp,
const gchar *ext = strchr (basename, '.');
if (ext && strlen (ext))
temp_file = gimp_get_temp_file (gimp, ext + 1, NULL);
temp_file = gimp_get_temp_file (gimp, ext + 1);
g_free (basename);
}
if (! temp_file)
temp_file = gimp_get_temp_file (gimp, "xxx", NULL);
temp_file = gimp_get_temp_file (gimp, "xxx");
return temp_file;
}

View file

@ -604,17 +604,15 @@ void
gimp_update_check (GimpCoreConfig *config)
{
#ifdef PLATFORM_OSX
const gchar *gimp_versions;
NSMutableURLRequest *request;
NSURLSession *session;
const gchar *gimp_versions;
gimp_versions = gimp_get_version_url ();
request = [[NSMutableURLRequest alloc] init];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:@(gimp_versions)]];
[request setHTTPMethod:@"GET"];
session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
/* completionHandler is called on a background thread */
[[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSString *reply;

View file

@ -33,7 +33,7 @@
#include <winnls.h>
#endif
#ifdef PLATFORM_OSX
#import <Foundation/Foundation.h>
#include <Foundation/NSLocale.h>
#endif
#include "language.h"

View file

@ -350,26 +350,27 @@ gimp_macos_setenv (const char * progname)
gchar *etc_dir;
size_t path_len;
struct stat sb;
gboolean need_pythonhome = TRUE;
bin_dir = g_path_get_dirname (resolved_path);
tmp = g_strdup_printf ("%s/lib", gimp_installation_directory());
tmp = g_strdup_printf ("%s/../Resources/lib", bin_dir);
lib_dir = g_canonicalize_filename (tmp, NULL);
g_free (tmp);
tmp = g_strdup_printf ("%s/share", gimp_installation_directory());
tmp = g_strdup_printf ("%s/../Resources/share", bin_dir);
share_dir = g_canonicalize_filename (tmp, NULL);
g_free (tmp);
tmp = g_strdup_printf ("%s/etc", gimp_installation_directory());
tmp = g_strdup_printf ("%s/../Resources/etc", bin_dir);
etc_dir = g_canonicalize_filename (tmp, NULL);
g_free (tmp);
/* Detect if we are running from bundle or from prefix */
if (g_str_has_suffix (bin_dir, "MacOS"))
if (share_dir && !stat (share_dir, &sb) && S_ISDIR (sb.st_mode))
{
g_print ("GIMP is started as MacOS application\n");
}
else
{
tmp = g_strdup_printf ("%s/share", gimp_installation_directory());
tmp = g_strdup_printf ("%s/../share", bin_dir);
share_dir = g_canonicalize_filename (tmp, NULL);
g_free (tmp);
if (share_dir && !stat (share_dir, &sb) && S_ISDIR (sb.st_mode))
@ -378,7 +379,7 @@ gimp_macos_setenv (const char * progname)
g_print ("GIMP is started in the build directory\n");
tmp = g_strdup_printf ("%s", gimp_installation_directory()); /* running in build dir */
tmp = g_strdup_printf ("%s/..", bin_dir); /* running in build dir */
share_dir = g_canonicalize_filename (tmp, NULL);
g_free (tmp);
}
@ -389,6 +390,23 @@ gimp_macos_setenv (const char * progname)
}
}
/* Detect we were built in homebrew for MacOS (for PYTHONHOME purposes) */
tmp = g_strdup_printf ("%s/../Frameworks/Python.framework", share_dir);
if (tmp && !stat (tmp, &sb) && S_ISDIR (sb.st_mode))
{
g_print ("GIMP was built with homebrew\n");
need_pythonhome = FALSE;
}
g_free (tmp);
/* Detect we were built in MacPorts for MacOS (for PYTHONHOME purposes) */
tmp = g_strdup_printf ("%s/../Library/Frameworks/Python.framework", share_dir);
if (tmp && !stat (tmp, &sb) && S_ISDIR (sb.st_mode))
{
g_print ("GIMP was built with MacPorts\n");
need_pythonhome = FALSE;
}
g_free (tmp);
/* Minimum runtime paths */
path_len = strlen (g_getenv ("PATH") ? g_getenv ("PATH") : "") + strlen (bin_dir) + 2;
path = g_try_malloc (path_len);
@ -451,13 +469,12 @@ gimp_macos_setenv (const char * progname)
tmp = g_strdup_printf ("%s/girepository-1.0", lib_dir);
g_setenv ("GI_TYPELIB_PATH", tmp, TRUE);
g_free (tmp);
tmp = g_strdup_printf ("%s/Frameworks/Python.framework/Versions/%s", gimp_installation_directory(), PYTHON_VERSION);
if (tmp && !stat (tmp, &sb) && S_ISDIR (sb.st_mode))
if (need_pythonhome)
{
tmp = g_strdup_printf ("%s/Library/Frameworks/Python.framework/Versions/%s", share_dir, PYTHON_VERSION);
g_setenv ("PYTHONHOME", tmp, TRUE);
g_free (tmp);
}
g_free (tmp);
g_free (lib_dir);
g_free (share_dir);
g_free (etc_dir);
@ -570,15 +587,12 @@ main (int argc,
#endif
gint retval;
gint i;
#if defined(ENABLE_RELOCATABLE_RESOURCES) && defined(__APPLE__)
gint newargc;
#endif
gimp_attach_console_window ();
#if defined(ENABLE_RELOCATABLE_RESOURCES) && defined(__APPLE__)
/* remove MacOS session identifier from the command line args */
newargc = 0;
gint newargc = 0;
for (gint i = 0; i < argc; i++)
{
if (!g_str_has_prefix (argv[i], "-psn_"))
@ -909,8 +923,6 @@ main (int argc,
pdb_compat_mode,
backtrace_file);
gimp_env_exit (FALSE);
g_free (backtrace_file);
g_clear_object (&system_gimprc_file);
@ -964,19 +976,8 @@ gimp_attach_console_window (void)
if (AttachConsole (ATTACH_PARENT_PROCESS) != 0)
{
/* 'r' is needed to prevent interleaving and '+' to support colors */
#ifndef _UCRT
freopen ("CONOUT$", "r+", stdout);
freopen ("CONOUT$", "r+", stderr);
#else
FILE* fileOut;
FILE* fileErr;
errno_t errOut = freopen_s (&fileOut, "CONOUT$", "r+", stdout);
errno_t errErr = freopen_s (&fileErr, "CONOUT$", "r+", stderr);
if (errOut != 0 || errErr != 0)
g_warning ("Failed to redirect streams to CONOUT$. stdout: %d, stderr: %d", errOut, errErr);
#endif
_flushall ();
{

View file

@ -587,13 +587,8 @@ gimp_curves_config_load_cruft (GimpCurvesConfig *config,
return FALSE;
}
#ifndef _UCRT
if (sscanf (x_str, "%d", &index[i][j]) != 1 ||
sscanf (y_str, "%d", &value[i][j]) != 1)
#else
if (sscanf_s (x_str, "%d", &index[i][j]) != 1 ||
sscanf_s (y_str, "%d", &value[i][j]) != 1)
#endif
{
g_set_error_literal (error,
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_PARSE,

View file

@ -904,21 +904,12 @@ gimp_levels_config_load_cruft (GimpLevelsConfig *config,
return FALSE;
}
#ifndef _UCRT
fields = sscanf (line, "%d %d %d %d %31s",
&low_input[i],
&high_input[i],
&low_output[i],
&high_output[i],
float_buf);
#else
fields = sscanf_s (line, "%d %d %d %d %31s",
&low_input[i],
&high_input[i],
&low_output[i],
&high_output[i],
float_buf, (unsigned) sizeof (float_buf));
#endif
g_free (line);

View file

@ -591,7 +591,7 @@ struct PaintBuf : Base
}
};
static BasicDispatch<PaintBuf, ALGORITHM_PAINT_BUF> G_GNUC_UNUSED dispatch_paint_buf;
static BasicDispatch<PaintBuf, ALGORITHM_PAINT_BUF> dispatch_paint_buf;
/* PaintMask, dispatch_paint_mask():
@ -691,7 +691,7 @@ struct DispatchStipple
else
visitor (identity<Stipple<Algorithm, FALSE>> ());
}
} static G_GNUC_UNUSED dispatch_stipple;
} static dispatch_stipple;
/* CompMask, dispatch_comp_mask(), has_comp_mask(), comp_mask_data():
@ -734,7 +734,7 @@ struct CompMask : Base
};
};
static BasicDispatch<CompMask, ALGORITHM_COMP_MASK> G_GNUC_UNUSED dispatch_comp_mask;
static BasicDispatch<CompMask, ALGORITHM_COMP_MASK> dispatch_comp_mask;
template <class Base>
static constexpr gboolean
@ -815,7 +815,7 @@ static BasicDispatch<
TempCompMask,
ALGORITHM_TEMP_COMP_MASK,
decltype (dispatch_comp_mask)
> G_GNUC_UNUSED dispatch_temp_comp_mask;
> dispatch_temp_comp_mask;
/* CompBuffer, dispatch_comp_buffer(), has_comp_buffer(), comp_buffer_data():
@ -858,7 +858,7 @@ struct CompBuffer : Base
};
};
static BasicDispatch<CompBuffer, ALGORITHM_COMP_BUFFER> G_GNUC_UNUSED dispatch_comp_buffer;
static BasicDispatch<CompBuffer, ALGORITHM_COMP_BUFFER> dispatch_comp_buffer;
template <class Base>
static constexpr gboolean
@ -939,7 +939,7 @@ static BasicDispatch<
TempCompBuffer,
ALGORITHM_TEMP_COMP_BUFFER,
decltype (dispatch_comp_buffer)
> G_GNUC_UNUSED dispatch_temp_comp_buffer;
> dispatch_temp_comp_buffer;
/* CanvasBufferIterator, DispatchCanvasBufferIterator:

View file

@ -1287,10 +1287,10 @@ static const gchar *expand_props[] =
"expand-mask-fill-type",
};
#define max_n_props (G_N_ELEMENTS (brush_props) + \
G_N_ELEMENTS (dynamics_props) + \
G_N_ELEMENTS (gradient_props) + \
G_N_ELEMENTS (expand_props))
static const gint max_n_props = (G_N_ELEMENTS (brush_props) +
G_N_ELEMENTS (dynamics_props) +
G_N_ELEMENTS (gradient_props) +
G_N_ELEMENTS (expand_props));
gboolean
gimp_paint_options_is_prop (const gchar *prop_name,
@ -1377,5 +1377,3 @@ gimp_paint_options_copy_props (GimpPaintOptions *src,
g_value_unset (&values[n_props]);
}
}
#undef max_n_props

View file

@ -246,6 +246,8 @@ gimp_smudge_start (GimpPaintCore *paint_core,
dest_pickable_off_y = 0;
}
pickable_buffer = gimp_pickable_get_buffer (dest_pickable);
n_strokes = gimp_symmetry_get_size (sym);
for (i = 0; i < n_strokes; i++)
{
@ -278,11 +280,6 @@ gimp_smudge_start (GimpPaintCore *paint_core,
if (! paint_buffer)
continue;
/* Fetch the buffer _after_ gimp_paint_core_get_paint_buffer() as it
* may have expanded the drawable when "Expand Layers" is enabled.
*/
pickable_buffer = gimp_pickable_get_buffer (dest_pickable);
gimp_smudge_accumulator_coords (paint_core, &coords, 0, &x, &y);
/* If clipped, prefill the smudge buffer with the color at the

View file

@ -207,8 +207,7 @@ static gboolean parse_svg_length (const gchar *value,
static gboolean parse_svg_viewbox (const gchar *value,
gdouble *width,
gdouble *height,
GimpMatrix3 *matrix,
gboolean scale);
GimpMatrix3 *matrix);
static gboolean parse_svg_transform (const gchar *value,
GimpMatrix3 *matrix);
static GList * parse_path_data (const gchar *data);
@ -637,7 +636,7 @@ svg_handler_svg_start (SvgHandler *handler,
gimp_matrix3_translate (matrix, x, y);
}
if (viewbox && parse_svg_viewbox (viewbox, &w, &h, &box, parser->scale))
if (viewbox && parse_svg_viewbox (viewbox, &w, &h, &box))
{
gimp_matrix3_mult (&box, matrix);
}
@ -1213,48 +1212,28 @@ static gboolean
parse_svg_viewbox (const gchar *value,
gdouble *width,
gdouble *height,
GimpMatrix3 *matrix,
gboolean scale)
GimpMatrix3 *matrix)
{
gdouble x, y, w, h;
gchar *tok;
gchar *str = g_strdup (value);
gboolean success = FALSE;
#ifdef _UCRT
gchar *context = NULL;
#endif
x = y = w = h = 0;
#ifndef _UCRT
tok = strtok (str, ", \t");
#else
tok = strtok_s (str, ", \t", &context);
#endif
if (tok)
{
x = g_ascii_strtod (tok, NULL);
#ifndef _UCRT
tok = strtok (NULL, ", \t");
#else
tok = strtok_s (NULL, ", \t", &context);
#endif
if (tok)
{
y = g_ascii_strtod (tok, NULL);
#ifndef _UCRT
tok = strtok (NULL, ", \t");
#else
tok = strtok_s (NULL, ", \t", &context);
#endif
if (tok != NULL)
{
w = g_ascii_strtod (tok, NULL);
#ifndef _UCRT
tok = strtok (NULL, ", \t");
#else
tok = strtok_s (NULL, ", \t", &context);
#endif
if (tok)
{
h = g_ascii_strtod (tok, NULL);
@ -1273,8 +1252,7 @@ parse_svg_viewbox (const gchar *value,
if (w > 0.0 && h > 0.0)
{
if (scale)
gimp_matrix3_scale (matrix, *width / w, *height / h);
gimp_matrix3_scale (matrix, *width / w, *height / h);
}
else /* disable rendering of the element */
{

View file

@ -113,13 +113,6 @@ static void gimp_vector_layer_scale (GimpItem *ite
gint new_offset_y,
GimpInterpolationType interp_type,
GimpProgress *progress);
static void gimp_vector_layer_resize (GimpItem *item,
GimpContext *context,
GimpFillType fill_type,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
static void gimp_vector_layer_flip (GimpItem *item,
GimpContext *context,
GimpOrientationType flip_type,
@ -187,7 +180,6 @@ gimp_vector_layer_class_init (GimpVectorLayerClass *klass)
item_class->duplicate = gimp_vector_layer_duplicate;
item_class->rename = gimp_rasterizable_rename;
item_class->scale = gimp_vector_layer_scale;
item_class->resize = gimp_vector_layer_resize;
item_class->flip = gimp_vector_layer_flip;
item_class->rotate = gimp_vector_layer_rotate;
item_class->transform = gimp_vector_layer_transform;
@ -398,10 +390,10 @@ gimp_vector_layer_convert (GimpItem *item,
if (path)
{
GIMP_ITEM_GET_CLASS (path)->convert (GIMP_ITEM (path), dest_image,
G_TYPE_FROM_INSTANCE (path));
gimp_item_convert (GIMP_ITEM (path), dest_image, GIMP_TYPE_PATH);
if (! gimp_item_is_attached (GIMP_ITEM (path)))
if (! gimp_item_is_attached (GIMP_ITEM (path)) &&
gimp_item_get_image (GIMP_ITEM (path)) == dest_image)
gimp_image_add_path (dest_image, path, NULL, -1, FALSE);
}
@ -460,7 +452,7 @@ gimp_vector_layer_translate (GimpLayer *layer,
{
GimpVectorLayer *vector_layer = GIMP_VECTOR_LAYER (layer);
if (gimp_item_is_vector_layer (GIMP_ITEM (layer)))
if (vector_layer->options && vector_layer->options->path)
{
gimp_item_translate (GIMP_ITEM (vector_layer->options->path),
offset_x, offset_y, FALSE);
@ -482,14 +474,11 @@ gimp_vector_layer_scale (GimpItem *item,
{
GimpVectorLayer *vector_layer = GIMP_VECTOR_LAYER (item);
if (gimp_item_is_vector_layer (item))
if (vector_layer->options && vector_layer->options->path)
{
gdouble scale_x = new_width / (gdouble) gimp_item_get_width (item);
gdouble scale_y = new_height / (gdouble) gimp_item_get_height (item);
gimp_item_scale_by_factors (GIMP_ITEM (vector_layer->options->path),
scale_x, scale_y,
interp_type, progress);
gimp_item_scale (GIMP_ITEM (vector_layer->options->path),
new_width, new_height, new_offset_x, new_offset_y,
interp_type, progress);
}
else
{
@ -499,31 +488,6 @@ gimp_vector_layer_scale (GimpItem *item,
}
}
static void
gimp_vector_layer_resize (GimpItem *item,
GimpContext *context,
GimpFillType fill_type,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y)
{
GimpVectorLayer *vector_layer = GIMP_VECTOR_LAYER (item);
if (gimp_item_is_vector_layer (item))
{
gimp_item_resize (GIMP_ITEM (vector_layer->options->path),
context, fill_type, new_width, new_height,
offset_x, offset_y);
}
else
{
GIMP_ITEM_CLASS (parent_class)->resize (item, context, fill_type,
new_width, new_height, offset_x,
offset_y);
}
}
static void
gimp_vector_layer_flip (GimpItem *item,
GimpContext *context,
@ -533,7 +497,7 @@ gimp_vector_layer_flip (GimpItem *item,
{
GimpVectorLayer *vector_layer = GIMP_VECTOR_LAYER (item);
if (gimp_item_is_vector_layer (item))
if (vector_layer->options && vector_layer->options->path)
{
gimp_item_flip (GIMP_ITEM (vector_layer->options->path),
context, flip_type, axis, clip_result);
@ -555,7 +519,7 @@ gimp_vector_layer_rotate (GimpItem *item,
{
GimpVectorLayer *vector_layer = GIMP_VECTOR_LAYER (item);
if (gimp_item_is_vector_layer (item))
if (vector_layer->options && vector_layer->options->path)
{
gimp_item_rotate (GIMP_ITEM (vector_layer->options->path),
context, rotate_type, center_x, center_y, clip_result);
@ -579,7 +543,7 @@ gimp_vector_layer_transform (GimpItem *item,
{
GimpVectorLayer *vector_layer = GIMP_VECTOR_LAYER (item);
if (gimp_item_is_vector_layer (item))
if (vector_layer->options && vector_layer->options->path)
{
gimp_item_transform (GIMP_ITEM (vector_layer->options->path),
context, matrix, direction, interp_type,
@ -738,49 +702,6 @@ gimp_vector_layer_get_options (GimpVectorLayer *layer)
return NULL;
}
void
gimp_vector_layer_set (GimpVectorLayer *layer,
const gchar *undo_desc,
const gchar *first_property_name,
...)
{
GimpImage *image;
GimpVectorLayerOptions *options;
va_list var_args;
g_return_if_fail (gimp_item_is_vector_layer (GIMP_ITEM (layer)));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)));
options = layer->options;
if (! options)
return;
image = gimp_item_get_image (GIMP_ITEM (layer));
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_VECTOR, undo_desc);
g_object_freeze_notify (G_OBJECT (layer));
if (gimp_rasterizable_is_rasterized (GIMP_RASTERIZABLE (layer)))
gimp_image_undo_push_drawable_mod (image, NULL,
GIMP_DRAWABLE (layer), TRUE);
gimp_image_undo_push_vector_layer (image, undo_desc, layer, NULL);
va_start (var_args, first_property_name);
g_object_set_valist (G_OBJECT (options), first_property_name,
var_args);
va_end (var_args);
if (gimp_rasterizable_is_rasterized (GIMP_RASTERIZABLE (layer)))
gimp_rasterizable_restore (GIMP_RASTERIZABLE (layer));
g_object_thaw_notify (G_OBJECT (layer));
gimp_image_undo_group_end (image);
}
void
gimp_vector_layer_refresh (GimpVectorLayer *layer)
{

View file

@ -62,11 +62,6 @@ GimpPath * gimp_vector_layer_get_path (GimpVectorLayer *layer)
GimpVectorLayerOptions * gimp_vector_layer_get_options (GimpVectorLayer *layer);
void gimp_vector_layer_set (GimpVectorLayer *layer,
const gchar *undo_desc,
const gchar *first_property_name,
...) G_GNUC_NULL_TERMINATED;
void gimp_vector_layer_refresh (GimpVectorLayer *layer);
gboolean gimp_item_is_vector_layer (GimpItem *item);

View file

@ -32,9 +32,7 @@
#include "path-types.h"
#include "core/gimp.h"
#include "core/gimpfilloptions.h"
#include "core/gimpimage.h"
#include "core/gimppattern.h"
#include "core/gimpstrokeoptions.h"
#include "gimppath.h"
@ -53,11 +51,7 @@ enum
PROP_ENABLE_FILL,
PROP_FILL_OPTIONS,
PROP_ENABLE_STROKE,
PROP_STROKE_OPTIONS,
/* Individual Fill Options */
PROP_FILL_STYLE,
PROP_FILL_COLOR,
PROP_FILL_PATTERN
PROP_STROKE_OPTIONS
};
@ -91,7 +85,6 @@ static void
gimp_vector_layer_options_class_init (GimpVectorLayerOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglColor *black = gegl_color_new ("black");
object_class->constructor = gimp_vector_layer_options_constructor;
object_class->finalize = gimp_vector_layer_options_finalize;
@ -139,28 +132,6 @@ gimp_vector_layer_options_class_init (GimpVectorLayerOptionsClass *klass)
GIMP_TYPE_STROKE_OPTIONS,
G_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_AGGREGATE);
/* Alias for fill properties */
GIMP_CONFIG_PROP_ENUM (object_class, PROP_FILL_STYLE,
"fill-style",
NULL, NULL,
GIMP_TYPE_CUSTOM_STYLE,
GIMP_CUSTOM_STYLE_SOLID_COLOR,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_COLOR (object_class, PROP_FILL_COLOR,
"fill-color",
NULL, NULL,
FALSE, black,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_OBJECT (object_class, PROP_FILL_PATTERN,
"fill-pattern",
NULL, NULL,
GIMP_TYPE_PATTERN,
GIMP_PARAM_STATIC_STRINGS);
g_object_unref (black);
}
static void
@ -247,12 +218,6 @@ gimp_vector_layer_options_get_property (GObject *object,
g_value_set_object (value, options->stroke_options);
break;
/* Alias for fill properties */
case PROP_FILL_STYLE:
case PROP_FILL_COLOR:
case PROP_FILL_PATTERN:
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@ -336,24 +301,6 @@ gimp_vector_layer_options_set_property (GObject *object,
}
break;
/* Alias for fill properties */
case PROP_FILL_STYLE:
if (options->fill_options)
g_object_set (GIMP_FILL_OPTIONS (options->fill_options),
"custom-style", g_value_get_enum (value),
NULL);
break;
case PROP_FILL_COLOR:
gimp_context_set_foreground (GIMP_CONTEXT (options->fill_options),
g_value_get_object (value));
break;
case PROP_FILL_PATTERN:
gimp_context_set_pattern (GIMP_CONTEXT (options->fill_options),
g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;

View file

@ -3735,7 +3735,7 @@ register_context_procs (GimpPDB *pdb)
gimp_param_spec_unit ("line-width-unit",
"line width unit",
"The line width setting unit",
TRUE,
FALSE,
FALSE,
gimp_unit_inch (),
GIMP_PARAM_READWRITE));

View file

@ -219,8 +219,7 @@ temp_file_invoker (GimpProcedure *procedure,
if (success)
{
file = gimp_get_temp_file (gimp, extension, error);
success = (file != NULL);
file = gimp_get_temp_file (gimp, extension);
}
return_vals = gimp_procedure_get_return_values (procedure, success,
@ -292,18 +291,12 @@ register_gimp_procs (GimpPDB *pdb)
"gimp-quit");
gimp_procedure_set_static_help (procedure,
"Causes GIMP to exit gracefully.",
"If there are unsaved images in an interactive GIMP session, the user will be asked for confirmation. If force is TRUE, the application is quit without querying the user to save any dirty images.\n"
"\n"
"This procedure is deprecated without any replacement. Scripts and plug-ins should not request the main process to exit. If you wish to run GIMP non-interactively so that it exits immediately when the batch script ends, call the executable with option `--quit`.\n"
"\n"
"Deprecated: There is no replacement for this procedure.",
"If there are unsaved images in an interactive GIMP session, the user will be asked for confirmation. If force is TRUE, the application is quit without querying the user to save any dirty images.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996");
gimp_procedure_set_deprecated (procedure,
"NONE");
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("force",
"force",

View file

@ -30,7 +30,7 @@
#include "internal-procs.h"
/* 786 procedures registered total */
/* 785 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)

View file

@ -48,38 +48,6 @@
#include "gimp-intl.h"
static GimpValueArray *
resources_loaded_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpValueArray *return_vals;
const gchar *type_name;
gboolean loaded = FALSE;
type_name = g_value_get_string (gimp_value_array_index (args, 0));
if (success)
{
if (g_type_from_name (type_name) == GIMP_TYPE_FONT)
loaded = ! gimp->no_fonts;
else
loaded = ! gimp->no_data;
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_boolean (gimp_value_array_index (return_vals, 1), loaded);
return return_vals;
}
static GimpValueArray *
resource_get_by_name_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -542,37 +510,6 @@ register_resource_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-resources-loaded
*/
procedure = gimp_procedure_new (resources_loaded_invoker, TRUE);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-resources-loaded");
gimp_procedure_set_static_help (procedure,
"Returns whether resource of a given type were loaded.",
"Returns whether resources of a given type were loaded.\n"
"In particular, it would return FALSE if GIMP was started with `--no-data` or `--no-fonts` for fonts.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Jehan",
"Jehan",
"2026");
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("type-name",
"type name",
"The name of the resource type e.g. GimpFont",
FALSE, FALSE, TRUE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("loaded",
"loaded",
"Whether resources of @type_name were loaded",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-resource-get-by-name
*/

View file

@ -1851,7 +1851,7 @@ register_vector_layer_procs (GimpPDB *pdb)
gimp_param_spec_unit ("unit",
"unit",
"The stroke width unit.",
TRUE,
FALSE,
FALSE,
gimp_unit_inch (),
GIMP_PARAM_READWRITE));

View file

@ -111,6 +111,10 @@ static gboolean gimp_plug_in_write (GIOChannel *channel,
static gboolean gimp_plug_in_flush (GIOChannel *channel,
gpointer data);
#if defined G_OS_WIN32 && defined WIN32_32BIT_DLL_FOLDER
static void gimp_plug_in_set_dll_directory (const gchar *path);
#endif
#ifndef G_OS_WIN32
static void gimp_plug_in_close_waitpid (GPid pid,
gint status,
@ -357,6 +361,39 @@ gimp_plug_in_flush (GIOChannel *channel,
return TRUE;
}
#if defined G_OS_WIN32 && defined WIN32_32BIT_DLL_FOLDER
static void
gimp_plug_in_set_dll_directory (const gchar *path)
{
LPWSTR w_path;
const gchar *install_dir;
gchar *bin_dir;
LPWSTR w_bin_dir;
DWORD BinaryType;
w_path = NULL;
w_bin_dir = NULL;
install_dir = gimp_installation_directory ();
if (path &&
(w_path = g_utf8_to_utf16 (path, -1, NULL, NULL, NULL)) &&
GetBinaryTypeW (w_path, &BinaryType) &&
BinaryType == SCS_32BIT_BINARY)
bin_dir = g_build_filename (install_dir, WIN32_32BIT_DLL_FOLDER, NULL);
else
bin_dir = g_build_filename (install_dir, "bin", NULL);
w_bin_dir = g_utf8_to_utf16 (bin_dir, -1, NULL, NULL, NULL);
if (w_bin_dir)
{
SetDllDirectoryW (w_bin_dir);
g_free (w_bin_dir);
}
g_free (bin_dir);
g_free (w_path);
}
#endif
#ifndef G_OS_WIN32
static void
gimp_plug_in_close_waitpid (GPid pid,
@ -612,6 +649,9 @@ gimp_plug_in_open (GimpPlugIn *plug_in,
/* Fork another process. We'll remember the process id so that we
* can later use it to kill the filter if necessary.
*/
#if defined G_OS_WIN32 && defined WIN32_32BIT_DLL_FOLDER
gimp_plug_in_set_dll_directory (argv[0]);
#endif
if (! gimp_spawn_async (argv, envp, spawn_flags, &plug_in->pid, &error))
{
gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
@ -650,6 +690,10 @@ gimp_plug_in_open (GimpPlugIn *plug_in,
cleanup:
#if defined G_OS_WIN32 && defined WIN32_32BIT_DLL_FOLDER
gimp_plug_in_set_dll_directory (NULL);
#endif
if (debug)
g_free (argv);

View file

@ -588,11 +588,7 @@ file_convert_string (const gchar *instr,
}
*tmpptr = '\0';
#ifndef _UCRT
sscanf ((gchar *) tmp, "%o", &k);
#else
sscanf_s ((gchar *) tmp, "%o", &k);
#endif
*(uout++) = k;
break;
@ -630,12 +626,7 @@ file_check_single_magic (const gchar *offset,
gchar num_operator;
/* Check offset */
#ifndef _UCRT
if (sscanf (offset, "%ld", &offs) != 1)
#else
if (sscanf_s (offset, "%ld", &offs) != 1)
#endif
return FILE_MATCH_NONE;
/* Check type of test */
@ -676,23 +667,11 @@ file_check_single_magic (const gchar *offset,
if (g_ascii_isdigit (num_operator_ptr[1]))
{
if (num_operator_ptr[1] != '0') /* decimal */
#ifndef _UCRT
sscanf (num_operator_ptr+1, "%lu", &num_operator_val);
#else
sscanf_s (num_operator_ptr+1, "%lu", &num_operator_val);
#endif
else if (num_operator_ptr[2] == 'x') /* hexadecimal */
#ifndef _UCRT
sscanf (num_operator_ptr+3, "%lx", &num_operator_val);
#else
sscanf_s (num_operator_ptr+3, "%lx", &num_operator_val);
#endif
else /* octal */
#ifndef _UCRT
sscanf (num_operator_ptr+2, "%lo", &num_operator_val);
#else
sscanf_s (num_operator_ptr+2, "%lo", &num_operator_val);
#endif
num_operator = *num_operator_ptr;
}

View file

@ -1117,28 +1117,17 @@ extensions_parse (gchar *extensions)
{
gchar *extension;
gchar *next_token;
#ifdef _UCRT
gchar *context = NULL;
#endif
/* work on a copy */
extensions = g_strdup (extensions);
next_token = extensions;
#ifndef _UCRT
extension = strtok (next_token, " \t,");
#else
extension = strtok_s (next_token, " \t,", &context);
#endif
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
#ifndef _UCRT
extension = strtok (NULL, " \t,");
#else
extension = strtok_s (NULL, " \t,", &context);
#endif
}
g_free (extensions);

View file

@ -43,12 +43,12 @@ typedef struct
gdouble min; /* minimal allowable slider value */
gdouble max; /* maximal allowable slider value */
guint visible : 1; /* slider is visible */
guint selectable : 1; /* slider is selectable */
guint movable : 1; /* slider movable */
guint removable : 1; /* slider is removable */
gboolean visible : 1; /* slider is visible */
gboolean selectable : 1; /* slider is selectable */
gboolean movable : 1; /* slider movable */
gboolean removable : 1; /* slider is removable */
guint autohide : 1; /* whether to autohide the slider */
gboolean autohide : 1; /* whether to autohide the slider */
GimpHandleType type; /* slider handle type */
gdouble size; /* slider handle size, as a fraction of *
* the default size */

View file

@ -217,7 +217,7 @@ gimp_font_factory_finalize (GObject *object)
g_slist_free_full (GET_PRIVATE (font_factory)->fonts_renaming_config, (GDestroyNotify) g_free);
g_free (GET_PRIVATE (font_factory)->sysconf);
g_free (GET_PRIVATE (font_factory)->conf);
g_clear_object (&GET_PRIVATE (font_factory)->pango_context);
g_object_unref (GET_PRIVATE (font_factory)->pango_context);
FcConfigDestroy (FcConfigGetCurrent ());
G_OBJECT_CLASS (parent_class)->finalize (object);
@ -867,7 +867,7 @@ gimp_font_factory_load_names (GimpFontFactory *factory)
fd = g_open ((gchar *) file, O_RDONLY, 0);
if (fd == -1)
{
g_string_append_printf (ignored_fonts, "- %s (access error: %s)\n", file, g_strerror (errno));
g_string_append_printf (ignored_fonts, "- %s (access error: %s)\n", file, strerror (errno));
n_ignored++;
continue;
}

View file

@ -89,22 +89,6 @@ gimp_text_from_parasite (const GimpParasite *parasite,
gboolean has_markup = g_str_has_prefix (parasite_data, "(markup ");
GimpParasite *new_parasite = NULL;
GString *new_data;
gboolean edited_data = FALSE;
if (! has_markup && strstr (parasite_data, "(markup \"\")") != NULL)
{
/* A bug in GIMP 3.2.2 may have created files with both a text
* and an empty markup. Get rid of the markup which is invalid
* anyway, so that it doesn't override the bare text.
* See #16169.
*/
new_data = g_string_new (parasite_data);
g_string_replace (new_data, "(markup \"\")", "", 1);
parasite_data = g_string_free (new_data, FALSE);
parasite_data_size = strlen (parasite_data) + 1;
edited_data = TRUE;
}
*before_xcf_v19 = (strstr (parasite_data, "(font \"GimpFont\"") == NULL);
/* This is for backward compatibility with older xcf files.
@ -193,14 +177,6 @@ gimp_text_from_parasite (const GimpParasite *parasite,
g_string_free (new_data, TRUE);
}
else if (edited_data)
{
new_parasite = gimp_parasite_new (gimp_parasite_get_name (parasite),
gimp_parasite_get_flags (parasite),
parasite_data_size,
parasite_data);
parasite = new_parasite;
}
if (error == NULL || *error == NULL)
gimp_config_deserialize_parasite (GIMP_CONFIG (text),
@ -209,8 +185,6 @@ gimp_text_from_parasite (const GimpParasite *parasite,
error);
gimp_parasite_free (new_parasite);
if (edited_data)
g_free (parasite_data);
}
else
{

View file

@ -106,19 +106,11 @@ gimp_text_font_name_from_xlfd (const gchar *xlfd)
switch (*fields[i])
{
case 'i':
#ifndef _UCRT
strcpy (buffers[i], "italic");
#else
strcpy_s (buffers[i], sizeof (buffers[i]), "italic");
#endif
i++;
break;
case 'o':
#ifndef _UCRT
strcpy (buffers[i], "oblique");
#else
strcpy_s (buffers[i], sizeof (buffers[i]), "oblique");
#endif
i++;
break;
case 'r':

View file

@ -112,8 +112,6 @@ struct _GimpEditSelectionTool
gdouble last_motion_x; /* Previous coords sent to _motion */
gdouble last_motion_y;
gboolean saved_show_selection;
};
struct _GimpEditSelectionToolClass
@ -179,8 +177,7 @@ gimp_edit_selection_tool_init (GimpEditSelectionTool *edit_select)
{
GimpTool *tool = GIMP_TOOL (edit_select);
edit_select->first_move = TRUE;
edit_select->saved_show_selection = FALSE;
edit_select->first_move = TRUE;
gimp_tool_control_set_active_modifiers (tool->control,
GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
@ -231,9 +228,6 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
shell = gimp_display_get_shell (display);
image = gimp_display_get_image (display);
edit_select->saved_show_selection =
gimp_display_shell_get_show_selection (shell);
/* Make a check to see if it should be a floating selection translation */
if ((edit_mode == GIMP_TRANSLATE_MODE_MASK_TO_LAYER ||
edit_mode == GIMP_TRANSLATE_MODE_MASK_COPY_TO_LAYER) &&
@ -250,11 +244,6 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
edit_mode = GIMP_TRANSLATE_MODE_FLOATING_SEL;
}
/* Turn off "marching ants" when moving selections or floating layers
* for better performance. */
if (edit_mode == GIMP_TRANSLATE_MODE_FLOATING_SEL)
gimp_display_shell_set_show_selection (shell, FALSE);
edit_select->edit_mode = edit_mode;
gimp_edit_selection_tool_start_undo_group (edit_select, image);
@ -471,9 +460,6 @@ gimp_edit_selection_tool_button_release (GimpTool *tool,
shell->equidistance_side_vertical = GIMP_ARRANGE_HFILL;
shell->snapped_side_horizontal = GIMP_ARRANGE_HFILL;
shell->snapped_side_vertical = GIMP_ARRANGE_HFILL;
gimp_display_shell_set_show_selection (shell,
edit_select->saved_show_selection);
}
static void

View file

@ -612,7 +612,6 @@ gimp_selection_tool_start_edit (GimpSelectionTool *sel_tool,
{
GimpTool *tool;
GimpSelectionOptions *options;
GimpDisplayShell *shell;
GError *error = NULL;
g_return_val_if_fail (GIMP_IS_SELECTION_TOOL (sel_tool), FALSE);
@ -621,7 +620,6 @@ gimp_selection_tool_start_edit (GimpSelectionTool *sel_tool,
tool = GIMP_TOOL (sel_tool);
options = GIMP_SELECTION_TOOL_GET_OPTIONS (sel_tool);
shell = gimp_display_get_shell (display);
g_return_val_if_fail (gimp_tool_control_is_active (tool->control) == FALSE,
FALSE);
@ -660,9 +658,6 @@ gimp_selection_tool_start_edit (GimpSelectionTool *sel_tool,
gimp_edit_selection_tool_start (tool, display, coords,
edit_mode, FALSE);
/* Turn off selection for performance if moved as floating selection */
gimp_display_shell_set_show_selection (shell, FALSE);
return TRUE;
}

View file

@ -26,7 +26,6 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@ -539,6 +538,14 @@ gimp_text_tool_editor_key_press (GimpTextTool *text_tool,
}
}
if (gtk_im_context_filter_keypress (text_tool->im_context, kevent))
{
text_tool->needs_im_reset = TRUE;
text_tool->x_pos = -1;
return TRUE;
}
gimp_text_tool_convert_gdkkeyevent (text_tool, kevent);
gimp_text_tool_ensure_proxy (text_tool);
@ -551,14 +558,6 @@ gimp_text_tool_editor_key_press (GimpTextTool *text_tool,
return TRUE;
}
if (gtk_im_context_filter_keypress (text_tool->im_context, kevent))
{
text_tool->needs_im_reset = TRUE;
text_tool->x_pos = -1;
return TRUE;
}
gtk_text_buffer_get_iter_at_mark (buffer, &cursor,
gtk_text_buffer_get_insert (buffer));
gtk_text_buffer_get_iter_at_mark (buffer, &selection,
@ -1358,13 +1357,6 @@ gimp_text_tool_change_size (GimpTextTool *text_tool,
GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
GtkTextIter start;
GtkTextIter end;
gdouble default_size;
gdouble x_res, y_res;
gimp_image_get_resolution (text_tool->image, &x_res, &y_res);
default_size = gimp_units_to_points (text_tool->text->font_size,
text_tool->text->unit, y_res);
if (! gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
{
@ -1373,7 +1365,7 @@ gimp_text_tool_change_size (GimpTextTool *text_tool,
gtk_text_iter_order (&start, &end);
gimp_text_buffer_change_size (text_tool->buffer, &start, &end,
amount * PANGO_SCALE, default_size * PANGO_SCALE);
amount * PANGO_SCALE);
}
static void

View file

@ -32,12 +32,12 @@
#include "unique.h"
#if !defined(G_OS_WIN32) && !defined(PLATFORM_OSX)
#ifndef G_OS_WIN32
static gboolean gimp_unique_dbus_open (const gchar **filenames,
gboolean as_new);
static gboolean gimp_unique_dbus_batch_run (const gchar *batch_interpreter,
const gchar **batch_commands);
#elif defined(G_OS_WIN32)
#else
static gboolean gimp_unique_win32_open (const gchar **filenames,
gboolean as_new);
#endif
@ -147,7 +147,7 @@ gimp_unique_win32_open (const gchar **filenames,
return FALSE;
}
#elif !defined(PLATFORM_OSX)
#else
static gboolean
gimp_unique_dbus_open (const gchar **filenames,

View file

@ -632,20 +632,6 @@ gimp_action_get_display_accels (GimpAction *action)
accels = g_strdupv (GET_PRIVATE (action)->accels);
/* "windows-hide-docks" has no registered accelerator because Tab takes
* precedence over standard accessibility usage across the whole software.
* Inject a cosmetic display hint so the menu label and shortcut editor
* both show "Tab" without registering a real accelerator.
*/
if ((accels == NULL || accels[0] == NULL) &&
g_strcmp0 (gimp_action_get_name (action), "windows-hide-docks") == 0)
{
g_strfreev (accels);
accels = g_new0 (gchar *, 2);
accels[0] = gtk_accelerator_get_label (GDK_KEY_Tab, 0);
return accels;
}
for (i = 0; accels != NULL && accels[i] != NULL; i++)
{
guint accel_key = 0;

View file

@ -369,7 +369,7 @@ gimp_colormap_editor_color_update (GimpColorDialog *dialog,
{
push_undo = TRUE;
if ((guint)state & (guint)gimp_get_toggle_behavior_mask ())
if (state & gimp_get_toggle_behavior_mask ())
gimp_context_set_background (image_editor->context, color);
else
gimp_context_set_foreground (image_editor->context, color);

View file

@ -163,7 +163,7 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
target_list = gtk_drag_dest_get_target_list (GTK_WIDGET (tree_view->view));
target_atom = gtk_drag_dest_find_target (GTK_WIDGET (tree_view->view),
context, target_list);
if (! gtk_target_list_find (target_list, target_atom, (guint *) &src_type))
if (! gtk_target_list_find (target_list, target_atom, &src_type))
goto drop_impossible;
switch (src_type)

View file

@ -1229,7 +1229,7 @@ gimp_dashboard_init (GimpDashboard *dashboard)
gimp_meter_set_history_resolution (GIMP_METER (meter),
interval / 1000.0);
gimp_meter_set_history_duration (GIMP_METER (meter),
(gdouble) priv->history_duration / 1000.0);
priv->history_duration / 1000.0);
gtk_box_pack_start (GTK_BOX (vbox2), meter, FALSE, FALSE, 0);
gtk_widget_show (meter);
@ -2418,11 +2418,6 @@ static void
gimp_dashboard_sample_memory_used (GimpDashboard *dashboard,
Variable variable)
{
#ifdef TASK_VM_INFO_REV0_COUNT
task_vm_info_data_t info;
mach_msg_type_number_t infoCount;
#endif
GimpDashboardPrivate *priv = dashboard->priv;
VariableData *variable_data = &priv->variables[variable];
@ -2438,7 +2433,8 @@ gimp_dashboard_sample_memory_used (GimpDashboard *dashboard,
variable_data->available = TRUE;
variable_data->value.size = info.resident_size;
#else
infoCount = TASK_VM_INFO_COUNT;
task_vm_info_data_t info;
mach_msg_type_number_t infoCount = TASK_VM_INFO_COUNT;
if( task_info(mach_task_self (), TASK_VM_INFO,
(task_info_t)&info, &infoCount ) != KERN_SUCCESS )
@ -2589,11 +2585,7 @@ gimp_dashboard_sample_memory_used (GimpDashboard *dashboard,
buffer[size] = '\0';
#ifndef _UCRT
if (sscanf (buffer, "%*u %llu %llu", &resident, &shared) != 2)
#else
if (sscanf_s (buffer, "%*u %llu %llu", &resident, &shared) != 2)
#endif
return;
variable_data->available = TRUE;
@ -4978,7 +4970,7 @@ gimp_dashboard_set_history_duration (GimpDashboard *dashboard,
if (group_data->meter)
{
gimp_meter_set_history_duration (group_data->meter,
(gdouble) history_duration / 1000.0);
history_duration / 1000.0);
}
}

View file

@ -795,11 +795,7 @@ gimp_device_info_pad_action_map_foreach (GimpPadActions *pad_actions,
label = g_strdup (gimp_action_get_label (action));
accel_pos = g_utf8_strchr (label, -1, '_');
if (accel_pos)
#ifndef _UCRT
strcpy (accel_pos, accel_pos + 1);
#else
strcpy_s (accel_pos, strlen (accel_pos), accel_pos + 1);
#endif
gtk_pad_controller_set_action (controller,
/* Action type enums are binary compatible */

View file

@ -297,6 +297,7 @@ gimp_device_info_editor_constructed (GObject *object)
* not break anything in this use case anyway).
*/
GimpCurve *curve;
gchar *title;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *view;
@ -304,10 +305,22 @@ gimp_device_info_editor_constructed (GObject *object)
GtkWidget *combo;
GtkWidget *button;
frame = gimp_frame_new (_("Pressure Curve"));
/* TODO: right now this string is split in 2 localized strings,
* to avoid breaking string freeze. After GIMP 3.2, we should just
* create the "Pressure Curve" string because that's our only
* case so far.
*/
/* e.g. "Pressure Curve" for mapping input device axes */
title = g_strdup_printf (_("%s Curve"),
_("Pressure"));
frame = gimp_frame_new (title);
gtk_box_pack_start (GTK_BOX (editor), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
g_free (title);
curve = gimp_device_info_get_curve (private->info, GDK_AXIS_PRESSURE);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);

View file

@ -126,6 +126,7 @@ _gimp_drawable_tree_view_filter_editor_show (GimpDrawableTreeView *view,
GimpDrawableTreeViewFiltersEditor *editor = view->editor;
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
GimpContainer *filters;
GList *list;
gint n_editable;
gboolean visible = FALSE;
@ -284,7 +285,17 @@ _gimp_drawable_tree_view_filter_editor_show (GimpDrawableTreeView *view,
}
filters = gimp_drawable_get_filters (drawable);
visible = gimp_drawable_has_visible_filters (drawable);
for (list = GIMP_LIST (filters)->queue->tail;
list;
list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
if (gimp_filter_get_active (list->data))
visible = TRUE;
}
}
/* Set the initial value for the effect visibility toggle */
g_signal_handlers_block_by_func (editor->visible_button,
@ -433,7 +444,6 @@ gimp_drawable_filters_editor_set_sensitive (GimpDrawableTreeView *view)
GimpContainer *filters;
gboolean is_group = FALSE;
gboolean is_editable = FALSE;
gboolean is_temporary;
gboolean has_visible_filters;
gint index;
@ -441,8 +451,6 @@ gimp_drawable_filters_editor_set_sensitive (GimpDrawableTreeView *view)
index = gimp_container_get_child_index (filters,
GIMP_OBJECT (editor->filter));
is_temporary = (gimp_drawable_filter_get_temporary (editor->filter) ||
! gimp_drawable_filter_get_mask (editor->filter));
/* do not allow merging down effects on group layers */
if (gimp_viewable_get_children (GIMP_VIEWABLE (editor->drawable)))
@ -454,19 +462,10 @@ gimp_drawable_filters_editor_set_sensitive (GimpDrawableTreeView *view)
is_editable = (index >= first_editable &&
index <= last_editable);
g_signal_handlers_block_by_func (editor->visible_button,
gimp_drawable_filters_editor_visible_all_toggled,
view);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->visible_button),
has_visible_filters);
g_signal_handlers_unblock_by_func (editor->visible_button,
gimp_drawable_filters_editor_visible_all_toggled,
view);
gtk_widget_set_sensitive (editor->visible_button,
TRUE);
gtk_widget_set_sensitive (editor->edit_button,
is_editable && ! is_temporary);
is_editable);
gtk_widget_set_sensitive (editor->raise_button,
index > first_editable);
gtk_widget_set_sensitive (editor->lower_button,
@ -474,11 +473,10 @@ gimp_drawable_filters_editor_set_sensitive (GimpDrawableTreeView *view)
gtk_widget_set_sensitive (editor->merge_button,
! is_group &&
has_visible_filters &&
! is_temporary &&
(! GIMP_IS_RASTERIZABLE (editor->drawable) ||
gimp_rasterizable_is_rasterized (GIMP_RASTERIZABLE (editor->drawable))));
gtk_widget_set_sensitive (editor->remove_button,
is_editable && ! is_temporary);
is_editable);
if (is_group ||
(GIMP_IS_RASTERIZABLE (editor->drawable) &&

View file

@ -504,17 +504,9 @@ gimp_file_proc_view_pattern_from_extension (const gchar *extension,
pattern = g_new (gchar, 6 + 4 * len);
if (is_meta)
#ifndef _UCRT
strcpy (pattern, "*.*.");
#else
strcpy_s (pattern, 6 + 4 * len, "*.*.");
#endif
else
#ifndef _UCRT
strcpy (pattern, "*.");
#else
strcpy_s (pattern, 6 + 4 * len, "*.");
#endif
for (i = 0, p = pattern + 2; i < len; i++, p+= 4)
{

View file

@ -190,8 +190,8 @@ gimp_fill_editor_constructed (GObject *object)
"pattern-view-size");
gimp_enum_radio_box_add (GTK_BOX (box), pattern_box,
(editor->use_custom_style ?
(gint) GIMP_CUSTOM_STYLE_PATTERN :
(gint) GIMP_FILL_STYLE_PATTERN),
GIMP_CUSTOM_STYLE_PATTERN :
GIMP_FILL_STYLE_PATTERN),
FALSE);
}

View file

@ -729,20 +729,7 @@ gimp_help_get_locales (Gimp *gimp)
static GFile *
gimp_help_get_user_manual_basedir (void)
{
GFile *user_dir;
GFile *sys_dir;
/* 1. Help is on user settings (e.g. for AppImage, macOS .app) */
user_dir = gimp_directory_file ("help", NULL);
if (g_file_query_exists (user_dir, NULL))
{
return user_dir;
}
/* 2. Fallback: help is on user installation */
g_object_unref (user_dir);
sys_dir = gimp_data_directory_file ("help", NULL);
return sys_dir;
return gimp_data_directory_file ("help", NULL);
}
static void

View file

@ -40,6 +40,7 @@
#include "core/gimpchannel.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpfilloptions.h"
#include "core/gimpimage-undo.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimpimage.h"
@ -52,6 +53,7 @@
#include "core/gimptreehandler.h"
#include "path/gimpvectorlayer.h"
#include "path/gimpvectorlayeroptions.h"
#include "text/gimptextlayer.h"
@ -755,14 +757,25 @@ gimp_layer_tree_view_drop_viewables (GimpContainerTreeView *view,
gimp_item_is_vector_layer (GIMP_ITEM (dest_viewable)) &&
GIMP_IS_PATTERN (src_viewable))
{
gimp_vector_layer_set (GIMP_VECTOR_LAYER (dest_viewable), NULL,
"fill-style", GIMP_CUSTOM_STYLE_PATTERN,
"fill-pattern", GIMP_PATTERN (src_viewable),
NULL);
GimpVectorLayerOptions *vector_options = NULL;
GimpFillOptions *vector_fill = NULL;
gimp_vector_layer_refresh (GIMP_VECTOR_LAYER (dest_viewable));
gimp_image_flush (gimp_item_tree_view_get_image (item_view));
return;
vector_options =
gimp_vector_layer_get_options (GIMP_VECTOR_LAYER (dest_viewable));
if (vector_options)
vector_fill = vector_options->fill_options;
if (vector_fill)
{
gimp_context_set_pattern (GIMP_CONTEXT (vector_fill),
GIMP_PATTERN (src_viewable));
gimp_fill_options_set_custom_style (vector_fill,
GIMP_CUSTOM_STYLE_PATTERN);
gimp_vector_layer_refresh (GIMP_VECTOR_LAYER (dest_viewable));
gimp_image_flush (gimp_item_tree_view_get_image (item_view));
return;
}
}
}
@ -790,14 +803,24 @@ gimp_layer_tree_view_drop_color (GimpContainerTreeView *view,
}
else if (gimp_item_is_vector_layer (GIMP_ITEM (dest_viewable)))
{
gimp_vector_layer_set (GIMP_VECTOR_LAYER (dest_viewable), NULL,
"fill-style", GIMP_CUSTOM_STYLE_SOLID_COLOR,
"fill-color", color,
NULL);
GimpVectorLayerOptions *vector_options = NULL;
GimpFillOptions *vector_fill = NULL;
gimp_vector_layer_refresh (GIMP_VECTOR_LAYER (dest_viewable));
gimp_image_flush (gimp_item_tree_view_get_image (item_view));
return;
vector_options =
gimp_vector_layer_get_options (GIMP_VECTOR_LAYER (dest_viewable));
if (vector_options)
vector_fill = vector_options->fill_options;
if (vector_fill)
{
gimp_context_set_foreground (GIMP_CONTEXT (vector_fill), color);
gimp_fill_options_set_custom_style (vector_fill,
GIMP_CUSTOM_STYLE_SOLID_COLOR);
gimp_vector_layer_refresh (GIMP_VECTOR_LAYER (dest_viewable));
gimp_image_flush (gimp_item_tree_view_get_image (item_view));
return;
}
}
GIMP_CONTAINER_TREE_VIEW_CLASS (parent_class)->drop_color (view, color,

View file

@ -593,7 +593,7 @@ gimp_menu_section_items_changed (GMenuModel *model,
GtkWidget *separator;
gboolean found = FALSE;
gint count = position;
/*gint real_pos = 0;*/
gint real_pos = 0;
separator = g_hash_table_lookup (menu->priv->sections, model);
g_return_if_fail (separator != NULL);
@ -601,7 +601,7 @@ gimp_menu_section_items_changed (GMenuModel *model,
children = gtk_container_get_children (GTK_CONTAINER (menu));
for (iter = children; iter; iter = iter->next)
{
/*real_pos++;*/
real_pos++;
if (! found)
{

View file

@ -599,7 +599,7 @@ gimp_modifiers_editor_notify_accelerator (GtkWidget *widget,
GdkModifierType old_modifiers;
GdkModifierType modifiers;
old_modifiers = (GdkModifierType) GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "shortcut-modifiers"));
old_modifiers = (GdkModifierType) g_object_get_data (G_OBJECT (widget), "shortcut-modifiers");
shortcut = g_object_get_data (G_OBJECT (widget), "shortcut-button");
combo = g_object_get_data (G_OBJECT (widget), "shortcut-action");

View file

@ -588,13 +588,8 @@ gimp_selection_data_get_image (GtkSelectionData *selection,
gint pid;
gint ID;
#ifndef _UCRT
if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
pid == gimp_get_pid ())
#else
if (sscanf_s (str, "%i:%i", &pid, &ID) == 2 &&
pid == gimp_get_pid ())
#endif
{
return gimp_image_get_by_id (gimp, ID);
}
@ -644,13 +639,8 @@ gimp_selection_data_get_component (GtkSelectionData *selection,
gint ID;
gint ch;
#ifndef _UCRT
if (sscanf (str, "%i:%i:%i", &pid, &ID, &ch) == 3 &&
pid == gimp_get_pid ())
#else
if (sscanf_s (str, "%i:%i:%i", &pid, &ID, &ch) == 3 &&
pid == gimp_get_pid ())
#endif
{
GimpImage *image = gimp_image_get_by_id (gimp, ID);
@ -698,13 +688,8 @@ gimp_selection_data_get_item (GtkSelectionData *selection,
gint pid;
gint ID;
#ifndef _UCRT
if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
pid == gimp_get_pid ())
#else
if (sscanf_s (str, "%i:%i", &pid, &ID) == 2 &&
pid == gimp_get_pid ())
#endif
{
return gimp_item_get_by_id (gimp, ID);
}
@ -976,13 +961,8 @@ gimp_selection_data_get_object (GtkSelectionData *selection,
gpointer object_addr;
gint name_offset = 0;
#ifndef _UCRT
if (sscanf (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 &&
pid == gimp_get_pid () && name_offset > 0)
#else
if (sscanf_s (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 &&
pid == gimp_get_pid () && name_offset > 0)
#endif
{
const gchar *name = str + name_offset;

View file

@ -442,8 +442,7 @@ void
gimp_text_buffer_change_size (GimpTextBuffer *buffer,
const GtkTextIter *start,
const GtkTextIter *end,
gint count,
gint default_size)
gint count)
{
GtkTextIter iter;
GtkTextIter span_start;
@ -480,19 +479,16 @@ gimp_text_buffer_change_size (GimpTextBuffer *buffer,
if (iter_size != span_size ||
gtk_text_iter_compare (&iter, end) >= 0)
{
gint base_size = (span_size == 0) ? default_size : span_size;
gint new_size = base_size + count;
if (span_size != 0)
{
gtk_text_buffer_remove_tag (GTK_TEXT_BUFFER (buffer), span_tag,
&span_start, &span_end);
}
if (new_size > 0)
if ((span_size + count) > 0)
{
span_tag = gimp_text_buffer_get_size_tag (buffer,
new_size);
span_size + count);
gtk_text_buffer_apply_tag (GTK_TEXT_BUFFER (buffer), span_tag,
&span_start, &span_end);
@ -1380,11 +1376,7 @@ gimp_text_buffer_name_to_tag (GimpTextBuffer *buffer,
guint r, g, b;
guchar rgb[3];
#ifndef _UCRT
sscanf (value, "#%02x%02x%02x", &r, &g, &b);
#else
sscanf_s (value, "#%02x%02x%02x", &r, &g, &b);
#endif
rgb[0] = r;
rgb[1] = g;
rgb[2] = b;

View file

@ -91,8 +91,7 @@ void gimp_text_buffer_set_size (GimpTextBuffer *buff
void gimp_text_buffer_change_size (GimpTextBuffer *buffer,
const GtkTextIter *start,
const GtkTextIter *end,
gint amount,
gint default_size);
gint amount);
GtkTextTag * gimp_text_buffer_get_iter_baseline (GimpTextBuffer *buffer,
const GtkTextIter *iter,

View file

@ -923,7 +923,7 @@ gimp_window_set_hint (GtkWindow *window,
/* similar to what we have in libgimp/gimpui.c */
/* TODO: Restore when we use it on Windows */
#if !defined(G_OS_WIN32) && !defined(PLATFORM_OSX)
#ifndef G_OS_WIN32
static GdkWindow *
gimp_get_foreign_window (gpointer window)
{
@ -2595,7 +2595,7 @@ gimp_window_set_transient_cb (GtkWidget *window,
GdkEventAny *event G_GNUC_UNUSED,
GBytes *handle)
{
#if !defined(G_OS_WIN32) && !defined(PLATFORM_OSX)
#ifndef G_OS_WIN32
gboolean transient_set = FALSE;
#endif

View file

@ -2613,8 +2613,8 @@ xcf_load_layer_props (XcfInfo *info,
{
gimp_message (info->gimp, G_OBJECT (info->progress),
GIMP_MESSAGE_WARNING,
_("XCF Warning: invalid link in XCF file. "
"The link layer \"%s\" is downgraded to a raster layer."),
"XCF Warning: invalid link in XCF file. "
"The link layer \"%s\" is downgraded to a raster layer.",
gimp_object_get_name (*layer));
}
else
@ -2633,8 +2633,8 @@ xcf_load_layer_props (XcfInfo *info,
{
gimp_message (info->gimp, G_OBJECT (info->progress),
GIMP_MESSAGE_WARNING,
_("XCF Warning: circular reference detected in XCF file. "
"The link layer \"%s\" is downgraded to a raster layer."),
"XCF Warning: cycling link detected in XCF file. "
"The link layer \"%s\" is downgraded to a raster layer.",
gimp_object_get_name (*layer));
ignore = TRUE;
break;
@ -4939,7 +4939,7 @@ xcf_load_tile_rle (XcfInfo *info,
{
guchar *data = tile_data + i;
gint size = tile_rect->width * tile_rect->height;
/*gint count = 0;*/
gint count = 0;
guchar val;
gint length;
gint j;
@ -4968,7 +4968,7 @@ xcf_load_tile_rle (XcfInfo *info,
xcfdata += 2;
}
/*count += length;*/
count += length;
size -= length;
if (size < 0)
@ -5002,7 +5002,7 @@ xcf_load_tile_rle (XcfInfo *info,
xcfdata += 2;
}
/*count += length;*/
count += length;
size -= length;
if (size < 0)

View file

@ -332,11 +332,7 @@ xcf_save_image (XcfInfo *info,
}
else
{
#ifndef _UCRT
strcpy (version_tag, "gimp xcf file");
#else
strcpy_s (version_tag, sizeof (version_tag), "gimp xcf file");
#endif
}
xcf_write_int8_check_error (info, (guint8 *) version_tag, 14, ;);
@ -1865,7 +1861,7 @@ xcf_save_prop (XcfInfo *info,
g_return_val_if_reached (FALSE);
xcf_write_int32_check_error (info, &item_type, 1, va_end (args));
if (! gimp_item_list_is_pattern (set, (GimpSelectMethod *) &method))
if (! gimp_item_list_is_pattern (set, &method))
method = G_MAXUINT32;
xcf_write_int32_check_error (info, &method, 1, va_end (args));

View file

@ -19,7 +19,7 @@ case $(readlink /proc/$$/exe) in
esac
set -e
if [ "$0" != 'build/linux/appimage/3_dist-gimp-goappimage.sh' ] && [ $(basename "$PWD") != 'appimage' ]; then
printf '\033[31m(ERROR)\033[0m: Script called from wrong dir. Please, call this script from the root of gimp source dir\n'
printf '\033[31m(ERROR)\033[0m: Script called from wrong dir. Please, call this script from the root of gimp git dir\n'
exit 1
elif [ $(basename "$PWD") = 'appimage' ]; then
cd ../../..
@ -380,8 +380,6 @@ conf_app GS_LIB "share/ghostscript/10*/Resource/Init"
### file-wmf support
bund_usr "$UNIX_PREFIX" "share/fonts/type1/urw-base35/Nimbus*" --dest "share/libwmf/fonts"
bund_usr "$UNIX_PREFIX" "share/fonts/type1/urw-base35/StandardSymbols*" --dest "share/libwmf/fonts"
### "Send by Email" support
bund_usr "$UNIX_PREFIX" "bin/xdg-email"
### Debug menu: if show_debug_menu is true in app/main.c or --show-debug-menu CLI option is set
#### Image graph support
bund_usr "$UNIX_PREFIX" "bin/libgvc*" --rename "bin/dot"

View file

@ -14,7 +14,7 @@ elif [ $(basename "$PWD") = 'flatpak' ]; then
cd ../../..
fi
if [ -z "$GITLAB_CI" ]; then
git submodule update --init || true #true is for this script work on tarballs too
git submodule update --init
fi

Some files were not shown because too many files have changed in this diff Show more