Full Code of c-koi/gmic-qt for AI

master aa4a6f4ab174 cached
242 files
3.0 MB
801.6k tokens
521 symbols
1 requests
Download .txt
Showing preview only (3,365K chars total). Download the full file or copy to clipboard to get everything.
Repository: c-koi/gmic-qt
Branch: master
Commit: aa4a6f4ab174
Files: 242
Total size: 3.0 MB

Directory structure:
gitextract_b0uqak3u/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── .travis.yml
├── CMakeLists.txt
├── COPYING
├── NEW_HOST_HOWTO.md
├── README.md
├── STANDALONE.md
├── check_versions.sh
├── cmake/
│   └── modules/
│       ├── COPYING-CMAKE-SCRIPTS
│       ├── FindFFTW3.cmake
│       └── LibFindMacros.cmake
├── gmic_qt.desktop
├── gmic_qt.pro
├── gmic_qt.qrc
├── icons/
│   └── application/
│       └── gmic_qt.icns
├── pkg-config-check.sh
├── pre_version.sh
├── scripts/
│   ├── travis_build_cmake.sh
│   └── travis_build_qmake.sh
├── src/
│   ├── ClickableLabel.cpp
│   ├── ClickableLabel.h
│   ├── Common.cpp
│   ├── Common.h
│   ├── CroppedActiveLayerProxy.cpp
│   ├── CroppedActiveLayerProxy.h
│   ├── CroppedImageListProxy.cpp
│   ├── CroppedImageListProxy.h
│   ├── DialogSettings.cpp
│   ├── DialogSettings.h
│   ├── FilterGuiDynamismCache.cpp
│   ├── FilterGuiDynamismCache.h
│   ├── FilterParameters/
│   │   ├── AbstractParameter.cpp
│   │   ├── AbstractParameter.h
│   │   ├── BoolParameter.cpp
│   │   ├── BoolParameter.h
│   │   ├── ButtonParameter.cpp
│   │   ├── ButtonParameter.h
│   │   ├── ChoiceParameter.cpp
│   │   ├── ChoiceParameter.h
│   │   ├── ColorParameter.cpp
│   │   ├── ColorParameter.h
│   │   ├── ConstParameter.cpp
│   │   ├── ConstParameter.h
│   │   ├── CustomDoubleSpinBox.cpp
│   │   ├── CustomDoubleSpinBox.h
│   │   ├── CustomSpinBox.cpp
│   │   ├── CustomSpinBox.h
│   │   ├── FileParameter.cpp
│   │   ├── FileParameter.h
│   │   ├── FilterParametersWidget.cpp
│   │   ├── FilterParametersWidget.h
│   │   ├── FloatParameter.cpp
│   │   ├── FloatParameter.h
│   │   ├── FolderParameter.cpp
│   │   ├── FolderParameter.h
│   │   ├── IntParameter.cpp
│   │   ├── IntParameter.h
│   │   ├── LinkParameter.cpp
│   │   ├── LinkParameter.h
│   │   ├── MultilineTextParameterWidget.cpp
│   │   ├── MultilineTextParameterWidget.h
│   │   ├── NoteParameter.cpp
│   │   ├── NoteParameter.h
│   │   ├── PointParameter.cpp
│   │   ├── PointParameter.h
│   │   ├── SeparatorParameter.cpp
│   │   ├── SeparatorParameter.h
│   │   ├── TextParameter.cpp
│   │   └── TextParameter.h
│   ├── FilterSelector/
│   │   ├── FavesModel.cpp
│   │   ├── FavesModel.h
│   │   ├── FavesModelReader.cpp
│   │   ├── FavesModelReader.h
│   │   ├── FavesModelWriter.cpp
│   │   ├── FavesModelWriter.h
│   │   ├── FilterTagMap.cpp
│   │   ├── FilterTagMap.h
│   │   ├── FiltersModel.cpp
│   │   ├── FiltersModel.h
│   │   ├── FiltersModelBinaryReader.cpp
│   │   ├── FiltersModelBinaryReader.h
│   │   ├── FiltersModelBinaryWriter.cpp
│   │   ├── FiltersModelBinaryWriter.h
│   │   ├── FiltersModelReader.cpp
│   │   ├── FiltersModelReader.h
│   │   ├── FiltersPresenter.cpp
│   │   ├── FiltersPresenter.h
│   │   ├── FiltersView/
│   │   │   ├── FilterTreeAbstractItem.cpp
│   │   │   ├── FilterTreeAbstractItem.h
│   │   │   ├── FilterTreeFolder.cpp
│   │   │   ├── FilterTreeFolder.h
│   │   │   ├── FilterTreeItem.cpp
│   │   │   ├── FilterTreeItem.h
│   │   │   ├── FilterTreeItemDelegate.cpp
│   │   │   ├── FilterTreeItemDelegate.h
│   │   │   ├── FiltersView.cpp
│   │   │   ├── FiltersView.h
│   │   │   ├── TreeView.cpp
│   │   │   └── TreeView.h
│   │   ├── FiltersVisibilityMap.cpp
│   │   └── FiltersVisibilityMap.h
│   ├── FilterSyncRunner.cpp
│   ├── FilterSyncRunner.h
│   ├── FilterTextTranslator.cpp
│   ├── FilterTextTranslator.h
│   ├── FilterThread.cpp
│   ├── FilterThread.h
│   ├── Globals.cpp
│   ├── Globals.h
│   ├── GmicProcessor.cpp
│   ├── GmicProcessor.h
│   ├── GmicQt.cpp
│   ├── GmicQt.h
│   ├── GmicStdlib.cpp
│   ├── GmicStdlib.h
│   ├── HeadlessProcessor.cpp
│   ├── HeadlessProcessor.h
│   ├── Host/
│   │   ├── 8bf/
│   │   │   └── host_8bf.cpp
│   │   ├── Gimp/
│   │   │   └── host_gimp.cpp
│   │   ├── GmicQtHost.h
│   │   ├── None/
│   │   │   ├── ImageDialog.cpp
│   │   │   ├── ImageDialog.h
│   │   │   ├── JpegQualityDialog.cpp
│   │   │   ├── JpegQualityDialog.h
│   │   │   ├── host_none.cpp
│   │   │   └── jpegqualitydialog.ui
│   │   └── PaintDotNet/
│   │       └── host_paintdotnet.cpp
│   ├── HtmlTranslator.cpp
│   ├── HtmlTranslator.h
│   ├── IconLoader.cpp
│   ├── IconLoader.h
│   ├── ImageTools.cpp
│   ├── ImageTools.h
│   ├── InputOutputState.cpp
│   ├── InputOutputState.h
│   ├── KeypointList.cpp
│   ├── KeypointList.h
│   ├── LanguageSettings.cpp
│   ├── LanguageSettings.h
│   ├── LayersExtentProxy.cpp
│   ├── LayersExtentProxy.h
│   ├── Logger.cpp
│   ├── Logger.h
│   ├── MainWindow.cpp
│   ├── MainWindow.h
│   ├── Misc.cpp
│   ├── Misc.h
│   ├── OverrideCursor.cpp
│   ├── OverrideCursor.h
│   ├── ParametersCache.cpp
│   ├── ParametersCache.h
│   ├── PersistentMemory.cpp
│   ├── PersistentMemory.h
│   ├── Settings.cpp
│   ├── Settings.h
│   ├── SourcesWidget.cpp
│   ├── SourcesWidget.h
│   ├── Tags.cpp
│   ├── Tags.h
│   ├── TimeLogger.cpp
│   ├── TimeLogger.h
│   ├── Updater.cpp
│   ├── Updater.h
│   ├── Utils.cpp
│   ├── Utils.h
│   ├── Widgets/
│   │   ├── InOutPanel.cpp
│   │   ├── InOutPanel.h
│   │   ├── LanguageSelectionWidget.cpp
│   │   ├── LanguageSelectionWidget.h
│   │   ├── PreviewWidget.cpp
│   │   ├── PreviewWidget.h
│   │   ├── ProgressInfoWidget.cpp
│   │   ├── ProgressInfoWidget.h
│   │   ├── ProgressInfoWindow.cpp
│   │   ├── ProgressInfoWindow.h
│   │   ├── SearchFieldWidget.cpp
│   │   ├── SearchFieldWidget.h
│   │   ├── VisibleTagSelector.cpp
│   │   ├── VisibleTagSelector.h
│   │   ├── ZoomLevelSelector.cpp
│   │   └── ZoomLevelSelector.h
│   └── ZoomConstraint.h
├── standalone.qrc
├── translations/
│   ├── authors/
│   │   ├── cs.txt
│   │   ├── de.txt
│   │   ├── es.txt
│   │   ├── fr.txt
│   │   ├── id.txt
│   │   ├── it.txt
│   │   ├── ja.txt
│   │   ├── nl.txt
│   │   ├── pl.txt
│   │   ├── pt.txt
│   │   ├── ru.txt
│   │   ├── sv.txt
│   │   ├── uk.txt
│   │   ├── zh.txt
│   │   └── zh_tw.txt
│   ├── cs.ts
│   ├── de.ts
│   ├── es.ts
│   ├── filters/
│   │   ├── HOWTO.md
│   │   ├── csv2ts.sh
│   │   ├── gmic_qt_de.csv
│   │   ├── gmic_qt_es.csv
│   │   ├── gmic_qt_fr.csv
│   │   ├── gmic_qt_it.csv
│   │   ├── gmic_qt_ja.csv
│   │   ├── gmic_qt_nl.csv
│   │   ├── gmic_qt_pl.csv
│   │   ├── gmic_qt_pt.csv
│   │   ├── gmic_qt_ru.csv
│   │   ├── gmic_qt_zh.csv
│   │   └── ts2csv.sh
│   ├── fr.ts
│   ├── id.ts
│   ├── it.ts
│   ├── ja.ts
│   ├── lrelease.sh
│   ├── nl.ts
│   ├── pl.ts
│   ├── pt.ts
│   ├── ru.ts
│   ├── sv.ts
│   ├── uk.ts
│   ├── zh.ts
│   └── zh_tw.ts
├── translations.qrc
├── ui/
│   ├── SearchFieldWidget.ui
│   ├── dialogsettings.ui
│   ├── filtersview.ui
│   ├── headlessprogressdialog.ui
│   ├── inoutpanel.ui
│   ├── languageselectionwidget.ui
│   ├── mainwindow.ui
│   ├── multilinetextparameterwidget.ui
│   ├── progressinfowidget.ui
│   ├── progressinfowindow.ui
│   ├── sourceswidget.ui
│   └── zoomlevelselector.ui
└── wip_translations.qrc

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
custom: https://libreart.info/en/projects/gmic


