diff --git a/CMakeLists.txt b/CMakeLists.txt index 615348484..4724c4001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,14 +13,9 @@ endif () string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE) -# assuming that Linux and Apple users will have gtk2 built by their installed gcc -if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0) - message(STATUS "Gcc Version >= 5.0 ; adding -D_GLIBCXX_USE_CXX11_ABI=0 to build with Gtk2") - add_definitions (-D_GLIBCXX_USE_CXX11_ABI=0) - # see here : https://gcc.gnu.org/gcc-5/changes.html#libstdcxx - endif() +# We might want to build using the old C++ ABI, even when using a new GCC version +if (USE_OLD_CXX_ABI) + add_definitions (-D_GLIBCXX_USE_CXX11_ABI=0) endif() if (UPPER_CMAKE_BUILD_TYPE STREQUAL "DEBUG") diff --git a/COMPILE.txt b/COMPILE.txt deleted file mode 100644 index 9b16c1f79..000000000 --- a/COMPILE.txt +++ /dev/null @@ -1,516 +0,0 @@ -If you have problems with the compilation, please ask on the appropriate -RawTherapee forum: http://www.rawtherapee.com/forum/viewforum.php?f=10 - -PREAMBLE --------- - - Some commands span multiple lines, each line of such a command except for the - last one will end in a backslash character, "\". - When copying code, be sure to copy all lines from the first one that ends in \ - till the last line that does not end in a \ character. - - Some parts of code contain . Replace these with whatever - value is needed, e.g. - - CMake is actually used to create the makefiles (scripts that handle the build - process) or specific Integrated Developement Environement (IDE) projects. It - is designed to find all necessary compilation flags for your specific machine, - but everything can be overriden. - - RawTherapee's build mechanism will generate a build information file, named - "AboutThisBuild.txt", and require some parameters that can't be set by CMake, - so it's done in our build script, and may be overridden at your own will. The - build process also enables some sort of cross-compiling, since you can only - choose a specific processor variation of the same type (e.g. core2, athlon64, - which are both an x86 architecture). Real cross-compiling (e.g. building the - Windows version on a Linux platform) has not been tested. - - By default, no processor is specified, so CMake/GCC will build RT for your - machine's processor. You can specify that the build is to be made for a - generic processor by using the -DPROC_TARGET_NUMBER="1" CMake option. - Developers who are providing builds for download from the RawTherapee website - have to set the processor label (a human-readable description of the - processor, set to "undefined" by default) manually with the -DPROC_LABEL="foo" - CMake parameter. - - Note for developers that handle an automated build system: Mercurial is - required in order to produce the build information file, but your build system - will certainly only use the source code without any access to a Mercurial - repository. To generate the needed information, run the script: - ./tools/generateReleaseInfo - After that, you can delete .hg* (the example below uses "-X *.hg*" to exclude - those files and folders instead of deleting them - the end result is the same) - and continue with the normal compile instructions without the need for - mercurial. - - In short, once you cd into your clone of the RawTherapee source code - repository, using version "4.1" as an example: - 1. Check out the desired hg tag: hg update "4.1" - 2. Run tools/generateReleaseInfo to generate ReleaseInfo.cmake: - ./tools/generateReleaseInfo - 3. The repository is now ready to be made into a public tarball: - ./tools/generateSourceTarball - - The build system especially encourages to perform out-of-source builds. This - means that the CMake project is generated in a folder which is not in the - source tree of RawTherapee. This way the source tree stays clean all the time - and multiple different compilation settings can be maintained in parallel - using different binary folders. Further information about out-of-source builds - can be found here: - http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F - - If an in-source build is performed, the CMake logic now warns about this but - does not fail. Especially important for clean out-of-source builds is that the - CMake code does not generate files inside the source tree, e.g. when using - configure_file. Please keep this in mind when altering the CMake files. - - -DEPENDENCIES ------------- - - PACKAGE URL - BZIP2 bzip2>-1.0.4 http://www.bzip.org/ - EXIV2 exiv2>=0.19 http://www.exiv2.org/ - EXPAT expat>=2.1.0 http://expat.sourceforge.net/ - FFTW fftw>=3.2.2 http://fftw.org/ - GCC gcc>=4.7 http://gcc.gnu.org/ - GLIB2 glib-2.0>=2.24 http://www.gtk.org/ - GLIBMM glibmm-2.4>=2.24 http://www.gtkmm.org - GTK+ gtk+-2.0>=2.24.18 http://www.gtk.org/ - GTK2-Engines gtk-engines-2.20.2 http://www.gtk.org/ - GTKMM gtkmm-2.4>=2.22 http://www.gtkmm.org - JPEG libjpeg>=6b http://libjpeg-turbo.virtualgl.org/ - http://jpegclub.org/ - http://www.ijg.org/ - LCMS2 lcms>=2.0a http://www.littlecms.com/ - LIBCANBERRA libcanberra-gtk http://0pointer.de/lennart/projects/libcanberra/ (Linux only) - LIBIPTCDATA libiptcdata>=1.0.2 http://libiptcdata.sourceforge.net - PNG libpng>=1.2.44 http://www.libpng.org/ - SIGC sigc++-2.0 http://libsigc.sourceforge.net/ - TIFF libtiff>=3.9.4 http://www.remotesensing.org/libtiff/ - ZLIB zlib>=1.2.3 http://www.zlib.net/ - - -WINDOWS -------- - - OPTIONAL - - - TortoiseHG - You can make your life a little easier by using a graphical client for - working with Mercurial. One such free and open-soure cross-platform - client is TortoiseHG, you can get it bundled with Mercurial from: - http://tortoisehg.bitbucket.org/ - - - Weird compressed archive formats? - You might need to unpack archives in formats which Windows does not - handle by default. That's no problem, there are a few free programs out - there which handle many more formats than Windows does, and faster too. - We recommend: - http://www.7-zip.org/ - http://peazip.sourceforge.net/ - - - THE TOOLCHAIN - - This document assumes that you install MinGW, CMake and gtkmm respectively - to "C:\MinGW64" (or "C:\MinGW32" for 32-bit), "C:\CMake", and "C:\gtkmm64" (or - "C:\gtkmm" for 32-bit). - These packages must be installed in paths that DO NOT CONTAIN SPACES. - - INSTALL THE TOOLCHAIN - - TDM-GCC On-Demand Installer - http://tdm-gcc.tdragon.net/download - GCC 4.9 is recommended for Win64 builds, as under some conditions older - versions of GCC can cause artifacts. - Download the "tdm-gcc-webdl" option. Run it, select "Create a new - TDM-GCC installation" and choose the appropriate option for your - machine: "MinGW/TDM (32-bit)" if you use a 32-bit machine, or - "MinGW-w64/TDM64 Experimental (32-bit and 64-bit)" if you use a 64-bit - machine. Even though the 64-bit version contains a 32-bit version too, - we had no luck making 32-bit RT builds using it at the time of writing. - Be sure to install with OpenMP support (Components > gcc > openmp). - - - CMake - http://www.cmake.org/cmake/resources/software.html - Use "Windows (Win32 Installer)", the newest version. - - - >=GTK+ 2.24.18 - http://hexchat.github.io/gtk-win32/ - - - gtkmm-2.24 - http://sourceforge.net/projects/gtk-mingw/files/gtkmm2/ - - - INSTALL THE DEPENDENCIES - - RawTherapee depends on additional build-time libraries. There are two ways - you can get these libraries: - - The easy way, you can use the pre-compiled ones available from: - http://www.rawtherapee.com/releases_head/windows/dependencies_for_creating_builds/ - Just unzip them to the base installation dir of MinGW, which should be - C:\MinGW64 if you followed the instructions to the letter. - - Note that this archive might not contain all of the required - libraries. If compilation fails due to missing libraries, then see the - dependency list at the beginning of this document, find the missing - ones, and see below for instructions on where to download them from - and how to install them. Please notify us so that we may update the - archive. - - - The hard way, you will need to download the source code for each and - compile each yourself. See further below for instructions. - - - SET UP THE TOOLCHAIN ENVIRONMENT VARIABLES - - The toolchain installers should have set up some environment variables - for you automatically, but some will be missing. Fire up: - System Properties > Advanced > Environment Variables - - Make sure you have the relevant ones, and that they point to the correct - places: - GTKMM_BASEPATH = "C:\gtkmm" - GTKMM64_BASEPATH = "C:\gtkmm64" - MINGW_BASEPATH = "C:\MinGW64" - PKG_CONFIG_PATH = "C:\MinGW64\lib\pkgconfig;c:\gtkmm64\lib\pkgconfig" - and that PATH contains "C:\gtkmm64\bin;C:\MinGW64\bin;C:\CMake\bin;" - (or the 32-bit counteparts) - - Restart your console to be sure the changes took effect. - - - COMPILE - - Clone or update the RawTherapee repository - You can use TortoiseHG to clone and update the repository, or you can - do it from the command line: - hg clone https://rawtherapee.googlecode.com/hg/ "C:\rtrepo" - If you have already cloned it before, update it: - cd C:\rtrepo - hg pull - hg update -C default - - - Tailor the buildRT.bat batch file to your needs - Copy C:\rtrepo\tools\buildRT.bat to C:\buildRT.bat so that you can make - changes to it and not lose them when you update the repository. - - Edit C:\buildRT.bat and customize as follows: - - If you are building RT for yourself, use - "-DPROC_TARGET_NUMBER:STRING=2" - - If you are building RT to be distributed to other people, use - "-DPROC_TARGET_NUMBER:STRING=1" - - If you want to upload a build, you should set some additional - information about your processor. There are two possibilities: - 1. You pick up a target processor from "ProcessorTargets.cmake". - All you have to do is set the PROC_TARGET_NUMBER parameter - to the desired target number. If you choose the "native" - solution, you have to set the processor label manually - by setting the PROC_LABEL parameter. Please provide a short name, - like "core i5" or "athlon64". Processor frequency is of no use. - 2. You don't need specific processor flags, so you'll let - PROC_TARGET_NUMBER default to 0, but you have to set the - PROC_LABEL parameter. Please provide a short name, like "core i5" - or "athlon64". Specifying the processor frequency is of no use. - - - Run buildRT.bat to compile RawTherapee - C:\buildRT.bat - - - DEPENDENCIES - THE HARD WAY - - The MSYS package is required to build the libraries. Before building them, - check if they are already installed in your gtkmm and MinGW directories. - There shouldn't be two versions of the same library in different places. - - Open an MSYS console, that will create a Linux environment, and compile - the dependencies in the following order: - zlib: - If you have gtkmm-2.22 installed, you should skip this zlib section. - - Download: http://zlib.net/ - - How to build: - cd to the directory you unpacked zlib-1.2.5 to, - make -f win32/Makefile.gcc - - Then, manually copy the files as follows (tip: you can individually - copy the lines below and paste them in MSYS' prompt with the middle - mouse button): - cp -iv zlib1.dll /mingw/bin - cp -iv zconf.h zlib.h /mingw/include - cp -iv libz.a /mingw/lib - cp -iv libzdll.a /mingw/lib/libz.dll.a - - libpng: - If you have gtkmm-2.22 installed, you should skip this libpng section. - - Download: http://sourceforge.net/projects/libpng/files/ - - How to build: - cd to the directory you unpacked lpng144 to. - There are two methods of building libpng: - 1. gtkmm doesn't provide zlib so compile it yourself: - cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_BUILD_TYPE:STRING=Release - 2. gtkmm provides zlib so you can reuse it (assuming that you - hadn't compiled zlib as explained above): - cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_PREFIX_PATH:PATH=C:/gtkmm -DCMAKE_BUILD_TYPE:STRING=Release - - Then build and install: - make - make install - - libjpeg: - - Download: http://www.ijg.org/ - - How to build: - cd to the directory you unpacked jpeg-8b to. - ./configure --prefix=/mingw - Copy jconfig.txt to jconfig.h (overwrite the existing file). - make - make install - - libtiff: - - Download: ftp://ftp.remotesensing.org/pub/libtiff/ - - How to build: - In the configure process below, set the zlib include and lib path to - the right folder. We're assuming that you're using the one provided - in the gtkmm bundle. - ./configure --prefix=/mingw --with-zlib-include-dir=/c/gtkmm/include --with-zlib-lib-dir=/c/gtkmm/lib - make - cd libtiff - make install - - libiptcdata: - - Download: http://libiptcdata.sourceforge.net/ - - How to build: - ./configure --prefix=/mingw - - Edit the "Makefile" file from the root dir of libiptcdata and - search for "DIST_SUBDIRS =" and "SUBDIRS =". You should only find - one line for each search. From these lines, remove "iptc", then: - make - make install - - LCMS: - - Download LCMS2 - http://sourceforge.net/projects/lcms/files/ - - How to build: - ./configure --prefix=/mingw - make - make install - - Expat: - - Download: http://expat.sourceforge.net/ - - Install - - FFTW: - - Instructions: http://www.fftw.org/install/windows.html - - Specific instructions more suitable for RawTherapee purposes: - 1. Download the official FFTW-64 DLL package from - http://www.fftw.org/download.html - Unpack it to C:\fftw3\ - 2. Start MSYS console and go to your FFTW3 directory - cd /c/fftw3 - 2. In MSYS console, execute: - dlltool --def libfftw3f-3.def --dllname libfftw3f-3.dll --output-lib libfftw3f-3.a - dlltool --def libfftw3l-3.def --dllname libfftw3l-3.dll --output-lib libfftw3l-3.a - dlltool --def libfftw3-3.def --dllname libfftw3-3.dll --output-lib libfftw3-3.a - 3. Copy files: - cp libfftw3f-3.dll /c/MinGW64/bin - cp libfftw3l-3.dll /c/MinGW64/bin - cp libfftw3-3.dll /c/MinGW64/bin - cp libfftw3f-3.a /c/MinGW64/lib - cp fftw3.h /c/MinGW64/include - 4. Create a new text file MinGW64/lib/pkgconfig/fftw3f.pc with the - following contents: - prefix=/mingw64 - exec_prefix=${prefix} - libdir=${exec_prefix}/lib - includedir=${prefix}/include - Name: fftw3f - Description: FFTW3 Float - Version: 3.3 - Libs: -L${libdir} -lfftw3f-3 -lm - Cflags: -I${includedir} - - - IMPORTANT - - Make sure that the lcms.pc and libiptcdata.pc files located in the - pkgconfig dir have the first line like this: - prefix=/mingw - - If everything has been installed correctly, you should see lines like - the following when running the cmake command (see "COMPILE" below): - -- checking for module 'libiptcdata' - -- found libiptcdata, version 1.0.4 - -- checking for module 'lcms2' - -- found lcms2, version 2.3 - -- Found JPEG: C:/mingw/lib/libjpeg.dll.a - -- Found ZLIB: C:/gtkmm/lib/libz.dll.a - -- Found PNG: C:/gtkmm/lib/libpng.lib - -- Found TIFF: C:/mingw/lib/libtiff.dll.a - - -LINUX ------ - - DEPENDENCIES - - See the list of dependencies at the beginning of this document. - - In Arch, run: - sudo pacman -S bzip2 exiv2 expat fftw glib2 glibmm gtk gtkmm lcms2 \ - libcanberra libiptcdata libjpeg-turbo libpng libsigc++ libtiff zlib - - In Fedora, run: - sudo yum install bzip2-devel cmake exiv2-devel expat-devel fftw-devel \ - gcc-c++ glib2-devel glibmm24-devel gtk+-devel gtk2-engines gtkmm24-devel \ - lcms2-devel libcanberra-devel libiptcdata-devel libjpeg-turbo-devel \ - libpng-devel libsigc++20-devel libtiff-devel zlib-devel - - In Gentoo, run: - sudo emerge -uva app-arch/bzip2 dev-cpp/glibmm dev-cpp/gtkmm \ - dev-libs/expat dev-libs/glib dev-libs/libsigc++ dev-vcs/mercurial \ - media-gfx/exiv2 media-libs/lcms media-libs/libcanberra \ - media-libs/libiptcdata media-libs/libjpeg-turbo media-libs/libpng \ - media-libs/tiff net-misc/curl sci-libs/fftw sys-libs/zlib x11-libs/gtk+ \ - x11-themes/gtk-engines - - In openSUSE, run: - sudo zypper in cmake fftw3-devel gcc-c++ glib2-devel glibmm2-devel \ - gtk2-devel gtkmm2-devel libbz2-devel libcanberra-devel libexpat-devel \ - libiptcdata-devel libjpeg-devel liblcms2-devel libpng-devel \ - libsigc++2-devel libtiff-devel zlib-devel - - In Ubuntu/Debian the requirements can be installed by running: - sudo apt-get update && sudo apt-get install build-essential cmake curl \ - libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libfftw3-dev \ - libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev \ - libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff4-dev \ - mercurial zlib1g-dev - - - COMPILE - - The Automatic Way: - The easiest way compile RawTherapee is by using the buildRT script, read - all about it in the forum: - http://rawtherapee.com/forum/viewtopic.php?p=22213#p22213 - - The Manual Way: - - Create and enter a new empty folder outside RawTherapee's source - directory: - mkdir ~/rt-build - cd ~/rt-build - - Type: - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release \ - -DBINDIR=. -DDATADIR=. -DLIBDIR=. - Developers who want to provide a public build have to set the PROC_LABEL - to their processor name, e.g.: - cmake -DPROC_LABEL:STRING=athlon64 -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. \ - - - Type: - make install - - You'll find the compiled program in the subdirectory named like the - value of CMAKE_BUILD_TYPE ("Release" in this example). You can copy it - anywhere you want. By changing the cmake flags, you can change where - the release will compile to. By removing all flags it should go to the - standard system install location. - - You're done. - - - Using Eclipse under Linux: - - Eclipse mercurial plugin: Click "Help > Install New Software". - The Eclipse Update Site for MercurialEclipse is available at this URL: - http://cbes.javaforge.com/update - - Import the RawTherapee Mercurial repository: - "File > new > other > mercurial > Clone existing repository" - Enter this URL: - https://rawtherapee.googlecode.com/hg - - Create and enter a new empty folder outside RawTherapee's source directory. - Configure the source for Eclipse with: - cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. -DCMAKE_BUILD_TYPE=Release - - If you want to upload a build, you should set some additional information - about your processor. There are two possibilities: - 1. You pick up a target processor from "ProcessorTargets.cmake". All you - have to do is set "-D PROC_TARGET_NUMBER:STRING=number" in cmake's - command line to the desired target number. If you choose the 'native' - solution, you have to set the processor label manually by setting "-D - PROC_LABEL:STRING=procLabel" in cmake's command line. Please provide a - short name, like "core i5" or "athlon64" (without double quotes). - Processor frequency is of no use. - 2. You don't need specific processor flags, so you'll let - PROC_TARGET_NUMBER default to 0, but you still have to set the - PROC_LABEL parameter (see point 1 righ above). - - Eclipse does not do 'make install', but only 'make all'. - There are two ways to compile: - 1. type 'make install' in the console or, - 2. in "Project > properties > C/C++ Make Project > Build (incremental - build)" change 'all' to 'install'. - -OS X ----- - - REQUIREMENTS - - - XCode Development Tools (you only need a subset of these, but it is - probably easier to just install all of them) - - MacPorts - - Add following line to /opt/local/etc/macports/variants.conf: - +no_gnome +no_x11 +quartz -x11 - - To install the dependencies, run: - sudo port install cairo pango gdk-pixbuf2 gtk2 libsigcxx2 gtk-osx-application-gtk2 gtkmm - - To install other dependencies and tools. - sudo port install gtk-engines2 lcms2 libiptcdata fftw-3-single cmake - - Install compiler, either - sudo port install gcc47 - or - Clang with OpenMP by follow instructions at https://clang-omp.github.io/ - - If you don't already have Git installed, run: - sudo port install git - - - COMPILE - - - Make build directory. - mkdir build - cd build - - To enable OpenMP, for gcc47, type: - cmake -D CMAKE_C_COMPILER=gcc-mp-4.7 -D CMAKE_CXX_COMPILER=g++-mp-4.7 \ - - - or if using Clang with OpenMP - cmake -v -D CMAKE_BUILD_TYPE=Release \ - -DPROC_TARGET_NUMBER="1" \ - -DBUILD_BUNDLE="ON" \ - -DBINDIR="." \ - -DDATADIR="." \ - -DCACHE_NAME_SUFFIX=4 \ - -DCMAKE_C_COMPILER="/tmp/clang/build_llvm/bin/clang" \ - -DCMAKE_CXX_COMPILER="/tmp/clang/build_llvm/bin/clang++" \ - -DCMAKE_C_FLAGS="-I/opt/local/include/libomp" \ - -DCMAKE_CXX_FLAGS="-I/opt/local/include/libomp" \ - - - If you want to upload a build, you should set some additional information - about your processor. There are two possibilities: - 1. You pick up a target processor from "ProcessorTargets.cmake". All you - have to do is set "-D PROC_TARGET_NUMBER:STRING=number" in cmake's - command line to the desired target number. If you choose the 'native' - solution, you have to set the processor label manually by setting "-D - PROC_LABEL:STRING=procLabel" in cmake's command line. Please provide a - short name, like "core i5" or "athlon64" (without double quotes). - Processor frequency is of no use. - 2. You don't need specific processor flags, so you'll let - PROC_TARGET_NUMBER default to 0, but you still have to set the - PROC_LABEL parameter (see point 1 righ above). - - - Type: - make -j4 install - - Type: - make macosx_bundle - - You will find a disk image in the build directory; this is the - distribution release and can be run on any machine which meets the - architecture requirements you specified in variants.conf earlier. diff --git a/README.md b/README.md index f0b286ba3..baa566ca0 100644 --- a/README.md +++ b/README.md @@ -21,44 +21,13 @@ Git handbook: http://git-scm.com/book/en/ ## Compilation, branches and Git -Refer to RawPedia for a detailed explanation of how to get the necessary dependencies and how to compile RawTherapee: +Refer to RawPedia for a detailed explanation of how to get the necessary dependencies and how to compile RawTherapee. + +Linux: http://rawpedia.rawtherapee.com/Linux -The information below is a brief summary of that. +Windows: +http://rawpedia.rawtherapee.com/Windows -### Clone the source code -Clone the source code either using HTTPS: -``` -git clone https://github.com/Beep6581/RawTherapee ~/repo-rt -``` -or using SSH (see https://help.github.com/articles/generating-ssh-keys/ ): -``` -git clone git@github.com:Beep6581/RawTherapee.git ~/repo-rt -``` -or update a previously cloned repository: -``` -cd ~/repo-rt && git pull -``` - -### Optionally pick a branch -New features and bug fixes are made on their own branches. Once tested, those branches are merged into the "master" branch. We used to test new features and bug fixes by sharing patches (.diff files) but git makes branching easy and branching makes sharing patches unnecessary. -To test a new feature or bug fix, just checkout [the right branch](https://github.com/Beep6581/RawTherapee/branches/active) before compiling: -``` -git checkout -``` - -### Compile and run -To find out how many threads your CPU supports, run: -`grep -c processor /proc/cpuinfo` -Then replace the number in `-j8` below with this number. This will make compilation faster but it will have no effect on the speed of running RawTherapee. - -Now you will make an out-of-source compilation of RawTherapee, it will be built into the ~/repo-rt/build/release folder, and then you will move this folder to your home directory and rename it to "rt", so make sure there is no ~/rt folder already! -``` -mkdir build && cd build && \ -cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCMAKE_BUILD_TYPE="release" -DPROC_TARGET_NUMBER="2" -DBUILD_BUNDLE="ON" -DBINDIR="." -DDATADIR="." -DCACHE_NAME_SUFFIX=4 .. && \ -make -j8 install && \ -mv release ~/rt -``` - -Run RawTherapee: -`~/rt/rawtherapee` +OS X: +http://rawpedia.rawtherapee.com/OS_X diff --git a/WindowsEnvironmentSetup.html b/WindowsEnvironmentSetup.html deleted file mode 100644 index 113a8dc6a..000000000 --- a/WindowsEnvironmentSetup.html +++ /dev/null @@ -1,43 +0,0 @@ -