================================================
FILE: .gitignore
================================================
Makefile
*.a
*.o
*.pro.user
*.pro.user.*
*.so
*~
.moc/*
.obj/*
.qmake.stash
.qrc/*
.ui/*
./Makefile
gmic_gimp_qt
gmic_paintdotnet_qt
gmic_qt
CMakeLists.txt.user
.rsync-exclude
translations/*.qm
translations/filters/*.qm
translations/filters/*.ts


================================================
FILE: .travis.yml
================================================
language: cpp

git:
  depth: 1

os:
  - linux

branches:
  only:
    - master
    - new_api
    - devel

compiler:
  - gcc

matrix:
  include:
    - os: linux
      dist: bionic
      env:
        - BUILD="qmake" GMIC_HOST="all"
    - os: linux
      dist: focal
      env:
        - BUILD="qmake" GMIC_HOST="all"
    - os: linux
      dist: bionic
      env:
        - BUILD="cmake" GMIC_HOST="none"
    - os: linux
      dist: bionic
      env:
        - BUILD="cmake" GMIC_HOST="gimp"
  fast_finish: true

before_install:
  - date -u
  - uname -a
  - git clone --depth=1 https://github.com/dtschump/gmic.git gmic-clone
  - make -C gmic-clone/src CImg.h gmic_stdlib.h
  - if [ -z "$TRAVIS_OS_NAME" -o "$TRAVIS_OS_NAME" = "linux" ]; then
        sudo apt-get update;
    fi;

install:
  - if [ -z "$TRAVIS_OS_NAME" -o "$TRAVIS_OS_NAME" = "linux" ]; then
       sudo apt-get install --allow-unauthenticated gdb libfftw3-dev zlib1g-dev libcurl4-openssl-dev libx11-dev libgimp2.0 libgegl-dev libgimp2.0-dev qt5-default qt5-qmake qtbase5-dev qttools5-dev qttools5-dev-tools;
    fi;

script:
  - g++ --version
  - if [ -z "$TRAVIS_OS_NAME" -o "$TRAVIS_OS_NAME" = "linux" ]; then
       travis_wait 45 ./scripts/travis_build_${BUILD}.sh;
    fi;


================================================
FILE: CMakeLists.txt
================================================
project(gmic-qt)

message(STATUS "Using CMake version: ${CMAKE_VERSION}")

cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
LIST (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
include(FeatureSummary)
include(FindPkgConfig)

set(CMAKE_CXX_STANDARD 11)
add_definitions(-Dcimg_use_cpp11=1)

option(BUILD_WITH_QT6 "Build with Qt6, else Qt5" OFF)

if(BUILD_WITH_QT6)
    set(MIN_QT_VERSION 6.5.0)
else()
    set(MIN_QT_VERSION 5.2.0)
endif()

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC OFF)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(EXTRA_LIBRARIES)

if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Release")
endif()

message("Build type is " ${CMAKE_BUILD_TYPE})

set (GMIC_QT_HOST "gimp" CACHE STRING "Define for which host gmic-qt will be built: gimp, gimp3 (experimental), none, paintdotnet or 8bf.")
if (${GMIC_QT_HOST} STREQUAL "none")
  message("Building standalone version.")
else()
  message("Building for target host application: " ${GMIC_QT_HOST})
endif()

option(ENABLE_SYSTEM_GMIC "Find GMIC shared library installed on the system" ON)

if (ENABLE_SYSTEM_GMIC)
  option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC shared library" ON)
else()
  option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC shared library" OFF)

  set (GMIC_LIB_PATH "${GMIC_PATH}" CACHE STRING "Define the path to the GMIC shared library")
  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../src/gmic.cpp")
  set (GMIC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../src" CACHE STRING "Define the path to the gmic headers")
  else()
  set (GMIC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../gmic/src" CACHE STRING "Define the path to the gmic headers")
  endif()

  message("G'MIC path: " ${GMIC_PATH})
endif()

option(ENABLE_CURL "Add support for curl" ON)

option(ENABLE_ASAN "Enable -fsanitize=address (if debug build)" ON)
option(ENABLE_FFTW3 "Enable FFTW3 library support" ON)

include(CheckIPOSupported)

check_ipo_supported(RESULT HAVE_LTO LANGUAGES CXX)

if (HAVE_LTO)
option(ENABLE_LTO "Enable Link Time Optimizer" OFF)
endif()

if (MSVC)
  option(ENABLE_CFG "Enable Control Flow Guard (MSVC)" ON)
  add_definitions(-D__PRETTY_FUNCTION__=__FUNCSIG__)
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(ENABLE_LTO OFF FORCE)
endif()

if (NOT ENABLE_SYSTEM_GMIC)
  #
  # Look for G'MIC repository
  #
  get_filename_component(GMIC_ABSOLUTE_PATH ${GMIC_PATH} ABSOLUTE BASEDIR ${CMAKE_SOURCE_DIR})
  if (EXISTS ${GMIC_ABSOLUTE_PATH}/gmic.cpp)
    message("Found G'MIC repository")
  else()
    get_filename_component(TARGET_CLONE_DIR ${GMIC_ABSOLUTE_PATH}/.. ABSOLUTE)
    message("")
    message("Cannot find G'MIC repository in " ${GMIC_ABSOLUTE_PATH} )
    message("")
    message("You should try:")
    message("")
    message("   git clone https://github.com/dtschump/gmic.git " ${TARGET_CLONE_DIR}/gmic )
    message("")
    message(FATAL_ERROR "\nG'MIC repository not found")
  endif()

  #
  # Look for CImg.h and gmic_stdlib_community.h
  #
  set(GMIC_FILES CImg.h gmic_stdlib_community.h)
  foreach(F ${GMIC_FILES})
  if(EXISTS ${GMIC_ABSOLUTE_PATH}/${F})
      message("Found " ${GMIC_PATH}/${F})
  else()
      message(${F} " not found")
      execute_process(COMMAND make -C ${GMIC_ABSOLUTE_PATH} ${F})
      if(EXISTS ${GMIC_ABSOLUTE_PATH}/${F})
      message("Found " ${GMIC_PATH}/${F})
      else()
      message(FATAL_ERROR "\nCannot obtain " ${GMIC_PATH}/${F})
      endif()
  endif()
  endforeach()

  #
  # Ensure that gmic and CImg are the same version
  #
  file(STRINGS ${GMIC_ABSOLUTE_PATH}/CImg.h CIMG_VERSION REGEX "cimg_version ")
  string(REGEX REPLACE ".*cimg_version " "" CIMG_VERSION ${CIMG_VERSION})
  message("CImg version is [" ${CIMG_VERSION} "]")

  file(STRINGS ${GMIC_ABSOLUTE_PATH}/gmic.h GMIC_VERSION REGEX "gmic_version ")
  string(REGEX REPLACE ".*gmic_version " "" GMIC_VERSION ${GMIC_VERSION})
  message("G'MIC version is [" ${GMIC_VERSION} "]")

  if (NOT(${GMIC_VERSION} EQUAL ${CIMG_VERSION}))
  message(FATAL_ERROR "\nVersion numbers of files 'gmic.h' (" ${GMIC_VERSION} ") and 'CImg.h' (" ${CIMG_VERSION} ") mismatch")
  endif()
endif()


option(PRERELEASE "Set to ON makes this a prelease build")
if (${PRERELEASE})
    string(TIMESTAMP PRERELEASE_DATE %y%m%d)
    message("Prelease date is " ${PRERELEASE_DATE})
    add_definitions(-Dgmic_prerelease="${PRERELEASE_DATE}")
endif()

option(DRMINGW "Set to ON enables the drmingw debugger.")
if (${DRMINGW})
    add_definitions(-DDRMINGW)
endif()


# Required packages

#
# Gmic
#
if (ENABLE_SYSTEM_GMIC)
  find_package(Gmic REQUIRED CONFIG)
endif (ENABLE_SYSTEM_GMIC)

#
# Threads
#
find_package(Threads REQUIRED)

if(BUILD_WITH_QT6)

    #
    # Qt6
    #
    find_package(Qt6 ${MIN_QT_VERSION}
            REQUIRED COMPONENTS
            Core
            Gui
            Widgets
            Network
    )

    #
    # For the translations
    #
    find_package(Qt6LinguistTools REQUIRED)

    set(QT_VERSION_MAJOR 6)

else()

    #
    # Qt5
    #
    find_package(Qt5 ${MIN_QT_VERSION}
            REQUIRED COMPONENTS
            Core
            Gui
            Widgets
            Network
    )

    #
    # For the translations
    #
    find_package(Qt5LinguistTools REQUIRED)

    set(QT_VERSION_MAJOR 5)

endif()

#
# PNG
#
find_package(PNG REQUIRED)
add_definitions(${PNG_DEFINITIONS})
add_definitions(-Dcimg_use_png)
include_directories(SYSTEM ${PNG_INCLUDE_DIR})
if (APPLE)
    # this is not added correctly on OSX -- see http://forum.kde.org/viewtopic.php?f=139&t=101867&p=221242#p221242
    include_directories(SYSTEM ${PNG_INCLUDE_DIR})
endif()

#
# ZLIB
#
find_package(ZLIB REQUIRED)
add_definitions(-Dcimg_use_zlib)
include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS} )

#
# FFTW3
#
if (ENABLE_FFTW3)
  find_package(FFTW3 REQUIRED)
  add_definitions(-Dcimg_use_fftw3 )
  include_directories(${FFTW3_INCLUDE_DIR})

  # Detect
  include(CheckCXXSourceCompiles)
  set(CMAKE_REQUIRED_INCLUDES ${FFTW3_INCLUDE_DIR})
  set(CMAKE_REQUIRED_LIBRARIES ${FFTW3_LIBRARIES})
  check_cxx_source_compiles("
      #include <fftw3.h>

      int main() {
          fftw_init_threads();
      }
  " HAVE_FFTW3_THREADS)

  if(HAVE_FFTW3_THREADS)
    message(STATUS "FFTW threads Found")
    list(APPEND EXTRA_LIBRARIES ${FFTW3_THREADS_LIBRARIES})
  else()
    add_definitions(-Dcimg_use_fftw3_singlethread)
  endif()
endif()

#
# CURL
#
if(ENABLE_CURL)
    find_package(CURL)
    if (CURL_FOUND)
        add_definitions(-Dcimg_use_curl)
        include_directories(SYSTEM ${CURL_INCLUDE_DIRS} )
    endif()
endif()

#
# Test for OpenMP
#
find_package(OpenMP 2.0)
set_package_properties(OpenMP PROPERTIES
    DESCRIPTION "A low-level parallel execution library"
    URL "http://openmp.org/wp/"
    TYPE OPTIONAL
    PURPOSE "Optionally used by gmic-qt")

if (OpenMP_FOUND)
    message(STATUS "G'Mic: using OpenMP ${OpenMP_CXX_VERSION}")
    link_libraries(OpenMP::OpenMP_CXX)
    add_definitions(-Dcimg_use_openmp)
endif()

#
# LTO option
#

if (ENABLE_LTO)
    message(STATUS "Link Time Optimizer enabled")
    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

#
# Enable CFG
#
if (MSVC)
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:16777216")
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /STACK:16777216")
    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /STACK:16777216")
    if (ENABLE_CFG)
        add_compile_options(/guard:CF)
        add_link_options(/GUARD:CF)
    endif()
elseif(WIN32)
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,16777216")
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--stack,16777216")
    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--stack,16777216")
endif()

#
# add all defines
#

set(gmic_qt_LIBRARIES
        Qt${QT_VERSION_MAJOR}::Core
        Qt${QT_VERSION_MAJOR}::Widgets
        Qt${QT_VERSION_MAJOR}::Gui
        Qt${QT_VERSION_MAJOR}::Network
        ${PNG_LIBRARIES}
        ${FFTW3_LIBRARIES}
        ${ZLIB_LIBRARIES}
        ${EXTRA_LIBRARIES}
)

if(ENABLE_CURL)
    if (CURL_FOUND)
        set(gmic_qt_LIBRARIES
            ${gmic_qt_LIBRARIES}
            ${CURL_LIBRARIES}
        )
    endif()
endif()

add_definitions(-Dgmic_core)
add_definitions(-Dgmic_community)
add_definitions(-Dcimg_use_abort)
add_definitions(-Dgmic_is_parallel)
add_definitions(-Dgmic_gui)
add_definitions(-Dcimg_use_abort)
add_definitions(-Dcimg_appname=\"gmic\")

if (UNIX)
    add_definitions(-D_IS_UNIX_)
    if(ANDROID)
        add_definitions(-Dcimg_display=0)
    elseif(NOT APPLE)
        add_definitions(-Dcimg_display=1)
        add_definitions(-Dcimg_use_vt100)
        find_package(X11)
        set(gmic_qt_LIBRARIES
            ${gmic_qt_LIBRARIES}
            ${X11_LIBRARIES} # XXX: Search for X11: Wayland is coming!
        )
    endif()
endif()

if (APPLE)
    add_definitions(-Dcimg_display=0)
    add_definitions(-D_IS_MACOS_)
    set(CMAKE_MACOSX_RPATH 1)
    set(BUILD_WITH_INSTALL_RPATH 1)
    add_definitions(-mmacosx-version-min=10.9 -Wno-macro-redefined -Wno-deprecated-register)
endif()

if (WIN32)
    add_definitions(-Dcimg_display=2)
    add_definitions(-DPSAPI_VERSION=1)
    add_definitions(-D_IS_WINDOWS_)
    if (MSVC)
      add_definitions(-D_CRT_SECURE_NO_WARNINGS)
      add_compile_options(/wd4267)
    endif()
    set(gmic_qt_LIBRARIES
        ${gmic_qt_LIBRARIES}
        Threads::Threads psapi gdi32
    )
endif()

SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/")

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    add_definitions(-D_GMIC_QT_DEBUG_)
    if(ENABLE_ASAN)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
    endif(ENABLE_ASAN)
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
    add_definitions(-DQT_NO_DEBUG_OUTPUT)
    if (MSVC)
      set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /fp:fast /Oi")
    else()
      string(REPLACE "-O2" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
      string(REPLACE "-O3" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
      set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
    endif()
    if (NOT MSVC)
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s")
    endif()
    if (WIN32 AND NOT MSVC)
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
    endif()
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
    add_definitions(-DQT_NO_DEBUG_OUTPUT)
    if(MSVC)
      string(REPLACE "Ob1" "Ob2" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
      set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /fp:fast /Oi")
    else()
      string(REPLACE "-O2" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
      string(REPLACE "-O3" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
      if (NOT ENABLE_SYSTEM_GMIC)
          set_source_files_properties(${GMIC_PATH}/gmic.cpp PROPERTIES COMPILE_FLAGS "-O3")
      endif (NOT ENABLE_SYSTEM_GMIC)
      set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2")
    endif()
else()
    message(FATAL_ERROR "Build type not recognized (${CMAKE_BUILD_TYPE})")
endif()

if (NOT ENABLE_SYSTEM_GMIC)
    include_directories(${GMIC_PATH})
endif (NOT ENABLE_SYSTEM_GMIC)
include_directories(${CMAKE_SOURCE_DIR}/src)

set (gmic_qt_SRCS
  src/ClickableLabel.h
  src/Common.h
  src/CroppedActiveLayerProxy.h
  src/CroppedImageListProxy.h
  src/DialogSettings.h
  src/FilterParameters/AbstractParameter.h
  src/FilterParameters/BoolParameter.h
  src/FilterParameters/ButtonParameter.h
  src/FilterParameters/ChoiceParameter.h
  src/FilterParameters/ColorParameter.h
  src/FilterParameters/ConstParameter.h
  src/FilterParameters/CustomDoubleSpinBox.h
  src/FilterParameters/CustomSpinBox.h
  src/FilterParameters/FileParameter.h
  src/FilterParameters/FilterParametersWidget.h
  src/FilterParameters/FloatParameter.h
  src/FilterParameters/FolderParameter.h
  src/FilterParameters/IntParameter.h
  src/FilterParameters/LinkParameter.h
  src/FilterParameters/MultilineTextParameterWidget.h
  src/FilterParameters/NoteParameter.h
  src/FilterParameters/PointParameter.h
  src/FilterParameters/SeparatorParameter.h
  src/FilterParameters/TextParameter.h
  src/FilterSelector/FavesModel.h
  src/FilterSelector/FavesModelReader.h
  src/FilterSelector/FavesModelWriter.h
  src/FilterSelector/FiltersModelBinaryReader.h
  src/FilterSelector/FiltersModelBinaryWriter.h
  src/FilterSelector/FiltersModel.h
  src/FilterSelector/FiltersModelReader.h
  src/FilterSelector/FiltersPresenter.h
  src/FilterSelector/FiltersView/FiltersView.h
  src/FilterSelector/FiltersView/FilterTreeAbstractItem.h
  src/FilterSelector/FiltersView/FilterTreeFolder.h
  src/FilterSelector/FiltersView/FilterTreeItemDelegate.h
  src/FilterSelector/FiltersView/FilterTreeItem.h
  src/FilterSelector/FiltersView/TreeView.h
  src/FilterSelector/FiltersVisibilityMap.h
  src/FilterSelector/FilterTagMap.h
  src/FilterGuiDynamismCache.h
  src/FilterSyncRunner.h
  src/FilterTextTranslator.h
  src/FilterThread.h
  src/Globals.h
  src/GmicProcessor.h
  src/GmicQt.h
  src/GmicStdlib.h
  src/HeadlessProcessor.h
  src/Host/GmicQtHost.h
  src/HtmlTranslator.h
  src/IconLoader.h
  src/ImageTools.h
  src/InputOutputState.h
  src/KeypointList.h
  src/LanguageSettings.h
  src/LayersExtentProxy.h
  src/Logger.h
  src/MainWindow.h
  src/Misc.h
  src/OverrideCursor.h
  src/ParametersCache.h
  src/PersistentMemory.h
  src/Settings.h
  src/SourcesWidget.h
  src/Tags.h
  src/TimeLogger.h
  src/Updater.h
  src/Utils.h
  src/Widgets/InOutPanel.h
  src/Widgets/LanguageSelectionWidget.h
  src/Widgets/PreviewWidget.h
  src/Widgets/ProgressInfoWidget.h
  src/Widgets/ProgressInfoWindow.h
  src/Widgets/SearchFieldWidget.h
  src/Widgets/VisibleTagSelector.h
  src/Widgets/ZoomLevelSelector.h
  src/ZoomConstraint.h
)

if (NOT ENABLE_SYSTEM_GMIC)
    set(gmic_qt_SRCS
        ${gmic_qt_SRCS}
        ${GMIC_PATH}/gmic.h
        ${GMIC_PATH}/CImg.h
        ${GMIC_PATH}/gmic_stdlib_community.h
    )
endif()

set(gmic_qt_SRCS
  ${gmic_qt_SRCS}
  src/ClickableLabel.cpp
  src/Common.cpp
  src/CroppedActiveLayerProxy.cpp
  src/CroppedImageListProxy.cpp
  src/DialogSettings.cpp
  src/FilterParameters/AbstractParameter.cpp
  src/FilterParameters/BoolParameter.cpp
  src/FilterParameters/ButtonParameter.cpp
  src/FilterParameters/ChoiceParameter.cpp
  src/FilterParameters/ColorParameter.cpp
  src/FilterParameters/ConstParameter.cpp
  src/FilterParameters/CustomDoubleSpinBox.cpp
  src/FilterParameters/CustomSpinBox.cpp
  src/FilterParameters/FileParameter.cpp
  src/FilterParameters/FilterParametersWidget.cpp
  src/FilterParameters/FloatParameter.cpp
  src/FilterParameters/FolderParameter.cpp
  src/FilterParameters/IntParameter.cpp
  src/FilterParameters/LinkParameter.cpp
  src/FilterParameters/MultilineTextParameterWidget.cpp
  src/FilterParameters/NoteParameter.cpp
  src/FilterParameters/PointParameter.cpp
  src/FilterParameters/SeparatorParameter.cpp
  src/FilterParameters/TextParameter.cpp
  src/FilterSelector/FavesModel.cpp
  src/FilterSelector/FavesModelReader.cpp
  src/FilterSelector/FavesModelWriter.cpp
  src/FilterSelector/FiltersModelBinaryReader.cpp
  src/FilterSelector/FiltersModelBinaryWriter.cpp
  src/FilterSelector/FiltersModel.cpp
  src/FilterSelector/FiltersModelReader.cpp
  src/FilterSelector/FiltersPresenter.cpp
  src/FilterSelector/FiltersView/FiltersView.cpp
  src/FilterSelector/FiltersView/FilterTreeAbstractItem.cpp
  src/FilterSelector/FiltersView/FilterTreeFolder.cpp
  src/FilterSelector/FiltersView/FilterTreeItem.cpp
  src/FilterSelector/FiltersView/FilterTreeItemDelegate.cpp
  src/FilterSelector/FiltersView/TreeView.cpp
  src/FilterSelector/FiltersVisibilityMap.cpp
  src/FilterSelector/FilterTagMap.cpp
  src/FilterGuiDynamismCache.cpp
  src/FilterSyncRunner.cpp
  src/FilterTextTranslator.cpp
  src/FilterThread.cpp
  src/Globals.cpp
  src/GmicProcessor.cpp
  src/GmicQt.cpp
  src/GmicStdlib.cpp
  src/HeadlessProcessor.cpp
  src/HtmlTranslator.cpp
  src/IconLoader.cpp
  src/ImageTools.cpp
  src/InputOutputState.cpp
  src/KeypointList.cpp
  src/LanguageSettings.cpp
  src/LayersExtentProxy.cpp
  src/Logger.cpp
  src/MainWindow.cpp
  src/Misc.cpp
  src/OverrideCursor.cpp
  src/ParametersCache.cpp
  src/PersistentMemory.cpp
  src/Settings.cpp
  src/SourcesWidget.cpp
  src/Tags.cpp
  src/TimeLogger.cpp
  src/Updater.cpp
  src/Utils.cpp
  src/Widgets/InOutPanel.cpp
  src/Widgets/LanguageSelectionWidget.cpp
  src/Widgets/PreviewWidget.cpp
  src/Widgets/ProgressInfoWidget.cpp
  src/Widgets/ProgressInfoWindow.cpp
  src/Widgets/SearchFieldWidget.cpp
  src/Widgets/VisibleTagSelector.cpp
  src/Widgets/ZoomLevelSelector.cpp
)

set (gmic_qt_FORMS
  ui/dialogsettings.ui
  ui/filtersview.ui
  ui/headlessprogressdialog.ui
  ui/inoutpanel.ui
  ui/languageselectionwidget.ui
  ui/mainwindow.ui
  ui/multilinetextparameterwidget.ui
  ui/progressinfowidget.ui
  ui/progressinfowindow.ui
  ui/SearchFieldWidget.ui
  ui/sourceswidget.ui
  ui/zoomlevelselector.ui
)

if(ENABLE_DYNAMIC_LINKING)
  set(CMAKE_SKIP_RPATH TRUE)
  # G'MIC-Qt needs visibility into the private symbols defined
  # by the gmic.cpp plugin. However, this is only possible
  # if the library is static OR if it's dynamic and built by
  # a compiler that supports .so-style exports.
  if (TARGET libgmicstatic OR MSVC OR NOT ENABLE_SYSTEM_GMIC)
    set(gmic_qt_LIBRARIES
      ${gmic_qt_LIBRARIES}
      libgmicstatic
    )
  elseif(TARGET libgmic)
    set(gmic_qt_LIBRARIES
      ${gmic_qt_LIBRARIES}
      libgmic
    )
  elseif(GMIC_LIB_PATH)
    set(gmic_qt_LIBRARIES
      ${gmic_qt_LIBRARIES}
      "gmic"
    )
  else()
    message(FATAL_ERROR "No G'MIC library is available for linking. Please build libgmic as a static library.")
  endif()
  if (NOT ENABLE_SYSTEM_GMIC)
    if (GMIC_LIB_PATH)
      link_directories(${GMIC_LIB_PATH})
      # Inject the G'MIC CImg plugin.
      include_directories(../src)
    else()
      # Mimic an external G'MIC library build for catching link ABI errors.
      add_library(libgmicstatic STATIC ../src/gmic.cpp)
      target_include_directories(libgmicstatic PUBLIC ../src)
      # We need internal access into the gmic-core API.
      target_compile_definitions(libgmicstatic PUBLIC gmic_core)
      set_target_properties(libgmicstatic
        PROPERTIES
          AUTOMOC OFF
      )
      target_link_libraries(libgmicstatic PUBLIC
        ${PNG_LIBRARIES}
        ${FFTW3_LIBRARIES}
        ${ZLIB_LIBRARIES}
        ${CURL_LIBRARIES}
        ${EXTRA_LIBRARIES})
    endif()
  else()
    # Inject the G'MIC CImg plugin.
    include_directories(../src)
  endif()
else(ENABLE_DYNAMIC_LINKING)
  set(gmic_qt_SRCS
    ${gmic_qt_SRCS}
    ${GMIC_PATH}/gmic.cpp
    )
endif(ENABLE_DYNAMIC_LINKING)

message("Producing translation .qm files")
execute_process(COMMAND make WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/translations OUTPUT_QUIET)
message("Producing filter translation .qm files")
execute_process(COMMAND make WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/translations/filters OUTPUT_QUIET)

set(gmic_qt_QRC
    gmic_qt.qrc
    translations.qrc
    wip_translations.qrc
)

if (${GMIC_QT_HOST} STREQUAL "gimp" OR ${GMIC_QT_HOST} STREQUAL "gimp3")
    if (${GMIC_QT_HOST} STREQUAL "gimp3")
        set(TARGET_GIMP_VERSION 3)
    else()
        set(TARGET_GIMP_VERSION 2)
    endif()

    find_package(PkgConfig REQUIRED)
    pkg_check_modules(GIMP REQUIRED gimp-${TARGET_GIMP_VERSION}.0 IMPORTED_TARGET)
    # CMake does not support passing --define-variable through pkg_get_variable.
    execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} gimp-${TARGET_GIMP_VERSION}.0 --define-variable=prefix=${CMAKE_INSTALL_PREFIX} --variable gimplibdir OUTPUT_VARIABLE GIMP_PKGLIBDIR OUTPUT_STRIP_TRAILING_WHITESPACE)

    set (gmic_qt_SRCS ${gmic_qt_SRCS} src/Host/Gimp/host_gimp.cpp)

    if(BUILD_WITH_QT6)

        qt6_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

    else()

        qt5_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

    endif()

    add_definitions(-DGMIC_HOST=gimp -DGIMP_DISABLE_DEPRECATED)
    add_executable(gmic_gimp_qt ${gmic_qt_SRCS} ${gmic_qt_QRC})
    target_link_libraries(
      gmic_gimp_qt
      PRIVATE
      PkgConfig::GIMP
      ${gmic_qt_LIBRARIES}
      )
    install(TARGETS gmic_gimp_qt RUNTIME DESTINATION "${GIMP_PKGLIBDIR}/plug-ins/gmic_gimp_qt")

elseif (${GMIC_QT_HOST} STREQUAL "none")

  set (gmic_qt_SRCS ${gmic_qt_SRCS}
    src/Host/None/host_none.cpp
    src/Host/None/ImageDialog.h
    src/Host/None/ImageDialog.cpp
    src/Host/None/JpegQualityDialog.h
    src/Host/None/JpegQualityDialog.cpp
    )
  set(gmic_qt_FORMS ${gmic_qt_FORMS}
    src/Host/None/jpegqualitydialog.ui
    )

  if(BUILD_WITH_QT6)

    qt6_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

  else()

    qt5_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

  endif()

  add_definitions(-DGMIC_HOST=standalone)
  add_executable(gmic_qt ${gmic_qt_SRCS} ${gmic_qt_QRC})
  target_link_libraries(gmic_qt PRIVATE ${gmic_qt_LIBRARIES})
  install(TARGETS gmic_qt RUNTIME DESTINATION bin)

elseif (${GMIC_QT_HOST} STREQUAL "paintdotnet")

  set (gmic_qt_SRCS ${gmic_qt_SRCS} src/Host/PaintDotNet/host_paintdotnet.cpp)

  if(BUILD_WITH_QT6)

    qt6_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

  else()

    qt5_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

  endif()

  add_definitions(-DGMIC_HOST=paintdotnet)
  add_executable(gmic_paintdotnet_qt ${gmic_qt_SRCS} ${gmic_qt_QRC})
  target_link_libraries(
    gmic_paintdotnet_qt
    PRIVATE ${gmic_qt_LIBRARIES}
    )

elseif (${GMIC_QT_HOST} STREQUAL "8bf")

  # Look for a CMake package on MSVC or a PkgConfig file on MinGW etc.
  if (MSVC)
    find_package(lcms2 CONFIG REQUIRED)
    include_directories(${LCMS2_INCLUDE_DIR})
  else()
    find_package(PkgConfig REQUIRED)
    pkg_check_modules(LCMS2 REQUIRED lcms2)
  endif()

  set (gmic_qt_SRCS ${gmic_qt_SRCS} src/Host/8bf/host_8bf.cpp)

  if(BUILD_WITH_QT6)

    qt6_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

  else()

    qt5_wrap_ui(gmic_qt_SRCS ${gmic_qt_FORMS})

  endif()
  add_definitions(-DGMIC_HOST=plugin8bf)
  add_executable(gmic_8bf_qt ${gmic_qt_SRCS} ${gmic_qt_QRC})
  target_link_libraries(
    gmic_8bf_qt
    PRIVATE
    ${gmic_qt_LIBRARIES}
	${LCMS2_LIBRARIES}
    )

else()

  message(FATAL_ERROR "GMIC_QT_HOST is not defined as gimp, gimp3, none, paintdotnet or 8bf")

endif()

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)


================================================
FILE: COPYING
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: NEW_HOST_HOWTO.md
================================================
# Contributing - New host HOWTO

This document describes the architecture of the plugin (especially its link with the host application) and provides guidelines for its adaptation to a new host application.

### Architecture of the plug-in

The plugin is intended to be a standalone program which communicates with the host application (typically digital painting or photo retouching software) to exchange image data and commands. This architecture, as opposed to a software component fully integrated in the host application process, has been designed like this for several reasons, among which :

* The plugin cannot mess up with the host application process which means in the worst case, make it crash. This would be a responsibility we don't want to endorse. If unfortunately the plugin crashes, the host application does not, and no user data are lost. As long as the host application handles properly its communication with the plugin, nothing bad should ever happen because of a plugin misbehavior.
* Being based on Qt, the plugin GUI inherits the desktop environment theme but also handles its own custom "dark theme" using style sheets in an application-wide way. Consequently, a Qt-based host application could inherit from these modifications with unexpected results (for instance, messing up the whole theme of the host GUI).
* This plugin architecture has allowed us to define our own and quite simple API made of a few functions (exactly 6) that need to be implemented for the plugin to be able to communicate with the host application. Namely, this API is the interface (in the software engineering sense) of the communication layer between the host and the plugin, from the viewpoint of the latter. Thus, any suitable implementation of this interface should be enough to make the plugin work with a given host. Note that only 4% of the whole "G'MIC-Qt for Gimp" source code is host-dependent. The next section gives more details about the work that needs to be done to have a functional plugin for a new host.
* With a plugin being a self-contained application whose host-related code is clearly identified, we can more easily build the plugin and quickly distribute new versions, thus following the rapid development cycle of G'MIC.

### New host HOWTO: What needs to be done

Consequently, in order to adapt the plug-in to a new host application cleanly, a few things need to be done:

* Provide the host application with a communication system targeted to an external application, if it does not exist yet, so that it supports passing commands and possibly large image data (preferably through memory for improved performances).
* Write a program:
  * Which is linked to an implementation of all functions declared and documented in the API header [`Host/GmicQtHost.h`](src/Host/GmicQtHost.h) (implementation usually written, at least in part, in a file named `host_HOSTNAME.cpp`). This is the only place where all the communication between the plugin and the host should occur. The plugin relies only on this interface to be implemented.
  * Which is linked to the host-agnostic code of the plugin found in this repository. (See [`GmicQt.h`](src/GmicQt.h) for more details about the services offered by this part of the plug-in's code.)
 ![Architecture](architecture.svg)
  * Which calls the `GmicQt::run()` function provided by the G'MIC-Qt code, once initialisations are done and the communication with the host is established.
  * It should be noticed that tweaking the API internals to adapt the plugin to a new host is definitely not good practice. It may break the compatibility with the plugin's future versions.
* Adapt the [qmake](gmic_qt.pro) or [CMake](CMakeLists.txt) project files and follow the [build instructions](README.md#build-instructions) from the README.

In all these steps, valuable hints may be obtained from the [implementation for the GIMP host](src/Host/Gimp), found in the [src/Host](src/Host) folder, which is where all of a given host related code should go (for the plugin side).

If you succeed in creating such a file for a new host application, you are welcome to open a [pull request.](https://github.com/c-koi/gmic-qt/pulls)

### Guidelines

First, we would like to point out that any contribution in the form of a new host adaptation is very (very) welcome.

However, we have decided that contributions will be now accepted in this (upstream) repository only if they respect the architecture described above. It ensures that the plugin executables can be built for these different hosts and that they can be easily updated to the latest G'MIC version.

Note that we do not deny the fact that some other "tweaked" versions of the G'MIC-Qt plugin (that do not follow the rules defined above) may work for other host applications. Simply, we cannot guarantee their proper functioning. We will not endorse the responsibility of any crash or data loss that may occur with such implementations. We will probably not help in updating these plugins with the newest G'MIC features either. We let the authors of these alternative implementations deal with these issues.

Anyway, we will be happy to share links to these alternative implementations when we become aware of them, [here](https://github.com/c-koi/gmic-qt/blob/master/README.md) and on the official [G'MIC website](https://gmic.eu).


================================================
FILE: README.md
================================================

# G'MIC-Qt: a versatile G'MIC plugin

### Purpose

 G'MIC-Qt is a versatile front-end to the image processing framework
 [G'MIC](https://gmic.eu).  It is in fact a plugin for
 [GIMP](http://gimp.org), [Krita](https://krita.org), [Paint.NET](https://www.getpaint.net/),
 [digiKam](https://www.digikam.org) and an 8bf filter plugin for Photoshop-compatible software as well as a [standalone application](STANDALONE.md).

### Authors

  * Sébastien Fourey
  * David Tschumperlé (G'MIC lib & original GTK-based plugin)

### Contributors

 * Boudewijn Rempt <boud@valdyas.org> (Krita compatibility layer, later replaced by a native version of the plugin)
 * [amyspark](https://github.com/amyspark) (Krita native version of the plugin, work in progress)
 * [Nicholas Hayes](https://github.com/0xC0000054) (Paint.NET and 8bf filter compatibility layers, work in progress)
 * [Gilles Caulier](https://github.com/cgilles) (digiKam compatibility layer)


### Translators

 * Jan Helebrant (Czech translation)
 * Frank Tegtmeyer (German translation)
 * chroma_ghost & bazza/pixls.us (Spanish translation)
 * Sébastien Fourey (French translation)
 * Duddy Hadiwido (Indonesian translation)
 * Francesco Riosa (Italian translation)
 * iarga / pixls.us (Dutch translation)
 * Alex Mozheiko (Polish translation)
 * maxr (Portuguese translation)
 * Alex Mozheiko (Russian translation)
 * Andrex Starodubtsev (Ukrainian translation)
 * LinuxToy (https://twitter.com/linuxtoy) (Chinese translation)
 * omiya tou tokyogeometry@github (Japanese translation)

### Official (pre-release) binary packages

 * Available at [gmic.eu](https://gmic.eu)

### Travis CI last build status

 * Master branch (Linux) [![Build Status](https://api.travis-ci.org/c-koi/gmic-qt.svg?branch=master)](https://travis-ci.org/c-koi/gmic-qt)
 * Devel branch (Linux) [![Build Status](https://api.travis-ci.org/c-koi/gmic-qt.svg?branch=devel)](https://travis-ci.org/c-koi/gmic-qt)

### Build instructions

By default, the gimp integration plugin is built.

#### QMake

qmake is simple to use but only really works in an environment where bash is available.

```sh
git clone https://github.com/GreycLab/gmic.git
git clone https://github.com/c-koi/gmic-qt.git
make -C gmic/src CImg.h gmic_stdlib_community.h
cd gmic-qt
qmake [HOST=none|gimp|paintdotnet|8bf]
make
```

#### CMake

cmake works on all platforms. The first part is the same and requires make and wget to be available. If you don't have all dependencies, cmake will warn you which ones are missing. Note that the minimum cmake version is 3.1.

```sh
git clone https://github.com/GreycLab/gmic.git
git clone https://github.com/c-koi/gmic-qt.git
make -C gmic/src CImg.h gmic_stdlib_community.h
cd gmic-qt
```

Then make a build directory:

```sh
mkdir build
cd build
```

```sh
cmake .. [-DGMIC_QT_HOST=none|gimp|paintdotnet|8bf] [-DGMIC_PATH=/path/to/gmic] [-DCMAKE_BUILD_TYPE=[Debug|Release|RelwithDebInfo]
make
```

### Adapt G'MIC-Qt to new applications

Developers will find guidelines and instructions for the adaptation of the plugin to a new host application in the [NEW HOST HOWTO](https://github.com/c-koi/gmic-qt/blob/master/NEW_HOST_HOWTO.md).


================================================
FILE: STANDALONE.md
================================================
# G'MIC-Qt standalone version HOWTO

The G'MIC-Qt GUI accepts several options on its command line, thus allowing simple batch processing.
In short, command line usage is as follows:

 * `gmic_qt [OPTIONS ...] [INPUT_FILES ...]`

More than basic single input file name specification, options allow batch processing using the G'MIC filters, with or without the help of the GUI.

## Command line parameters

### Option `-o --output FILE`

Instead of displaying the output image in a dialog with a "Save as..." button, the application will save the filter output in the specified file. If multiple input files are provided, it is
suggested to include one of the `%b` or `%f` placeholders in the specified filename so that all output images will be written to distinct files :

  - `%b` is the input file basename, that is the filename with no extension and no path.
  - `%f` is the input file filename (without path).

If, on the other hand, multiple layers are expected as output, the `%l` placeholder will be replaced by the layer number in each output file (0 is top layer).

#### Examples

```sh
# Launch the GUI, save output to output.png
$ ./gmic_qt --output output.png input.png
# Select a filter and its parameters twice (i.e. once for each input), save each output to a distinct file.
$ ./gmic_qt --output processed-%f input1.png input2.png
# Save the expected output layers in layer_0.png, layer_1.png, ...
$ ./gmic_qt -o /tmp/layer_%l.png -p "Layers/Tiles to Layers" gmicky.png
```

### Option `-q --quality N`

Set the quality of JPEG output files to N (N in 0..100).

#### Example

```sh
# Select a filter through the GUI and save the result using 85 quality factor.
$ ./gmic_qt --quality 85 --output blured-gmicky.jpg gmicky.png
# Select a filter through the GUI, do not ask for JPEG quality when "Saving as..."
$ ./gmic_qt --quality 85  gmicky.png
```

### Option `-r --repeat`

Use last applied filter and parameters.

#### Example

```sh
# Select a filter & its parameters from GUI, then apply.
$ ./gmic_qt gmicky.png
# Call the GUI with previously applied filter & parameters, output will be written to result.png
$ ./gmic_qt --repeat --output result.png  hat.png
```

### Option `-p --path FILTER_PATH|FILTER_NAME`

  - Select filter from a full path in the filter tree or from its name (if unique).
   A filter path begins with `/`,  like for example `/Black & White/Charcoal`.

#### Example

```sh
# Launch GUI with selected filter
$ ./gmic_qt --path "/Black & White/Charcoal" gmicky.png
# Apply Charcoal filter with default parameters to image, then
# save result to charcoal-gmic.png
$ ./gmic_qt --path Charcoal --ouput charcoal-%f gmicky.png
```

### Option `-c --command "GMIC COMMAND"`

Run the gmic command on input image(s).

If a filter name/path is provided (option `-p`) and the command matches with this filter, or no filter name/path is provided and the command matches with some filter, then the parameters are completed using the filter's defaults.

If the command does not match with a filter, the option `--apply` (see below) is highly recommended as the GUI will not be of any help. Of course, batch processing is possible through the extra option `--output`.

#### Examples

```sh
# Launch GUI with filter "/Black & White/Charcoal", using 30 as its first parameter and default values otherwise.
$ ./gmic_qt -c "fx_charcoal 30" input.png
# Batch process to blur several images, showing each output with a "Save as..." option
$ ./gmic_qt -c "blur 10" images/*.png
# Batch process to blur several images, writing output images in distinct files
$ ./gmic_qt -o output/%b-blurred.jpg -c "blur 10" images/*.png
```

### Option `--apply`

Apply filter or command without showing the main plugin dialog for filter & parameters selection. One of the following options must therefore be present: `--path`, `--command` or `--repeat`.

#### Examples

```sh
# Shows up the resulting image dialog (image to be saved).
$ ./gmic_qt --apply -c "blur 10"  input.png
# Just do the processing, no question asked
$ ./gmic_qt --apply --path "Black & White/Charcoal" --output output.jpg input.jpg
# Select a filter and parameters through GUI, than batch process
$ ./gmic_qt --output test.png inputs/input1.png
$ ./gmic_qt --repeat --apply --ouput output/%f input/*.png
```

In fact, there is a command dedicated to the latter sample use case: `--first`

### Option `--reapply-first -R`

Launch the GUI once for the first input file, then reapply selected filter and parameters to all other files like `--repeat --apply` would do.

#### Examples

```sh
# Select a filter and parameters through GUI, than batch process to all input files
$ ./gmic_qt --reapply-first --output output/%f input/*.png
# Tune the Charcoal filter's parameters through the GUI, than batch process to all input files
$ ./gmic_qt -R -p "Charcoal" -o output/%f input/*.png
```

### Option `--show-last`

Print last applied plugin parameters

#### Example

```sh
$ ./gmic_qt --apply -p "Charcoal" -c "fx_charcoal 56" input.png
$ ./gmic_qt --show-last
Path: /Black & White/Charcoal
Name: Charcoal
Command: fx_charcoal 56,70,170,0,1,0,50,70,255,255,255,0,0,0,0,0,50,50
InputMode: 1
OutputMode: 0
```

### Option `--show-last-after`

Print last applied plugin parameters after filter execution. (Indeed, some filters may change the value of their parameters.)

### Option `--layers`

Consider multiple input files as layers of the same image (first image is the top layer).

```sh
$ ./gmic_qt -p "Blend [Average All]" --layers --apply -o output.png toplayer.png middlelayer.png bottomlayer.png
```


================================================
FILE: check_versions.sh
================================================
#!/bin/bash
set -o errexit
function usage()
{
  echo "  Usage:"
  echo
  echo "        check_version.sh GMIC_PATH [gmic|CImg|stdlib]"
  echo
  exit 0
}

function die()
{
  local message="$1"
  >&2 echo "Error: $*"
  exit 1
}

(( $# == 0 )) && usage
[[ -d "$1" ]] || die "$1 is not an existing directory"

# @param folder
function gmic_version()
{
  local folder="$1"
  [[ -e "${folder}/gmic.h" ]] || die "File not found: ${folder}/gmic.h"
  local version=$(grep -F "#define gmic_version " ${folder}/gmic.h)
  echo ${version//* }
}

# @param folder
function cimg_version()
{
  local folder="$1"
  [[ -e "${folder}/CImg.h" ]] || die "File not found: ${folder}/CImg.h"
  local version=$(grep -F "#define cimg_version " ${folder}/CImg.h)
  echo ${version//* }
}

# @param folder
function stdlib_version()
{
  local folder="$1"
  [[ -e "${folder}/gmic_stdlib_community.h" ]] || die "File not found: ${folder}/gmic_stdlib_community.h"
  local version=$(grep -E "File.*gmic_stdlib_community.h.*\(v." ${folder}/gmic_stdlib_community.h)
  version=${version#*v.}
  version=${version%)}
  version=${version//.}
  echo ${version}
}

if [[ "$2" == gmic ]]; then
  gmic_version "$1"
  exit 0
fi

if [[ "$2" == CImg ]]; then
  cimg_version "$1"
  exit 0
fi

if [[ "$2" == stdlib ]]; then
  stdlib_version "$1"
  exit 0
fi

echo "Checking G'MIC and CImg versions..."

GMIC_VERSION=$(gmic_version "$1")
CIMG_VERSION=$(cimg_version "$1")
STDLIB_VERSION=$(stdlib_version "$1")

echo "G'MIC version is .................... $GMIC_VERSION"
echo "gmic_stdlib_community.h version is .. $STDLIB_VERSION"
echo "CImg version is ..................... $CIMG_VERSION"

if [[ $GMIC_VERSION != $CIMG_VERSION ]]; then
  die "Version numbers of files 'gmic.h' (${GMIC_VERSION}) and 'CImg.h' (${CIMG_VERSION}) mismatch"
fi

if [[ $GMIC_VERSION != $STDLIB_VERSION ]]; then
  die "Version numbers of files 'gmic.h' (${GMIC_VERSION}) and 'gmic_stdlib_community.h' (${STDLIB_VERSION}) mismatch"
fi

exit 0


================================================
FILE: cmake/modules/COPYING-CMAKE-SCRIPTS
================================================
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products 
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: cmake/modules/FindFFTW3.cmake
================================================
# - Try to find the Fftw3 Libraries
#
# Once done this will define
#
#  FFTW3_FOUND        - system has fftw3
#  FFTW3_INCLUDE_DIRS - the fftw3 include directories
#  FFTW3_LIBRARIES    - the libraries needed to use fftw3
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#

if (NOT WIN32)

    include(LibFindMacros)
    libfind_pkg_check_modules(FFTW3_PKGCONF fftw3>=3.2)

    find_path(FFTW3_INCLUDE_DIR
        NAMES fftw3.h
        HINTS ${FFTW3_PKGCONF_INCLUDE_DIRS} ${FFTW3_PKGCONF_INCLUDEDIR}
        PATH_SUFFIXES fftw3
    )

    find_library(FFTW3_LIBRARY_CORE
        NAMES fftw3
        HINTS ${FFTW3_PKGCONF_LIBRARY_DIRS} ${FFTW3_PKGCONF_LIBDIR}
    )

    set(FFTW3_CORE_PROCESS_INCLUDES FFTW3_INCLUDE_DIR)
    set(FFTW3_CORE_PROCESS_LIBS FFTW3_LIBRARY_CORE)
    libfind_process(FFTW3_CORE)

    if(FFTW3_CORE_FOUND)
        message(STATUS "FFTW core Found Libraries: " ${FFTW3_CORE_LIBRARIES})
    endif()

    find_library(FFTW3_LIBRARY_THREADS
        NAMES fftw3_threads
        HINTS ${FFTW3_PKGCONF_LIBRARY_DIRS} ${FFTW3_PKGCONF_LIBDIR}
    )

    set(FFTW3_THREADS_PROCESS_INCLUDES FFTW3_INCLUDE_DIR)
    set(FFTW3_THREADS_PROCESS_LIBS FFTW3_LIBRARY_THREADS)
    libfind_process(FFTW3_THREADS)

    if(FFTW3_THREADS_FOUND)
        message(STATUS "FFTW threads Found Libraries: " ${FFTW3_THREADS_LIBRARIES})
    endif()

    if(FFTW3_CORE_FOUND AND FFTW3_THREADS_FOUND)
        set(FFTW3_FOUND true)
        set(FFTW3_LIBRARIES ${FFTW3_CORE_LIBRARIES} ${FFTW3_THREADS_LIBRARIES})
    endif()

else()

    # TODO: Maybe use fftw3/FFTW3Config.cmake?

    find_path(FFTW3_INCLUDE_DIR
        NAMES fftw3.h
    )

    find_library(
        FFTW3_LIBRARY
        NAMES libfftw3 libfftw3-3 libfftw3f-3 libfftw3l-3 fftw3
        DOC "Libraries to link against for FFT Support")

    if (FFTW3_LIBRARY)
        set(FFTW3_LIBRARY_DIR ${FFTW3_LIBRARY})
    endif()

    set (FFTW3_LIBRARIES ${FFTW3_LIBRARY})

    if(FFTW3_INCLUDE_DIR AND FFTW3_LIBRARY_DIR)
       set (FFTW3_FOUND true)
       message(STATUS "Correctly found FFTW3")
    else()
       message(STATUS "Could not find FFTW3")
    endif()

endif()


================================================
FILE: cmake/modules/LibFindMacros.cmake
================================================
# Version 1.0 (2013-04-12)
# Public Domain, originally written by Lasse Kärkkäinen <tronic@zi.fi>
# Published at http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

# If you improve the script, please modify the forementioned wiki page because
# I no longer maintain my scripts (hosted as static files at zi.fi). Feel free
# to remove this entire header if you use real version control instead.

# Changelog:
# 2013-04-12  Added version number (1.0) and this header, no other changes
# 2009-10-08  Originally published


# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
# used for the current package. For this to work, the first parameter must be the
# prefix of the current package, then the prefix of the new package etc, which are
# passed to find_package.
macro (libfind_package PREFIX)
  set (LIBFIND_PACKAGE_ARGS ${ARGN})
  if (${PREFIX}_FIND_QUIETLY)
    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
  endif ()
  if (${PREFIX}_FIND_REQUIRED)
    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
  endif ()
  find_package(${LIBFIND_PACKAGE_ARGS})
endmacro (libfind_package)

# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
# where they added pkg_check_modules. Consequently I need to support both in my scripts
# to avoid those deprecated warnings. Here's a helper that does just that.
# Works identically to pkg_check_modules, except that no checks are needed prior to use.
macro (libfind_pkg_check_modules PREFIX PKGNAME)
  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
    include(UsePkgConfig)
    pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
  else ()
    find_package(PkgConfig)
    if (PKG_CONFIG_FOUND)
      pkg_check_modules(${PREFIX} QUIET ${PKGNAME})
    endif ()
  endif ()
endmacro (libfind_pkg_check_modules)

# Do the final processing once the paths have been detected.
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
# all the variables, each of which contain one include directory.
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
# Also handles errors in case library detection was required, etc.
macro (libfind_process PREFIX)
  # Skip processing if already processed during this run
  if (NOT ${PREFIX}_FOUND)
    # Start with the assumption that the library was found
    set (${PREFIX}_FOUND TRUE)

    # Process all includes and set _FOUND to false if any are missing
    foreach (i ${${PREFIX}_PROCESS_INCLUDES})
      if (${i})
        set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
        mark_as_advanced(${i})
      else ()
        set (${PREFIX}_FOUND FALSE)
      endif ()
    endforeach (i)

    # Process all libraries and set _FOUND to false if any are missing
    foreach (i ${${PREFIX}_PROCESS_LIBS})
      if (${i})
        set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
        mark_as_advanced(${i})
      else ()
        set (${PREFIX}_FOUND FALSE)
      endif ()
    endforeach (i)

    # Print message and/or exit on fatal error
    if (${PREFIX}_FOUND)
      if (NOT ${PREFIX}_FIND_QUIETLY)
        message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
      endif ()
    else ()
      if (${PREFIX}_FIND_REQUIRED)
        foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
          message("${i}=${${i}}")
        endforeach (i)
        message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
      endif ()
    endif ()
  endif ()
endmacro (libfind_process)

macro(libfind_library PREFIX basename)
  set(TMP "")
  if(MSVC80)
    set(TMP -vc80)
  endif()
  if(MSVC90)
    set(TMP -vc90)
  endif()
  set(${PREFIX}_LIBNAMES ${basename}${TMP})
  if(${ARGC} GREATER 2)
    set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
    string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
    set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
  endif()
  find_library(${PREFIX}_LIBRARY
    NAMES ${${PREFIX}_LIBNAMES}
    PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
  )
endmacro(libfind_library)



================================================
FILE: gmic_qt.desktop
================================================
[Desktop Entry]
Version=1.0
Type=Application
Name=G'MIC-Qt
Terminal=false
Comment=Apply G'MIC filters to images
Comment[fr]=Appliquer des filtres G'MIC à des images
TryExec=gmic_qt
Exec=gmic_qt %F
Icon=gmic_qt
Categories=Graphics;
MimeType=image/jpeg;image/png;image/bmp;image/gif;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xbitmap;image/x-xpixmap;image/svg;


================================================
FILE: gmic_qt.pro
================================================
#
# Set HOST variable to define target host software.
# Possible values are "none", "gimp", "gimp3" (experimental), and "paintdotnet"
#
#

!defined(HOST,var) { HOST = gimp }

!defined(GMIC_DYNAMIC_LINKING,var) { GMIC_DYNAMIC_LINKING = off }

!defined(ASAN,var) { ASAN = off }

!defined(PRERELEASE, var) {
# calling 'date' directly crashes on MSYS2!
   PRERELEASE = $$system(bash pre_version.sh)
}

# Possible values are "gcc" or "clang"
!defined(COMPILER,var) { COMPILER = gcc }

# Possible values are "on" or "off"
!defined(LTO,var) { LTO=off }

#
#
#
#

# For debugging purpose
!defined(TIMING,var) { TIMING = off }

# DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

greaterThan(QT_MAJOR_VERSION, 5) {
 message("Qt version >= 6.0.0")
 QMAKE_CXXFLAGS += -fPIE
 QMAKE_LFLAGS += -fPIE
}

#
# Check Qt version (>= 5.2)
#
!greaterThan(QT_MAJOR_VERSION, 4):error("You need Qt 5.2 or greater to build this program.")
equals(QT_MAJOR_VERSION,5) {
  !greaterThan(QT_MINOR_VERSION, 1):error("You need Qt 5.2 or greater to build this program.")
}

DEFINES += QT_DEPRECATED_WARNINGS

#
# Check that pkg-config is installed (qmake error messages are misleading, if not)
#

!system(bash pkg-config-check.sh):error("pkg-config is not installed")

TEMPLATE = app
QT += widgets network
CONFIG	+= qt c++17 strict_c++
CONFIG	+= warn_on
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
VERSION = 0.0.0

PKGCONFIG += fftw3 zlib libpng libjpeg libcurl

equals( HOST, "gimp" ) {
  PKGCONFIG += gimp-2.0
}

equals( HOST, "gimp3" ) {
  PKGCONFIG += gimp-3.0
}

equals( HOST, "8bf") {
  PKGCONFIG += lcms2
}

DEFINES += cimg_use_cpp11=1
DEFINES += cimg_use_fftw3 cimg_use_zlib
DEFINES += cimg_use_abort gmic_is_parallel cimg_use_curl cimg_use_png cimg_use_jpeg
DEFINES += cimg_appname="\\\"gmic\\\""

equals(TIMING, "on")|equals(TIMING,"ON") {
 DEFINES += _TIMING_ENABLED_
 message(Timing is enabled)
}

defined(GMIC_PATH, var) {
  message("GMIC_PATH is set ("$$GMIC_PATH")")
}
!defined(GMIC_PATH, var):exists(../src/gmic.cpp) {
  message(GMIC_PATH was not set: Found gmic sources in ../src)
  GMIC_PATH = ../src
}
!defined(GMIC_PATH, var):exists(../gmic/src/gmic.cpp) {
  message(GMIC_PATH was not set: Found gmic sources in ../gmic/src)
  GMIC_PATH = ../gmic/src
}
defined(GMIC_PATH, var):!exists( $$GMIC_PATH/gmic.cpp ) {
 error("G'MIC repository was not found ("$$GMIC_PATH")")
}
!defined(GMIC_PATH, var) {
 error("GMIC_PATH variable not set, and no G'MIC source tree found")
}

message("G'MIC repository was found ("$$GMIC_PATH")")

DEPENDPATH += $$GMIC_PATH

CIMG.target = $$GMIC_PATH/CImg.h
CIMG.commands = \$(MAKE) -C $$GMIC_PATH CImg.h
QMAKE_EXTRA_TARGETS += CIMG

GMIC_STDLIB.target = $$GMIC_PATH/gmic_stdlib_community.h
GMIC_STDLIB.commands = \$(MAKE) -C $$GMIC_PATH gmic_stdlib_community.h
QMAKE_EXTRA_TARGETS += GMIC_STDLIB

# $$escape_expand(\n\t)

'translations/%.qm'.depends += 'translations/%.ts'
'translations/%.qm'.commands += './translations/lrelease.sh $<'

'translations/filters/%.qm'.depends += 'translations/filters/%.ts'
'translations/filters/%.qm'.commands += './translations/lrelease.sh $<'

'translations/filters/%.ts'.depends += 'translations/filters/gmic_qt_%.csv'
'translations/filters/%.ts'.commands += './translations/filters/csv2ts.sh -o $@ $<'

QMAKE_EXTRA_TARGETS += 'translations/%.qm' \
                       'translations/filters/%.qm' \
                       'translations/filters/%.ts'

GMIC_VERSION = $$system(bash check_versions.sh $$GMIC_PATH gmic)
message("G'MIC version is ................." $$GMIC_VERSION)
exists($$GMIC_PATH/CImg.h) {
 CIMG_VERSION = $$system(bash check_versions.sh $$GMIC_PATH CImg)
 message("CImg version is .................." $$CIMG_VERSION)
}
exists($$GMIC_PATH/gmic_stdlib_community.h) {
 STDLIB_VERSION = $$system(bash check_versions.sh $$GMIC_PATH stdlib)
 message("gmic_stdlib_community.h version is" $$STDLIB_VERSION)
}
exists($$GMIC_PATH/CImg.h):exists($$GMIC_PATH/gmic_stdlib_community.h) {
 GMIC_VERSION = $$system(bash check_versions.sh $$GMIC_PATH gmic)
 STDLIB_VERSION = $$system(bash check_versions.sh $$GMIC_PATH stdlib)
 CIMG_VERSION = $$system(bash check_versions.sh $$GMIC_PATH CImg)
 !equals(GMIC_VERSION, $$CIMG_VERSION):{
   error("Version numbers of files 'gmic.h' (" $$GMIC_VERSION ") and 'CImg.h' (" $$CIMG_VERSION ") mismatch")
 }
 !equals(GMIC_VERSION, $$STDLIB_VERSION):{
   error("Version numbers of files 'gmic.h' (" $$GMIC_VERSION ") and 'gmic_stdlib_community.h' (" $$STDLIB_VERSION ") mismatch")
 }
}

QMAKE_DISTCLEAN = \
  translations/*.qm \
  translations/filters/*.ts \
  translations/filters/*.qm

equals( COMPILER, "clang" ) {
 message("Compiler is clang++")
 QMAKE_CXX = clang++
 QMAKE_LINK = clang++
}

!isEmpty(PRERELEASE) {
  message( Prerelease date is $$PRERELEASE )
  DEFINES += gmic_prerelease="\\\"$$PRERELEASE\\\""
}

LIBS += -lfftw3_threads

win32 {
  DEFINES += _IS_WINDOWS_
  DEFINES += cimg_display=2
  LIBS += -mwindows -lpthread -DPSAPI_VERSION=1 -lpsapi -lgdi32
  message( Windows/GDI32 platform )
}

unix:!macx {
  DEFINES += _IS_UNIX_
  DEFINES += cimg_display=1
  PKGCONFIG += x11
  message( Unix/X11 platform )
}

macx {
  DEFINES += _IS_MACOS_
  DEFINES += cimg_display=0
  ICON = icons/application/gmic_qt.icns
  message( macOS platform )
}

!win32:!unix:!macx {
  DEFINES += cimg_display=0
  message( Unknown platform )
}

equals( HOST, "gimp")|equals( HOST, "gimp3") {
 TARGET = gmic_gimp_qt
 SOURCES += src/Host/Gimp/host_gimp.cpp
 DEFINES += GMIC_HOST=gimp
 DEFINES += GIMP_DISABLE_DEPRECATED
 DEPENDPATH += $$PWD/src/Host/Gimp
 message(Target host software is GIMP)
}

equals( HOST, "none") {
 TARGET = gmic_qt
 DEFINES += GMIC_HOST=standalone
 HEADERS += src/Host/None/ImageDialog.h \
            src/Host/None/JpegQualityDialog.h
 SOURCES += src/Host/None/host_none.cpp \
            src/Host/None/ImageDialog.cpp \
            src/Host/None/JpegQualityDialog.cpp
 FORMS += src/Host/None/jpegqualitydialog.ui
 DEPENDPATH += $$PWD/src/Host/None
 message(Building standalone version)
}

equals( HOST, "paintdotnet") {
 TARGET = gmic_paintdotnet_qt
 SOURCES += src/Host/PaintDotNet/host_paintdotnet.cpp
 DEFINES += GMIC_HOST=paintdotnet
 DEPENDPATH += $$PWD/src/Host/PaintDotNet
 message(Target host software is Paint.NET)
}

equals( HOST, "8bf") {
 TARGET = gmic_8bf_qt
 SOURCES += src/Host/8bf/host_8bf.cpp
 DEFINES += GMIC_HOST=plugin8bf
 DEPENDPATH += $$PWD/src/Host/8bf
 message(Target host software is 8bf filter)
}

# enable OpenMP by default on with g++, except on OS X
!macx:*g++* {
    CONFIG += openmp
}
!macx:equals(COMPILER,"clang") {
    CONFIG += openmp
}

# use qmake CONFIG+=openmp ... to force using openmp
# For example, on OS X with GCC 4.8 installed:
# qmake -spec unsupported/macx-clang QMAKE_CXX=g++-4.8 QMAKE_LINK=g++-4.8 CONFIG+=openmp
# Notes:
#  - the compiler name is g++-4.8 on Homebrew and g++-mp-4.8 on MacPorts
#  - we use the unsupported/macx-clang config because macx-g++ uses arch flags that are not recognized by GNU GCC
openmp:equals(COMPILER,"gcc") {
    message("OpenMP enabled, with g++")
    DEFINES += cimg_use_openmp
    QMAKE_CXXFLAGS_DEBUG += -fopenmp
    QMAKE_CXXFLAGS_RELEASE += -fopenmp
    QMAKE_LFLAGS_DEBUG += -fopenmp
    QMAKE_LFLAGS_RELEASE += -fopenmp
}

openmp:equals(COMPILER,"clang") {
    message("OpenMP enabled, with clang++")
    DEFINES += cimg_use_openmp
    QMAKE_CXXFLAGS_DEBUG += -fopenmp=libomp -I/usr/lib/gcc/x86_64-redhat-linux/7/include/
    QMAKE_CXXFLAGS_RELEASE += -fopenmp=libomp  -I/usr/lib/gcc/x86_64-redhat-linux/7/include/
    QMAKE_LFLAGS_DEBUG += -fopenmp=libomp
    QMAKE_LFLAGS_RELEASE += -fopenmp=libomp
}

equals(LTO,"on") { LTO = ON }
CONFIG(release, debug|release):gcc|clang:equals(LTO,"ON") {
    message("Link Time Optimizer enabled")
    QMAKE_CXXFLAGS_RELEASE += -flto
    QMAKE_LFLAGS_RELEASE += -flto
}

DEFINES += gmic_gui gmic_core gmic_is_parallel gmic_community cimg_use_abort

INCLUDEPATH	+= $$PWD $$PWD/src $$GMIC_PATH
DEPENDPATH += $$PWD/src \
              $$PWD/src/Host \
              $$PWD/src/FilterParameters \
              $$PWD/src/FilterSelector \
              $$PWD/src/FilterSelector/FiltersView \

HEADERS +=  \
  src/ClickableLabel.h \
  src/Common.h \
  src/FilterParameters/CustomSpinBox.h \
  src/GmicQt.h \
  src/Host/GmicQtHost.h \
  src/OverrideCursor.h \
  src/DialogSettings.h \
  src/FilterParameters/AbstractParameter.h \
  src/FilterParameters/BoolParameter.h \
  src/FilterParameters/ButtonParameter.h \
  src/FilterParameters/ChoiceParameter.h \
  src/FilterParameters/ColorParameter.h \
  src/FilterParameters/ConstParameter.h \
  src/FilterParameters/CustomDoubleSpinBox.h \
  src/FilterParameters/FileParameter.h \
  src/FilterParameters/FilterParametersWidget.h \
  src/FilterParameters/FloatParameter.h \
  src/FilterParameters/FolderParameter.h \
  src/FilterParameters/IntParameter.h \
  src/FilterParameters/LinkParameter.h \
  src/FilterParameters/MultilineTextParameterWidget.h \
  src/FilterParameters/NoteParameter.h \
  src/FilterParameters/PointParameter.h \
  src/FilterParameters/SeparatorParameter.h \
  src/FilterParameters/TextParameter.h \
  src/FilterSelector/FiltersModel.h \
  src/FilterSelector/FiltersModelReader.h \
  src/FilterSelector/FiltersModelBinaryReader.h \
  src/FilterSelector/FiltersModelBinaryWriter.h \
  src/FilterSelector/FiltersPresenter.h \
  src/FilterSelector/FiltersView/FiltersView.h \
  src/FilterSelector/FiltersView/TreeView.h \
  src/FilterSelector/FiltersVisibilityMap.h \
  src/FilterSelector/FilterTagMap.h \
  src/CroppedImageListProxy.h \
  src/CroppedActiveLayerProxy.h \
  src/FilterGuiDynamismCache.h \
  src/FilterSyncRunner.h \
  src/FilterThread.h \
  src/FilterTextTranslator.h \
  src/Globals.h \
  src/GmicStdlib.h \
  src/GmicProcessor.h \
  src/HeadlessProcessor.h \
  src/HtmlTranslator.h \
  src/IconLoader.h \
  src/ImageTools.h \
  src/InputOutputState.h \
  src/KeypointList.h \
  src/LayersExtentProxy.h \
  src/Logger.h \
  src/LanguageSettings.h \
  src/MainWindow.h \
  src/Misc.h \
  src/ParametersCache.h \
  src/PersistentMemory.h \
  src/Settings.h \
  src/SourcesWidget.h \
  src/Tags.h \
  src/TimeLogger.h \
  src/Updater.h \
  src/Utils.h \
  src/Widgets/VisibleTagSelector.h \
  src/ZoomConstraint.h \
  src/FilterSelector/FiltersView/FilterTreeFolder.h \
  src/FilterSelector/FiltersView/FilterTreeItem.h \
  src/FilterSelector/FavesModel.h \
  src/FilterSelector/FavesModelReader.h \
  src/FilterSelector/FiltersView/FilterTreeAbstractItem.h \
  src/FilterSelector/FiltersView/FilterTreeItemDelegate.h \
  src/FilterSelector/FavesModelWriter.h \
  src/Widgets/PreviewWidget.h \
  src/Widgets/ProgressInfoWidget.h \
  src/Widgets/InOutPanel.h \
  src/Widgets/ZoomLevelSelector.h \
  src/Widgets/SearchFieldWidget.h \
  src/Widgets/LanguageSelectionWidget.h \
  src/Widgets/ProgressInfoWindow.h

HEADERS += $$GMIC_PATH/gmic.h

SOURCES += \
  src/ClickableLabel.cpp \
  src/Common.cpp \
  src/FilterParameters/CustomSpinBox.cpp \
  src/GmicQt.cpp \
  src/OverrideCursor.cpp \
  src/DialogSettings.cpp \
  src/FilterParameters/AbstractParameter.cpp \
  src/FilterParameters/BoolParameter.cpp \
  src/FilterParameters/ButtonParameter.cpp \
  src/FilterParameters/ChoiceParameter.cpp \
  src/FilterParameters/ColorParameter.cpp \
  src/FilterParameters/ConstParameter.cpp \
  src/FilterParameters/CustomDoubleSpinBox.cpp \
  src/FilterParameters/FileParameter.cpp \
  src/FilterParameters/FilterParametersWidget.cpp \
  src/FilterParameters/FloatParameter.cpp \
  src/FilterParameters/FolderParameter.cpp \
  src/FilterParameters/IntParameter.cpp \
  src/FilterParameters/LinkParameter.cpp \
  src/FilterParameters/MultilineTextParameterWidget.cpp \
  src/FilterParameters/NoteParameter.cpp \
  src/FilterParameters/PointParameter.cpp \
  src/FilterParameters/SeparatorParameter.cpp \
  src/FilterParameters/TextParameter.cpp \
  src/FilterSelector/FiltersModel.cpp \
  src/FilterSelector/FiltersModelReader.cpp \
  src/FilterSelector/FiltersModelBinaryReader.cpp \
  src/FilterSelector/FiltersModelBinaryWriter.cpp \
  src/FilterSelector/FiltersPresenter.cpp \
  src/FilterSelector/FiltersView/FiltersView.cpp \
  src/FilterSelector/FiltersView/TreeView.cpp \
  src/FilterSelector/FiltersVisibilityMap.cpp \
  src/FilterSelector/FilterTagMap.cpp \
  src/CroppedImageListProxy.cpp \
  src/CroppedActiveLayerProxy.cpp \
  src/FilterGuiDynamismCache.cpp \
  src/FilterSyncRunner.cpp \
  src/FilterThread.cpp \
  src/FilterTextTranslator.cpp \
  src/Globals.cpp \
  src/GmicStdlib.cpp \
  src/GmicProcessor.cpp \
  src/HeadlessProcessor.cpp \
  src/HtmlTranslator.cpp \
  src/IconLoader.cpp \
  src/ImageTools.cpp \
  src/InputOutputState.cpp \
  src/KeypointList.cpp \
  src/LayersExtentProxy.cpp \
  src/LanguageSettings.cpp \
  src/Logger.cpp \
  src/MainWindow.cpp \
  src/ParametersCache.cpp \
  src/PersistentMemory.cpp \
  src/Settings.cpp \
  src/SourcesWidget.cpp \
  src/Tags.cpp \
  src/TimeLogger.cpp \
  src/Updater.cpp \
  src/Utils.cpp \
  src/Misc.cpp \
  src/FilterSelector/FiltersView/FilterTreeItem.cpp \
  src/FilterSelector/FiltersView/FilterTreeFolder.cpp \
  src/FilterSelector/FavesModel.cpp \
  src/FilterSelector/FavesModelReader.cpp \
  src/FilterSelector/FiltersView/FilterTreeAbstractItem.cpp \
  src/FilterSelector/FiltersView/FilterTreeItemDelegate.cpp \
  src/FilterSelector/FavesModelWriter.cpp \
  src/Widgets/PreviewWidget.cpp \
  src/Widgets/ProgressInfoWidget.cpp \
  src/Widgets/InOutPanel.cpp \
  src/Widgets/VisibleTagSelector.cpp \
  src/Widgets/ZoomLevelSelector.cpp \
  src/Widgets/SearchFieldWidget.cpp \
  src/Widgets/LanguageSelectionWidget.cpp \
  src/Widgets/ProgressInfoWindow.cpp

equals(GMIC_DYNAMIC_LINKING, "on" )|equals(GMIC_DYNAMIC_LINKING, "ON" ) {
  message(Dynamic linking with libgmic)
  LIBS += -Wl,-rpath,. $$GMIC_PATH/libgmic.so
}

equals(GMIC_DYNAMIC_LINKING, "off" )|equals(GMIC_DYNAMIC_LINKING, "OFF" ) {
   SOURCES += $$GMIC_PATH/gmic.cpp
}

# ALL_FORMS
FORMS +=  ui/inoutpanel.ui \
          ui/sourceswidget.ui \
          ui/multilinetextparameterwidget.ui \
          ui/progressinfowindow.ui \
          ui/dialogsettings.ui \
          ui/progressinfowidget.ui \
          ui/mainwindow.ui \
          ui/SearchFieldWidget.ui \
          ui/headlessprogressdialog.ui \
          ui/zoomlevelselector.ui \
          ui/languageselectionwidget.ui \
          ui/filtersview.ui

RESOURCES += gmic_qt.qrc translations.qrc
equals(HOST, "none") {
 RESOURCES += standalone.qrc
}

TRANSLATIONS = \
translations/cs.ts \
translations/de.ts \
translations/es.ts \
translations/fr.ts \
translations/id.ts \
translations/it.ts \
translations/ja.ts \
translations/nl.ts \
translations/pl.ts \
translations/pt.ts \
translations/ru.ts \
translations/sv.ts \
translations/uk.ts \
translations/zh.ts \
translations/zh_tw.ts

RESOURCES += wip_translations.qrc

# Prevent overwriting of these files by lupdate
# TRANSLATIONS += translations/filters/fr.ts

QMAKE_CXXFLAGS_RELEASE += -O3
QMAKE_LFLAGS_RELEASE += -s
QMAKE_CXXFLAGS_DEBUG += -Dcimg_verbosity=3

unix { DEFINES += cimg_use_vt100 }

CONFIG(release, debug|release) {
    message(Release build)
    DEFINES += QT_NO_DEBUG_OUTPUT
}

CONFIG(debug, debug|release) {
    message(Debug build)
    DEFINES += _GMIC_QT_DEBUG_
#    QMAKE_CXXFLAGS_DEBUG += -Wfatal-errors
}

equals(ASAN,"on")|equals(ASAN,"ON") {
    message(Address sanitizer enabled)
    QMAKE_CXXFLAGS_DEBUG += -fsanitize=address
    QMAKE_LFLAGS_DEBUG += -fsanitize=address
}

UI_DIR = .ui
MOC_DIR = .moc
RCC_DIR = .qrc
OBJECTS_DIR = .obj


================================================
FILE: gmic_qt.qrc
================================================
<RCC>
    <qresource prefix="/">
        <file>icons/bookmark-add.png</file>
        <file>icons/bookmark-remove.png</file>
        <file>icons/cancel.png</file>
        <file>icons/close.png</file>
        <file>icons/dark/bookmark-add.png</file>
        <file>icons/dark/bookmark-remove.png</file>
        <file>icons/dark/cancel.png</file>
        <file>icons/dark/close.png</file>
        <file>icons/dark/document-open.png</file>
        <file>icons/dark/draw-arrow-down.png</file>
        <file>icons/dark/draw-arrow-up.png</file>
        <file>icons/dark/edit-clear.png</file>
        <file>icons/dark/edit-copy.png</file>
        <file>icons/dark/edit-find.png</file>
        <file>icons/dark/folder.png</file>
        <file>icons/dark/insert-image.png</file>
        <file>icons/dark/list-add.png</file>
        <file>icons/dark/list-remove.png</file>
        <file>icons/dark/package_settings.png</file>
        <file>icons/dark/rename.png</file>
        <file>icons/dark/selection_mode.png</file>
        <file>icons/dark/system-run.png</file>
        <file>icons/dark/undo.png</file>
        <file>icons/dark/user-trash.png</file>
        <file>icons/dark/view-fullscreen.png</file>
        <file>icons/dark/view-refresh.png</file>
        <file>icons/dark/zoom-in.png</file>
        <file>icons/dark/zoom-out.png</file>
        <file>icons/document-open.png</file>
        <file>icons/draw-arrow-down.png</file>
        <file>icons/draw-arrow-up.png</file>
        <file>icons/edit-clear.png</file>
        <file>icons/edit-copy.png</file>
        <file>icons/edit-find.png</file>
        <file>icons/folder.png</file>
        <file>icons/insert-image.png</file>
        <file>icons/list-add.png</file>
        <file>icons/list-remove.png</file>
        <file>icons/package_settings.png</file>
        <file>icons/rename.png</file>
        <file>icons/selection_mode.png</file>
        <file>icons/system-run.png</file>
        <file>icons/undo.png</file>
        <file>icons/user-trash.png</file>
        <file>icons/view-fullscreen.png</file>
        <file>icons/view-refresh.png</file>
        <file>icons/zoom-in.png</file>
        <file>icons/zoom-out.png</file>
        <file>images/no_warning.png</file>
        <file>images/preview_left.png</file>
        <file>images/preview_right.png</file>
        <file>images/warning.png</file>
        <file>resources/gmic_hat.png</file>
        <file>resources/logos.png</file>
        <file>resources/transparency.png</file>
        <file>icons/color-wheel.png</file>
        <file>icons/dark/color-wheel.png</file>
        <file>icons/randomize.png</file>
    </qresource>
</RCC>


================================================
FILE: pkg-config-check.sh
================================================
#!/bin/bash
bash -c "pkg-config --version" > /dev/null 2>&1


================================================
FILE: pre_version.sh
================================================
#!/bin/bash
# workaround for MSYS2 call of date by qmake.
date "+%y%m%d%H"


================================================
FILE: scripts/travis_build_cmake.sh
================================================
#!/bin/bash
set -ev

if [ "${TRAVIS_BRANCH}" = devel ]; then
    BUILD_TYPE=Debug
else
    BUILD_TYPE=Release
fi

cmake --version

GMIC_PATH=$(pwd)/gmic-clone/src

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DGMIC_PATH=${GMIC_PATH} -DGMIC_QT_HOST=${GMIC_HOST} ..
make VERBOSE=1


================================================
FILE: scripts/travis_build_qmake.sh
================================================
#!/bin/bash
set -ev

if [ "${TRAVIS_BRANCH}" = devel ]; then
    config=debug
else
    config=release
fi

qmake --version

echo "Building standalone plugin"
qmake CONFIG+=${config} HOST=none GMIC_PATH=gmic-clone/src
make

echo "Building Gimp plugin"
qmake CONFIG+=${config} HOST=gimp GMIC_PATH=gmic-clone/src
make
make


================================================
FILE: src/ClickableLabel.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ClickableLabel.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "ClickableLabel.h"
#include <QMouseEvent>

namespace GmicQt
{

ClickableLabel::ClickableLabel(QWidget * parent) : QLabel(parent) {}

void ClickableLabel::mousePressEvent(QMouseEvent * e)
{
  if (e->buttons() & Qt::LeftButton) {
    emit clicked();
  }
}

} // namespace GmicQt


================================================
FILE: src/ClickableLabel.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ClickableLabel.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_CLICKABLELABEL_H
#define GMIC_QT_CLICKABLELABEL_H

#include <QLabel>

class QMouseEvent;

namespace GmicQt
{

class ClickableLabel : public QLabel {
  Q_OBJECT
public:
  ClickableLabel(QWidget * parent);
  void mousePressEvent(QMouseEvent * e) override;
signals:
  void clicked();
};

} // namespace GmicQt

#endif // GMIC_QT_CLICKABLELABEL_H


================================================
FILE: src/Common.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file Common.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "Common.h"


================================================
FILE: src/Common.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file Common.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_COMMON_H
#define GMIC_QT_COMMON_H

#include <QTime>
#include <QtGlobal>
#include <iostream>
#include "TimeLogger.h"

#ifdef _GMIC_QT_DEBUG_
#define DEBUG_QTIMESTAMP QTime::currentTime().toString("[hh:mm:ss]")
#define DEBUG_TIMESTAMP QTime::currentTime().toString("[hh:mm:ss]").toStdString()
#define ENTERING std::cerr << DEBUG_TIMESTAMP << " [" << __PRETTY_FUNCTION__ << "] <<Entering>>" << std::endl
#define LEAVING std::cerr << DEBUG_TIMESTAMP << " [" << __PRETTY_FUNCTION__ << "] <<Leaving>>" << std::endl
#define TRACE qWarning() << DEBUG_QTIMESTAMP << "[" << __PRETTY_FUNCTION__ << "]"
#define TSHOW(V) qWarning() << DEBUG_QTIMESTAMP << "[" << __PRETTY_FUNCTION__ << "]:" << __LINE__ << " " << #V << "=" << (V)
#define SHOW(V) qWarning() << #V << "=" << (V)
#define STDSHOW(V) std::cerr << #V << " = " << (V) << std::endl
#define QSTDSHOW(STR) std::cerr << #STR << " = " << (STR).toStdString() << std::endl
#else
#define ENTERING while (false)
#define LEAVING while (false)
#define TRACE                                                                                                                                                                                          \
  while (false)                                                                                                                                                                                        \
  qWarning() << ""
#define TSHOW(V)                                                                                                                                                                                       \
  while (false)                                                                                                                                                                                        \
  qWarning() << ""
#define SHOW(V)                                                                                                                                                                                        \
  while (false)                                                                                                                                                                                        \
  qWarning() << ""
#define STDSHOW(V)                                                                                                                                                                                     \
  while (false)                                                                                                                                                                                        \
  std::cerr << ""
#define QSTDSHOW(STR)                                                                                                                                                                                  \
  while (false)                                                                                                                                                                                        \
  std::cerr << ""
#endif

template <typename T> inline void unused(const T &, ...) {}

#ifdef _TIMING_ENABLED_
#define TIMING GmicQt::TimeLogger::getInstance()->step(__PRETTY_FUNCTION__, __LINE__, __FILE__)
#else
#define TIMING                                                                                                                                                                                         \
  if (false)                                                                                                                                                                                           \
  std::cout << ""
#endif

#define QT_VERSION_GTE(MAJOR, MINOR, PATCH) (QT_VERSION >= QT_VERSION_CHECK(MAJOR, MINOR, PATCH))

#if QT_VERSION_GTE(5, 14, 0)
#define QT_SKIP_EMPTY_PARTS Qt::SkipEmptyParts
#define QT_KEEP_EMPTY_PARTS Qt::KeepEmptyParts
#else
#define QT_SKIP_EMPTY_PARTS QString::SkipEmptyParts
#define QT_KEEP_EMPTY_PARTS QString::KeepEmptyParts
#endif

#endif // GMIC_QT_COMMON_H


================================================
FILE: src/CroppedActiveLayerProxy.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CroppedActiveLayerProxy.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "CroppedActiveLayerProxy.h"
#include <QDebug>
#include "Common.h"
#include "Host/GmicQtHost.h"
#include "gmic.h"

namespace GmicQt
{

double CroppedActiveLayerProxy::_x = -1.0;
double CroppedActiveLayerProxy::_y = -1.0;
double CroppedActiveLayerProxy::_width = -1.0;
double CroppedActiveLayerProxy::_height = -1.0;
std::unique_ptr<gmic_library::gmic_image<gmic_pixel_type>> CroppedActiveLayerProxy::_cachedImage(new gmic_library::gmic_image<gmic_pixel_type>);

void CroppedActiveLayerProxy::get(gmic_library::gmic_image<gmic_pixel_type> & image, double x, double y, double width, double height)
{
  if ((x != _x) || (y != _y) || (width != _width) || (height != _height)) {
    update(x, y, width, height);
  }
  image = *_cachedImage;
}

QSize CroppedActiveLayerProxy::getSize(double x, double y, double width, double height)
{
  if ((x != _x) || (y != _y) || (width != _width) || (height != _height)) {
    update(x, y, width, height);
  }
  return QSize(_cachedImage->width(), _cachedImage->height());
}

void CroppedActiveLayerProxy::clear()
{
  _cachedImage->assign();
  _x = _y = _width = _height = -1.0;
}

void CroppedActiveLayerProxy::update(double x, double y, double width, double height)
{
  _x = x;
  _y = y;
  _width = width;
  _height = height;

  gmic_library::gmic_list<gmic_pixel_type> images;
  gmic_library::gmic_list<char> imageNames;
  GmicQtHost::getCroppedImages(images, imageNames, _x, _y, _width, _height, InputMode::Active);
  if (images.size() > 0) {
    GmicQtHost::applyColorProfile(images.front());
    _cachedImage->swap(images.front());
  } else {
    clear();
  }
}

} // namespace GmicQt


================================================
FILE: src/CroppedActiveLayerProxy.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CroppedActiveLayerProxy.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_CROPPEDACTIVELAYERPROXY_H
#define GMIC_QT_CROPPEDACTIVELAYERPROXY_H

#include <QSize>
#include <memory>
#include "GmicQt.h"

namespace gmic_library
{
template <typename T> struct gmic_image;
template <typename T> struct gmic_list;
} // namespace gmic_library

namespace GmicQt
{
class CroppedActiveLayerProxy {
public:
  CroppedActiveLayerProxy() = delete;

  static void get(gmic_library::gmic_image<gmic_pixel_type> & image, double x, double y, double width, double height);
  static QSize getSize(double x, double y, double width, double height);
  static void clear();

private:
  static void update(double x, double y, double width, double height);
  static std::unique_ptr<gmic_library::gmic_image<float>> _cachedImage;
  static double _x;
  static double _y;
  static double _width;
  static double _height;
};

} // namespace GmicQt

#endif // GMIC_QT_CROPPEDACTIVELAYERPROXY_H


================================================
FILE: src/CroppedImageListProxy.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CroppedImageListProxy.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "CroppedImageListProxy.h"
#include <QDebug>
#include <cmath>
#include "Common.h"
#include "Host/GmicQtHost.h"
#include "gmic.h"

namespace GmicQt
{

double CroppedImageListProxy::_x = -1.0;
double CroppedImageListProxy::_y = -1.0;
double CroppedImageListProxy::_width = -1.0;
double CroppedImageListProxy::_height = -1.0;
double CroppedImageListProxy::_zoom = 0.0;
InputMode CroppedImageListProxy::_inputMode = InputMode::Unspecified;
std::unique_ptr<gmic_library::gmic_list<gmic_pixel_type>> CroppedImageListProxy::_cachedImageList(new gmic_library::gmic_list<gmic_pixel_type>);
std::unique_ptr<gmic_library::gmic_list<char>> CroppedImageListProxy::_cachedImageNames(new gmic_library::gmic_list<char>);

void CroppedImageListProxy::get(gmic_library::gmic_list<gmic_pixel_type> & images, gmic_library::gmic_list<char> & imageNames,
                                double x, double y, double width, double height, InputMode mode, double zoom)
{
  if ((x != _x) || (y != _y) || (width != _width) || (height != _height) || (mode != _inputMode) || (zoom != _zoom)) {
    update(x, y, width, height, mode, zoom);
  }
  images = *_cachedImageList;
  imageNames = *_cachedImageNames;
}

void CroppedImageListProxy::update(double x, double y, double width, double height, InputMode mode, double zoom)
{
  _x = x;
  _y = y;
  _width = width;
  _height = height;
  _inputMode = mode;
  _zoom = zoom;
  GmicQtHost::getCroppedImages(*_cachedImageList, *_cachedImageNames, _x, _y, _width, _height, _inputMode);
  if (zoom < 1.0) {
    for (unsigned int i = 0; i < _cachedImageList->size(); ++i) {
      gmic_image<float> & image = (*_cachedImageList)[i];
      image.resize(std::round(image.width() * zoom), std::round(image.height() * zoom), 1, -100, 1);
    }
  }
}

void CroppedImageListProxy::clear()
{
  _cachedImageList->assign();
  _cachedImageNames->assign();
  _x = _y = _width = _height = -1.0;
  _inputMode = InputMode::Unspecified;
  _zoom = 0.0;
}

} // namespace GmicQt


================================================
FILE: src/CroppedImageListProxy.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CroppedImageListProxy.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_CROPPEDIMAGELISTPROXY_H
#define GMIC_QT_CROPPEDIMAGELISTPROXY_H

#include <memory>
#include "GmicQt.h"

namespace gmic_library
{
template <typename T> struct gmic_image;
template <typename T> struct gmic_list;
} // namespace gmic_library

namespace GmicQt
{

class CroppedImageListProxy {
public:
  CroppedImageListProxy() = delete;

  static void get(gmic_library::gmic_list<gmic_pixel_type> & images, gmic_library::gmic_list<char> & imageNames, double x, double y, double width, double height, InputMode mode, double zoom);
  static void update(double x, double y, double width, double height, InputMode mode, double zoom);
  static void clear();

private:
  static std::unique_ptr<gmic_library::gmic_list<float>> _cachedImageList;
  static std::unique_ptr<gmic_library::gmic_list<char>> _cachedImageNames;
  static double _x;
  static double _y;
  static double _width;
  static double _height;
  static InputMode _inputMode;
  static double _zoom;
};

} // namespace GmicQt

#endif // GMIC_QT_CROPPEDIMAGELISTPROXY_H


================================================
FILE: src/DialogSettings.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file DialogSettings.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "DialogSettings.h"
#include <QCloseEvent>
#include <QSettings>
#include <limits>
#include "Common.h"
#include "Globals.h"
#include "Host/GmicQtHost.h"
#include "IconLoader.h"
#include "Logger.h"
#include "MainWindow.h"
#include "Settings.h"
#include "Updater.h"
#include "ui_dialogsettings.h"

namespace GmicQt
{
DialogSettings::DialogSettings(QWidget * parent) : QDialog(parent), ui(new Ui::DialogSettings)
{
  ui->setupUi(this);

  setWindowTitle(tr("Settings"));
  setWindowIcon(parent->windowIcon());
  adjustSize();

  ui->pbUpdate->setIcon(IconLoader::load("view-refresh"));

  ui->cbUpdatePeriodicity->addItem(tr("Never"), QVariant(INTERNET_NEVER_UPDATE_PERIODICITY));
  ui->cbUpdatePeriodicity->addItem(tr("Daily"), QVariant(ONE_DAY_HOURS));
  ui->cbUpdatePeriodicity->addItem(tr("Weekly"), QVariant(ONE_WEEK_HOURS));
  ui->cbUpdatePeriodicity->addItem(tr("Every 2 weeks"), QVariant(TWO_WEEKS_HOURS));
  ui->cbUpdatePeriodicity->addItem(tr("Monthly"), QVariant(ONE_MONTH_HOURS));
#ifdef _GMIC_QT_DEBUG_
  ui->cbUpdatePeriodicity->addItem(tr("At launch (debug)"), QVariant(0));
#endif
  for (int i = 0; i < ui->cbUpdatePeriodicity->count(); ++i) {
    if (Settings::updatePeriodicity() == ui->cbUpdatePeriodicity->itemData(i).toInt()) {
      ui->cbUpdatePeriodicity->setCurrentIndex(i);
    }
  }

  ui->outputMessages->setToolTip(tr("Output messages"));
  ui->outputMessages->addItem(tr("Quiet (default)"), (int)OutputMessageMode::Quiet);
  ui->outputMessages->addItem(tr("Verbose (console)"), (int)OutputMessageMode::VerboseConsole);
  ui->outputMessages->addItem(tr("Verbose (log file)"), (int)OutputMessageMode::VerboseLogFile);
  ui->outputMessages->addItem(tr("Very verbose (console)"), (int)OutputMessageMode::VeryVerboseConsole);
  ui->outputMessages->addItem(tr("Very verbose (log file)"), (int)OutputMessageMode::VeryVerboseLogFile);
  ui->outputMessages->addItem(tr("Debug (console)"), (int)OutputMessageMode::DebugConsole);
  ui->outputMessages->addItem(tr("Debug (log file)"), (int)OutputMessageMode::DebugLogFile);
  for (int index = 0; index < ui->outputMessages->count(); ++index) {
    if (ui->outputMessages->itemData(index) == (int)Settings::outputMessageMode()) {
      ui->outputMessages->setCurrentIndex(index);
      break;
    }
  }

  ui->sbPreviewTimeout->setRange(0, 999);

  ui->rbLeftPreview->setChecked(Settings::previewPosition() == MainWindow::PreviewPosition::Left);
  ui->rbRightPreview->setChecked(Settings::previewPosition() == MainWindow::PreviewPosition::Right);
  const bool savedDarkTheme = QSettings().value(DARK_THEME_KEY, GmicQtHost::DarkThemeIsDefault).toBool();
  ui->rbDarkTheme->setChecked(savedDarkTheme);
  ui->rbDefaultTheme->setChecked(!savedDarkTheme);
  ui->cbNativeColorDialogs->setChecked(Settings::nativeColorDialogs());
  ui->cbNativeColorDialogs->setToolTip(tr("Check to use Native/OS color dialog, uncheck to use Qt's"));
  ui->cbNativeFileDialogs->setChecked(Settings::nativeFileDialogs());
  ui->cbNativeFileDialogs->setToolTip(tr("Check to use Native/OS file dialog, uncheck to use Qt's"));
  ui->cbShowLogos->setChecked(Settings::visibleLogos());
  ui->sbPreviewTimeout->setValue(Settings::previewTimeout());
  ui->cbPreviewZoom->setChecked(Settings::previewZoomAlwaysEnabled());
  ui->cbNotifyFailedUpdate->setChecked(Settings::notifyFailedStartupUpdate());

  connect(ui->pbOk, &QPushButton::clicked, this, &DialogSettings::onOk);
  connect(ui->rbLeftPreview, &QRadioButton::toggled, this, &DialogSettings::onRadioLeftPreviewToggled);
  connect(ui->pbUpdate, &QPushButton::clicked, this, &DialogSettings::onUpdateClicked);
  connect(ui->cbUpdatePeriodicity, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DialogSettings::onUpdatePeriodicityChanged);
  connect(ui->labelPreviewLeft, &ClickableLabel::clicked, ui->rbLeftPreview, &QRadioButton::click);
  connect(ui->labelPreviewRight, &ClickableLabel::clicked, ui->rbRightPreview, &QRadioButton::click);
  connect(ui->cbNativeColorDialogs, &QCheckBox::toggled, this, &DialogSettings::onColorDialogsToggled);
  connect(ui->cbNativeFileDialogs, &QCheckBox::toggled, this, &DialogSettings::onFileDialogsToggled);
  connect(Updater::getInstance(), &Updater::updateIsDone, this, &DialogSettings::enableUpdateButton);
  connect(ui->rbDarkTheme, &QRadioButton::toggled, this, &DialogSettings::onDarkThemeToggled);
  connect(ui->cbShowLogos, &QCheckBox::toggled, this, &DialogSettings::onVisibleLogosToggled);
  connect(ui->cbPreviewZoom, &QCheckBox::toggled, this, &DialogSettings::onPreviewZoomToggled);
  connect(ui->sbPreviewTimeout, QOverload<int>::of(&QSpinBox::valueChanged), this, &DialogSettings::onPreviewTimeoutChange);
  connect(ui->outputMessages, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DialogSettings::onOutputMessageModeChanged);
  connect(ui->cbNotifyFailedUpdate, &QCheckBox::toggled, this, &DialogSettings::onNotifyStartupUpdateFailedToggle);

#if QT_VERSION_GTE(6, 0, 0)
  ui->cbHighDPI->hide();
  ui->labelHighDPI->hide();
#else
  ui->cbHighDPI->setChecked(Settings::highDPIEnabled());
  connect(ui->cbHighDPI, &QCheckBox::toggled, this, &DialogSettings::onHighDPIToggled);
#endif

  ui->languageSelector->selectLanguage(Settings::languageCode());
  ui->languageSelector->enableFilterTranslation(Settings::filterTranslationEnabled());

  if (Settings::darkThemeEnabled()) {
    QPalette p = ui->cbNativeColorDialogs->palette();
    p.setColor(QPalette::Text, Settings::CheckBoxTextColor);
    p.setColor(QPalette::Base, Settings::CheckBoxBaseColor);
    ui->cbNativeColorDialogs->setPalette(p);
    ui->cbNativeFileDialogs->setPalette(p);
    ui->cbPreviewZoom->setPalette(p);
    ui->cbUpdatePeriodicity->setPalette(p);
    ui->rbDarkTheme->setPalette(p);
    ui->rbDefaultTheme->setPalette(p);
    ui->rbLeftPreview->setPalette(p);
    ui->rbRightPreview->setPalette(p);
    ui->cbShowLogos->setPalette(p);
    ui->cbNotifyFailedUpdate->setPalette(p);
    ui->cbHighDPI->setPalette(p);
  }
  ui->pbOk->setFocus();
  ui->tabWidget->setCurrentIndex(0);
}

DialogSettings::~DialogSettings()
{
  delete ui;
}

void DialogSettings::sourcesStatus(bool & modified, bool & internetUpdateRequired)
{
  modified = ui->sources->sourcesModified(internetUpdateRequired);
}

void DialogSettings::onOk()
{
  done(QDialog::Accepted);
}

void DialogSettings::done(int r)
{
  QSettings settings;
  ui->sources->saveSettings();
  Settings::save(settings);
  QDialog::done(r);
}

void DialogSettings::onVisibleLogosToggled(bool on)
{
  Settings::setVisibleLogos(on);
}

void DialogSettings::onPreviewTimeoutChange(int value)
{
  Settings::setPreviewTimeout(value);
}

void DialogSettings::onOutputMessageModeChanged(int)
{
  const OutputMessageMode mode = static_cast<OutputMessageMode>(ui->outputMessages->currentData().toInt());
  Settings::setOutputMessageMode(mode);
  Logger::setMode(mode);
}

void DialogSettings::onPreviewZoomToggled(bool on)
{
  Settings::setPreviewZoomAlwaysEnabled(on);
}

void DialogSettings::onNotifyStartupUpdateFailedToggle(bool on)
{
  Settings::setNotifyFailedStartupUpdate(on);
}

void DialogSettings::onHighDPIToggled(bool on)
{
  Settings::setHighDPIEnabled(on);
}

void DialogSettings::enableUpdateButton()
{
  ui->pbUpdate->setEnabled(true);
}

void DialogSettings::onRadioLeftPreviewToggled(bool on)
{
  if (on) {
    Settings::setPreviewPosition(MainWindow::PreviewPosition::Left);
  } else {
    Settings::setPreviewPosition(MainWindow::PreviewPosition::Right);
  }
}

void DialogSettings::onUpdateClicked()
{
  auto mainWindow = dynamic_cast<MainWindow *>(parent());
  if (mainWindow) {
    ui->pbUpdate->setEnabled(false);
    mainWindow->updateFiltersFromSources(0, true);
  }
}

void DialogSettings::onDarkThemeToggled(bool on)
{
  QSettings().setValue(DARK_THEME_KEY, on);
}

void DialogSettings::onUpdatePeriodicityChanged(int)
{
  Settings::setUpdatePeriodicity(ui->cbUpdatePeriodicity->currentData().toInt());
}

void DialogSettings::onColorDialogsToggled(bool on)
{
  Settings::setNativeColorDialogs(on);
}

void DialogSettings::onFileDialogsToggled(bool on)
{
  Settings::setNativeFileDialogs(on);
}

} // namespace GmicQt


================================================
FILE: src/DialogSettings.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file DialogSettings.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_DIALOGSETTINGS_H
#define GMIC_QT_DIALOGSETTINGS_H

#include <QDialog>
class QCloseEvent;
class QSettings;

namespace Ui
{
class DialogSettings;
}

namespace GmicQt
{

class DialogSettings : public QDialog {
  Q_OBJECT

public:
  explicit DialogSettings(QWidget * parent);
  ~DialogSettings() override;
  void sourcesStatus(bool & modified, bool & internetUpdateRequired);

public slots:
  void onRadioLeftPreviewToggled(bool);
  void onDarkThemeToggled(bool on);
  void onUpdateClicked();
  void onOk();
  void enableUpdateButton();
  void onUpdatePeriodicityChanged(int i);
  void onColorDialogsToggled(bool);
  void onFileDialogsToggled(bool);
  void done(int r) override;
  void onVisibleLogosToggled(bool);
  void onPreviewTimeoutChange(int);
  void onOutputMessageModeChanged(int);
  void onPreviewZoomToggled(bool);
  void onNotifyStartupUpdateFailedToggle(bool);
  void onHighDPIToggled(bool);

private:
  Ui::DialogSettings * ui;
};

} // namespace GmicQt

#endif // GMIC_QT_DIALOGSETTINGS_H


================================================
FILE: src/FilterGuiDynamismCache.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file FilterGuiDynamismCache.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterGuiDynamismCache.h"
#include <QBuffer>
#include <QDataStream>
#include <QDebug>
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <iostream>
#include "Common.h"
#include "Globals.h"
#include "Logger.h"
#include "Utils.h"
#include "gmic.h"

namespace GmicQt
{
QHash<QString, int> FilterGuiDynamismCache::_dynamismCache;

void FilterGuiDynamismCache::load()
{
  _dynamismCache.clear();
  QString jsonFilename = QString("%1%2").arg(gmicConfigPath(true), FILTER_GUI_DYNAMISM_CACHE_FILENAME);
  QFile jsonFile(jsonFilename);
  if (!jsonFile.exists()) {
    return;
  }
  if (jsonFile.open(QFile::ReadOnly)) {
    QJsonDocument jsonDoc;
    QByteArray allFile = jsonFile.readAll();
    if (allFile.startsWith("{")) { // Was created in debug mode
      jsonDoc = QJsonDocument::fromJson(allFile);
    } else {
      jsonDoc = QJsonDocument::fromJson(qUncompress(allFile));
    }
    if (jsonDoc.isNull()) {
      Logger::warning(QString("Cannot parse ") + jsonFilename);
      Logger::warning("Last filters parameters are lost!");
    } else {
      if (!jsonDoc.isObject()) {
        Logger::error(QString("JSON file format is not correct (") + jsonFilename + ")");
      } else {
        QJsonObject documentObject = jsonDoc.object();
        QJsonObject::iterator itFilter = documentObject.begin();
        while (itFilter != documentObject.end()) {
          QString hash = itFilter.key();
          QString status = itFilter.value().toString();
          if (status == "Static") {
            _dynamismCache.insert(hash, FilterGuiDynamism::Static);
          } else if (status == "Dynamic") {
            _dynamismCache.insert(hash, FilterGuiDynamism::Dynamic);
          }
          ++itFilter;
        }
      }
    }
  } else {
    Logger::error("Cannot open " + jsonFilename);
    Logger::error("Parameters cannot be restored");
  }
}

void FilterGuiDynamismCache::save()
{
  // JSON Document format
  //
  // {
  //  "51d288e6f1c6e531cc61289f17e34d8a": {
  //      "parameters": [
  //          "6",
  //          "21.06",
  //          "1.36",
  //          "5",
  //          "0"
  //      ],
  //      "in_out_state": {
  //          "InputLayers": 1,
  //          "OutputMessages": 5,
  //          "OutputMode": 100,
  //          "PreviewMode": 100
  //      }
  //      "visibility_states": [
  //             0,
  //             1,
  //             2,
  //             0
  //      ]
  //  }
  // }

  QJsonObject documentObject;
  QHash<QString, int>::iterator it = _dynamismCache.begin();
  while (it != _dynamismCache.end()) {
    if (it.value() == FilterGuiDynamism::Unknown) {
      ++it;
      continue;
    }
    QJsonValue status((it.value() == FilterGuiDynamism::Static) ? "Static" : "Dynamic");
    documentObject.insert(it.key(), status);
    ++it;
  }

  QJsonDocument jsonDoc(documentObject);
  QString jsonFilename = QString("%1%2").arg(gmicConfigPath(true), FILTER_GUI_DYNAMISM_CACHE_FILENAME);
#ifdef _GMIC_QT_DEBUG_
  QByteArray array(jsonDoc.toJson());
#else
  QByteArray array(qCompress(jsonDoc.toJson(QJsonDocument::Compact)));
#endif
  if (!safelyWrite(array, jsonFilename)) {
    Logger::error("Cannot write " + jsonFilename);
    Logger::error("Parameters cannot be saved");
  }
}

void FilterGuiDynamismCache::setValue(const QString & hash, FilterGuiDynamism dynamism)
{
  _dynamismCache.insert(hash, int(dynamism));
}

FilterGuiDynamism FilterGuiDynamismCache::getValue(const QString & hash)
{
  auto it = _dynamismCache.find(hash);
  if (it != _dynamismCache.end()) {
    return FilterGuiDynamism(it.value());
  }
  return FilterGuiDynamism::Unknown;
}

void FilterGuiDynamismCache::remove(const QString & hash)
{
  _dynamismCache.remove(hash);
}

void FilterGuiDynamismCache::clear()
{
  _dynamismCache.clear();
}

} // namespace GmicQt


================================================
FILE: src/FilterGuiDynamismCache.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file FilterGuiDynamismCache.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_FILTERGUIDYNAMISMCACHE_H
#define GMIC_QT_FILTERGUIDYNAMISMCACHE_H

#include <QHash>
#include <QString>

namespace GmicQt
{

enum FilterGuiDynamism
{
  Unknown = 0,
  Static = 1,
  Dynamic = 2
};

class FilterGuiDynamismCache {
public:
  static void load();
  static void save();
  static void setValue(const QString & hash, FilterGuiDynamism dynamism);
  static FilterGuiDynamism getValue(const QString & hash);
  static void remove(const QString & hash);
  static void clear();

private:
  static QHash<QString, int> _dynamismCache;
};

} // namespace GmicQt

#endif // GMIC_QT_FILTERGUIDYNAMISMCACHE_H


================================================
FILE: src/FilterParameters/AbstractParameter.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file AbstractParameter.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/AbstractParameter.h"
#include <QDebug>
#include <QGridLayout>
#include <QLabel>
#include <QRegularExpression>
#include <cstring>
#include "Common.h"
#include "FilterParameters/BoolParameter.h"
#include "FilterParameters/ButtonParameter.h"
#include "FilterParameters/ChoiceParameter.h"
#include "FilterParameters/ColorParameter.h"
#include "FilterParameters/ConstParameter.h"
#include "FilterParameters/FileParameter.h"
#include "FilterParameters/FloatParameter.h"
#include "FilterParameters/FolderParameter.h"
#include "FilterParameters/IntParameter.h"
#include "FilterParameters/LinkParameter.h"
#include "FilterParameters/NoteParameter.h"
#include "FilterParameters/PointParameter.h"
#include "FilterParameters/SeparatorParameter.h"
#include "FilterParameters/TextParameter.h"
#include "Logger.h"

namespace GmicQt
{

const QStringList AbstractParameter::NoValueParameters = {"link", "note", "separator"};

AbstractParameter::AbstractParameter(QObject * parent) : QObject(parent)
{
  _update = true;
  _visibilityState = _defaultVisibilityState = VisibilityState::Visible;
  _visibilityPropagation = VisibilityPropagation::NoPropagation;
  _row = -1;
  _grid = nullptr;
  _acceptRandom = false;
}

AbstractParameter::~AbstractParameter() {}

bool AbstractParameter::isActualParameter() const
{
  return size() > 0;
}

bool AbstractParameter::isQuoted() const
{
  return false;
}

void AbstractParameter::clear()
{
  // Used to clear the value of a ButtonParameter
}

void AbstractParameter::randomize()
{
  // By default, no effect
}

void AbstractParameter::addToKeypointList(KeypointList &) const {}

void AbstractParameter::extractPositionFromKeypointList(KeypointList &) {}

AbstractParameter * AbstractParameter::createFromText(const QString & filterName, const char * text, int & length, QString & error, QObject * parent)
{
  AbstractParameter * result = nullptr;
  QString line = text;
  error.clear();

#define IS_OF_TYPE(ptype) QRegularExpression("^[^=]*\\s*=\\s*[_~]{0,2}" ptype, QRegularExpression::CaseInsensitiveOption).match(line).hasMatch()

  if (IS_OF_TYPE("int")) {
    result = new IntParameter(parent);
  } else if (IS_OF_TYPE("float")) {
    result = new FloatParameter(parent);
  } else if (IS_OF_TYPE("bool")) {
    result = new BoolParameter(parent);
  } else if (IS_OF_TYPE("choice")) {
    result = new ChoiceParameter(parent);
  } else if (IS_OF_TYPE("color")) {
    result = new ColorParameter(parent);
  } else if (IS_OF_TYPE("separator")) {
    result = new SeparatorParameter(parent);
  } else if (IS_OF_TYPE("note")) {
    result = new NoteParameter(parent);
  } else if (IS_OF_TYPE("file") || IS_OF_TYPE("filein") || IS_OF_TYPE("fileout")) {
    result = new FileParameter(parent);
  } else if (IS_OF_TYPE("folder")) {
    result = new FolderParameter(parent);
  } else if (IS_OF_TYPE("text")) {
    result = new TextParameter(parent);
  } else if (IS_OF_TYPE("link")) {
    result = new LinkParameter(parent);
  } else if (IS_OF_TYPE("value")) {
    result = new ConstParameter(parent);
  } else if (IS_OF_TYPE("button")) {
    result = new ButtonParameter(parent);
  } else if (IS_OF_TYPE("point")) {
    result = new PointParameter(parent);
  }
  if (result) {
    if (!result->initFromText(filterName, text, length)) {
      delete result;
      result = nullptr;
      if (!line.isEmpty()) {
        QRegularExpression nameRegExp("^([^=]*\\s*)=");
        QRegularExpressionMatch match = nameRegExp.match(line);
        if (match.hasMatch()) {
          QString name = match.captured(1);
          error = "Parameter name: " + name + "\n" + error;
        }
      }
    }
  } else {
    if (!line.isEmpty()) {
      QRegularExpression nameRegExp("^([^=]*\\s*)=");
      QRegularExpressionMatch match = nameRegExp.match(line);
      if (match.hasMatch()) {
        QString name = match.captured(1);
        QRegularExpression typeRegExp(R"_(^[^=]*\s*=\s*[_~]{0,2}([^\( ]*)\s*\()_");
        match = typeRegExp.match(line);
        if (match.hasMatch()) {
          error = "Parameter name: " + name + "\n" + "Type <" + match.captured(1) + "> is not recognized\n" + error;
        } else {
          error = "Parameter name: " + name + "\n" + error;
        }
      }
    }
  }
  return result;
}

AbstractParameter::VisibilityState AbstractParameter::defaultVisibilityState() const
{
  return _defaultVisibilityState;
}

void AbstractParameter::hideWidgets()
{
  if (!_grid || (_row == -1)) {
    return;
  }
  for (int col = 0; col < 5; ++col) {
    QLayoutItem * item = _grid->itemAtPosition(_row, col);
    if (item) {
      auto widget = item->widget();
      widget->hide();
    }
  }
}

void AbstractParameter::setVisibilityState(AbstractParameter::VisibilityState state)
{
  if (state == VisibilityState::Unspecified) {
    setVisibilityState(defaultVisibilityState());
    return;
  }
  _visibilityState = state;
  if (!_grid || (_row == -1)) {
    return;
  }
  for (int col = 0; col < 5; ++col) {
    QLayoutItem * item = _grid->itemAtPosition(_row, col);
    if (item) {
      auto widget = item->widget();
      switch (state) {
      case VisibilityState::Visible:
        widget->setEnabled(true);
        widget->show();
        break;
      case VisibilityState::Disabled:
        widget->setEnabled(false);
        widget->show();
        break;
      case VisibilityState::Hidden:
        widget->hide();
        break;
      case VisibilityState::Unspecified:
        // Taken care above (if)
        break;
      }
    }
  }
}

AbstractParameter::VisibilityState AbstractParameter::visibilityState() const
{
  return _visibilityState;
}

AbstractParameter::VisibilityPropagation AbstractParameter::visibilityPropagation() const
{
  return _visibilityPropagation;
}

bool AbstractParameter::acceptRandom() const
{
  return _acceptRandom;
}

void AbstractParameter::setTextSelectable(QLabel * label)
{
  Qt::TextInteractionFlags flags = label->textInteractionFlags();
  flags.setFlag(Qt::TextSelectableByMouse, true);
  label->setTextInteractionFlags(flags);
}

QStringList AbstractParameter::parseText(const QString & type, const char * text, int & length)
{
  QStringList result;
  const QString str = text;
  result << str.left(str.indexOf("=")).trimmed();
#ifdef _GMIC_QT_DEBUG_
  _debugName = result.back();
#endif

  QRegularExpression re(QString("^[^=]*\\s*=\\s*([_~]{0,2})%1\\s*(.)").arg(type), QRegularExpression::CaseInsensitiveOption);
  QRegularExpressionMatch match = re.match(str);
  const int prefixLength = match.captured(0).toUtf8().size();

  _update = !match.captured(1).contains("_");
  _acceptRandom = match.captured(1).contains("~");

  QString open = match.captured(2);
  const char * end = nullptr;
  const char * closing = (open == "(") ? ")" : (open == "{") ? "}" : (open == "[") ? "]" : nullptr;
  if (!closing) {
    Logger::error(QString("Parse error in %1 parameter (invalid opening character '%2').").arg(type).arg(open));
    length = 1 + prefixLength;
    return QStringList();
  }
  end = strstr(text + prefixLength, closing);
  if (!end) {
    Logger::error(QString("Parse error in %1 parameter (cannot find closing '%2').").arg(type).arg(closing));
    length = 1 + prefixLength;
    return QStringList();
  }

  // QString values = str.mid(prefixLength, -1).left(end - (text + prefixLength)).trimmed();
  QString values = QString::fromUtf8(text + prefixLength, int(end - (text + prefixLength))).trimmed();
  length = int(1 + end - text);

  if (text[length] == '_' && text[length + 1] >= '0' && text[length + 1] <= '2') {
    _defaultVisibilityState = static_cast<VisibilityState>(text[length + 1] - '0');
    _visibilityPropagation = VisibilityPropagation::NoPropagation;
    switch (text[length + 2]) {
    case '-':
      _visibilityPropagation = VisibilityPropagation::Up;
      length += 3;
      break;
    case '+':
      _visibilityPropagation = VisibilityPropagation::Down;
      length += 3;
      break;
    case '*':
      _visibilityPropagation = VisibilityPropagation::Down;
      length += 3;
      break;
    default:
      length += 2;
      break;
    }
    if (NoValueParameters.contains(type)) {
      Logger::warning(QString("Warning: %1 parameter should not define visibility. Ignored.").arg(result.first()));
      _defaultVisibilityState = AbstractParameter::VisibilityState::Visible;
      _visibilityPropagation = VisibilityPropagation::NoPropagation;
    }
  }
  while (text[length] && (text[length] == ',' || QChar(text[length]).isSpace())) {
    ++length;
  }
  result << values;
  return result;
}

bool AbstractParameter::matchType(const QString & type, const char * text) const
{
  return QString::fromUtf8(text).contains(QRegularExpression(QString("^[^=]*\\s*=\\s*_?%1\\s*.").arg(type), QRegularExpression::CaseInsensitiveOption));
}

void AbstractParameter::notifyIfRelevant()
{
  if (_update) {
    emit valueChanged();
  }
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/AbstractParameter.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file AbstractParameter.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_ABSTRACTPARAMETER_H
#define GMIC_QT_ABSTRACTPARAMETER_H

#include <QObject>
#include <QStringList>
class QGridLayout;
class QLabel;

namespace GmicQt
{
class KeypointList;

class AbstractParameter : public QObject {
  Q_OBJECT

public:
  AbstractParameter(QObject * parent);
  virtual ~AbstractParameter() override;
  bool isActualParameter() const;
  virtual int size() const = 0;
  virtual bool addTo(QWidget *, int row) = 0;
  virtual QString value() const = 0;
  virtual QString defaultValue() const = 0;
  virtual bool isQuoted() const;
  virtual void setValue(const QString & value) = 0;
  virtual void clear();
  virtual void reset() = 0;
  virtual void randomize();

  virtual void addToKeypointList(KeypointList &) const;
  virtual void extractPositionFromKeypointList(KeypointList &);

  static AbstractParameter * createFromText(const QString & filterName, const char * text, int & length, QString & error, QObject * parent);
  virtual bool initFromText(const QString & filterName, const char * text, int & textLength) = 0;

  enum class VisibilityState
  {
    Unspecified = -1,
    Hidden = 0,
    Disabled = 1,
    Visible = 2,
  };
  enum class VisibilityPropagation
  {
    NoPropagation = 0,
    Up = 1,
    Down = 2,
    UpDown = 3
  };

  static const QStringList NoValueParameters;

  void hideWidgets();
  virtual VisibilityState defaultVisibilityState() const;
  virtual void setVisibilityState(VisibilityState state);
  VisibilityState visibilityState() const;
  VisibilityPropagation visibilityPropagation() const;
  bool acceptRandom() const;

signals:
  void valueChanged();

protected:
  static void setTextSelectable(QLabel * label);
  QStringList parseText(const QString & type, const char * text, int & length);
  bool matchType(const QString & type, const char * text) const;
  void notifyIfRelevant();
  VisibilityState _defaultVisibilityState;
  QGridLayout * _grid;
  int _row;
#ifdef _GMIC_QT_DEBUG_
  QString _debugName;
#endif

private:
  bool _update;
  bool _acceptRandom;
  VisibilityState _visibilityState;
  VisibilityPropagation _visibilityPropagation;
};

} // namespace GmicQt

#endif // GMIC_QT_ABSTRACTPARAMETER_H


================================================
FILE: src/FilterParameters/BoolParameter.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file BoolParameter.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/BoolParameter.h"
#include <QCheckBox>
#include <QDebug>
#include <QGridLayout>
#include <QLabel>
#include <QPalette>
#include <QRandomGenerator>
#include <QWidget>
#include "Common.h"
#include "FilterTextTranslator.h"
#include "HtmlTranslator.h"
#include "Settings.h"

namespace GmicQt
{

BoolParameter::BoolParameter(QObject * parent) //
    : AbstractParameter(parent), _default(false), _value(false), _checkBox(nullptr), _label(nullptr), _connected(false)
{
}

BoolParameter::~BoolParameter()
{
  delete _checkBox;
  delete _label;
}

int BoolParameter::size() const
{
  return 1;
}

bool BoolParameter::addTo(QWidget * widget, int row)
{
  _grid = dynamic_cast<QGridLayout *>(widget->layout());
  Q_ASSERT_X(_grid, __PRETTY_FUNCTION__, "No grid layout in widget");
  _row = row;
  delete _checkBox;
  delete _label;
  _checkBox = new QCheckBox(widget);
  _checkBox->setChecked(_value);
  _label = new QLabel(_name, widget);
  if (Settings::darkThemeEnabled()) {
    QPalette p = _checkBox->palette();
    p.setColor(QPalette::Text, Settings::CheckBoxTextColor);
    p.setColor(QPalette::Base, Settings::CheckBoxBaseColor);
    _checkBox->setPalette(p);
  }
  _grid->addWidget(_label, row, 0, 1, 1);
  _grid->addWidget(_checkBox, row, 1, 1, 2);
  connectCheckBox();
  return true;
}

QString BoolParameter::value() const
{
  return _value ? QString("1") : QString("0");
}

QString BoolParameter::defaultValue() const
{
  return _default ? QString("1") : QString("0");
}

void BoolParameter::setValue(const QString & value)
{
  _value = (value == "1");
  if (_checkBox) {
    disconnectCheckBox();
    _checkBox->setChecked(_value);
    connectCheckBox();
  }
}

void BoolParameter::reset()
{
  _checkBox->setChecked(_default);
  _value = _default;
}

void BoolParameter::randomize()
{
  if (acceptRandom()) {
    _value = QRandomGenerator::global()->bounded(0, 2);
    disconnectCheckBox();
    _checkBox->setChecked(_value);
    connectCheckBox();
  }
}

void BoolParameter::onCheckBoxChanged(bool on)
{
  _value = on;
  notifyIfRelevant();
}

void BoolParameter::connectCheckBox()
{
  if (_connected) {
    return;
  }
  connect(_checkBox, &QCheckBox::toggled, this, &BoolParameter::onCheckBoxChanged);
  _connected = true;
}

void BoolParameter::disconnectCheckBox()
{
  if (!_connected) {
    return;
  }
  _checkBox->disconnect(this);
  _connected = false;
}

bool BoolParameter::initFromText(const QString & filterName, const char * text, int & textLength)
{
  QList<QString> list = parseText("bool", text, textLength);
  if (list.isEmpty()) {
    return false;
  }
  _name = HtmlTranslator::html2txt(FilterTextTranslator::translate(list[0], filterName));
  _value = _default = (list[1].startsWith("true") || list[1].startsWith("1"));
  return true;
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/BoolParameter.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file BoolParameter.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_BOOLPARAMETER_H
#define GMIC_QT_BOOLPARAMETER_H

#include <QString>
#include "AbstractParameter.h"
class QCheckBox;
class QLabel;

namespace GmicQt
{

class BoolParameter : public AbstractParameter {
  Q_OBJECT
public:
  BoolParameter(QObject * parent);
  ~BoolParameter() override;
  virtual int size() const override;
  bool addTo(QWidget *, int row) override;
  QString value() const override;
  QString defaultValue() const override;
  void setValue(const QString & value) override;
  void reset() override;
  void randomize() override;
  bool initFromText(const QString & filterName, const char * text, int & textLength) override;
public slots:
  void onCheckBoxChanged(bool);

private:
  void connectCheckBox();
  void disconnectCheckBox();
  QString _name;
  bool _default;
  bool _value;
  QCheckBox * _checkBox;
  QLabel * _label;
  bool _connected;
};

} // namespace GmicQt

#endif // GMIC_QT_BOOLPARAMETER_H


================================================
FILE: src/FilterParameters/ButtonParameter.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ButtonParameter.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/ButtonParameter.h"
#include <QDebug>
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <QRandomGenerator>
#include <QWidget>
#include "FilterTextTranslator.h"
#include "HtmlTranslator.h"

namespace GmicQt
{

ButtonParameter::ButtonParameter(QObject * parent) : AbstractParameter(parent), _value(false), _pushButton(nullptr), _alignment(Qt::AlignHCenter) {}

ButtonParameter::~ButtonParameter()
{
  delete _pushButton;
}

int ButtonParameter::size() const
{
  return 1;
}

bool ButtonParameter::addTo(QWidget * widget, int row)
{
  _grid = dynamic_cast<QGridLayout *>(widget->layout());
  Q_ASSERT_X(_grid, __PRETTY_FUNCTION__, "No grid layout in widget");
  _row = row;
  delete _pushButton;
  _pushButton = new QPushButton(_text, widget);
  _pushButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
  _grid->addWidget(_pushButton, row, 0, 1, 3, _alignment);
  connectButton();
  return true;
}

QString ButtonParameter::value() const
{
  return _value ? QString("1") : QString("0");
}

QString ButtonParameter::defaultValue() const
{
  return QString("0");
}

void ButtonParameter::setValue(const QString & s)
{
  _value = (s == "1");
}

void ButtonParameter::clear()
{
  _value = false;
}

void ButtonParameter::reset() {}

void ButtonParameter::randomize()
{
  if (acceptRandom()) {
    _value = QRandomGenerator::global()->bounded(0, 2);
  }
}

void ButtonParameter::onPushButtonClicked(bool /* checked */)
{
  _value = true;
  notifyIfRelevant();
}

void ButtonParameter::connectButton()
{
  connect(_pushButton, &QPushButton::clicked, this, &ButtonParameter::onPushButtonClicked);
}

void ButtonParameter::disconnectButton()
{
  _pushButton->disconnect(this);
}

bool ButtonParameter::initFromText(const QString & filterName, const char * text, int & textLength)
{
  QList<QString> list = parseText("button", text, textLength);
  if (list.isEmpty()) {
    return false;
  }
  _text = HtmlTranslator::html2txt(FilterTextTranslator::translate(list[0], filterName));
  QString & alignment = list[1];
  if (alignment.isEmpty()) {
    return true;
  }
  float a = alignment.toFloat();
  if (a == 0.0f) {
    _alignment = Qt::AlignLeft;
  } else if (a == 1.0f) {
    _alignment = Qt::AlignRight;
  } else {
    _alignment = Qt::AlignCenter;
  }
  return true;
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/ButtonParameter.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ButtonParameter.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_BUTTONPARAMETER_H
#define GMIC_QT_BUTTONPARAMETER_H

#include <QString>
#include <Qt>
#include "AbstractParameter.h"
class QWidget;
class QPushButton;
class QLabel;

namespace GmicQt
{

class ButtonParameter : public AbstractParameter {
  Q_OBJECT
public:
  ButtonParameter(QObject * parent);
  ~ButtonParameter() override;
  virtual int size() const override;
  bool addTo(QWidget *, int row) override;
  QString value() const override;
  QString defaultValue() const override;
  void setValue(const QString &) override;
  void clear() override;
  void reset() override;
  void randomize() override;
  bool initFromText(const QString & filterName, const char * text, int & textLength) override;
public slots:
  void onPushButtonClicked(bool);

private:
  void connectButton();
  void disconnectButton();
  bool _value;
  QString _text;
  QPushButton * _pushButton;
  Qt::AlignmentFlag _alignment;
};

} // namespace GmicQt

#endif // GMIC_QT_BUTTONPARAMETER_H


================================================
FILE: src/FilterParameters/ChoiceParameter.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ChoiceParameter.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/ChoiceParameter.h"
#include <QComboBox>
#include <QGridLayout>
#include <QLabel>
#include <QRandomGenerator>
#include <QRegularExpression>
#include <QStringList>
#include <QWidget>
#include "Common.h"
#include "FilterTextTranslator.h"
#include "HtmlTranslator.h"
#include "Logger.h"

namespace GmicQt
{
ChoiceParameter::ChoiceParameter(QObject * parent) : AbstractParameter(parent), _default(0), _value(0), _label(nullptr), _comboBox(nullptr), _connected(false) {}

ChoiceParameter::~ChoiceParameter()
{
  delete _comboBox;
  delete _label;
}

int ChoiceParameter::size() const
{
  return 1;
}

bool ChoiceParameter::addTo(QWidget * widget, int row)
{
  _grid = dynamic_cast<QGridLayout *>(widget->layout());
  Q_ASSERT_X(_grid, __PRETTY_FUNCTION__, "No grid layout in widget");
  _row = row;
  delete _comboBox;
  delete _label;

  _comboBox = new QComboBox(widget);
  _comboBox->addItems(_choices);
  _comboBox->setCurrentIndex(_value);

  _grid->addWidget(_label = new QLabel(_name, widget), row, 0, 1, 1);
  setTextSelectable(_label);
  _grid->addWidget(_comboBox, row, 1, 1, 2);
  connectComboBox();
  return true;
}

QString ChoiceParameter::value() const
{
  return QString("%1").arg(_comboBox->currentIndex());
}

QString ChoiceParameter::defaultValue() const
{
  return QString("%1").arg(_default);
}

void ChoiceParameter::setValue(const QString & value)
{
  bool ok = true;
  const int k = value.toInt(&ok);
  if (!ok || (k < 0)) {
    return;
  }
  if (_comboBox && (k >= _comboBox->count())) {
    return;
  }
  _value = k;
  if (_comboBox) {
    disconnectComboBox();
    _comboBox->setCurrentIndex(_value);
    connectComboBox();
  }
}

void ChoiceParameter::reset()
{
  disconnectComboBox();
  _comboBox->setCurrentIndex(_default);
  _value = _default;
  connectComboBox();
}

void ChoiceParameter::randomize()
{
  if (acceptRandom()) {
    disconnectComboBox();
    _value = QRandomGenerator::global()->bounded(0, _comboBox->count());
    _comboBox->setCurrentIndex(_value);
    connectComboBox();
  }
}

bool ChoiceParameter::initFromText(const QString & filterName, const char * text, int & textLength)
{
  QStringList list = parseText("choice", text, textLength);
  if (list.isEmpty()) {
    return false;
  }
  _name = HtmlTranslator::html2txt(FilterTextTranslator::translate(list[0], filterName));
  _choices = list[1].split(QChar(','));
  bool ok;
  if (_choices.isEmpty()) {
    return false;
  }
  _default = _choices[0].toInt(&ok);
  if (!ok) {
    _default = 0;
  } else {
    _choices.pop_front();
  }
  QList<QString>::iterator it = _choices.begin();
  while (it != _choices.end()) {
    *it = it->trimmed().remove(QRegularExpression("^\"")).remove(QRegularExpression("\"$"));
    *it = HtmlTranslator::html2txt(FilterTextTranslator::translate(*it, filterName));
    ++it;
  }
  _value = _default;
  return true;
}

void ChoiceParameter::onComboBoxIndexChanged(int i)
{
  _value = i;
  notifyIfRelevant();
}

void ChoiceParameter::connectComboBox()
{
  if (_connected) {
    return;
  }
  connect(_comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ChoiceParameter::onComboBoxIndexChanged);
  _connected = true;
}

void ChoiceParameter::disconnectComboBox()
{
  if (!_connected) {
    return;
  }
  _comboBox->disconnect(this);
  _connected = false;
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/ChoiceParameter.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ChoiceParameter.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_CHOICEPARAMETER_H
#define GMIC_QT_CHOICEPARAMETER_H

#include <QList>
#include <QString>
#include "AbstractParameter.h"
class QComboBox;
class QLabel;

namespace GmicQt
{

class ChoiceParameter : public AbstractParameter {
  Q_OBJECT
public:
  ChoiceParameter(QObject * parent);
  ~ChoiceParameter() override;
  virtual int size() const override;
  bool addTo(QWidget *, int row) override;
  QString value() const override;
  QString defaultValue() const override;
  void setValue(const QString &) override;
  void reset() override;
  void randomize() override;
  bool initFromText(const QString & filterName, const char * text, int & textLength) override;
public slots:
  void onComboBoxIndexChanged(int);

private:
  void connectComboBox();
  void disconnectComboBox();
  QString _name;
  int _default;
  int _value;
  QLabel * _label;
  QComboBox * _comboBox;
  QList<QString> _choices;
  bool _connected;
};

} // namespace GmicQt

#endif // GMIC_QT_CHOICEPARAMETER_H


================================================
FILE: src/FilterParameters/ColorParameter.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ColorParameter.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/ColorParameter.h"
#include <QApplication>
#include <QColorDialog>
#include <QDebug>
#include <QFont>
#include <QFontMetrics>
#include <QGridLayout>
#include <QLabel>
#include <QPainter>
#include <QPushButton>
#include <QRandomGenerator>
#include <QRegularExpression>
#include <QWidget>
#include <cstdio>
#include "FilterTextTranslator.h"
#include "HtmlTranslator.h"
#include "Logger.h"
#include "Settings.h"

namespace GmicQt
{

ColorParameter::ColorParameter(QObject * parent) //
    : AbstractParameter(parent),                 //
      _default(0, 0, 0, 0),                      //
      _value(_default),                          //
      _alphaChannel(false),                      //
      _label(nullptr),                           //
      _button(nullptr),                          //
      _dialog(nullptr),                          //
      _size(-1)
{
}

ColorParameter::~ColorParameter()
{
  delete _button;
  delete _label;
  delete _dialog;
}

int ColorParameter::size() const
{
  return _size;
}

bool ColorParameter::addTo(QWidget * widget, int row)
{
  _grid = dynamic_cast<QGridLayout *>(widget->layout());
  Q_ASSERT_X(_grid, __PRETTY_FUNCTION__, "No grid layout in widget");
  _row = row;
  delete _button;
  delete _label;

  _button = new QPushButton(widget);
  _button->setText("");

  QFontMetrics fm(widget->font());
  QRect r = fm.boundingRect("CLR");
  _pixmap = QPixmap(r.width(), r.height());
  _button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);

  _button->setIconSize(_pixmap.size());

  updateButtonColor();

  _grid->addWidget(_label = new QLabel(_name, widget), row, 0, 1, 1);
  setTextSelectable(_label);
  _grid->addWidget(_button, row, 1, 1, 1);
  connect(_button, &QPushButton::clicked, this, &ColorParameter::onButtonPressed);
  return true;
}

QString ColorParameter::value() const
{
  const QColor & c = _value;
  if (_alphaChannel) {
    return QString("%1,%2,%3,%4").arg(c.red()).arg(c.green()).arg(c.blue()).arg(c.alpha());
  }
  return QString("%1,%2,%3").arg(c.red()).arg(c.green()).arg(c.blue());
}

QString ColorParameter::defaultValue() const
{
  const QColor & c = _default;
  if (_alphaChannel) {
    return QString("%1,%2,%3,%4").arg(c.red()).arg(c.green()).arg(c.blue()).arg(c.alpha());
  }
  return QString("%1,%2,%3").arg(c.red()).arg(c.green()).arg(c.blue());
}

void ColorParameter::setValue(const QString & value)
{
  QStringList list = value.split(",");
  if ((list.size() != 3) && (list.size() != 4)) {
    return;
  }
  bool ok = false;
  const int red = list[0].toInt(&ok);
  if (!ok) {
    Logger::warning(QString("ColorParameter::setValue(\"%1\"): bad red channel").arg(value));
  }
  const int green = list[1].toInt(&ok);
  if (!ok) {
    Logger::warning(QString("ColorParameter::setValue(\"%1\"): bad green channel").arg(value));
  }
  const int blue = list[2].toInt(&ok);
  if (!ok) {
    Logger::warning(QString("ColorParameter::setValue(\"%1\"): bad blue channel").arg(value));
  }
  if ((list.size() == 4) && _alphaChannel) {
    const int alpha = list[3].toInt(&ok);
    if (!ok) {
      Logger::warning(QString("ColorParameter::setValue(\"%1\"): bad alpha channel").arg(value));
    }
    _value = QColor(red, green, blue, alpha);
  } else {
    _value = QColor(red, green, blue);
  }
  if (_button) {
    updateButtonColor();
  }
}

void ColorParameter::reset()
{
  _value = _default;
  updateButtonColor();
}

void ColorParameter::randomize()
{
  if (acceptRandom()) {
    auto generator = QRandomGenerator::global();
    _value.setRgb(generator->bounded(0, 256), //
                  generator->bounded(0, 256), //
                  generator->bounded(0, 256), //
                  _alphaChannel ? generator->bounded(164, 256) : 255);
    updateButtonColor();
  }
}

bool ColorParameter::initFromText(const QString & filterName, const char * text, int & textLength)
{
  QList<QString> list = parseText("color", text, textLength);
  if (list.isEmpty()) {
    return false;
  }
  _name = HtmlTranslator::html2txt(FilterTextTranslator::translate(list[0], filterName));

  // color(#e9cc00) and color(#e9cc00ff)
  const QString trimmed = list[1].trimmed();
  if (QRegularExpression("^#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$").match(trimmed).hasMatch()) {
    _default = QColor(trimmed.left(7));
    if (trimmed.length() == 9) {
      _alphaChannel = true;
      _default.setAlpha(trimmed.right(2).toInt(nullptr, 16));
    } else {
      _alphaChannel = false;
    }
    _size = 3 + _alphaChannel;
    _value = _default;
    return true;
  }

  // color(120,100,10) and color(120,100,10,128)
  QList<QString> channels = list[1].split(",");
  const int n = channels.size();
  bool okR = true, okG = true, okB = true, okA = true;
  int r = (n > 0) ? channels[0].toInt(&okR) : 0;
  int g = (n >= 2) ? channels[1].toInt(&okG) : r;
  int b = (n >= 3) ? channels[2].toInt(&okB) : (n == 1) ? r : 0;
  if (channels.size() == 4) {
    int a = channels[3].toInt(&okA);
    _default = _value = QColor(r, g, b, a);
    _alphaChannel = true;
  } else {
    _default = _value = QColor(r, g, b);
  }
  if (okR && okG && okB && okA) {
    _size = channels.size();
    return true;
  }
  return false;
}

void ColorParameter::onButtonPressed()
{
  QColor color = QColorDialog::getColor(_value, QApplication::activeWindow(), tr("Select color"),
                                        (Settings::nativeColorDialogs() ? QColorDialog::ColorDialogOptions() : QColorDialog::DontUseNativeDialog) |
                                            (_alphaChannel ? QColorDialog::ShowAlphaChannel : QColorDialog::ColorDialogOptions()));
  if (color.isValid()) {
    _value = color;
    updateButtonColor();
    notifyIfRelevant();
  }
}

void ColorParameter::updateButtonColor()
{
  QPainter painter(&_pixmap);
  QColor color(_value);
  if (_alphaChannel) {
    painter.drawImage(0, 0, QImage(":resources/transparency.png"));
  }
  painter.setBrush(color);
  painter.setPen(Qt::black);
  painter.drawRect(0, 0, _pixmap.width() - 1, _pixmap.height() - 1);
  _button->setIcon(_pixmap);
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/ColorParameter.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ColorParameter.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_COLORPARAMETER_H
#define GMIC_QT_COLORPARAMETER_H

#include <QColor>
#include <QColorDialog>
#include <QPixmap>
#include <QString>
#include "AbstractParameter.h"
class QSpinBox;
class QSlider;
class QLabel;
class QPushButton;

namespace GmicQt
{

class ColorParameter : public AbstractParameter {
  Q_OBJECT
public:
  ColorParameter(QObject * parent);
  ~ColorParameter() override;
  int size() const override;
  bool addTo(QWidget *, int row) override;
  QString value() const override;
  QString defaultValue() const override;
  void setValue(const QString & value) override;
  void reset() override;
  void randomize() override;
  bool initFromText(const QString & filterName, const char * text, int & textLength) override;
public slots:
  void onButtonPressed();

private:
  void updateButtonColor();
  QString _name;
  QColor _default;
  QColor _value;
  bool _alphaChannel;
  QLabel * _label;
  QPushButton * _button;
  QPixmap _pixmap;
  QColorDialog * _dialog;
  int _size;
};

} // namespace GmicQt

#endif // GMIC_QT_COLORPARAMETER_H


================================================
FILE: src/FilterParameters/ConstParameter.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ConstParameter.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/ConstParameter.h"
#include <QString>
#include <QStringList>
#include "Common.h"
#include "FilterTextTranslator.h"
#include "HtmlTranslator.h"
#include "Misc.h"

namespace GmicQt
{

ConstParameter::ConstParameter(QObject * parent) : AbstractParameter(parent) {}

int ConstParameter::size() const
{
  return 1;
}

ConstParameter::~ConstParameter() = default;

bool ConstParameter::addTo(QWidget *, int)
{
  return false;
}

bool ConstParameter::isQuoted() const
{
  return true;
}

QString ConstParameter::value() const
{
  return _value;
}

QString ConstParameter::defaultValue() const
{
  return _default;
}

void ConstParameter::setValue(const QString & value)
{
  _value = value;
}

void ConstParameter::reset()
{
  _value = _default;
}

bool ConstParameter::initFromText(const QString & filterName, const char * text, int & textLength)
{
  QStringList list = parseText("value", text, textLength);
  if (list.isEmpty()) {
    return false;
  }
  _name = HtmlTranslator::html2txt(FilterTextTranslator::translate(list[0], filterName));
  _value = _default = unescaped(unquoted(list[1]));
  return true;
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/ConstParameter.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file ConstParameter.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_CONSTPARAMETER_H
#define GMIC_QT_CONSTPARAMETER_H

#include "AbstractParameter.h"
class QLabel;

namespace GmicQt
{

class ConstParameter : public AbstractParameter {
  Q_OBJECT
public:
  ConstParameter(QObject * parent);
  ~ConstParameter() override;
  virtual int size() const override;
  bool addTo(QWidget *, int row) override;
  bool isQuoted() const override;
  QString value() const override;
  QString defaultValue() const override;
  void setValue(const QString & value) override;
  void reset() override;
  bool initFromText(const QString & filterName, const char * text, int & textLength) override;

private:
  QString _name;
  QString _default;
  QString _value;
};

} // namespace GmicQt

#endif // GMIC_QT_CONSTPARAMETER_H


================================================
FILE: src/FilterParameters/CustomDoubleSpinBox.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CustomDoubleSpinBox.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/CustomDoubleSpinBox.h"
#include <QFontMetrics>
#include <QKeyEvent>
#include <QLineEdit>
#include <QShowEvent>
#include <QSizePolicy>
#include <QString>
#include <QTimer>
#include <algorithm>
#include <cmath>
#include "Common.h"
#include "Settings.h"

namespace GmicQt
{

CustomDoubleSpinBox::CustomDoubleSpinBox(QWidget * parent, float min, float max) : QDoubleSpinBox(parent)
{
  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  const int decimals = std::max(2, MAX_DIGITS - std::max(integerPartDigitCount(min), integerPartDigitCount(max)));
  setDecimals(decimals);
  setRange(min, max);

  QDoubleSpinBox * dummy = new QDoubleSpinBox(this);
  dummy->hide();
  dummy->setRange(min, max);
  dummy->setDecimals(decimals);
  _sizeHint = dummy->sizeHint();
  _minimumSizeHint = dummy->minimumSizeHint();
  delete dummy;
  connect(this, &QDoubleSpinBox::editingFinished, [this]() { _unfinishedKeyboardEditing = false; });
}

CustomDoubleSpinBox::~CustomDoubleSpinBox() {}

QString CustomDoubleSpinBox::textFromValue(double value) const
{
  QString text = QString::number(value, 'g', MAX_DIGITS);
  if (text.contains('e') || text.contains('E')) {
    text = QString::number(value, 'f', decimals());
    if (text.contains(Settings::DecimalPoint)) {
      while (text.endsWith(QChar('0'))) {
        text.chop(1);
      }
      if (text.endsWith(Settings::DecimalPoint)) {
        text.chop(Settings::DecimalPoint.length());
      }
    }
  }
  return text;
}

QSize CustomDoubleSpinBox::sizeHint() const
{
  return _sizeHint;
}

QSize CustomDoubleSpinBox::minimumSizeHint() const
{
  return _minimumSizeHint;
}

void CustomDoubleSpinBox::keyPressEvent(QKeyEvent * event)
{
  QString text = event->text();
  if ((text.length() == 1 && text[0].isDigit()) || //
      (text == Settings::DecimalPoint) ||          //
      (text == Settings::NegativeSign) ||          //
      (text == Settings::GroupSeparator) ||        //
      (event->key() == Qt::Key_Backspace) ||       //
      (event->key() == Qt::Key_Delete)) {
    _unfinishedKeyboardEditing = true;
  }
  QDoubleSpinBox::keyPressEvent(event);
}

int CustomDoubleSpinBox::integerPartDigitCount(float value)
{
  QString text = QString::number(static_cast<double>(value), 'f', 0);
  if (text[0] == QChar('-')) {
    text.remove(0, 1);
  }
  return text.length();
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/CustomDoubleSpinBox.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CustomDoubleSpinBox.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_CUSTOMDOUBLESPINBOX_H
#define GMIC_QT_CUSTOMDOUBLESPINBOX_H

#include <QDoubleSpinBox>
#include <QSize>
class QShowEvent;
class QResizeEvent;

namespace GmicQt
{

class CustomDoubleSpinBox : public QDoubleSpinBox {
  Q_OBJECT
public:
  CustomDoubleSpinBox(QWidget * parent, float min, float max);
  ~CustomDoubleSpinBox() override;
  QString textFromValue(double value) const override;
  inline bool unfinishedKeyboardEditing() const;

protected:
  QSize sizeHint() const override;
  QSize minimumSizeHint() const override;
  void keyPressEvent(QKeyEvent *) override;
signals:
  void keyboardNumericalInputOngoing();

private:
  QSize _sizeHint;
  QSize _minimumSizeHint;
  bool _unfinishedKeyboardEditing = false;
  static const int MAX_DIGITS = 5;
  static int integerPartDigitCount(float value);
};

bool CustomDoubleSpinBox::unfinishedKeyboardEditing() const
{
  return _unfinishedKeyboardEditing;
}

} // namespace GmicQt

#endif // GMIC_QT_CUSTOMDOUBLESPINBOX_H


================================================
FILE: src/FilterParameters/CustomSpinBox.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CustomSpinBox.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/CustomSpinBox.h"
#include <QFontMetrics>
#include <QKeyEvent>
#include <QLineEdit>
#include <QShowEvent>
#include <QSizePolicy>
#include <QString>
#include <QTimer>
#include <algorithm>
#include <cmath>
#include "Common.h"
#include "Settings.h"

namespace GmicQt
{

CustomSpinBox::CustomSpinBox(QWidget * parent, int min, int max) : QSpinBox(parent)
{
  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  setRange(min, max);

  QSpinBox * dummy = new QSpinBox(this);
  dummy->hide();
  dummy->setRange(min, max);
  _sizeHint = dummy->sizeHint();
  _minimumSizeHint = dummy->minimumSizeHint();
  delete dummy;
  connect(this, &QSpinBox::editingFinished, [this]() { _unfinishedKeyboardEditing = false; });
}

CustomSpinBox::~CustomSpinBox() {}

QString CustomSpinBox::textFromValue(int value) const
{
  return QString::number(value);
}

QSize CustomSpinBox::sizeHint() const
{
  return _sizeHint;
}

QSize CustomSpinBox::minimumSizeHint() const
{
  return _minimumSizeHint;
}

void CustomSpinBox::keyPressEvent(QKeyEvent * event)
{
  QString text = event->text();
  if ((text.length() == 1 && text[0].isDigit()) || //
      (text == Settings::NegativeSign) ||          //
      (text == Settings::GroupSeparator) ||        //
      (event->key() == Qt::Key_Backspace) ||       //
      (event->key() == Qt::Key_Delete)) {
    _unfinishedKeyboardEditing = true;
  }
  QSpinBox::keyPressEvent(event);
}

int CustomSpinBox::integerPartDigitCount(float value)
{
  QString text = QString::number(static_cast<double>(value), 'f', 0);
  if (text[0] == QChar('-')) {
    text.remove(0, 1);
  }
  return text.length();
}

} // namespace GmicQt


================================================
FILE: src/FilterParameters/CustomSpinBox.h
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file CustomSpinBox.h
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef GMIC_QT_CUSTOMSPINBOX_H
#define GMIC_QT_CUSTOMSPINBOX_H

#include <QSize>
#include <QSpinBox>
class QShowEvent;
class QResizeEvent;

namespace GmicQt
{

class CustomSpinBox : public QSpinBox {
  Q_OBJECT
public:
  CustomSpinBox(QWidget * parent, int min, int max);
  ~CustomSpinBox() override;
  QString textFromValue(int value) const override;
  inline bool unfinishedKeyboardEditing() const;

protected:
  QSize sizeHint() const override;
  QSize minimumSizeHint() const override;
  void keyPressEvent(QKeyEvent *) override;
signals:
  void keyboardNumericalInputOngoing();

private:
  QSize _sizeHint;
  QSize _minimumSizeHint;
  bool _unfinishedKeyboardEditing = false;
  static const int MAX_DIGITS = 5;
  static int integerPartDigitCount(float value);
};

bool CustomSpinBox::unfinishedKeyboardEditing() const
{
  return _unfinishedKeyboardEditing;
}

} // namespace GmicQt

#endif // GMIC_QT_CUSTOMSPINBOX_H


================================================
FILE: src/FilterParameters/FileParameter.cpp
================================================
/** -*- mode: c++ ; c-basic-offset: 2 -*-
 *
 *  @file FileParameter.cpp
 *
 *  Copyright 2017 Sebastien Fourey
 *
 *  This file is part of G'MIC-Qt, a generic plug-in for raster graphics
 *  editors, offering hundreds of filters thanks to the underlying G'MIC
 *  image processing framework.
 *
 *  gmic_qt is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  gmic_qt is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gmic_qt.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "FilterParameters/FileParameter.h"
#include <QApplication>
#include <QDebug>
#include <QFileDialog>
#include <QFileInfo>
#include <QFontMetrics>
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <QRegularExpression>
#include <QWidget>
#include "FilterTextTranslator.h"
#include "HtmlTranslator.h"
#include "IconLoader.h"
#include "Settings.h"

namespace GmicQt
{

FileParameter::FileParameter(QObject * parent) : AbstractParameter(parent), _label(nullptr), _button(nullptr), _dialogMode(DialogMode::InputOutput) {}

FileParameter::~FileParameter()
{
  delete _label;
  delete _button;
}

int FileParameter::size() const
{
  return 1;
}

bool FileParameter::addTo(QWidget * widget, int row)
{
  _grid = dynamic_cast<QGridLayout *>(widget->layout());
  Q_ASSERT_X(_grid, __PRETTY_FUNCTION__, "No grid layout in widget");
  _row = row;
  delete _label;
  delete _button;

  QString buttonText;
  if (_value.isEmpty()) {
    buttonText = "...";
  } else {
    int w = widget->contentsRect().width() / 3;
    QFontMetrics fm(widget->font());
    buttonText = fm.elidedText(QFileInfo(_value).fileName(), Qt::ElideRight, w);
  }
  _button = new QPushButton(buttonText, widget);
  _button->setIcon(IconLoader::load("document-open"));
  _grid->addWidget(_label = new QLabel(_name, widget), row, 0, 1, 1);
  setTextSelectable(_label);
  _grid->addWidget(_button, row, 1, 1, 2);
  connect(_button, &QPushButton::clicked, this, &FileParameter::onButtonPressed);
  return true;
}

QString FileParameter::value() const
{
  return _value;
}

QString FileParameter::defaultValue() const
{
  return _default;
}

void FileParameter::setValue(const QString & value)
{
  _value = value;
  if (_button) {
    if (_value.isEmpty()) {
      _button->setText("...");
    } else {
      int width = _button->contentsRect().width() - 10;
      QFontMetrics fm(_button->font());
      _button->setText(fm.elidedText(QFileInfo(_value).fileName(), Qt::ElideRight, width));
    }
  }
}

void FileParameter::reset()
{
  setValue(_default);
}

bool FileParameter::initFromText(const QString & filterName, const char * text, int & textLength)
{
  QList<QString> list;
  if (matchType("filein", text))
Download .txt
gitextract_b0uqak3u/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── .travis.yml
├── CMakeLists.txt
├── COPYING
├── NEW_HOST_HOWTO.md
├── README.md
├── STANDALONE.md
├── check_versions.sh
├── cmake/
│   └── modules/
│       ├── COPYING-CMAKE-SCRIPTS
│       ├── FindFFTW3.cmake
│       └── LibFindMacros.cmake
├── gmic_qt.desktop
├── gmic_qt.pro
├── gmic_qt.qrc
├── icons/
│   └── application/
│       └── gmic_qt.icns
├── pkg-config-check.sh
├── pre_version.sh
├── scripts/
│   ├── travis_build_cmake.sh
│   └── travis_build_qmake.sh
├── src/
│   ├── ClickableLabel.cpp
│   ├── ClickableLabel.h
│   ├── Common.cpp
│   ├── Common.h
│   ├── CroppedActiveLayerProxy.cpp
│   ├── CroppedActiveLayerProxy.h
│   ├── CroppedImageListProxy.cpp
│   ├── CroppedImageListProxy.h
│   ├── DialogSettings.cpp
│   ├── DialogSettings.h
│   ├── FilterGuiDynamismCache.cpp
│   ├── FilterGuiDynamismCache.h
│   ├── FilterParameters/
│   │   ├── AbstractParameter.cpp
│   │   ├── AbstractParameter.h
│   │   ├── BoolParameter.cpp
│   │   ├── BoolParameter.h
│   │   ├── ButtonParameter.cpp
│   │   ├── ButtonParameter.h
│   │   ├── ChoiceParameter.cpp
│   │   ├── ChoiceParameter.h
│   │   ├── ColorParameter.cpp
│   │   ├── ColorParameter.h
│   │   ├── ConstParameter.cpp
│   │   ├── ConstParameter.h
│   │   ├── CustomDoubleSpinBox.cpp
│   │   ├── CustomDoubleSpinBox.h
│   │   ├── CustomSpinBox.cpp
│   │   ├── CustomSpinBox.h
│   │   ├── FileParameter.cpp
│   │   ├── FileParameter.h
│   │   ├── FilterParametersWidget.cpp
│   │   ├── FilterParametersWidget.h
│   │   ├── FloatParameter.cpp
│   │   ├── FloatParameter.h
│   │   ├── FolderParameter.cpp
│   │   ├── FolderParameter.h
│   │   ├── IntParameter.cpp
│   │   ├── IntParameter.h
│   │   ├── LinkParameter.cpp
│   │   ├── LinkParameter.h
│   │   ├── MultilineTextParameterWidget.cpp
│   │   ├── MultilineTextParameterWidget.h
│   │   ├── NoteParameter.cpp
│   │   ├── NoteParameter.h
│   │   ├── PointParameter.cpp
│   │   ├── PointParameter.h
│   │   ├── SeparatorParameter.cpp
│   │   ├── SeparatorParameter.h
│   │   ├── TextParameter.cpp
│   │   └── TextParameter.h
│   ├── FilterSelector/
│   │   ├── FavesModel.cpp
│   │   ├── FavesModel.h
│   │   ├── FavesModelReader.cpp
│   │   ├── FavesModelReader.h
│   │   ├── FavesModelWriter.cpp
│   │   ├── FavesModelWriter.h
│   │   ├── FilterTagMap.cpp
│   │   ├── FilterTagMap.h
│   │   ├── FiltersModel.cpp
│   │   ├── FiltersModel.h
│   │   ├── FiltersModelBinaryReader.cpp
│   │   ├── FiltersModelBinaryReader.h
│   │   ├── FiltersModelBinaryWriter.cpp
│   │   ├── FiltersModelBinaryWriter.h
│   │   ├── FiltersModelReader.cpp
│   │   ├── FiltersModelReader.h
│   │   ├── FiltersPresenter.cpp
│   │   ├── FiltersPresenter.h
│   │   ├── FiltersView/
│   │   │   ├── FilterTreeAbstractItem.cpp
│   │   │   ├── FilterTreeAbstractItem.h
│   │   │   ├── FilterTreeFolder.cpp
│   │   │   ├── FilterTreeFolder.h
│   │   │   ├── FilterTreeItem.cpp
│   │   │   ├── FilterTreeItem.h
│   │   │   ├── FilterTreeItemDelegate.cpp
│   │   │   ├── FilterTreeItemDelegate.h
│   │   │   ├── FiltersView.cpp
│   │   │   ├── FiltersView.h
│   │   │   ├── TreeView.cpp
│   │   │   └── TreeView.h
│   │   ├── FiltersVisibilityMap.cpp
│   │   └── FiltersVisibilityMap.h
│   ├── FilterSyncRunner.cpp
│   ├── FilterSyncRunner.h
│   ├── FilterTextTranslator.cpp
│   ├── FilterTextTranslator.h
│   ├── FilterThread.cpp
│   ├── FilterThread.h
│   ├── Globals.cpp
│   ├── Globals.h
│   ├── GmicProcessor.cpp
│   ├── GmicProcessor.h
│   ├── GmicQt.cpp
│   ├── GmicQt.h
│   ├── GmicStdlib.cpp
│   ├── GmicStdlib.h
│   ├── HeadlessProcessor.cpp
│   ├── HeadlessProcessor.h
│   ├── Host/
│   │   ├── 8bf/
│   │   │   └── host_8bf.cpp
│   │   ├── Gimp/
│   │   │   └── host_gimp.cpp
│   │   ├── GmicQtHost.h
│   │   ├── None/
│   │   │   ├── ImageDialog.cpp
│   │   │   ├── ImageDialog.h
│   │   │   ├── JpegQualityDialog.cpp
│   │   │   ├── JpegQualityDialog.h
│   │   │   ├── host_none.cpp
│   │   │   └── jpegqualitydialog.ui
│   │   └── PaintDotNet/
│   │       └── host_paintdotnet.cpp
│   ├── HtmlTranslator.cpp
│   ├── HtmlTranslator.h
│   ├── IconLoader.cpp
│   ├── IconLoader.h
│   ├── ImageTools.cpp
│   ├── ImageTools.h
│   ├── InputOutputState.cpp
│   ├── InputOutputState.h
│   ├── KeypointList.cpp
│   ├── KeypointList.h
│   ├── LanguageSettings.cpp
│   ├── LanguageSettings.h
│   ├── LayersExtentProxy.cpp
│   ├── LayersExtentProxy.h
│   ├── Logger.cpp
│   ├── Logger.h
│   ├── MainWindow.cpp
│   ├── MainWindow.h
│   ├── Misc.cpp
│   ├── Misc.h
│   ├── OverrideCursor.cpp
│   ├── OverrideCursor.h
│   ├── ParametersCache.cpp
│   ├── ParametersCache.h
│   ├── PersistentMemory.cpp
│   ├── PersistentMemory.h
│   ├── Settings.cpp
│   ├── Settings.h
│   ├── SourcesWidget.cpp
│   ├── SourcesWidget.h
│   ├── Tags.cpp
│   ├── Tags.h
│   ├── TimeLogger.cpp
│   ├── TimeLogger.h
│   ├── Updater.cpp
│   ├── Updater.h
│   ├── Utils.cpp
│   ├── Utils.h
│   ├── Widgets/
│   │   ├── InOutPanel.cpp
│   │   ├── InOutPanel.h
│   │   ├── LanguageSelectionWidget.cpp
│   │   ├── LanguageSelectionWidget.h
│   │   ├── PreviewWidget.cpp
│   │   ├── PreviewWidget.h
│   │   ├── ProgressInfoWidget.cpp
│   │   ├── ProgressInfoWidget.h
│   │   ├── ProgressInfoWindow.cpp
│   │   ├── ProgressInfoWindow.h
│   │   ├── SearchFieldWidget.cpp
│   │   ├── SearchFieldWidget.h
│   │   ├── VisibleTagSelector.cpp
│   │   ├── VisibleTagSelector.h
│   │   ├── ZoomLevelSelector.cpp
│   │   └── ZoomLevelSelector.h
│   └── ZoomConstraint.h
├── standalone.qrc
├── translations/
│   ├── authors/
│   │   ├── cs.txt
│   │   ├── de.txt
│   │   ├── es.txt
│   │   ├── fr.txt
│   │   ├── id.txt
│   │   ├── it.txt
│   │   ├── ja.txt
│   │   ├── nl.txt
│   │   ├── pl.txt
│   │   ├── pt.txt
│   │   ├── ru.txt
│   │   ├── sv.txt
│   │   ├── uk.txt
│   │   ├── zh.txt
│   │   └── zh_tw.txt
│   ├── cs.ts
│   ├── de.ts
│   ├── es.ts
│   ├── filters/
│   │   ├── HOWTO.md
│   │   ├── csv2ts.sh
│   │   ├── gmic_qt_de.csv
│   │   ├── gmic_qt_es.csv
│   │   ├── gmic_qt_fr.csv
│   │   ├── gmic_qt_it.csv
│   │   ├── gmic_qt_ja.csv
│   │   ├── gmic_qt_nl.csv
│   │   ├── gmic_qt_pl.csv
│   │   ├── gmic_qt_pt.csv
│   │   ├── gmic_qt_ru.csv
│   │   ├── gmic_qt_zh.csv
│   │   └── ts2csv.sh
│   ├── fr.ts
│   ├── id.ts
│   ├── it.ts
│   ├── ja.ts
│   ├── lrelease.sh
│   ├── nl.ts
│   ├── pl.ts
│   ├── pt.ts
│   ├── ru.ts
│   ├── sv.ts
│   ├── uk.ts
│   ├── zh.ts
│   └── zh_tw.ts
├── translations.qrc
├── ui/
│   ├── SearchFieldWidget.ui
│   ├── dialogsettings.ui
│   ├── filtersview.ui
│   ├── headlessprogressdialog.ui
│   ├── inoutpanel.ui
│   ├── languageselectionwidget.ui
│   ├── mainwindow.ui
│   ├── multilinetextparameterwidget.ui
│   ├── progressinfowidget.ui
│   ├── progressinfowindow.ui
│   ├── sourceswidget.ui
│   └── zoomlevelselector.ui
└── wip_translations.qrc
Download .txt
SYMBOL INDEX (521 symbols across 159 files)

FILE: src/ClickableLabel.cpp
  type GmicQt (line 28) | namespace GmicQt

FILE: src/ClickableLabel.h
  function namespace (line 32) | namespace GmicQt

FILE: src/Common.h
  function unused (line 63) | void unused(const T &, ...) {}

FILE: src/CroppedActiveLayerProxy.cpp
  type GmicQt (line 32) | namespace GmicQt
    function QSize (line 49) | QSize CroppedActiveLayerProxy::getSize(double x, double y, double widt...

FILE: src/CroppedActiveLayerProxy.h
  function namespace (line 32) | namespace gmic_library
  function namespace (line 38) | namespace GmicQt

FILE: src/CroppedImageListProxy.cpp
  type GmicQt (line 33) | namespace GmicQt

FILE: src/CroppedImageListProxy.h
  function namespace (line 31) | namespace gmic_library
  function namespace (line 37) | namespace GmicQt

FILE: src/DialogSettings.cpp
  type GmicQt (line 39) | namespace GmicQt

FILE: src/DialogSettings.h
  function namespace (line 32) | namespace Ui
  function namespace (line 37) | namespace GmicQt

FILE: src/FilterGuiDynamismCache.cpp
  type GmicQt (line 40) | namespace GmicQt
    function FilterGuiDynamism (line 145) | FilterGuiDynamism FilterGuiDynamismCache::getValue(const QString & hash)

FILE: src/FilterGuiDynamismCache.h
  function namespace (line 31) | namespace GmicQt

FILE: src/FilterParameters/AbstractParameter.cpp
  type GmicQt (line 48) | namespace GmicQt
    function AbstractParameter (line 89) | AbstractParameter * AbstractParameter::createFromText(const QString & ...
    function QStringList (line 233) | QStringList AbstractParameter::parseText(const QString & type, const c...

FILE: src/FilterParameters/AbstractParameter.h
  function virtual (line 44) | virtual int size() const = 0;

FILE: src/FilterParameters/BoolParameter.cpp
  type GmicQt (line 38) | namespace GmicQt
    function QString (line 79) | QString BoolParameter::value() const
    function QString (line 84) | QString BoolParameter::defaultValue() const

FILE: src/FilterParameters/BoolParameter.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterParameters/ButtonParameter.cpp
  type GmicQt (line 35) | namespace GmicQt
    function QString (line 63) | QString ButtonParameter::value() const
    function QString (line 68) | QString ButtonParameter::defaultValue() const

FILE: src/FilterParameters/ButtonParameter.h
  function namespace (line 35) | namespace GmicQt

FILE: src/FilterParameters/ChoiceParameter.cpp
  type GmicQt (line 38) | namespace GmicQt
    function QString (line 72) | QString ChoiceParameter::value() const
    function QString (line 77) | QString ChoiceParameter::defaultValue() const

FILE: src/FilterParameters/ChoiceParameter.h
  function namespace (line 34) | namespace GmicQt

FILE: src/FilterParameters/ColorParameter.cpp
  type GmicQt (line 44) | namespace GmicQt
    function QString (line 98) | QString ColorParameter::value() const
    function QString (line 107) | QString ColorParameter::defaultValue() const

FILE: src/FilterParameters/ColorParameter.h
  function namespace (line 38) | namespace GmicQt

FILE: src/FilterParameters/ConstParameter.cpp
  type GmicQt (line 33) | namespace GmicQt
    function QString (line 55) | QString ConstParameter::value() const
    function QString (line 60) | QString ConstParameter::defaultValue() const

FILE: src/FilterParameters/ConstParameter.h
  function namespace (line 31) | namespace GmicQt

FILE: src/FilterParameters/CustomDoubleSpinBox.cpp
  type GmicQt (line 38) | namespace GmicQt
    function QString (line 60) | QString CustomDoubleSpinBox::textFromValue(double value) const
    function QSize (line 77) | QSize CustomDoubleSpinBox::sizeHint() const
    function QSize (line 82) | QSize CustomDoubleSpinBox::minimumSizeHint() const

FILE: src/FilterParameters/CustomDoubleSpinBox.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterParameters/CustomSpinBox.cpp
  type GmicQt (line 38) | namespace GmicQt
    function QString (line 57) | QString CustomSpinBox::textFromValue(int value) const
    function QSize (line 62) | QSize CustomSpinBox::sizeHint() const
    function QSize (line 67) | QSize CustomSpinBox::minimumSizeHint() const

FILE: src/FilterParameters/CustomSpinBox.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterParameters/FileParameter.cpp
  type GmicQt (line 41) | namespace GmicQt
    function QString (line 82) | QString FileParameter::value() const
    function QString (line 87) | QString FileParameter::defaultValue() const

FILE: src/FilterParameters/FileParameter.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterParameters/FilterParametersWidget.cpp
  type GmicQt (line 36) | namespace GmicQt
    function QStringList (line 106) | QStringList FilterParametersWidget::defaultParameterList(const QVector...
    function QStringList (line 124) | QStringList FilterParametersWidget::defaultParameterList(const QString...
    function QString (line 289) | const QString & FilterParametersWidget::valueString() const
    function QStringList (line 294) | QStringList FilterParametersWidget::valueStringList() const
    function QString (line 420) | QString FilterParametersWidget::filterName() const
    function QString (line 435) | QString FilterParametersWidget::filterHash() const
    function QString (line 440) | QString FilterParametersWidget::valueString(const QVector<AbstractPara...
    function QString (line 459) | QString FilterParametersWidget::defaultValueString(const QVector<Abstr...
    function KeypointList (line 523) | KeypointList FilterParametersWidget::keypoints() const

FILE: src/FilterParameters/FilterParametersWidget.h
  function namespace (line 38) | namespace GmicQt

FILE: src/FilterParameters/FloatParameter.cpp
  type GmicQt (line 43) | namespace GmicQt
    function QString (line 98) | QString FloatParameter::value() const
    function QString (line 107) | QString FloatParameter::defaultValue() const

FILE: src/FilterParameters/FloatParameter.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterParameters/FolderParameter.cpp
  type GmicQt (line 41) | namespace GmicQt
    function QString (line 75) | QString FolderParameter::value() const
    function QString (line 80) | QString FolderParameter::defaultValue() const

FILE: src/FilterParameters/FolderParameter.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterParameters/IntParameter.cpp
  type GmicQt (line 40) | namespace GmicQt
    function QString (line 100) | QString IntParameter::value() const
    function QString (line 105) | QString IntParameter::defaultValue() const

FILE: src/FilterParameters/IntParameter.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterParameters/LinkParameter.cpp
  type GmicQt (line 37) | namespace GmicQt
    function QString (line 68) | QString LinkParameter::value() const
    function QString (line 73) | QString LinkParameter::defaultValue() const

FILE: src/FilterParameters/LinkParameter.h
  function namespace (line 32) | namespace GmicQt

FILE: src/FilterParameters/MultilineTextParameterWidget.cpp
  type GmicQt (line 32) | namespace GmicQt
    function QString (line 50) | QString MultilineTextParameterWidget::text() const

FILE: src/FilterParameters/MultilineTextParameterWidget.h
  function namespace (line 30) | namespace Ui
  function namespace (line 35) | namespace GmicQt

FILE: src/FilterParameters/NoteParameter.cpp
  type GmicQt (line 35) | namespace GmicQt
    function QString (line 66) | QString NoteParameter::value() const
    function QString (line 71) | QString NoteParameter::defaultValue() const

FILE: src/FilterParameters/NoteParameter.h
  function namespace (line 31) | namespace GmicQt

FILE: src/FilterParameters/PointParameter.cpp
  type GmicQt (line 48) | namespace GmicQt
    function QString (line 163) | QString PointParameter::value() const
    function QString (line 171) | QString PointParameter::defaultValue() const

FILE: src/FilterParameters/PointParameter.h
  function namespace (line 41) | namespace GmicQt

FILE: src/FilterParameters/SeparatorParameter.cpp
  type GmicQt (line 32) | namespace GmicQt
    function QString (line 68) | QString SeparatorParameter::value() const
    function QString (line 73) | QString SeparatorParameter::defaultValue() const

FILE: src/FilterParameters/SeparatorParameter.h
  function namespace (line 31) | namespace GmicQt

FILE: src/FilterParameters/TextParameter.cpp
  type GmicQt (line 43) | namespace GmicQt
    function QString (line 90) | QString TextParameter::value() const
    function QString (line 95) | QString TextParameter::defaultValue() const

FILE: src/FilterParameters/TextParameter.h
  function namespace (line 35) | namespace GmicQt

FILE: src/FilterSelector/FavesModel.cpp
  type GmicQt (line 35) | namespace GmicQt
    function QString (line 98) | QString FavesModel::uniqueName(const QString & name, const QString & f...
    function QString (line 191) | const QString & FavesModel::Fave::name() const
    function QString (line 196) | const QString & FavesModel::Fave::plainText() const
    function QString (line 201) | const QString FavesModel::Fave::absolutePath() const
    function QString (line 207) | const QString & FavesModel::Fave::originalName() const
    function QString (line 212) | const QString & FavesModel::Fave::originalHash() const
    function QString (line 217) | const QString & FavesModel::Fave::command() const
    function QString (line 222) | const QString & FavesModel::Fave::previewCommand() const
    function QString (line 227) | const QString & FavesModel::Fave::hash() const
    function QString (line 242) | QString FavesModel::Fave::toString() const

FILE: src/FilterSelector/FavesModel.h
  function namespace (line 32) | namespace GmicQt

FILE: src/FilterSelector/FavesModelReader.cpp
  type GmicQt (line 42) | namespace GmicQt
    function QString (line 182) | QString FavesModelReader::gmicGTKFavesFilename()

FILE: src/FilterSelector/FavesModelReader.h
  function namespace (line 32) | namespace GmicQt

FILE: src/FilterSelector/FavesModelWriter.cpp
  type GmicQt (line 37) | namespace GmicQt
    function QJsonObject (line 69) | QJsonObject FavesModelWriter::faveToJsonObject(const FavesModel::Fave ...

FILE: src/FilterSelector/FavesModelWriter.h
  function namespace (line 31) | namespace GmicQt

FILE: src/FilterSelector/FilterTagMap.cpp
  type GmicQt (line 42) | namespace GmicQt
    function TagColorSet (line 47) | TagColorSet FiltersTagMap::filterTags(const QString & hash)
    function TagColorSet (line 129) | TagColorSet FiltersTagMap::usedColors(int * count)

FILE: src/FilterSelector/FilterTagMap.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterSelector/FiltersModel.cpp
  type GmicQt (line 36) | namespace GmicQt
    function QString (line 204) | const QString & FiltersModel::Filter::name() const
    function QString (line 209) | const QString & FiltersModel::Filter::plainText() const
    function QString (line 214) | const QString & FiltersModel::Filter::translatedPlainText() const
    function QString (line 224) | const QString FiltersModel::Filter::absolutePathNoTags() const
    function QString (line 229) | const QString & FiltersModel::Filter::hash() const
    function QString (line 234) | QString FiltersModel::Filter::hash236() const
    function QString (line 245) | const QString & FiltersModel::Filter::command() const
    function QString (line 250) | const QString & FiltersModel::Filter::previewCommand() const
    function QString (line 255) | const QString & FiltersModel::Filter::parameters() const
    function InputMode (line 280) | InputMode FiltersModel::Filter::defaultInputMode() const

FILE: src/FilterSelector/FiltersModel.h
  function class (line 39) | class FiltersModel {

FILE: src/FilterSelector/FiltersModelBinaryReader.cpp
  type GmicQt (line 34) | namespace GmicQt
    function QByteArray (line 83) | QByteArray FiltersModelBinaryReader::readHash(const QString & filename)

FILE: src/FilterSelector/FiltersModelBinaryReader.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterSelector/FiltersModelBinaryWriter.cpp
  type GmicQt (line 35) | namespace GmicQt

FILE: src/FilterSelector/FiltersModelBinaryWriter.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterSelector/FiltersModelReader.cpp
  function isSpace (line 67) | inline bool isSpace(const QChar & c)
  function isSpace (line 72) | inline bool isSpace(const char c)
  function traverseSpaces (line 77) | inline void traverseSpaces(const QChar *& pc, const QChar * limit)
  function traverseSpaces (line 84) | inline void traverseSpaces(const char *& pc, const char * limit)
  function traverseOneChar (line 91) | inline bool traverseOneChar(const QChar *& pc, const QChar * limit, cons...
  function traverseOneChar (line 100) | inline bool traverseOneChar(const char *& pc, const char * limit, const ...
  function traverseOneCharDifferentFrom (line 109) | inline bool traverseOneCharDifferentFrom(const QChar *& pc, const QChar ...
  function traverseCharSequenceDifferentFrom (line 118) | inline void traverseCharSequenceDifferentFrom(const QChar *& pc, const Q...
  function traverseOneAlphabeticLetter (line 125) | inline bool traverseOneAlphabeticLetter(const QChar *& pc, const QChar *...
  function equals (line 137) | inline bool equals(const QChar *& pc, const QChar * limit, const QString...
  function containsGuiComment (line 149) | bool containsGuiComment(const QString & text)
  function isFolderNoLanguage (line 158) | bool isFolderNoLanguage(const QString & text)
  function isFolderLanguage (line 174) | bool isFolderLanguage(const QString & text, const QString & language)
  function isFilterNoLanguage (line 197) | bool isFilterNoLanguage(const QString & text)
  function isFilterLanguage (line 214) | bool isFilterLanguage(const QString & text, const QString & language)
  function containsInputMode (line 236) | bool containsInputMode(const QString & text, QString & inputMode)
  function containsHidePath (line 256) | bool containsHidePath(const QString & text, const QString & language, QS...
  function containsLeadingSpaceAndCrossSign (line 289) | bool containsLeadingSpaceAndCrossSign(const char * text, const char * li...
  function removeColonAndText (line 296) | void removeColonAndText(QString & text)
  function removeAtGuiLangPrefix (line 306) | void removeAtGuiLangPrefix(QString & text)
  function removeAtGuiTextAndColon (line 326) | void removeAtGuiTextAndColon(QString & text)
  function removeAtGuiSpacesAndColon (line 354) | void removeAtGuiSpacesAndColon(QString & text)
  function removeLeadingSpaces (line 376) | void removeLeadingSpaces(QString & text)
  function removeSpaceAndText (line 388) | void removeSpaceAndText(QString & text)
  function removeInputMode (line 397) | void removeInputMode(QString & text)
  function isPrefixAndColon (line 411) | bool isPrefixAndColon(const QString & text, const QString & prefix)
  type GmicQt (line 426) | namespace GmicQt
    function InputMode (line 611) | InputMode FiltersModelReader::symbolToInputMode(const QString & str)
    function QString (line 643) | QString FiltersModelReader::readBufferLine(const char *& ptr, const ch...

FILE: src/FilterSelector/FiltersModelReader.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterSelector/FiltersPresenter.cpp
  type GmicQt (line 48) | namespace GmicQt
    function QString (line 453) | const QString & FiltersPresenter::errorMessage() const

FILE: src/FilterSelector/FiltersView/FilterTreeAbstractItem.cpp
  type GmicQt (line 30) | namespace GmicQt
    function QString (line 53) | const QString & FilterTreeAbstractItem::plainText() const
    function QStringList (line 78) | QStringList FilterTreeAbstractItem::path() const
    function QString (line 90) | QString FilterTreeAbstractItem::removeWarningPrefix(QString folderName)

FILE: src/FilterSelector/FiltersView/FilterTreeAbstractItem.h
  function namespace (line 30) | namespace GmicQt

FILE: src/FilterSelector/FiltersView/FilterTreeFolder.cpp
  type GmicQt (line 30) | namespace GmicQt

FILE: src/FilterSelector/FiltersView/FilterTreeFolder.h
  function namespace (line 31) | namespace GmicQt

FILE: src/FilterSelector/FiltersView/FilterTreeItem.cpp
  type GmicQt (line 32) | namespace GmicQt
    function QString (line 68) | QString FilterTreeItem::hash() const
    function TagColorSet (line 123) | const TagColorSet FilterTreeItem::tags() const

FILE: src/FilterSelector/FiltersView/FilterTreeItem.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterSelector/FiltersView/FilterTreeItemDelegate.cpp
  type GmicQt (line 36) | namespace GmicQt
    function QSize (line 85) | QSize FilterTreeItemDelegate::sizeHint(const QStyleOptionViewItem & op...

FILE: src/FilterSelector/FiltersView/FilterTreeItemDelegate.h
  function namespace (line 30) | namespace GmicQt

FILE: src/FilterSelector/FiltersView/FiltersView.cpp
  type GmicQt (line 44) | namespace GmicQt
    function FilterTreeItem (line 239) | FilterTreeItem * FiltersView::selectedItem() const
    function FilterTreeItem (line 245) | FilterTreeItem * FiltersView::filterTreeItemFromIndex(QModelIndex inde...
    function QString (line 270) | QString FiltersView::selectedFilterHash() const
    function TagColorSet (line 372) | TagColorSet FiltersView::visibleTagColors() const
    function QStandardItem (line 587) | QStandardItem * FiltersView::getFolderFromPath(const QList<QString> & ...
    function QStandardItem (line 597) | QStandardItem * FiltersView::createFolder(QStandardItem * parent, QLis...
    function QStandardItem (line 625) | QStandardItem * FiltersView::getFolderFromPath(QStandardItem * parent,...
    function QMenu (line 674) | QMenu * FiltersView::itemContextMenu(MenuType type, FilterTreeItem * i...
    function FilterTreeItem (line 748) | FilterTreeItem * FiltersView::findFave(const QString & hash)

FILE: src/FilterSelector/FiltersView/FiltersView.h
  function namespace (line 39) | namespace Ui
  function class (line 51) | class FiltersView : public QWidget {

FILE: src/FilterSelector/FiltersView/TreeView.cpp
  type GmicQt (line 28) | namespace GmicQt

FILE: src/FilterSelector/FiltersView/TreeView.h
  function namespace (line 33) | namespace GmicQt

FILE: src/FilterSelector/FiltersVisibilityMap.cpp
  type GmicQt (line 37) | namespace GmicQt

FILE: src/FilterSelector/FiltersVisibilityMap.h
  function namespace (line 30) | namespace GmicQt

FILE: src/FilterSyncRunner.cpp
  type GmicQt (line 37) | namespace GmicQt
    function QStringList (line 100) | QStringList FilterSyncRunner::gmicStatus() const
    function QString (line 110) | QString FilterSyncRunner::errorMessage() const
    function QString (line 130) | QString FilterSyncRunner::fullCommand() const

FILE: src/FilterSyncRunner.h
  function namespace (line 37) | namespace gmic_library
  function namespace (line 42) | namespace GmicQt

FILE: src/FilterTextTranslator.cpp
  type GmicQt (line 14) | namespace GmicQt
    function QString (line 16) | QString FilterTextTranslator::translate(const QString & str)
    function QString (line 20) | QString FilterTextTranslator::translate(const QString & str, const QSt...

FILE: src/FilterTextTranslator.h
  function namespace (line 19) | namespace GmicQt

FILE: src/FilterThread.cpp
  type GmicQt (line 37) | namespace GmicQt
    function QStringList (line 91) | QStringList FilterThread::status2StringList(QString status)
    function QStringList (line 147) | QStringList FilterThread::gmicStatus() const
    function QString (line 157) | QString FilterThread::errorMessage() const
    function QString (line 182) | QString FilterThread::fullCommand() const

FILE: src/FilterThread.h
  function namespace (line 35) | namespace gmic_library
  function namespace (line 40) | namespace GmicQt

FILE: src/Globals.cpp
  type GmicQt (line 28) | namespace GmicQt

FILE: src/Globals.h
  function namespace (line 32) | namespace GmicQt

FILE: src/GmicProcessor.cpp
  type GmicQt (line 50) | namespace GmicQt
    function qint64 (line 268) | qint64 GmicProcessor::lastCompletedExecutionTime() const
    function QStringList (line 316) | const QStringList & GmicProcessor::gmicStatus() const

FILE: src/GmicProcessor.h
  function namespace (line 41) | namespace gmic_library
  function RequestType (line 56) | enum class RequestType

FILE: src/GmicQt.cpp
  function archIsLittleEndian (line 60) | inline bool archIsLittleEndian()
  function float2uchar_bounded (line 66) | inline unsigned char float2uchar_bounded(const float & in)
  type GmicQt (line 73) | namespace GmicQt
    function QString (line 80) | const QString & gmicVersionString()
    function RunParameters (line 86) | RunParameters lastAppliedFilterRunParameters(ReturnedRunParametersFlag...
    function run (line 108) | int run(UserInterfaceMode interfaceMode,                   //
    function calibrateImage (line 222) | void calibrateImage(gmic_library::gmic_image<T> & img, const int spect...
    function convertGmicImageToQImage (line 353) | void convertGmicImageToQImage(const gmic_library::gmic_image<float> & ...
    function convertQImageToGmicImage (line 480) | void convertQImageToGmicImage(const QImage & in, gmic_library::gmic_im...
  function configureApplication (line 546) | void configureApplication()
  function disableModes (line 559) | void disableModes(const std::list<GmicQt::InputMode> & disabledInputMode...

FILE: src/GmicQt.h
  function namespace (line 28) | namespace gmic_library
  type class (line 50) | enum class
  type class (line 57) | enum class
  type class (line 73) | enum class
  type class (line 83) | enum class
  type RunParameters (line 101) | struct RunParameters {
  function ReturnedRunParametersFlag (line 116) | enum class ReturnedRunParametersFlag

FILE: src/GmicStdlib.cpp
  type GmicQt (line 42) | namespace GmicQt
    function QString (line 61) | QString GmicStdLib::substituteSourceVariables(QString text)
  function QStringList (line 92) | QStringList GmicStdLib::substituteSourceVariables(const QStringList & list)
  function QByteArray (line 104) | QByteArray GmicStdLib::hash()

FILE: src/GmicStdlib.h
  function namespace (line 32) | namespace GmicQt

FILE: src/HeadlessProcessor.cpp
  type GmicQt (line 51) | namespace GmicQt
    function QString (line 135) | const QString & HeadlessProcessor::error() const
    function QString (line 172) | QString HeadlessProcessor::command() const
    function QString (line 177) | QString HeadlessProcessor::filterName() const

FILE: src/HeadlessProcessor.h
  function namespace (line 34) | namespace gmic_library
  function namespace (line 39) | namespace GmicQt

FILE: src/Host/8bf/host_8bf.cpp
  type Gmic8bfLayer (line 49) | struct Gmic8bfLayer
  type host_8bf (line 58) | namespace host_8bf
  type GmicQtHost (line 77) | namespace GmicQtHost
    function getLayersExtent (line 2306) | void getLayersExtent(int * width, int * height, GmicQt::InputMode mode)
    function getCroppedImages (line 2336) | void getCroppedImages(gmic_list<float> & images, gmic_list<char> & ima...
    function outputImages (line 2396) | void outputImages(gmic_list<float> & images, const gmic_list<char> & i...
    function applyColorProfile (line 2478) | void applyColorProfile(gmic_library::gmic_image<gmic_pixel_type> & image)
    function showMessage (line 2591) | void showMessage(const char * message)
  function QString (line 86) | QString ReadUTF8String(QDataStream& dataStream)
  type InputFileParseStatus (line 106) | enum class InputFileParseStatus
  function InputFileParseStatus (line 120) | InputFileParseStatus FillTileBuffer(
  function InputFileParseStatus (line 144) | InputFileParseStatus CopyTileToGmicImage8Interleaved(
  function InputFileParseStatus (line 258) | InputFileParseStatus CopyTileToGmicImage8Planar(
  function InputFileParseStatus (line 288) | InputFileParseStatus ConvertGmic8bfInputToGmicImage8(
  function InputFileParseStatus (line 398) | InputFileParseStatus CopyTileToGmicImage16Interleaved(
  function InputFileParseStatus (line 511) | InputFileParseStatus CopyTileToGmicImage16Planar(
  function InputFileParseStatus (line 541) | InputFileParseStatus ConvertGmic8bfInputToGmicImage16(
  function InputFileParseStatus (line 663) | InputFileParseStatus CopyTileToGmicImage32Interleaved(
  function InputFileParseStatus (line 777) | InputFileParseStatus CopyTileToGmicImage32Planar(
  function InputFileParseStatus (line 805) | InputFileParseStatus ConvertGmic8bfInputToGmicImage32(
  function InputFileParseStatus (line 918) | InputFileParseStatus ReadGmic8bfInput(const QString& path, gmic_library:...
  function InputFileParseStatus (line 1032) | InputFileParseStatus ReadColorProfile(const QString& path, cmsContext co...
  function InputFileParseStatus (line 1053) | InputFileParseStatus ParseInputFileIndex(const QString& indexFilePath)
  function FilterLayersForInputMode (line 1210) | QVector<Gmic8bfLayer> FilterLayersForInputMode(GmicQt::InputMode mode)
  function float2uchar_bounded (line 1281) | inline unsigned char float2uchar_bounded(const float& in)
  function float2ushort_bounded (line 1286) | inline unsigned short float2ushort_bounded(const float& in)
  function WriteGmic8bfImageHeader (line 1294) | void WriteGmic8bfImageHeader(
  function WriteGmicOutputTile8Interleaved (line 1327) | void WriteGmicOutputTile8Interleaved(
  function WriteGmicOutputTile8Planar (line 1453) | void WriteGmicOutputTile8Planar(
  function WriteGmicOutput8 (line 1485) | void WriteGmicOutput8(
  function WriteGmicOutputTile16Interleaved (line 1565) | void WriteGmicOutputTile16Interleaved(
  function WriteGmicOutputTile16Planar (line 1691) | void WriteGmicOutputTile16Planar(
  function WriteGmicOutput16 (line 1723) | void WriteGmicOutput16(
  function WriteGmicOutputTile32Interleaved (line 1805) | void WriteGmicOutputTile32Interleaved(
  function WriteGmicOutputTile32Planar (line 1928) | void WriteGmicOutputTile32Planar(
  function WriteGmicOutput32 (line 1958) | void WriteGmicOutput32(
  function EmptyOutputFolder (line 2041) | void EmptyOutputFolder()
  function ReadGmic8bfInputMode (line 2051) | GmicQt::InputMode ReadGmic8bfInputMode(QDataStream& dataStream)
  function ReadGmic8bfFilterParameters (line 2081) | bool ReadGmic8bfFilterParameters(const QString& path, GmicQt::RunParamet...
  function GetFilterRunParameters (line 2137) | GmicQt::RunParameters GetFilterRunParameters(const QString& path)
  function WriteGmic8bfInputMode (line 2149) | void WriteGmic8bfInputMode(QDataStream& dataStream, GmicQt::InputMode in...
  function WriteUtf8String (line 2183) | void WriteUtf8String(QDataStream& dataStream, const std::string& str)
  function WriteGmic8bfFilterParameters (line 2195) | void WriteGmic8bfFilterParameters(const QString& path, const GmicQt::Run...
  function QWidget (line 2229) | QWidget* visibleMainWindow()
  function FetchDisplayProfileFromWindowHandle (line 2241) | void FetchDisplayProfileFromWindowHandle(HWND hwnd)
  function FetchDisplayProfileFromQtWidget (line 2286) | void FetchDisplayProfileFromQtWidget()
  type GmicQtHost (line 2304) | namespace GmicQtHost {
    function getLayersExtent (line 2306) | void getLayersExtent(int * width, int * height, GmicQt::InputMode mode)
    function getCroppedImages (line 2336) | void getCroppedImages(gmic_list<float> & images, gmic_list<char> & ima...
    function outputImages (line 2396) | void outputImages(gmic_list<float> & images, const gmic_list<char> & i...
    function applyColorProfile (line 2478) | void applyColorProfile(gmic_library::gmic_image<gmic_pixel_type> & image)
    function showMessage (line 2591) | void showMessage(const char * message)
  function launchDebugger (line 2603) | bool launchDebugger()
  function DestroyLCMSData (line 2640) | void DestroyLCMSData()
  function main (line 2663) | int main(int argc, char *argv[])

FILE: src/Host/Gimp/host_gimp.cpp
  type _GmicQtPlugin (line 97) | struct _GmicQtPlugin
  type _GmicQtPluginClass (line 98) | struct _GmicQtPluginClass
  type _GmicQtPlugin (line 100) | struct _GmicQtPlugin {
  type _GmicQtPluginClass (line 104) | struct _GmicQtPluginClass {
  function gmic_qt_class_init (line 131) | static void gmic_qt_class_init(GmicQtPluginClass * klass)
  function gmic_qt_init (line 139) | static void gmic_qt_init(GmicQtPlugin * gmic_qt) {}
  type GmicQtHost (line 143) | namespace GmicQtHost
    function showMessage (line 430) | void showMessage(const char * message)
    function applyColorProfile (line 442) | void applyColorProfile(gmic_library::gmic_image<float> & image)
    function getLayersExtent (line 479) | void getLayersExtent(int * width, int * height, GmicQt::InputMode mode)
    function getCroppedImages (line 552) | void getCroppedImages(gmic_list<float> & images, gmic_list<char> & ima...
    function outputImages (line 702) | void outputImages(gmic_list<gmic_pixel_type> & images, const gmic_list...
  function reverseBlendingModeMap (line 229) | QMap<GimpLayerModeEffects, QString> reverseBlendingModeMap(const QMap<QS...
  function QString (line 241) | QString blendingMode2String(const GimpLayerModeEffects & blendingMode)
  function QByteArray (line 253) | QByteArray mapToASCII(const char * str)
  function _GIMP_ITEM_SET_NAME (line 258) | inline void _GIMP_ITEM_SET_NAME(_GimpItemPtr item_ID, const gchar * name)
  function _GIMP_ITEM_SET_NAME (line 263) | inline void _GIMP_ITEM_SET_NAME(_GimpItemPtr item_ID, const gchar * name)
  function get_output_layer_props (line 271) | void get_output_layer_props(const char * const s, GimpLayerModeEffects &...
  function _GimpLayerPtr (line 347) | _GimpLayerPtr * get_gimp_layers_flat_list(_GimpImagePtr imageId, int * c...
  function image2uchar (line 376) | void image2uchar(gmic_library::gmic_image<T> & img)
  type GmicQtHost (line 427) | namespace GmicQtHost
    function showMessage (line 430) | void showMessage(const char * message)
    function applyColorProfile (line 442) | void applyColorProfile(gmic_library::gmic_image<float> & image)
    function getLayersExtent (line 479) | void getLayersExtent(int * width, int * height, GmicQt::InputMode mode)
    function getCroppedImages (line 552) | void getCroppedImages(gmic_list<float> & images, gmic_list<char> & ima...
    function outputImages (line 702) | void outputImages(gmic_list<gmic_pixel_type> & images, const gmic_list...
  function gmic_qt_run (line 1070) | void gmic_qt_run(const gchar * /* name */, gint /* nparams */, const Gim...
  function gmic_qt_query (line 1116) | void gmic_qt_query()
  function GList (line 1155) | static GList * gmic_qt_query(GimpPlugIn * plug_in)
  function GimpProcedure (line 1224) | static GimpProcedure * gmic_qt_create_procedure(GimpPlugIn * plug_in, co...

FILE: src/Host/GmicQtHost.h
  function namespace (line 30) | namespace gmic_library
  function namespace (line 36) | namespace GmicQtHost

FILE: src/Host/None/ImageDialog.cpp
  type gmic_qt_standalone (line 38) | namespace gmic_qt_standalone
    function QImage (line 101) | const QImage & ImageDialog::currentImage() const
    function QImage (line 185) | const QImage & ImageView::image() const

FILE: src/Host/None/ImageDialog.h
  function namespace (line 43) | namespace gmic_library
  function namespace (line 48) | namespace gmic_qt_standalone

FILE: src/Host/None/JpegQualityDialog.h
  function namespace (line 6) | namespace Ui
  function class (line 11) | class JpegQualityDialog : public QDialog {

FILE: src/Host/None/host_none.cpp
  type gmic_qt_standalone (line 49) | namespace gmic_qt_standalone
    function QWidget (line 58) | QWidget * visibleMainWindow()
    function askForInputImageFilename (line 68) | void askForInputImageFilename()
    function QImage (line 91) | const QImage & transparentImage()
    function QString (line 100) | QString imageName(const char * text)
    function basename (line 130) | std::string basename(const std::string & text)
    function QImage (line 140) | const QImage & inputImage(int n)
  type GmicQtHost (line 151) | namespace GmicQtHost
    function getLayersExtent (line 157) | void getLayersExtent(int * width, int * height, GmicQt::InputMode)
    function getCroppedImages (line 174) | void getCroppedImages(gmic_library::gmic_list<float> & images, gmic_li...
    function outputImages (line 209) | void outputImages(gmic_library::gmic_list<float> & images, const gmic_...
    function showMessage (line 253) | void showMessage(const char * message)
    function applyColorProfile (line 258) | void applyColorProfile(gmic_library::gmic_image<gmic_pixel_type> &) {}
  function usage (line 262) | void usage(const std::string & argv0)
  function loadImage (line 290) | inline bool loadImage(QImage & image, const QString & filename, int argc...
  function main (line 297) | int main(int argc, char * argv[])

FILE: src/Host/PaintDotNet/host_paintdotnet.cpp
  type KernelHandleCloser (line 39) | struct KernelHandleCloser
  type MappedFileViewCloser (line 50) | struct MappedFileViewCloser
  type host_paintdotnet (line 64) | namespace host_paintdotnet
  type GmicQtHost (line 70) | namespace GmicQtHost
    function getLayersExtent (line 257) | void getLayersExtent(int * width, int * height, GmicQt::InputMode mode)
    function getCroppedImages (line 282) | void getCroppedImages(gmic_list<float> & images, gmic_list<char> & ima...
    function outputImages (line 381) | void outputImages(gmic_list<float> & images, const gmic_list<char> & i...
    function applyColorProfile (line 538) | void applyColorProfile(gmic_library::gmic_image<gmic_pixel_type> & ima...
    function showMessage (line 543) | void showMessage(const char * message)
  class ScopedCreateFile (line 79) | class ScopedCreateFile : public std::unique_ptr<void, KernelHandleCloser>
    method ScopedCreateFile (line 82) | ScopedCreateFile(HANDLE handle) : std::unique_ptr<void, KernelHandleCl...
  function BOOL (line 87) | BOOL ReadFileBlocking(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfByte...
  function BOOL (line 123) | BOOL WriteFileBlocking(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBy...
  function QByteArray (line 159) | QByteArray SendMessageSynchronously(QByteArray message)
  function quint8 (line 249) | inline quint8 Float2Uint8Clamped(const float& value)
  type GmicQtHost (line 255) | namespace GmicQtHost {
    function getLayersExtent (line 257) | void getLayersExtent(int * width, int * height, GmicQt::InputMode mode)
    function getCroppedImages (line 282) | void getCroppedImages(gmic_list<float> & images, gmic_list<char> & ima...
    function outputImages (line 381) | void outputImages(gmic_list<float> & images, const gmic_list<char> & i...
    function applyColorProfile (line 538) | void applyColorProfile(gmic_library::gmic_image<gmic_pixel_type> & ima...
    function showMessage (line 543) | void showMessage(const char * message)
  function main (line 551) | int main(int argc, char *argv[])

FILE: src/HtmlTranslator.cpp
  type GmicQt (line 32) | namespace GmicQt
    function QString (line 37) | QString HtmlTranslator::removeTags(QString str)
    function QString (line 43) | QString HtmlTranslator::html2txt(const QString & str, bool force)
    function QString (line 57) | QString HtmlTranslator::fromUtf8Escapes(const QString & str)

FILE: src/HtmlTranslator.h
  function namespace (line 31) | namespace GmicQt

FILE: src/IconLoader.cpp
  type GmicQt (line 30) | namespace GmicQt
    function QIcon (line 33) | QIcon IconLoader::getForDarkTheme(const char * name)
    function QIcon (line 41) | QIcon IconLoader::load(const char * name)
    function QIcon (line 50) | QIcon IconLoader::loadNoDarkened(const char * name)
    function QPixmap (line 59) | QPixmap IconLoader::darkerPixmap(const QPixmap & pixmap)
    function QString (line 78) | QString IconLoader::darkIconPath(const char * name)

FILE: src/IconLoader.h
  function namespace (line 33) | namespace GmicQt

FILE: src/ImageTools.cpp
  type GmicQt (line 37) | namespace GmicQt
    function buildPreviewImage (line 40) | void buildPreviewImage(const gmic_library::gmic_list<float> & images, ...
    function checkImageSpectrumAtMost4 (line 55) | bool checkImageSpectrumAtMost4(const gmic_library::gmic_list<float> & ...
    function hasAlphaChannel (line 66) | bool hasAlphaChannel(const gmic_library::gmic_image<T> & image)

FILE: src/ImageTools.h
  function namespace (line 31) | namespace gmic_library
  function namespace (line 37) | namespace GmicQt

FILE: src/InputOutputState.cpp
  function filterDeprecatedInputMode (line 32) | void filterDeprecatedInputMode(GmicQt::InputMode & mode)
  type GmicQt (line 47) | namespace GmicQt
    function InputOutputState (line 83) | InputOutputState InputOutputState::fromJSONObject(const QJsonObject & ...

FILE: src/InputOutputState.h
  function namespace (line 33) | namespace GmicQt

FILE: src/KeypointList.cpp
  type GmicQt (line 30) | namespace GmicQt
    function QPointF (line 52) | QPointF KeypointList::position(int n) const
    function QColor (line 58) | QColor KeypointList::color(int n) const

FILE: src/KeypointList.h
  function namespace (line 36) | namespace GmicQt

FILE: src/LanguageSettings.cpp
  type GmicQt (line 39) | namespace GmicQt
    function QString (line 67) | QString LanguageSettings::configuredTranslator()
    function QString (line 84) | QString LanguageSettings::systemDefaultAndAvailableLanguageCode()

FILE: src/LanguageSettings.h
  function namespace (line 31) | namespace GmicQt

FILE: src/LayersExtentProxy.cpp
  type GmicQt (line 30) | namespace GmicQt
    function QSize (line 37) | QSize LayersExtentProxy::getExtent(InputMode mode)

FILE: src/LayersExtentProxy.h
  function namespace (line 30) | namespace GmicQt

FILE: src/Logger.cpp
  type GmicQt (line 35) | namespace GmicQt

FILE: src/Logger.h
  function class (line 36) | class Logger {

FILE: src/MainWindow.cpp
  function QString (line 67) | QString appendShortcutText(const QString & text, const QKeySequence & key)
  type GmicQt (line 78) | namespace GmicQt
    function QString (line 484) | QString MainWindow::screenGeometries()

FILE: src/MainWindow.h
  function namespace (line 39) | namespace Ui
  function namespace (line 44) | namespace gmic_library
  function PreviewPosition (line 65) | enum class PreviewPosition

FILE: src/Misc.cpp
  function skipSpaces (line 46) | inline void skipSpaces(const char *& pc)
  function isEmptyOrSpaceSequence (line 52) | inline bool isEmptyOrSpaceSequence(const char * pc)
  type GmicQt (line 64) | namespace GmicQt
    function QString (line 67) | QString commandFromOutputMessageMode(OutputMessageMode mode)
    function appendWithSpace (line 85) | void appendWithSpace(QString & str, const QString & other)
    function downcaseCommandTitle (line 95) | void downcaseCommandTitle(QString & title)
    function parseGmicFilterParameters (line 141) | bool parseGmicFilterParameters(const QString & text, QStringList & args)
    function parseGmicFilterParameters (line 146) | bool parseGmicFilterParameters(const char * text, QStringList & args)
    function parseGmicUniqueFilterCommand (line 191) | bool parseGmicUniqueFilterCommand(const char * text, QString & command...
    function QString (line 235) | QString escapeUnescapedQuotes(const QString & text)
    function QString (line 256) | QString filterFullPathWithoutTags(const QList<QString> & path, const Q...
    function QString (line 269) | QString filterFullPathBasename(const QString & path)
    function QString (line 276) | QString flattenGmicParameterList(const QList<QString> & list, const QV...
    function QString (line 291) | QString mergedWithSpace(const QString & prefix, const QString & suffix)
    function QString (line 299) | QString elided(const QString & text, int width)
    function quotedParameters (line 307) | QVector<bool> quotedParameters(const QList<QString> & parameters)
    function QStringList (line 316) | QStringList mergeSubsequences(const QStringList & sequence, const QVec...
    function QStringList (line 343) | QStringList completePrefixFromFullList(const QStringList & prefix, con...
    function QString (line 357) | QString quotedString(QString text)
    function QStringList (line 362) | QStringList quotedStringList(const QStringList & stringList)
    function QString (line 371) | QString unescaped(const QString & text)
    function QString (line 378) | QString unquoted(const QString & text)
    function QStringList (line 389) | QStringList expandParameterList(const QStringList & parameters, const ...
    function QString (line 410) | QString readableDuration(qint64 ms)
    function QString (line 429) | QString readableSize(quint64 n)
    function qreal (line 442) | qreal randomReal(qreal lowest, qreal highest)

FILE: src/Misc.h
  function namespace (line 34) | namespace GmicQt

FILE: src/OverrideCursor.cpp
  type GmicQt (line 29) | namespace GmicQt

FILE: src/OverrideCursor.h
  function namespace (line 30) | namespace GmicQt

FILE: src/ParametersCache.cpp
  type GmicQt (line 40) | namespace GmicQt
    function InputOutputState (line 249) | InputOutputState ParametersCache::getInputOutputState(const QString & ...

FILE: src/ParametersCache.h
  function namespace (line 33) | namespace GmicQt

FILE: src/PersistentMemory.cpp
  type GmicQt (line 28) | namespace GmicQt

FILE: src/PersistentMemory.h
  function namespace (line 28) | namespace gmic_library
  function namespace (line 33) | namespace GmicQt

FILE: src/Settings.cpp
  function filterDeprecatedOutputMessageMode (line 37) | GmicQt::OutputMessageMode filterDeprecatedOutputMessageMode(const GmicQt...
  type GmicQt (line 46) | namespace GmicQt
    function QString (line 142) | QString Settings::languageCode()
    function OutputMessageMode (line 212) | OutputMessageMode Settings::outputMessageMode()
    function QStringList (line 252) | const QStringList & Settings::filterSources()

FILE: src/Settings.h
  function namespace (line 38) | namespace GmicQt

FILE: src/SourcesWidget.cpp
  type GmicQt (line 42) | namespace GmicQt
    function QStringList (line 120) | QStringList SourcesWidget::list() const
    function QStringList (line 133) | QStringList SourcesWidget::defaultList()

FILE: src/SourcesWidget.h
  function namespace (line 32) | namespace Ui
  function class (line 42) | class SourcesWidget : public QWidget {

FILE: src/Tags.cpp
  type GmicQt (line 39) | namespace GmicQt
    function QString (line 54) | const QString & TagAssets::markerHtml(const TagColor color, unsigned i...
    function QIcon (line 83) | const QIcon & TagAssets::menuIcon(TagColor color, IconMark mark)
    function QAction (line 146) | QAction * TagAssets::action(QObject * parent, TagColor color, IconMark...
    function QString (line 154) | QString TagAssets::colorName(TagColor color)

FILE: src/Tags.h
  function namespace (line 37) | namespace GmicQt

FILE: src/TimeLogger.cpp
  type GmicQt (line 34) | namespace GmicQt
    function TimeLogger (line 50) | TimeLogger * TimeLogger::getInstance()

FILE: src/TimeLogger.h
  function namespace (line 31) | namespace GmicQt

FILE: src/Updater.cpp
  type GmicQt (line 42) | namespace GmicQt
    function Updater (line 60) | Updater * Updater::getInstance()
    function QByteArray (line 214) | QByteArray Updater::cimgzDecompress(const QByteArray & array)
    function QByteArray (line 228) | QByteArray Updater::cimgzDecompressFile(const QString & filename)
    function QString (line 240) | QString Updater::localFilename(QString url)
    function QByteArray (line 284) | QByteArray Updater::buildFullStdlib() const

FILE: src/Updater.h
  function class (line 48) | class Updater : public QObject {

FILE: src/Utils.cpp
  type GmicQt (line 48) | namespace GmicQt
    function QString (line 51) | const QString & gmicConfigPath(bool create)
    function host_app_pid (line 71) | unsigned int host_app_pid()
    function QString (line 96) | const QString & pluginFullName()
    function QString (line 114) | const QString & pluginCodeName()
    function touchFile (line 123) | bool touchFile(const QString & path)
    function writeAll (line 135) | bool writeAll(const QByteArray & array, QFile & file)
    function safelyWrite (line 159) | bool safelyWrite(const QByteArray & array, const QString & filename)

FILE: src/Utils.h
  function namespace (line 33) | namespace GmicQt

FILE: src/Widgets/InOutPanel.cpp
  type GmicQt (line 33) | namespace GmicQt
    function InputMode (line 116) | InputMode InOutPanel::inputMode() const
    function OutputMode (line 122) | OutputMode InOutPanel::outputMode() const
    function InputOutputState (line 245) | InputOutputState InOutPanel::state() const

FILE: src/Widgets/InOutPanel.h
  function namespace (line 35) | namespace Ui
  function namespace (line 40) | namespace GmicQt

FILE: src/Widgets/LanguageSelectionWidget.cpp
  type GmicQt (line 35) | namespace GmicQt

FILE: src/Widgets/LanguageSelectionWidget.h
  function namespace (line 31) | namespace Ui
  function namespace (line 36) | namespace GmicQt

FILE: src/Widgets/PreviewWidget.cpp
  type GmicQt (line 44) | namespace GmicQt
    function QRect (line 238) | QRect PreviewWidget::splittedPreviewPosition()
    function QPoint (line 344) | QPoint PreviewWidget::keypointToPointInWidget(const KeypointList::Keyp...
    function QPoint (line 350) | QPoint PreviewWidget::keypointToVisiblePointInWidget(const KeypointLis...
    function QPointF (line 358) | QPointF PreviewWidget::pointInWidgetToKeypointPosition(const QPoint & ...
    function QSize (line 1159) | QSize PreviewWidget::originalImageCropSize()
    function KeypointList (line 1218) | const KeypointList & PreviewWidget::keypoints() const
    function ZoomConstraint (line 1235) | ZoomConstraint PreviewWidget::zoomConstraint() const

FILE: src/Widgets/PreviewWidget.h
  function namespace (line 41) | namespace gmic_library
  function namespace (line 47) | namespace GmicQt

FILE: src/Widgets/ProgressInfoWidget.cpp
  type GmicQt (line 41) | namespace GmicQt

FILE: src/Widgets/ProgressInfoWidget.h
  function namespace (line 30) | namespace Ui
  function class (line 39) | class ProgressInfoWidget : public QWidget {

FILE: src/Widgets/ProgressInfoWindow.cpp
  type GmicQt (line 43) | namespace GmicQt

FILE: src/Widgets/ProgressInfoWindow.h
  function namespace (line 33) | namespace Ui
  function namespace (line 38) | namespace gmic_library
  function namespace (line 43) | namespace GmicQt

FILE: src/Widgets/SearchFieldWidget.cpp
  type GmicQt (line 40) | namespace GmicQt
    function QString (line 99) | QString SearchFieldWidget::text() const

FILE: src/Widgets/SearchFieldWidget.h
  function namespace (line 34) | namespace Ui
  function namespace (line 39) | namespace GmicQt

FILE: src/Widgets/VisibleTagSelector.cpp
  type GmicQt (line 33) | namespace GmicQt
    function TagColorSet (line 72) | TagColorSet VisibleTagSelector::selectedColors() const

FILE: src/Widgets/VisibleTagSelector.h
  function namespace (line 34) | namespace GmicQt

FILE: src/Widgets/ZoomLevelSelector.cpp
  type GmicQt (line 36) | namespace GmicQt

FILE: src/Widgets/ZoomLevelSelector.h
  function namespace (line 32) | namespace Ui
  function namespace (line 37) | namespace GmicQt

FILE: src/ZoomConstraint.h
  function namespace (line 28) | namespace GmicQt
Condensed preview — 242 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,457K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 47,
    "preview": "custom: https://libreart.info/en/projects/gmic\n"
  },
  {
    "path": ".gitignore",
    "chars": 246,
    "preview": "Makefile\n*.a\n*.o\n*.pro.user\n*.pro.user.*\n*.so\n*~\n.moc/*\n.obj/*\n.qmake.stash\n.qrc/*\n.ui/*\n./Makefile\ngmic_gimp_qt\ngmic_pa"
  },
  {
    "path": ".travis.yml",
    "chars": 1242,
    "preview": "language: cpp\n\ngit:\n  depth: 1\n\nos:\n  - linux\n\nbranches:\n  only:\n    - master\n    - new_api\n    - devel\n\ncompiler:\n  - g"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 22553,
    "preview": "project(gmic-qt)\n\nmessage(STATUS \"Using CMake version: ${CMAKE_VERSION}\")\n\ncmake_minimum_required(VERSION 3.10.0 FATAL_E"
  },
  {
    "path": "COPYING",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "NEW_HOST_HOWTO.md",
    "chars": 5343,
    "preview": "# Contributing - New host HOWTO\n\nThis document describes the architecture of the plugin (especially its link with the ho"
  },
  {
    "path": "README.md",
    "chars": 3170,
    "preview": "\n# G'MIC-Qt: a versatile G'MIC plugin\n\n### Purpose\n\n G'MIC-Qt is a versatile front-end to the image processing framework"
  },
  {
    "path": "STANDALONE.md",
    "chars": 5577,
    "preview": "# G'MIC-Qt standalone version HOWTO\n\nThe G'MIC-Qt GUI accepts several options on its command line, thus allowing simple "
  },
  {
    "path": "check_versions.sh",
    "chars": 1967,
    "preview": "#!/bin/bash\nset -o errexit\nfunction usage()\n{\n  echo \"  Usage:\"\n  echo\n  echo \"        check_version.sh GMIC_PATH [gmic|"
  },
  {
    "path": "cmake/modules/COPYING-CMAKE-SCRIPTS",
    "chars": 1327,
    "preview": "Redistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the followi"
  },
  {
    "path": "cmake/modules/FindFFTW3.cmake",
    "chars": 2218,
    "preview": "# - Try to find the Fftw3 Libraries\n#\n# Once done this will define\n#\n#  FFTW3_FOUND        - system has fftw3\n#  FFTW3_I"
  },
  {
    "path": "cmake/modules/LibFindMacros.cmake",
    "chars": 4326,
    "preview": "# Version 1.0 (2013-04-12)\n# Public Domain, originally written by Lasse Kärkkäinen <tronic@zi.fi>\n# Published at http://"
  },
  {
    "path": "gmic_qt.desktop",
    "chars": 397,
    "preview": "[Desktop Entry]\nVersion=1.0\nType=Application\nName=G'MIC-Qt\nTerminal=false\nComment=Apply G'MIC filters to images\nComment["
  },
  {
    "path": "gmic_qt.pro",
    "chars": 15588,
    "preview": "#\n# Set HOST variable to define target host software.\n# Possible values are \"none\", \"gimp\", \"gimp3\" (experimental), and "
  },
  {
    "path": "gmic_qt.qrc",
    "chars": 2644,
    "preview": "<RCC>\n    <qresource prefix=\"/\">\n        <file>icons/bookmark-add.png</file>\n        <file>icons/bookmark-remove.png</fi"
  },
  {
    "path": "pkg-config-check.sh",
    "chars": 60,
    "preview": "#!/bin/bash\nbash -c \"pkg-config --version\" > /dev/null 2>&1\n"
  },
  {
    "path": "pre_version.sh",
    "chars": 75,
    "preview": "#!/bin/bash\n# workaround for MSYS2 call of date by qmake.\ndate \"+%y%m%d%H\"\n"
  },
  {
    "path": "scripts/travis_build_cmake.sh",
    "chars": 295,
    "preview": "#!/bin/bash\nset -ev\n\nif [ \"${TRAVIS_BRANCH}\" = devel ]; then\n    BUILD_TYPE=Debug\nelse\n    BUILD_TYPE=Release\nfi\n\ncmake "
  },
  {
    "path": "scripts/travis_build_qmake.sh",
    "chars": 319,
    "preview": "#!/bin/bash\nset -ev\n\nif [ \"${TRAVIS_BRANCH}\" = devel ]; then\n    config=debug\nelse\n    config=release\nfi\n\nqmake --versio"
  },
  {
    "path": "src/ClickableLabel.cpp",
    "chars": 1231,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ClickableLabel.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/ClickableLabel.h",
    "chars": 1302,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ClickableLabel.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/Common.cpp",
    "chars": 958,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Common.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This fil"
  },
  {
    "path": "src/Common.h",
    "chars": 5023,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Common.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file "
  },
  {
    "path": "src/CroppedActiveLayerProxy.cpp",
    "chars": 2586,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CroppedActiveLayerProxy.cpp\n *\n *  Copyright 2017 Sebastien Foure"
  },
  {
    "path": "src/CroppedActiveLayerProxy.h",
    "chars": 1854,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CroppedActiveLayerProxy.h\n *\n *  Copyright 2017 Sebastien Fourey\n"
  },
  {
    "path": "src/CroppedImageListProxy.cpp",
    "chars": 2933,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CroppedImageListProxy.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n"
  },
  {
    "path": "src/CroppedImageListProxy.h",
    "chars": 1987,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CroppedImageListProxy.h\n *\n *  Copyright 2017 Sebastien Fourey\n *"
  },
  {
    "path": "src/DialogSettings.cpp",
    "chars": 9077,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file DialogSettings.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/DialogSettings.h",
    "chars": 1959,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file DialogSettings.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterGuiDynamismCache.cpp",
    "chars": 4790,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterGuiDynamismCache.cpp\n *\n *  Copyright 2017 Sebastien Fourey"
  },
  {
    "path": "src/FilterGuiDynamismCache.h",
    "chars": 1571,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterGuiDynamismCache.h\n *\n *  Copyright 2017 Sebastien Fourey\n "
  },
  {
    "path": "src/FilterParameters/AbstractParameter.cpp",
    "chars": 9854,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file AbstractParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n "
  },
  {
    "path": "src/FilterParameters/AbstractParameter.h",
    "chars": 3123,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file AbstractParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/FilterParameters/BoolParameter.cpp",
    "chars": 3755,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file BoolParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/BoolParameter.h",
    "chars": 1878,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file BoolParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterParameters/ButtonParameter.cpp",
    "chars": 3299,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ButtonParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/FilterParameters/ButtonParameter.h",
    "chars": 1921,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ButtonParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/ChoiceParameter.cpp",
    "chars": 4296,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ChoiceParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/FilterParameters/ChoiceParameter.h",
    "chars": 1932,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ChoiceParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/ColorParameter.cpp",
    "chars": 7032,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ColorParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterParameters/ColorParameter.h",
    "chars": 2003,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ColorParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterParameters/ConstParameter.cpp",
    "chars": 2100,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ConstParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterParameters/ConstParameter.h",
    "chars": 1696,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ConstParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterParameters/CustomDoubleSpinBox.cpp",
    "chars": 3325,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CustomDoubleSpinBox.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n "
  },
  {
    "path": "src/FilterParameters/CustomDoubleSpinBox.h",
    "chars": 1932,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CustomDoubleSpinBox.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n "
  },
  {
    "path": "src/FilterParameters/CustomSpinBox.cpp",
    "chars": 2612,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CustomSpinBox.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterParameters/CustomSpinBox.h",
    "chars": 1865,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file CustomSpinBox.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterParameters/FileParameter.cpp",
    "chars": 5599,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FileParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/FileParameter.h",
    "chars": 1909,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FileParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterParameters/FilterParametersWidget.cpp",
    "chars": 16421,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterParametersWidget.cpp\n *\n *  Copyright 2017 Sebastien Fourey"
  },
  {
    "path": "src/FilterParameters/FilterParametersWidget.h",
    "chars": 4051,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterParametersWidget.h\n *\n *  Copyright 2017 Sebastien Fourey\n "
  },
  {
    "path": "src/FilterParameters/FloatParameter.cpp",
    "chars": 6570,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FloatParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterParameters/FloatParameter.h",
    "chars": 2203,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FloatParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterParameters/FolderParameter.cpp",
    "chars": 4024,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FolderParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/FilterParameters/FolderParameter.h",
    "chars": 1825,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FolderParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/IntParameter.cpp",
    "chars": 5721,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file IntParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterParameters/IntParameter.h",
    "chars": 2121,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file IntParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/FilterParameters/LinkParameter.cpp",
    "chars": 3542,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LinkParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/LinkParameter.h",
    "chars": 1750,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LinkParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterParameters/MultilineTextParameterWidget.cpp",
    "chars": 2452,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file MultilineTextParameterWidget.cpp\n *\n *  Copyright 2017 Sebastien "
  },
  {
    "path": "src/FilterParameters/MultilineTextParameterWidget.h",
    "chars": 1697,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file MultilineTextParameterWidget.h\n *\n *  Copyright 2017 Sebastien Fo"
  },
  {
    "path": "src/FilterParameters/NoteParameter.cpp",
    "chars": 3405,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file NoteParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/NoteParameter.h",
    "chars": 1688,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file NoteParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterParameters/PointParameter.cpp",
    "chars": 12027,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file PointParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterParameters/PointParameter.h",
    "chars": 2903,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file PointParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterParameters/SeparatorParameter.cpp",
    "chars": 2612,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file SeparatorParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n"
  },
  {
    "path": "src/FilterParameters/SeparatorParameter.h",
    "chars": 1646,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file SeparatorParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/FilterParameters/TextParameter.cpp",
    "chars": 5289,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file TextParameter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/FilterParameters/TextParameter.h",
    "chars": 2059,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file TextParameter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterSelector/FavesModel.cpp",
    "chars": 7608,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FavesModel.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/FilterSelector/FavesModel.h",
    "chars": 4009,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FavesModel.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/FilterSelector/FavesModelReader.cpp",
    "chars": 6266,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FavesModelReader.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/FilterSelector/FavesModelReader.h",
    "chars": 1495,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FavesModelReader.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterSelector/FavesModelWriter.cpp",
    "chars": 2853,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FavesModelWriter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/FilterSelector/FavesModelWriter.h",
    "chars": 1412,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FavesModelWriter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterSelector/FilterTagMap.cpp",
    "chars": 5357,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTagMap.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/FilterSelector/FilterTagMap.h",
    "chars": 1843,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTagMap.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/FilterSelector/FiltersModel.cpp",
    "chars": 9035,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModel.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterSelector/FiltersModel.h",
    "chars": 4383,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModel.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/FilterSelector/FiltersModelBinaryReader.cpp",
    "chars": 3664,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModelBinaryReader.cpp\n *\n *  Copyright 2017 Sebastien Four"
  },
  {
    "path": "src/FilterSelector/FiltersModelBinaryReader.h",
    "chars": 1860,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModelBinaryReader.h\n *\n *  Copyright 2017 Sebastien Fourey"
  },
  {
    "path": "src/FilterSelector/FiltersModelBinaryWriter.cpp",
    "chars": 2602,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModelBinaryReader.cpp\n *\n *  Copyright 2017 Sebastien Four"
  },
  {
    "path": "src/FilterSelector/FiltersModelBinaryWriter.h",
    "chars": 1728,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModelBinaryWriter.h\n *\n *  Copyright 2017 Sebastien Fourey"
  },
  {
    "path": "src/FilterSelector/FiltersModelReader.cpp",
    "chars": 19796,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModelReader.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n"
  },
  {
    "path": "src/FilterSelector/FiltersModelReader.h",
    "chars": 1660,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersModelReader.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/FilterSelector/FiltersPresenter.cpp",
    "chars": 21522,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersPresenter.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/FilterSelector/FiltersPresenter.h",
    "chars": 4970,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersPresenter.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeAbstractItem.cpp",
    "chars": 2648,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeAbstractItem.cpp\n *\n *  Copyright 2017 Sebastien Fourey"
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeAbstractItem.h",
    "chars": 1656,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeAbstractItem.h\n *\n *  Copyright 2017 Sebastien Fourey\n "
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeFolder.cpp",
    "chars": 3289,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeFolder.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeFolder.h",
    "chars": 1584,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeFolder.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeItem.cpp",
    "chars": 3220,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeItem.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeItem.h",
    "chars": 1824,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeItem.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeItemDelegate.cpp",
    "chars": 3349,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeItemDelegate.cpp\n *\n *  Copyright 2017 Sebastien Fourey"
  },
  {
    "path": "src/FilterSelector/FiltersView/FilterTreeItemDelegate.h",
    "chars": 1471,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterTreeItemDelegate.h\n *\n *  Copyright 2017 Sebastien Fourey\n "
  },
  {
    "path": "src/FilterSelector/FiltersView/FiltersView.cpp",
    "chars": 22342,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersView.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/FilterSelector/FiltersView/FiltersView.h",
    "chars": 4874,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersView.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This "
  },
  {
    "path": "src/FilterSelector/FiltersView/TreeView.cpp",
    "chars": 1306,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file TreeView.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/FilterSelector/FiltersView/TreeView.h",
    "chars": 1351,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file TreeView.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This fil"
  },
  {
    "path": "src/FilterSelector/FiltersVisibilityMap.cpp",
    "chars": 2998,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersVisibilityMap.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n "
  },
  {
    "path": "src/FilterSelector/FiltersVisibilityMap.h",
    "chars": 1426,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FiltersVisibilityMap.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n"
  },
  {
    "path": "src/FilterSyncRunner.cpp",
    "chars": 5117,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterSyncRunner.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/FilterSyncRunner.h",
    "chars": 2605,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterSyncRunner.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/FilterTextTranslator.cpp",
    "chars": 869,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n * @file   FilterTextTranslator.cpp\n * @author Sebastien Fourey\n * @date   Sep"
  },
  {
    "path": "src/FilterTextTranslator.h",
    "chars": 788,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n * @file   FilterTextTranslator.h\n * @author Sebastien Fourey\n * @date   Sep 2"
  },
  {
    "path": "src/FilterThread.cpp",
    "chars": 6825,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterThread.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/FilterThread.h",
    "chars": 2763,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file FilterThread.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/Globals.cpp",
    "chars": 1129,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Globals.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This fi"
  },
  {
    "path": "src/Globals.h",
    "chars": 2777,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Globals.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file"
  },
  {
    "path": "src/GmicProcessor.cpp",
    "chars": 21478,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file GmicProcessor.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/GmicProcessor.h",
    "chars": 4952,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file GmicProcessor.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/GmicQt.cpp",
    "chars": 18738,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file GmicQt.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This fil"
  },
  {
    "path": "src/GmicQt.h",
    "chars": 4293,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file GmicQt.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file "
  },
  {
    "path": "src/GmicStdlib.cpp",
    "chars": 3164,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file GmicStdlib.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/GmicStdlib.h",
    "chars": 1407,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file GmicStdlib.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/HeadlessProcessor.cpp",
    "chars": 9928,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file HeadlessProcessor.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n "
  },
  {
    "path": "src/HeadlessProcessor.h",
    "chars": 2452,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file HeadlessProcessor.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/Host/8bf/host_8bf.cpp",
    "chars": 86501,
    "preview": "/*\n*  This file is part of G'MIC-Qt, a generic plug-in for raster graphics\n*  editors, offering hundreds of filters than"
  },
  {
    "path": "src/Host/Gimp/host_gimp.cpp",
    "chars": 60370,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file host_gimp.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This "
  },
  {
    "path": "src/Host/GmicQtHost.h",
    "chars": 3988,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file GmicQtHost.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/Host/None/ImageDialog.cpp",
    "chars": 6094,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ImageDialog.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/Host/None/ImageDialog.h",
    "chars": 2436,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ImageDialog.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This "
  },
  {
    "path": "src/Host/None/JpegQualityDialog.cpp",
    "chars": 2455,
    "preview": "#include \"JpegQualityDialog.h\"\n#include <QSettings>\n#include \"Settings.h\"\n#include \"ui_jpegqualitydialog.h\"\nint JpegQual"
  },
  {
    "path": "src/Host/None/JpegQualityDialog.h",
    "chars": 606,
    "preview": "#ifndef JPEGQUALITYDIALOG_H\n#define JPEGQUALITYDIALOG_H\n\n#include <QDialog>\n\nnamespace Ui\n{\nclass JpegQualityDialog;\n}\n\n"
  },
  {
    "path": "src/Host/None/host_none.cpp",
    "chars": 19750,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file host_none.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This "
  },
  {
    "path": "src/Host/None/jpegqualitydialog.ui",
    "chars": 2987,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>JpegQualityDialog</class>\n <widget class=\"QDialog\" nam"
  },
  {
    "path": "src/Host/PaintDotNet/host_paintdotnet.cpp",
    "chars": 21780,
    "preview": "/*\n*  This file is part of G'MIC-Qt, a generic plug-in for raster graphics\n*  editors, offering hundreds of filters than"
  },
  {
    "path": "src/HtmlTranslator.cpp",
    "chars": 1989,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file HtmlTranslator.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/HtmlTranslator.h",
    "chars": 1430,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file HtmlTranslator.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/IconLoader.cpp",
    "chars": 2533,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file IconLoader.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/IconLoader.h",
    "chars": 1458,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file IconLoader.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/ImageTools.cpp",
    "chars": 2439,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ImageTools.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/ImageTools.h",
    "chars": 1551,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ImageTools.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/InputOutputState.cpp",
    "chars": 2997,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file InputOutputState.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/InputOutputState.h",
    "chars": 1627,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file InputOutputState.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/KeypointList.cpp",
    "chars": 3068,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file KeypointList.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/KeypointList.h",
    "chars": 4388,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file KeypointList.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/LanguageSettings.cpp",
    "chars": 5071,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LanguageSettings.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/LanguageSettings.h",
    "chars": 1585,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LanguageSettings.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/LayersExtentProxy.cpp",
    "chars": 1739,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LayersExtentProxy.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n "
  },
  {
    "path": "src/LayersExtentProxy.h",
    "chars": 1429,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LayersExtentProxy.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/Logger.cpp",
    "chars": 3464,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Logger.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This fil"
  },
  {
    "path": "src/Logger.h",
    "chars": 1768,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Logger.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file "
  },
  {
    "path": "src/MainWindow.cpp",
    "chars": 60081,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file MainWindow.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/MainWindow.h",
    "chars": 5307,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file MainWindow.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/Misc.cpp",
    "chars": 12367,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Misc.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file "
  },
  {
    "path": "src/Misc.h",
    "chars": 3315,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Utils.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file i"
  },
  {
    "path": "src/OverrideCursor.cpp",
    "chars": 1462,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file OverrideCursor.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/OverrideCursor.h",
    "chars": 1252,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file OverrideCursor.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "src/ParametersCache.cpp",
    "chars": 9371,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ParametersCache.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/ParametersCache.h",
    "chars": 2045,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ParametersCache.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/PersistentMemory.cpp",
    "chars": 1432,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file PersistentMemory.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/PersistentMemory.h",
    "chars": 1437,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file PersistentMemory.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  "
  },
  {
    "path": "src/Settings.cpp",
    "chars": 9786,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Settings.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/Settings.h",
    "chars": 3731,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Settings.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This fil"
  },
  {
    "path": "src/SourcesWidget.cpp",
    "chars": 10444,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file SourcesWidget.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/SourcesWidget.h",
    "chars": 1962,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file SourcesWidget.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/Tags.cpp",
    "chars": 6173,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Tags.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file "
  },
  {
    "path": "src/Tags.h",
    "chars": 7539,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Tags.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file is"
  },
  {
    "path": "src/TimeLogger.cpp",
    "chars": 2185,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file TimeLogger.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/TimeLogger.h",
    "chars": 1451,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file TimeLogger.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/Updater.cpp",
    "chars": 10873,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Updater.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This fi"
  },
  {
    "path": "src/Updater.h",
    "chars": 3298,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Updater.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file"
  },
  {
    "path": "src/Utils.cpp",
    "chars": 5092,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Utils.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file"
  },
  {
    "path": "src/Utils.h",
    "chars": 1423,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file Utils.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This file i"
  },
  {
    "path": "src/Widgets/InOutPanel.cpp",
    "chars": 9610,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file InOutPanel.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This"
  },
  {
    "path": "src/Widgets/InOutPanel.h",
    "chars": 2452,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file InOutPanel.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  This f"
  },
  {
    "path": "src/Widgets/LanguageSelectionWidget.cpp",
    "chars": 4071,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LanguageSelectionWidget.cpp\n *\n *  Copyright 2017 Sebastien Foure"
  },
  {
    "path": "src/Widgets/LanguageSelectionWidget.h",
    "chars": 1718,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file LanguageSelectionWidget.h\n *\n *  Copyright 2017 Sebastien Fourey\n"
  },
  {
    "path": "src/Widgets/PreviewWidget.cpp",
    "chars": 44393,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file PreviewWidget.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  T"
  },
  {
    "path": "src/Widgets/PreviewWidget.h",
    "chars": 7588,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file PreviewWidget.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Thi"
  },
  {
    "path": "src/Widgets/ProgressInfoWidget.cpp",
    "chars": 7305,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ProgressInfoWidget.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n"
  },
  {
    "path": "src/Widgets/ProgressInfoWidget.h",
    "chars": 2044,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ProgressInfoWidget.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/Widgets/ProgressInfoWindow.cpp",
    "chars": 5362,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ProgressInfoWindow.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n"
  },
  {
    "path": "src/Widgets/ProgressInfoWindow.h",
    "chars": 1927,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ProgressInfoWindow.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/Widgets/SearchFieldWidget.cpp",
    "chars": 3922,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file SearchFieldWidget.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n "
  },
  {
    "path": "src/Widgets/SearchFieldWidget.h",
    "chars": 1749,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file SearchFieldWidget.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/Widgets/VisibleTagSelector.cpp",
    "chars": 2598,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file VisibleTagSelector.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n"
  },
  {
    "path": "src/Widgets/VisibleTagSelector.h",
    "chars": 1604,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file VisibleTagSelector.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *"
  },
  {
    "path": "src/Widgets/ZoomLevelSelector.cpp",
    "chars": 6803,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ZoomLevelSelector.cpp\n *\n *  Copyright 2017 Sebastien Fourey\n *\n "
  },
  {
    "path": "src/Widgets/ZoomLevelSelector.h",
    "chars": 2187,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ZoomLevelSelector.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n * "
  },
  {
    "path": "src/ZoomConstraint.h",
    "chars": 1661,
    "preview": "/** -*- mode: c++ ; c-basic-offset: 2 -*-\n *\n *  @file ZoomConstraint.h\n *\n *  Copyright 2017 Sebastien Fourey\n *\n *  Th"
  },
  {
    "path": "standalone.qrc",
    "chars": 99,
    "preview": "<RCC>\n    <qresource prefix=\"/\">\n        <file>resources/gmicky.png</file>\n    </qresource>\n</RCC>\n"
  },
  {
    "path": "translations/authors/cs.txt",
    "chars": 58,
    "preview": "<!-- Original Czech translation done by Jan Helebrant -->\n"
  },
  {
    "path": "translations/authors/de.txt",
    "chars": 61,
    "preview": "<!-- Original German translation done by Frank Tegtmeyer -->\n"
  },
  {
    "path": "translations/authors/es.txt",
    "chars": 76,
    "preview": "<!-- Original Spanish translation done by chroma_ghost & bazza/pixls.us -->\n"
  },
  {
    "path": "translations/authors/fr.txt",
    "chars": 62,
    "preview": "<!-- Original French translation done by Sébastien Fourey -->\n"
  },
  {
    "path": "translations/authors/id.txt",
    "chars": 64,
    "preview": "<!-- Original Indonesian translation done by Duddy Hadiwido -->\n"
  },
  {
    "path": "translations/authors/it.txt",
    "chars": 62,
    "preview": "<!-- Original Italian translation done by Francesco Riosa -->\n"
  },
  {
    "path": "translations/authors/ja.txt",
    "chars": 82,
    "preview": "<!-- Original Japanese translation done by omiya tou (tokyogeometry / github) -->\n"
  },
  {
    "path": "translations/authors/nl.txt",
    "chars": 61,
    "preview": "<!-- Original Dutch translation done by iarga / pixls.us -->\n"
  },
  {
    "path": "translations/authors/pl.txt",
    "chars": 59,
    "preview": "<!-- Original Polish translation done by Alex Mozheiko -->\n"
  },
  {
    "path": "translations/authors/pt.txt",
    "chars": 54,
    "preview": "<!-- Original Portuguese translation done by maxr -->\n"
  },
  {
    "path": "translations/authors/ru.txt",
    "chars": 55,
    "preview": "<!-- Original Russian translation by Alex Mozheiko -->\n"
  },
  {
    "path": "translations/authors/sv.txt",
    "chars": 65,
    "preview": "<!-- Original Swedish translation done by starinspace@github -->\n"
  },
  {
    "path": "translations/authors/uk.txt",
    "chars": 68,
    "preview": "<!-- Original Ukrainian translation done by Andrex Starodubtsev -->\n"
  },
  {
    "path": "translations/authors/zh.txt",
    "chars": 86,
    "preview": "<!-- Original Chinese translation done by LinuxToy (https://twitter.com/linuxtoy) -->\n"
  },
  {
    "path": "translations/authors/zh_tw.txt",
    "chars": 91,
    "preview": "<!-- Original traditional Chinese translation done by ZX-WT (https://github.com/ZX-WT) -->\n"
  },
  {
    "path": "translations/cs.ts",
    "chars": 53945,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!-- Original Czech translation done by Jan Helebrant -->\n\n<!DOCTYPE TS>\n<TS ver"
  },
  {
    "path": "translations/de.ts",
    "chars": 54398,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!-- Original German translation done by Frank Tegtmeyer -->\n\n<!DOCTYPE TS>\n<TS "
  }
]

// ... and 42 more files (download for full content)

About this extraction

This page contains the full source code of the c-koi/gmic-qt GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 242 files (3.0 MB), approximately 801.6k tokens, and a symbol index with 521 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!