Building RawTherapee in Windows 64

-12 November 2011
-
-
-This short guide outlines setting up a development environment for building RawTherapee (64 bit) in Windows.
-Apology and warning: the procedure is convoluted. Prepare for frustration if you deviate even one bit. Sorry.
-
-Step 0:
-Use TortoiseHg to grab the latest RawTherapee, put it in a directory whose name doesn't contain spaces. This is more or less simple but well documented, please figure it out yourself.
-
-Step 1:
-Download the latest CMake. Install it into C:\CMake.
-
-Step 2:
-Download a rather specific version of gtkmm64. Install it into C:\gtkmm64.
-
-Step 3:
-Download a rather specific build of MinGW. When installing, uncheck "Check for updated files...", check "Experimental (32 and 64 bit)", check the "openmp" component under Components->gcc, install into C:\MinGW64.
-
-Step 4:
-Download the latest Precompiled package for 64bit Windows. Unzip the file contents (already organized into several subdirectories) into C:\MinGW64.
-
-Step 5:
-Download a rather specific build of MSYS. Install to C:\msys. At the end it asks for your MinGW directory, make sure you give it C:/MinGW64. That's a forward slash, and it matters.
-
-Step 6:
-Create a file named build.bat in your RawTherapee source directory with the following content:
-
-set GTKMM_BASEPATH=C:\gtkmm64
-set GTKMM64_BASEPATH=C:\gtkmm64
-set MINGW_BASEPATH=C:\MinGW64
-set PATH=%PATH%;C:\gtkmm64\bin;C:\MinGW64\bin;C:\CMake\bin
-set PKG_CONFIG_PATH=C:\MinGW64\lib\pkgconfig;c:\gtkmm64\lib\pkgconfig
-
-cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" -DPROC_TARGET_NUMBER:STRING=2
-mingw32-make -j2 install
-pause
-
-
-
-Running the batch file above after completing all steps properly should slowly but flawlessly build RawTherapee.
-If it doesn't work, please tell us about it at the RawTherapee forum. Maybe this document needs updating.
-Do not rest until it builds. A complicated build sucks, but out of date or inaccurate build documentation is unacceptable.
diff --git a/rtdata/images/Dark/actions/arrow-down-small.png b/rtdata/images/Dark/actions/arrow-down-small.png new file mode 100644 index 000000000..d631a72f5 Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-down-small.png differ diff --git a/rtdata/images/Dark/actions/arrow-down.png b/rtdata/images/Dark/actions/arrow-down.png new file mode 100644 index 000000000..417038d15 Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-down.png differ diff --git a/rtdata/images/Dark/actions/arrow-left-small.png b/rtdata/images/Dark/actions/arrow-left-small.png new file mode 100644 index 000000000..d61abd8a3 Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-left-small.png differ diff --git a/rtdata/images/Dark/actions/arrow-left.png b/rtdata/images/Dark/actions/arrow-left.png new file mode 100644 index 000000000..a30aeadef Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-left.png differ diff --git a/rtdata/images/Dark/actions/arrow-right-small.png b/rtdata/images/Dark/actions/arrow-right-small.png new file mode 100644 index 000000000..fa0741927 Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-right-small.png differ diff --git a/rtdata/images/Dark/actions/arrow-right.png b/rtdata/images/Dark/actions/arrow-right.png new file mode 100644 index 000000000..2f426f9f1 Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-right.png differ diff --git a/rtdata/images/Dark/actions/arrow-up-small.png b/rtdata/images/Dark/actions/arrow-up-small.png new file mode 100644 index 000000000..21f8f61eb Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-up-small.png differ diff --git a/rtdata/images/Dark/actions/arrow-up.png b/rtdata/images/Dark/actions/arrow-up.png new file mode 100644 index 000000000..2f4a9d228 Binary files /dev/null and b/rtdata/images/Dark/actions/arrow-up.png differ diff --git a/rtdata/images/Dark/actions/filter-original-1.png b/rtdata/images/Dark/actions/filter-original-1.png new file mode 100644 index 000000000..9b4e47ce9 Binary files /dev/null and b/rtdata/images/Dark/actions/filter-original-1.png differ diff --git a/rtdata/images/Dark/actions/filter-original-2.png b/rtdata/images/Dark/actions/filter-original-2.png new file mode 100644 index 000000000..03531e921 Binary files /dev/null and b/rtdata/images/Dark/actions/filter-original-2.png differ diff --git a/rtdata/images/Light/actions/arrow-down-small.png b/rtdata/images/Light/actions/arrow-down-small.png new file mode 100644 index 000000000..21f25626c Binary files /dev/null and b/rtdata/images/Light/actions/arrow-down-small.png differ diff --git a/rtdata/images/Light/actions/arrow-down.png b/rtdata/images/Light/actions/arrow-down.png new file mode 100644 index 000000000..36c366bd3 Binary files /dev/null and b/rtdata/images/Light/actions/arrow-down.png differ diff --git a/rtdata/images/Light/actions/arrow-left-small.png b/rtdata/images/Light/actions/arrow-left-small.png new file mode 100644 index 000000000..5dfd88f09 Binary files /dev/null and b/rtdata/images/Light/actions/arrow-left-small.png differ diff --git a/rtdata/images/Light/actions/arrow-left.png b/rtdata/images/Light/actions/arrow-left.png new file mode 100644 index 000000000..711ad1016 Binary files /dev/null and b/rtdata/images/Light/actions/arrow-left.png differ diff --git a/rtdata/images/Light/actions/arrow-right-small.png b/rtdata/images/Light/actions/arrow-right-small.png new file mode 100644 index 000000000..310e87b9c Binary files /dev/null and b/rtdata/images/Light/actions/arrow-right-small.png differ diff --git a/rtdata/images/Light/actions/arrow-right.png b/rtdata/images/Light/actions/arrow-right.png new file mode 100644 index 000000000..933e84025 Binary files /dev/null and b/rtdata/images/Light/actions/arrow-right.png differ diff --git a/rtdata/images/Light/actions/arrow-up-small.png b/rtdata/images/Light/actions/arrow-up-small.png new file mode 100644 index 000000000..9b8884c5e Binary files /dev/null and b/rtdata/images/Light/actions/arrow-up-small.png differ diff --git a/rtdata/images/Light/actions/arrow-up.png b/rtdata/images/Light/actions/arrow-up.png new file mode 100644 index 000000000..df6b022a3 Binary files /dev/null and b/rtdata/images/Light/actions/arrow-up.png differ diff --git a/rtdata/images/Light/actions/filter-original-1.png b/rtdata/images/Light/actions/filter-original-1.png new file mode 100644 index 000000000..2daef11fb Binary files /dev/null and b/rtdata/images/Light/actions/filter-original-1.png differ diff --git a/rtdata/images/Light/actions/filter-original-2.png b/rtdata/images/Light/actions/filter-original-2.png new file mode 100644 index 000000000..37727f3be Binary files /dev/null and b/rtdata/images/Light/actions/filter-original-2.png differ diff --git a/rtdata/languages/default b/rtdata/languages/default index a5e4611c6..4f0dae8f7 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -171,6 +171,7 @@ FILEBROWSER_SHOWEDITEDHINT;Show edited images.\nShortcut: 7 FILEBROWSER_SHOWEDITEDNOTHINT;Show not edited images.\nShortcut: 6 FILEBROWSER_SHOWEXIFINFO;Show Exif info.\n\nShortcuts:\ni - Multiple Editor Tabs Mode,\nAlt-i - Single Editor Tab Mode. FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. +FILEBROWSER_SHOWORIGINALHINT;Show only the original images.\n\nThe orignal images are determined by the position of their file extensions in the parsed extensions list in the preferences. Extensions higher up in that list are considered the originals of those below. FILEBROWSER_SHOWRANK1HINT;Show images ranked as 1-star.\nShortcut: 1 FILEBROWSER_SHOWRANK2HINT;Show images ranked as 2-star.\nShortcut: 2 FILEBROWSER_SHOWRANK3HINT;Show images ranked as 3-star.\nShortcut: 3 @@ -1002,6 +1003,8 @@ PREFERENCES_PARSEDEXT;Parsed Extensions PREFERENCES_PARSEDEXTADD;Add extension PREFERENCES_PARSEDEXTADDHINT;Add entered extension to the list. PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list. +PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. PREFERENCES_PREVDEMO;Preview Demosaic Method PREFERENCES_PREVDEMO_FAST;Fast PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: diff --git a/rtdata/osx/macosx_bundle.sh b/rtdata/osx/macosx_bundle.sh index 6667548c5..670343b08 100644 --- a/rtdata/osx/macosx_bundle.sh +++ b/rtdata/osx/macosx_bundle.sh @@ -41,6 +41,18 @@ if test ! -n "${MINIMUM_SYSTEM_VERSION}"; then MINIMUM_SYSTEM_VERSION=$(sw_vers -productVersion | cut -d. -f-2) fi +# check for pango-querymodules. Pango 1.38.0 and above do not include it. +# https://github.com/Homebrew/homebrew/issues/44764#issuecomment-146795820 +PangoVer="$(brew list --versions pango)" +PangoVer="${PangoVer//./}" +# Only check the first 4 digits, so that "1.36.99" (13699) doesn't test greater than "1.38.0" (1380) +PangoVer="${PangoVer:0:4}" +if [[ "$PangoVer" -ge "1380" ]]; then + ExistPangoQuerymodules="false" +else + ExistPangoQuerymodules="true" +fi + case ${PROC_BIT_DEPTH} in 64) arch=x86_64;; 32) arch=i386;; @@ -93,13 +105,13 @@ install -d "${ETC}"/{gtk-2.0,pango} cp "${GTK_PREFIX}"/etc/gtk-2.0/im-multipress.conf "${ETC}"/gtk-2.0 "${GTK_PREFIX}"/bin/gdk-pixbuf-query-loaders "${LIB}"/gdk-pixbuf-2.0/*/loaders/*.so > "${ETC}"/gtk-2.0/gdk-pixbuf.loaders "${GTK_PREFIX}"/bin/gtk-query-immodules-2.0 "${LIB}"/gtk-2.0/*/immodules/*.so > "${ETC}"/gtk-2.0/gtk.immodules -"${GTK_PREFIX}"/bin/pango-querymodules "${LIB}"/pango/*/modules/*.so > "${ETC}"/pango/pango.modules sed -i "" -e "s|${PWD}|/tmp|" "${ETC}"/gtk-2.0/gdk-pixbuf.loaders \ - "${ETC}"/gtk-2.0/gtk.immodules \ - "${ETC}"/pango/pango.modules -printf "[Pango]\nModuleFiles = /tmp/${ETC}/pango/pango.modules" > "${ETC}"/pango/pangorc - - + "${ETC}"/gtk-2.0/gtk.immodules +if [[ "$ExistPangoQuerymodules" = "true" ]]; then + "${GTK_PREFIX}"/bin/pango-querymodules "${LIB}"/pango/*/modules/*.so > "${ETC}"/pango/pango.modules + sed -i "" -e "s|${PWD}|/tmp|" "${ETC}"/pango/pango.modules + printf "[Pango]\nModuleFiles = /tmp/${ETC}/pango/pango.modules" > "${ETC}"/pango/pangorc +fi message "Copying shared files from ${GTK_PREFIX}" cp -R "${GTK_PREFIX}"/share/mime "${MACOS}"/share diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 8866cd398..18b5eed6d 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -5821,7 +5821,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (EditBuffer *editBuffer, }; #ifdef _DEBUG - #pragma omp parallel default(shared) firstprivate(highlight, ccut, clut, chromaticity, bwToning, rstprotection, avoidColorShift, LCredsk, protectRed, protectRedH, gamutLch, lold, lnew, MunsDebugInfo, pW) if (multiThread) + #pragma omp parallel default(shared) firstprivate(lold, lnew, MunsDebugInfo, pW) if (multiThread) #else #pragma omp parallel if (multiThread) #endif diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 2c91fbf01..3e6ff97f2 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -188,7 +188,7 @@ void ImProcFunctions::vibrance (LabImage* lab) MunsDebugInfo = new MunsellDebugInfo(); } - #pragma omp parallel default(shared) firstprivate(lab, width, height, chromaPastel, chromaSatur, highlight, limitpastelsatur, transitionweighting, protectskins, avoidcolorshift, MunsDebugInfo) reduction(+: negat, moreRGB, negsat, moresat) if (multiThread) + #pragma omp parallel default(shared) firstprivate(lab, MunsDebugInfo) reduction(+: negat, moreRGB, negsat, moresat) if (multiThread) #else #pragma omp parallel default(shared) if (multiThread) #endif diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 1edfa590c..6e1c876cf 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -77,6 +77,14 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p params.crop.w = fw; params.crop.h = fh; } else { + if (params.crop.x < 0) { + params.crop.x = 0; + } + + if (params.crop.y < 0) { + params.crop.y = 0; + } + if ((params.crop.x + params.crop.w) > fw) { // crop overflow in the width dimension ; we trim it params.crop.w = fw - params.crop.x; @@ -191,8 +199,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p float *ry = new float [nbtl]; float *sk = new float [nbtl]; float *pcsk = new float [nbtl]; - float *Max_R_ = new float [nbtl]; - float *Max_B_ = new float [nbtl]; // printf("expert=%d\n",settings->leveldnautsimpl); if(settings->leveldnautsimpl == 1 && params.dirpyrDenoise.Cmethod == "PON") { @@ -371,11 +377,11 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p MaxRMoy += max_r[k]; if(max_r[k] > MaxR) { - MaxR = Max_R_[k]; + MaxR = max_r[k]; } if(max_b[k] > MaxB) { - MaxB = Max_B_[k]; + MaxB = max_b[k]; } } @@ -713,8 +719,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p delete [] ry; delete [] sk; delete [] pcsk; - delete [] Max_R_; - delete [] Max_B_; imgsrc->convertColorSpace(baseImg, params.icm, currWB); diff --git a/rtgui/browserfilter.cc b/rtgui/browserfilter.cc index f7d1038ed..6fa663aa3 100644 --- a/rtgui/browserfilter.cc +++ b/rtgui/browserfilter.cc @@ -18,11 +18,11 @@ */ #include "browserfilter.h" -BrowserFilter::BrowserFilter () : exifFilterEnabled (false) +BrowserFilter::BrowserFilter () : exifFilterEnabled (false), + showTrash (true), + showNotTrash (true), + showOriginal (false) { - - showTrash = true; - for (int i = 0; i < 6; i++) { showRanked[i] = true; showCLabeled[i] = true; diff --git a/rtgui/browserfilter.h b/rtgui/browserfilter.h index 6cfa3be62..8880a364d 100644 --- a/rtgui/browserfilter.h +++ b/rtgui/browserfilter.h @@ -30,6 +30,7 @@ public: bool showCLabeled[6]; bool showTrash; bool showNotTrash; + bool showOriginal; bool showEdited[2]; bool showRecentlySaved[2]; bool multiselect; diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 294c074bb..8bb1d69bb 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -19,6 +19,7 @@ * along with RawTherapee. If not, see . */ #include "filebrowser.h" +#include #include #include "options.h" #include "multilangmgr.h" @@ -32,6 +33,98 @@ extern Options options; +namespace +{ + +const Glib::ustring* getOriginalExtension (const ThumbBrowserEntryBase* entry) +{ + // We use the parsed extensions as a priority list, + // i.e. what comes earlier in the list is considered an original of what comes later. + typedef std::vector ExtensionVector; + typedef ExtensionVector::const_iterator ExtensionIterator; + + const ExtensionVector& originalExtensions = options.parsedExtensions; + + // Extract extension from basename + const Glib::ustring basename = Glib::path_get_basename (entry->filename.lowercase()); + + const Glib::ustring::size_type pos = basename.find_last_of ('.'); + if (pos >= basename.length () - 1) { + return NULL; + } + + const Glib::ustring extension = basename.substr (pos + 1); + + // Try to find a matching original extension + for (ExtensionIterator originalExtension = originalExtensions.begin(); originalExtension != originalExtensions.end(); ++originalExtension) { + if (*originalExtension == extension) { + return &*originalExtension; + } + } + + return NULL; +} + +ThumbBrowserEntryBase* selectOriginalEntry (ThumbBrowserEntryBase* original, ThumbBrowserEntryBase* candidate) +{ + if (original == NULL) { + return candidate; + } + + // The candidate will become the new original, if it has an original extension + // and if its extension is higher in the list than the old original. + if (const Glib::ustring* candidateExtension = getOriginalExtension (candidate)) { + if (const Glib::ustring* originalExtension = getOriginalExtension (original)) { + return candidateExtension < originalExtension ? candidate : original; + } + } + + return original; +} + +void findOriginalEntries (const std::vector& entries) +{ + typedef std::vector EntryVector; + typedef EntryVector::const_iterator EntryIterator; + typedef std::map BasenameMap; + typedef BasenameMap::const_iterator BasenameIterator; + + // Sort all entries into buckets by basename without extension + BasenameMap byBasename; + + for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { + const Glib::ustring basename = Glib::path_get_basename ((*entry)->filename.lowercase()); + + const Glib::ustring::size_type pos = basename.find_last_of ('.'); + if (pos >= basename.length () - 1) { + (*entry)->setOriginal (NULL); + continue; + } + + const Glib::ustring withoutExtension = basename.substr (0, pos); + + byBasename[withoutExtension].push_back (*entry); + } + + // Find the original image for each bucket + for (BasenameIterator bucket = byBasename.begin (); bucket != byBasename.end (); ++bucket) { + const EntryVector& entries = bucket->second; + ThumbBrowserEntryBase* original = NULL; + + // Select the most likely original in a first pass... + for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { + original = selectOriginalEntry (original, *entry); + } + + // ...and link all other images to it in a second pass. + for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { + (*entry)->setOriginal (*entry != original ? original : NULL); + } + } +} + +} + FileBrowser::FileBrowser () : tbl(NULL), numFiltered(0), partialPasteDlg(M("PARTIALPASTE_DIALOGLABEL")) { @@ -1370,6 +1463,10 @@ void FileBrowser::applyFilter (const BrowserFilter& filter) MYWRITERLOCK(l, entryRW); // Don't make this a writer lock! HOMBRE: Why? 'selected' is modified here #endif + if (filter.showOriginal) { + findOriginalEntries(fd); + } + for (size_t i = 0; i < fd.size(); i++) { if (checkFilter (fd[i])) { numFiltered++; @@ -1400,6 +1497,10 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) // true -> entry FileBrowserEntry* entry = static_cast(entryb); + if (filter.showOriginal && entry->getOriginal() != NULL) { + return false; + } + // return false if basic filter settings are not satisfied if ((filter.showRanked[entry->thumbnail->getRank()] == false ) || (filter.showCLabeled[entry->thumbnail->getColorLabel()] == false ) || diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 0112f9ebf..99392b330 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -286,6 +286,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : bTrash->signal_button_press_event().connect (sigc::mem_fun(*this, &FileCatalog::capture_event), false); iNotTrash = new RTImage("trash-hide-deleted.png") ; + iOriginal = new RTImage("filter-original-2.png"); bNotTrash = Gtk::manage( new Gtk::ToggleButton () ); bNotTrash->set_image (*iNotTrash); @@ -294,8 +295,16 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : bCateg[18] = bNotTrash->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bNotTrash, true)); bNotTrash->signal_button_press_event().connect (sigc::mem_fun(*this, &FileCatalog::capture_event), false); + bOriginal = Gtk::manage( new Gtk::ToggleButton () ); + bOriginal->set_image (*iOriginal); + bOriginal->set_tooltip_markup (M("FILEBROWSER_SHOWORIGINALHINT")); + bOriginal->set_relief (Gtk::RELIEF_NONE); + bCateg[19] = bOriginal->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bOriginal, true)); + bOriginal->signal_button_press_event().connect (sigc::mem_fun(*this, &FileCatalog::capture_event), false); + buttonBar->pack_start (*bTrash, Gtk::PACK_SHRINK); buttonBar->pack_start (*bNotTrash, Gtk::PACK_SHRINK); + buttonBar->pack_start (*bOriginal, Gtk::PACK_SHRINK); buttonBar->pack_start (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); fileBrowser->trash_changed().connect( sigc::mem_fun(*this, &FileCatalog::trashChanged) ); @@ -318,6 +327,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : // 16 - bRecentlySaved[1] // 17 - bTrash // 18 - bNotTrash + // 19 - bOriginal categoryButtons[0] = bFilterClear; categoryButtons[1] = bUnRanked; @@ -342,6 +352,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : categoryButtons[17] = bTrash; categoryButtons[18] = bNotTrash; + categoryButtons[19] = bOriginal; exifInfo = Gtk::manage(new Gtk::ToggleButton ()); exifInfo->set_image (*Gtk::manage(new RTImage ("info.png"))); @@ -440,6 +451,8 @@ FileCatalog::~FileCatalog() delete igUnCLabeled; delete iTrashEmpty; delete iTrashFull; + delete iNotTrash; + delete iOriginal; delete iRefreshWhite; delete iRefreshRed; delete iQueryClear; @@ -1352,8 +1365,8 @@ void FileCatalog::categoryButtonToggled (Gtk::ToggleButton* b, bool isMouseClick // if no modifier key is pressed, if (!(control_down || shift_down)) { - // if we're deselecting non-trashed - if (toggled_button == 18 && (buttons & (1 << toggled_button))) { + // if we're deselecting non-trashed or original + if (toggled_button >= 18 && toggled_button <= 19 && (buttons & (1 << toggled_button))) { categoryButtons[0]->set_active (true); for (int i = 1; i < numButtons; i++) { @@ -1446,9 +1459,15 @@ void FileCatalog::categoryButtonToggled (Gtk::ToggleButton* b, bool isMouseClick //if more than one star & color label is selected, do nothing } } - // ...or non-trashed with Control modifier - else if (toggled_button == 18 && control_down) { - bNotTrash->set_active (!bNotTrash->get_active ()); + // ...or non-trashed or original with Control modifier + else if (toggled_button >= 18 && toggled_button <= 19 && control_down) { + Gtk::ToggleButton* categoryButton = categoryButtons[toggled_button]; + categoryButton->set_active (!categoryButton->get_active ()); + + // If it was the first or last one, we reset the clear filter. + if (buttons == 1 || buttons == (1 << toggled_button)) { + bFilterClear->set_active (!categoryButton->get_active ()); + } } bool active_now, active_before; @@ -1555,30 +1574,30 @@ BrowserFilter FileCatalog::getFilter () bool anyCLabelFilterActive = bUnCLabeled->get_active () || bCLabel[0]->get_active () || bCLabel[1]->get_active () || bCLabel[2]->get_active () || bCLabel[3]->get_active () || bCLabel[4]->get_active (); bool anyEditedFilterActive = bEdited[0]->get_active() || bEdited[1]->get_active(); bool anyRecentlySavedFilterActive = bRecentlySaved[0]->get_active() || bRecentlySaved[1]->get_active(); - const bool nonTrashedActive = bNotTrash->get_active(); + const bool anySupplementaryActive = bNotTrash->get_active() || bOriginal->get_active(); /* * filter is setup in 2 steps * Step 1: handle individual filters */ - filter.showRanked[0] = bFilterClear->get_active() || bUnRanked->get_active () || bTrash->get_active () || nonTrashedActive || + filter.showRanked[0] = bFilterClear->get_active() || bUnRanked->get_active () || bTrash->get_active () || anySupplementaryActive || anyCLabelFilterActive || anyEditedFilterActive || anyRecentlySavedFilterActive; - filter.showCLabeled[0] = bFilterClear->get_active() || bUnCLabeled->get_active () || bTrash->get_active () || nonTrashedActive || + filter.showCLabeled[0] = bFilterClear->get_active() || bUnCLabeled->get_active () || bTrash->get_active () || anySupplementaryActive || anyRankFilterActive || anyEditedFilterActive || anyRecentlySavedFilterActive; for (int i = 1; i <= 5; i++) { - filter.showRanked[i] = bFilterClear->get_active() || bRank[i - 1]->get_active () || bTrash->get_active () || nonTrashedActive || + filter.showRanked[i] = bFilterClear->get_active() || bRank[i - 1]->get_active () || bTrash->get_active () || anySupplementaryActive || anyCLabelFilterActive || anyEditedFilterActive || anyRecentlySavedFilterActive; - filter.showCLabeled[i] = bFilterClear->get_active() || bCLabel[i - 1]->get_active () || bTrash->get_active () || nonTrashedActive || + filter.showCLabeled[i] = bFilterClear->get_active() || bCLabel[i - 1]->get_active () || bTrash->get_active () || anySupplementaryActive || anyRankFilterActive || anyEditedFilterActive || anyRecentlySavedFilterActive; } for (int i = 0; i < 2; i++) { - filter.showEdited[i] = bFilterClear->get_active() || bEdited[i]->get_active () || bTrash->get_active () || nonTrashedActive || + filter.showEdited[i] = bFilterClear->get_active() || bEdited[i]->get_active () || bTrash->get_active () || anySupplementaryActive || anyRankFilterActive || anyCLabelFilterActive || anyRecentlySavedFilterActive; - filter.showRecentlySaved[i] = bFilterClear->get_active() || bRecentlySaved[i]->get_active () || bTrash->get_active () || nonTrashedActive || + filter.showRecentlySaved[i] = bFilterClear->get_active() || bRecentlySaved[i]->get_active () || bTrash->get_active () || anySupplementaryActive || anyRankFilterActive || anyCLabelFilterActive || anyEditedFilterActive; } @@ -1616,7 +1635,7 @@ BrowserFilter FileCatalog::getFilter () (anyCLabelFilterActive && anyEditedFilterActive ) || (anyCLabelFilterActive && anyRecentlySavedFilterActive ) || (anyEditedFilterActive && anyRecentlySavedFilterActive) || - (nonTrashedActive && (anyRankFilterActive || anyCLabelFilterActive || anyEditedFilterActive || anyRecentlySavedFilterActive))) { + (anySupplementaryActive && (anyRankFilterActive || anyCLabelFilterActive || anyEditedFilterActive || anyRecentlySavedFilterActive))) { filter.multiselect = true; filter.showRanked[0] = anyRankFilterActive ? bUnRanked->get_active () : true; @@ -1658,6 +1677,7 @@ BrowserFilter FileCatalog::getFilter () filter.showTrash = bTrash->get_active () || !bNotTrash->get_active (); filter.showNotTrash = !bTrash->get_active (); + filter.showOriginal = bOriginal->get_active(); if (!filterPanel) { filter.exifFilterEnabled = false; diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 377a6b0da..b30ebb553 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -108,16 +108,17 @@ private: Gtk::ToggleButton* bRecentlySaved[2]; Gtk::ToggleButton* bTrash; Gtk::ToggleButton* bNotTrash; - Gtk::ToggleButton* categoryButtons[19]; + Gtk::ToggleButton* bOriginal; + Gtk::ToggleButton* categoryButtons[20]; Gtk::ToggleButton* exifInfo; - sigc::connection bCateg[19]; + sigc::connection bCateg[20]; Gtk::Image* iFilterClear, *igFilterClear; Gtk::Image* iranked[5], *igranked[5], *iUnRanked, *igUnRanked; Gtk::Image* iCLabeled[5], *igCLabeled[5], *iUnCLabeled, *igUnCLabeled; Gtk::Image* iEdited[2], *igEdited[2]; Gtk::Image* iRecentlySaved[2], *igRecentlySaved[2]; Gtk::Image *iTrashEmpty, *iTrashFull; - Gtk::Image *iNotTrash; + Gtk::Image *iNotTrash, *iOriginal; Gtk::Image *iRefreshWhite, *iRefreshRed; Gtk::Image *iLeftPanel_1_Show, *iLeftPanel_1_Hide, *iRightPanel_1_Show, *iRightPanel_1_Hide; Gtk::Image *iQueryClear; diff --git a/rtgui/main.cc b/rtgui/main.cc index bbfca0c52..03b85654e 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -278,6 +278,12 @@ int main(int argc, char **argv) if (options.theme.empty()) { options.theme = "21-Gray-Gray"; + } else { + std::string themeFile = argv0 + "/themes/" + options.theme + ".gtkrc"; + if (!std::ifstream(themeFile.c_str())) { + printf ("Current theme in options file is invalid: %s\nChanging to 21-Gray-Gray\n", options.theme.c_str()); + options.theme = "21-Gray-Gray"; + } } if (!options.useSystemTheme) { diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 56fb63c3e..4551b6bad 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1187,12 +1187,22 @@ Gtk::Widget* Preferences::getFileBrowserPanel () hb0->pack_start (*extension); addExt = Gtk::manage( new Gtk::Button () ); delExt = Gtk::manage( new Gtk::Button () ); + moveExtUp = Gtk::manage( new Gtk::Button () ); + moveExtDown = Gtk::manage( new Gtk::Button () ); addExt->set_tooltip_text (M("PREFERENCES_PARSEDEXTADDHINT")); delExt->set_tooltip_text (M("PREFERENCES_PARSEDEXTDELHINT")); + moveExtUp->set_tooltip_text (M("PREFERENCES_PARSEDEXTUPHINT")); + moveExtDown->set_tooltip_text (M("PREFERENCES_PARSEDEXTDOWNHINT")); Gtk::Image* addExtImg = Gtk::manage( new RTImage ("list-add-small.png") ); Gtk::Image* delExtImg = Gtk::manage( new RTImage ("list-remove-red-small.png") ); + Gtk::Image* moveExtUpImg = Gtk::manage( new RTImage ("arrow-up-small.png") ); + Gtk::Image* moveExtDownImg = Gtk::manage( new RTImage ("arrow-down-small.png") ); addExt->add (*addExtImg); delExt->add (*delExtImg); + moveExtUp->set_image (*moveExtUpImg); + moveExtDown->set_image (*moveExtDownImg); + hb0->pack_end (*moveExtDown, Gtk::PACK_SHRINK, 4); + hb0->pack_end (*moveExtUp, Gtk::PACK_SHRINK, 4); hb0->pack_end (*delExt, Gtk::PACK_SHRINK, 4); hb0->pack_end (*addExt, Gtk::PACK_SHRINK, 4); extensions = Gtk::manage( new Gtk::TreeView () ); @@ -1263,6 +1273,8 @@ Gtk::Widget* Preferences::getFileBrowserPanel () addExt->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::addExtPressed) ); delExt->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::delExtPressed) ); + moveExtUp->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::moveExtUpPressed) ); + moveExtDown->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::moveExtDownPressed) ); extension->signal_activate().connect( sigc::mem_fun(*this, &Preferences::addExtPressed) ); clearThumbnails->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::clearThumbImagesPressed) ); clearProfiles->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::clearProfilesPressed) ); @@ -2093,6 +2105,36 @@ void Preferences::delExtPressed () extensionModel->erase (extensions->get_selection()->get_selected ()); } +void Preferences::moveExtUpPressed () +{ + const Glib::RefPtr selection = extensions->get_selection (); + if (!selection) + return; + + const Gtk::TreeModel::iterator selected = selection->get_selected (); + if (!selected || selected == extensionModel->children ().begin ()) + return; + + Gtk::TreeModel::iterator previous = selected; + --previous; + extensionModel->iter_swap (selected, previous); +} + +void Preferences::moveExtDownPressed () +{ + const Glib::RefPtr selection = extensions->get_selection (); + if (!selection) + return; + + const Gtk::TreeModel::iterator selected = selection->get_selected (); + if (!selected) + return; + + Gtk::TreeModel::iterator next = selected; + if (++next) + extensionModel->iter_swap (selected, next); +} + void Preferences::clearProfilesPressed () { diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 2bf118459..1cfb435cf 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -144,6 +144,8 @@ protected: Gtk::TreeView* extensions; Gtk::Button* addExt; Gtk::Button* delExt; + Gtk::Button* moveExtUp; + Gtk::Button* moveExtDown; Gtk::CheckButton* overlayedFileNames; Gtk::CheckButton* filmStripOverlayedFileNames; Gtk::CheckButton* sameThumbSize; @@ -243,6 +245,8 @@ public: void selectStartupDir (); void addExtPressed (); void delExtPressed (); + void moveExtUpPressed (); + void moveExtDownPressed (); void darkFrameChanged (); void flatFieldChanged (); void clearProfilesPressed (); diff --git a/rtgui/thumbbrowserentrybase.cc b/rtgui/thumbbrowserentrybase.cc index f9f8f9f1e..d1d7adc51 100644 --- a/rtgui/thumbbrowserentrybase.cc +++ b/rtgui/thumbbrowserentrybase.cc @@ -26,7 +26,7 @@ ThumbBrowserEntryBase::ThumbBrowserEntryBase (const Glib::ustring& fname) prex(0), prey(0), upperMargin(6), borderWidth(1), textGap(6), sideMargin(8), lowerMargin(8), preview(NULL), dispname(Glib::path_get_basename (fname)), buttonSet(NULL), width(0), height(0), exp_width(0), exp_height(0), startx(0), starty(0), ofsX(0), ofsY(0), redrawRequests(0), - parent(NULL), bbSelected(false), bbFramed(false), bbPreview(NULL), + parent(NULL), original(NULL), bbSelected(false), bbFramed(false), bbPreview(NULL), thumbnail(NULL), filename(fname), shortname(dispname), exifline(""), datetimeline(""), selected(false), drawable(false), filtered(false), framed(false), processing(false), italicstyle(false), edited(false), recentlysaved(false), updatepriority(false), withFilename(WFNAME_NONE) {} @@ -544,6 +544,17 @@ bool ThumbBrowserEntryBase::insideWindow (int x, int y, int w, int h) return !(ofsX + startx > x + w || ofsX + startx + exp_width < x || ofsY + starty > y + h || ofsY + starty + exp_height < y); } +std::vector > ThumbBrowserEntryBase::getIconsOnImageArea() +{ + return std::vector >(); +} + +void ThumbBrowserEntryBase::getIconSize(int& w, int& h) +{ + w = 0; + h = 0; +} + bool ThumbBrowserEntryBase::motionNotify (int x, int y) { diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h index e910aedd0..1b7f0691a 100644 --- a/rtgui/thumbbrowserentrybase.h +++ b/rtgui/thumbbrowserentrybase.h @@ -72,6 +72,7 @@ protected: int redrawRequests; ThumbBrowserBase* parent; + ThumbBrowserEntryBase* original; Glib::RefPtr backBuffer; bool bbSelected, bbFramed; @@ -168,22 +169,17 @@ public: return shortname.casefold() > other.shortname.casefold(); } + ThumbBrowserEntryBase* getOriginal () const; + void setOriginal (ThumbBrowserEntryBase* original); + virtual void refreshThumbnailImage () {} virtual void refreshQuickThumbnailImage () {} virtual void calcThumbnailSize () {} virtual void drawProgressBar (Glib::RefPtr win, Glib::RefPtr gc, const Gdk::Color& foregr, const Gdk::Color& backgr, int x, int w, int y, int h) {} - virtual std::vector > getIconsOnImageArea () - { - std::vector > r; - return r; - } - virtual void getIconSize (int& w, int& h) - { - w = 0; - h = 0; - } + virtual std::vector > getIconsOnImageArea (); + virtual void getIconSize (int& w, int& h); virtual bool motionNotify (int x, int y); virtual bool pressNotify (int button, int type, int bstate, int x, int y); @@ -191,4 +187,14 @@ public: virtual Glib::ustring getToolTip (int x, int y); }; +inline ThumbBrowserEntryBase* ThumbBrowserEntryBase::getOriginal() const +{ + return original; +} + +inline void ThumbBrowserEntryBase::setOriginal(ThumbBrowserEntryBase* original) +{ + this->original = original; +} + #endif diff --git a/tools/source_icons/scalable/arrow-down-small.file b/tools/source_icons/scalable/arrow-down-small.file new file mode 100644 index 000000000..df0b971b0 --- /dev/null +++ b/tools/source_icons/scalable/arrow-down-small.file @@ -0,0 +1 @@ +arrow-down-small.png,w16,actions diff --git a/tools/source_icons/scalable/arrow-down-small.svg b/tools/source_icons/scalable/arrow-down-small.svg new file mode 100644 index 000000000..7042bdabd --- /dev/null +++ b/tools/source_icons/scalable/arrow-down-small.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/arrow-down.file b/tools/source_icons/scalable/arrow-down.file new file mode 100644 index 000000000..67ebd1f45 --- /dev/null +++ b/tools/source_icons/scalable/arrow-down.file @@ -0,0 +1 @@ +arrow-down.png,w22,actions diff --git a/tools/source_icons/scalable/arrow-down.svg b/tools/source_icons/scalable/arrow-down.svg new file mode 100644 index 000000000..7042bdabd --- /dev/null +++ b/tools/source_icons/scalable/arrow-down.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/arrow-left-small.file b/tools/source_icons/scalable/arrow-left-small.file new file mode 100644 index 000000000..fcf5e7094 --- /dev/null +++ b/tools/source_icons/scalable/arrow-left-small.file @@ -0,0 +1 @@ +arrow-left-small.png,w16,actions diff --git a/tools/source_icons/scalable/arrow-left-small.svg b/tools/source_icons/scalable/arrow-left-small.svg new file mode 100644 index 000000000..c0ecb3b13 --- /dev/null +++ b/tools/source_icons/scalable/arrow-left-small.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/arrow-left.file b/tools/source_icons/scalable/arrow-left.file new file mode 100644 index 000000000..4ed6a9390 --- /dev/null +++ b/tools/source_icons/scalable/arrow-left.file @@ -0,0 +1 @@ +arrow-left.png,w22,actions diff --git a/tools/source_icons/scalable/arrow-left.svg b/tools/source_icons/scalable/arrow-left.svg new file mode 100644 index 000000000..c0ecb3b13 --- /dev/null +++ b/tools/source_icons/scalable/arrow-left.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/arrow-right-small.file b/tools/source_icons/scalable/arrow-right-small.file new file mode 100644 index 000000000..bc480df22 --- /dev/null +++ b/tools/source_icons/scalable/arrow-right-small.file @@ -0,0 +1 @@ +arrow-right-small.png,w16,actions diff --git a/tools/source_icons/scalable/arrow-right-small.svg b/tools/source_icons/scalable/arrow-right-small.svg new file mode 100644 index 000000000..8d1c4694c --- /dev/null +++ b/tools/source_icons/scalable/arrow-right-small.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/arrow-right.file b/tools/source_icons/scalable/arrow-right.file new file mode 100644 index 000000000..7040fee0a --- /dev/null +++ b/tools/source_icons/scalable/arrow-right.file @@ -0,0 +1 @@ +arrow-right.png,w22,actions diff --git a/tools/source_icons/scalable/arrow-right.svg b/tools/source_icons/scalable/arrow-right.svg new file mode 100644 index 000000000..8d1c4694c --- /dev/null +++ b/tools/source_icons/scalable/arrow-right.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/arrow-up-small.file b/tools/source_icons/scalable/arrow-up-small.file new file mode 100644 index 000000000..e20834553 --- /dev/null +++ b/tools/source_icons/scalable/arrow-up-small.file @@ -0,0 +1 @@ +arrow-up-small.png,w16,actions diff --git a/tools/source_icons/scalable/arrow-up-small.svg b/tools/source_icons/scalable/arrow-up-small.svg new file mode 100644 index 000000000..cb6379f6b --- /dev/null +++ b/tools/source_icons/scalable/arrow-up-small.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/arrow-up.file b/tools/source_icons/scalable/arrow-up.file new file mode 100644 index 000000000..187c9e710 --- /dev/null +++ b/tools/source_icons/scalable/arrow-up.file @@ -0,0 +1 @@ +arrow-up.png,w22,actions diff --git a/tools/source_icons/scalable/arrow-up.svg b/tools/source_icons/scalable/arrow-up.svg new file mode 100644 index 000000000..cb6379f6b --- /dev/null +++ b/tools/source_icons/scalable/arrow-up.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/filter-original-1.file b/tools/source_icons/scalable/filter-original-1.file new file mode 100644 index 000000000..8f2876c7b --- /dev/null +++ b/tools/source_icons/scalable/filter-original-1.file @@ -0,0 +1 @@ +filter-original-1.png,w22,actions diff --git a/tools/source_icons/scalable/filter-original-1.svg b/tools/source_icons/scalable/filter-original-1.svg new file mode 100644 index 000000000..4295c2fdb --- /dev/null +++ b/tools/source_icons/scalable/filter-original-1.svg @@ -0,0 +1,738 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/filter-original-2.file b/tools/source_icons/scalable/filter-original-2.file new file mode 100644 index 000000000..d2e205806 --- /dev/null +++ b/tools/source_icons/scalable/filter-original-2.file @@ -0,0 +1 @@ +filter-original-2.png,w22,actions diff --git a/tools/source_icons/scalable/filter-original-2.svg b/tools/source_icons/scalable/filter-original-2.svg new file mode 100644 index 000000000..e1c436ac0 --- /dev/null +++ b/tools/source_icons/scalable/filter-original-2.svg @@ -0,0 +1,768 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/source_icons/script/svg2png.bash b/tools/source_icons/script/svg2png.bash index 2e9c4bb5a..27642a52c 100755 --- a/tools/source_icons/script/svg2png.bash +++ b/tools/source_icons/script/svg2png.bash @@ -49,7 +49,7 @@ do echo "#! /bin/bash" > $DIR_TMP/$FILE_NAME.bash if [[ $OSTYPE == msys || $OSTYPE == MSYS ]]; then - awk -v s="$SVG" -v d="$DIR_OUT" -F, '{print "\"/c/Program Files (x86)/Inkscape/inkscape.exe\" " s " --export-png=" d "/" $1 " -" $2}' $DIR_IN/$FILE >> $DIR_TMP/$FILE_NAME.bash + awk -v s="$SVG" -v d="$DIR_OUT" -F, '{print "\"/c/Program Files/Inkscape/inkscape.exe\" " s " --export-png=" d "/" $1 " -" $2}' $DIR_IN/$FILE >> $DIR_TMP/$FILE_NAME.bash else awk -v s="$SVG" -v d="$DIR_OUT" -F, '{print "inkscape " s " --export-png=" d "/" $1 " -" $2}' $DIR_IN/$FILE >> $DIR_TMP/$FILE_NAME.bash fi