"Fossies" - the Fresh Open Source Software Archive

Member "rawtherapee-5.7/rtgui/preferences.h" (10 Sep 2019, 9572 Bytes) of package /linux/misc/rawtherapee-5.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "preferences.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.6_vs_5.7.

    1 /*
    2  *  This file is part of RawTherapee.
    3  *
    4  *  Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
    5  *
    6  *  RawTherapee is free software: you can redistribute it and/or modify
    7  *  it under the terms of the GNU General Public License as published by
    8  *  the Free Software Foundation, either version 3 of the License, or
    9  *  (at your option) any later version.
   10  *
   11  *  RawTherapee is distributed in the hope that it will be useful,
   12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  *  GNU General Public License for more details.
   15  *
   16  *  You should have received a copy of the GNU General Public License
   17  *  along with RawTherapee.  If not, see <https://www.gnu.org/licenses/>.
   18  */
   19 #ifndef __PREFERENCES_H__
   20 #define __PREFERENCES_H__
   21 
   22 #include <gtkmm.h>
   23 #include "adjuster.h"
   24 #include "options.h"
   25 #include <vector>
   26 #include "rtwindow.h"
   27 #include "dynamicprofilepanel.h"
   28 
   29 class Preferences : public Gtk::Dialog, public ProfileStoreListener
   30 {
   31 
   32     class ExtensionColumns : public Gtk::TreeModel::ColumnRecord
   33     {
   34     public:
   35         Gtk::TreeModelColumn<bool>  enabled;
   36         Gtk::TreeModelColumn<Glib::ustring>  ext;
   37         ExtensionColumns()
   38         {
   39             add (enabled);
   40             add (ext);
   41         }
   42     };
   43     ExtensionColumns extensionColumns;
   44     Glib::RefPtr<Gtk::ListStore> extensionModel;
   45 
   46 
   47     class BehavColumns : public Gtk::TreeModel::ColumnRecord
   48     {
   49     public:
   50         Gtk::TreeModelColumn<Glib::ustring> label;
   51         Gtk::TreeModelColumn<bool>          badd;
   52         Gtk::TreeModelColumn<bool>          bset;
   53         Gtk::TreeModelColumn<bool>          visible;
   54         Gtk::TreeModelColumn<int>           addsetid;
   55         BehavColumns()
   56         {
   57             add (label);
   58             add (badd);
   59             add (bset);
   60             add (visible);
   61             add (addsetid);
   62         }
   63     };
   64 
   65     class ThemeFilename
   66     {
   67     public:
   68         Glib::ustring shortFName;
   69         Glib::ustring longFName;
   70 
   71         ThemeFilename (Glib::ustring sfname, Glib::ustring lfname) : shortFName (sfname), longFName (lfname) {}
   72     };
   73 
   74     Glib::RefPtr<Gtk::TreeStore> behModel;
   75     BehavColumns behavColumns;
   76     std::vector<ThemeFilename> themeFNames;
   77     Glib::RefPtr<Glib::Regex> regex;
   78     Glib::MatchInfo matchInfo;
   79     Splash* splash;
   80     ProfileStoreComboBox* rprofiles;
   81     Gtk::TreeIter currRawRow; // :)
   82     ProfileStoreComboBox* iprofiles;
   83     Gtk::TreeIter currImgRow;
   84     Gtk::ComboBoxText* languages;
   85     Gtk::CheckButton* ckbLangAutoDetect;
   86     Gtk::Entry* dateformat;
   87     Gtk::Entry* startupdir;
   88     Gtk::RadioButton* sdcurrent;
   89     Gtk::RadioButton* sdlast;
   90     Gtk::RadioButton* sdhome;
   91     Gtk::RadioButton* sdother;
   92     MyFileChooserButton* gimpDir;
   93     MyFileChooserButton* psDir;
   94     Gtk::Entry* editorToSendTo;
   95     Gtk::RadioButton* edGimp;
   96     Gtk::RadioButton* edPS;
   97     Gtk::RadioButton* edOther;
   98     MyFileChooserButton* darkFrameDir;
   99     MyFileChooserButton* flatFieldDir;
  100     MyFileChooserButton* clutsDir;
  101     Gtk::Label *dfLabel;
  102     Gtk::Label *ffLabel;
  103 
  104     Gtk::CheckButton* showDateTime;
  105     Gtk::CheckButton* showBasicExif;
  106     Gtk::CheckButton* showExpComp;
  107 
  108     MyFileChooserButton* iccDir;
  109     Gtk::ComboBoxText* prtProfile;
  110     Gtk::ComboBoxText* prtIntent;
  111     Gtk::CheckButton* prtBPC;
  112     Gtk::ComboBoxText* monProfile;
  113     Gtk::ComboBoxText* monIntent;
  114     Gtk::CheckButton* monBPC;
  115     Gtk::CheckButton* cbAutoMonProfile;
  116     //Gtk::CheckButton* cbAutocielab;
  117     Gtk::CheckButton* cbdaubech;
  118     Gtk::SpinButton*  hlThresh;
  119     Gtk::SpinButton*  shThresh;
  120 
  121     Gtk::SpinButton*  panFactor;
  122     Gtk::CheckButton* rememberZoomPanCheckbutton;
  123 
  124 //   Gtk::ComboBoxText* view;
  125 //    Gtk::ComboBoxText* grey;
  126 //    Gtk::ComboBoxText* greySc;
  127     Gtk::ComboBoxText* dnv;
  128     Gtk::ComboBoxText* dnti;
  129     Gtk::ComboBoxText* dnaut;
  130     Gtk::ComboBoxText* dnautsimpl;
  131     Gtk::ComboBoxText* dnwavlev;
  132     Gtk::ComboBoxText* dnliss;
  133 
  134     Gtk::Frame* waveletFrame;
  135     Gtk::HBox* waveletTileSizeHBox;
  136     Gtk::Label* waveletTileSizeLabel;
  137     Gtk::ComboBoxText* waveletTileSizeCombo;
  138 
  139     Gtk::ComboBoxText* cprevdemo;
  140     Gtk::CheckButton* ctiffserialize;
  141     Gtk::ComboBoxText* curveBBoxPosC;
  142 
  143     Gtk::ComboBoxText* themeCBT;
  144     Gtk::FontButton* mainFontFB;
  145     Gtk::FontButton* colorPickerFontFB;
  146     Gtk::ColorButton* cropMaskColorCB;
  147     Gtk::ColorButton* navGuideColorCB;
  148     Gtk::CheckButton* pseudoHiDPI;
  149 
  150 
  151     Gtk::SpinButton*   maxRecentFolders;
  152     Gtk::SpinButton*   maxThumbHeightSB;
  153     Gtk::SpinButton*   maxCacheEntriesSB;
  154     Gtk::Entry*     extension;
  155     Gtk::TreeView*  extensions;
  156     Gtk::Button*    addExt;
  157     Gtk::Button*    delExt;
  158     Gtk::Button*    moveExtUp;
  159     Gtk::Button*    moveExtDown;
  160     Gtk::CheckButton* overlayedFileNames;
  161     Gtk::CheckButton* filmStripOverlayedFileNames;
  162     Gtk::CheckButton* sameThumbSize;
  163 
  164     Gtk::SpinButton*  threadsSpinBtn;
  165     Gtk::SpinButton*  clutCacheSizeSB;
  166     Gtk::CheckButton* measureCB;
  167     Gtk::SpinButton*  chunkSizeAMSB;
  168     Gtk::SpinButton*  chunkSizeCASB;
  169     Gtk::SpinButton*  chunkSizeRCDSB;
  170     Gtk::SpinButton*  chunkSizeRGBSB;
  171     Gtk::SpinButton*  chunkSizeXTSB;
  172     Gtk::SpinButton*  maxInspectorBuffersSB;
  173     Gtk::ComboBoxText *thumbnailInspectorMode;
  174 
  175     Gtk::CheckButton* ckbmenuGroupRank;
  176     Gtk::CheckButton* ckbmenuGroupLabel;
  177     Gtk::CheckButton* ckbmenuGroupFileOperations;
  178     Gtk::CheckButton* ckbmenuGroupProfileOperations;
  179     Gtk::CheckButton* ckbmenuGroupExtProg;
  180 
  181     Gtk::Button*      behAddAll;
  182     Gtk::Button*      behSetAll;
  183     Gtk::CheckButton* chOverwriteOutputFile;
  184 
  185     Gtk::ComboBoxText* saveParamsPreference;
  186     Gtk::CheckButton* useBundledProfiles;
  187     Gtk::ComboBoxText* loadParamsPreference;
  188     Gtk::ComboBoxText* editorLayout;
  189     RTWindow* parent;
  190 
  191     Gtk::CheckButton* ckbSndEnable;
  192     Gtk::Entry* txtSndBatchQueueDone;
  193     Gtk::Entry* txtSndLngEditProcDone;
  194     Gtk::SpinButton* spbSndLngEditProcDoneSecs;
  195 
  196     Gtk::CheckButton* ckbInternalThumbIfUntouched;
  197 
  198     Gtk::Entry* txtCustProfBuilderPath;
  199     Gtk::ComboBoxText* custProfBuilderLabelType;
  200 
  201     Gtk::CheckButton* ckbHistogramPositionLeft;
  202     Gtk::CheckButton* ckbFileBrowserToolbarSingleRow;
  203     Gtk::CheckButton* ckbShowFilmStripToolBar;
  204     Gtk::CheckButton* ckbHideTPVScrollbar;
  205 
  206     Gtk::CheckButton* ckbAutoSaveTpOpen;
  207     Gtk::Button* btnSaveTpOpenNow;
  208 
  209     DynamicProfilePanel *dynProfilePanel;
  210 
  211     Gtk::ComboBoxText *cropGuidesCombo;
  212     Gtk::CheckButton *cropAutoFitCB;
  213 
  214     Glib::ustring storedValueRaw;
  215     Glib::ustring storedValueImg;
  216 
  217     Options moptions;
  218     sigc::connection tconn, sconn, fconn, cpfconn, addc, setc, dfconn, ffconn, bpconn, rpconn, ipconn;
  219     sigc::connection autoMonProfileConn, sndEnableConn, langAutoDetectConn, autocielabConn;
  220     Glib::ustring initialTheme;
  221     Glib::ustring initialFontFamily;
  222     int initialFontSize;
  223     bool newFont;
  224     bool newCPFont;
  225 
  226     void fillPreferences ();
  227     void storePreferences ();
  228     void parseDir       (Glib::ustring dirname, std::vector<Glib::ustring>& items, Glib::ustring ext);
  229     void parseThemeDir  (Glib::ustring dirname);
  230     void updateDFinfos ();
  231     void updateFFinfos ();
  232     void workflowUpdate();
  233     void themeChanged  ();
  234     void fontChanged   ();
  235     void cpFontChanged ();
  236     void forRAWComboChanged ();
  237     void forImageComboChanged ();
  238     void layoutComboChanged ();
  239     void bundledProfilesChanged ();
  240     void iccDirChanged ();
  241     void switchThemeTo (Glib::ustring newTheme);
  242     void switchFontTo  (const Glib::ustring &newFontFamily, const int newFontSize);
  243     bool splashClosed (GdkEventAny* event);
  244 
  245     int getThemeRowNumber (Glib::ustring& longThemeFName);
  246 
  247     void appendBehavList (Gtk::TreeModel::iterator& parent, Glib::ustring label, int id, bool set);
  248 
  249     Gtk::ScrolledWindow *swGeneral;
  250     Gtk::ScrolledWindow *swImageProcessing;
  251     Gtk::ScrolledWindow *swDynamicProfile;
  252     Gtk::ScrolledWindow *swFileBrowser;
  253     Gtk::ScrolledWindow *swColorMan;
  254     Gtk::ScrolledWindow *swBatchProc;
  255     Gtk::ScrolledWindow *swPerformance;
  256     Gtk::ScrolledWindow *swSounds;
  257 
  258     Gtk::Widget *getGeneralPanel();
  259     Gtk::Widget *getImageProcessingPanel();
  260     Gtk::Widget *getDynamicProfilePanel();
  261     Gtk::Widget *getFileBrowserPanel();
  262     Gtk::Widget *getColorManPanel();
  263     Gtk::Widget *getBatchProcPanel();
  264     Gtk::Widget *getPerformancePanel();
  265     Gtk::Widget *getSoundsPanel();
  266 
  267 public:
  268     explicit Preferences (RTWindow *rtwindow);
  269     ~Preferences () override;
  270 
  271     void savePressed ();
  272     void loadPressed ();
  273     void okPressed ();
  274     void cancelPressed ();
  275     void aboutPressed ();
  276     void autoMonProfileToggled ();
  277     void sndEnableToggled ();
  278     void langAutoDetectToggled ();
  279     void autocielabToggled ();
  280 
  281     void selectStartupDir ();
  282     void addExtPressed ();
  283     void delExtPressed ();
  284     void moveExtUpPressed ();
  285     void moveExtDownPressed ();
  286     void darkFrameChanged ();
  287     void flatFieldChanged ();
  288     void clearProfilesPressed ();
  289     void clearThumbImagesPressed ();
  290     void clearAllPressed ();
  291 
  292     void behAddSetRadioToggled (const Glib::ustring& path, bool add);
  293     void behAddRadioToggled (const Glib::ustring& path);
  294     void behSetRadioToggled (const Glib::ustring& path);
  295     void behAddSetAllPressed (bool add);
  296     void behAddAllPressed ();
  297     void behSetAllPressed ();
  298 
  299     void storeCurrentValue() override;
  300     void updateProfileList() override;
  301     void restoreValue() override;
  302 
  303 //    void selectICCProfileDir ();
  304 //    void selectMonitorProfile ();
  305 };
  306 
  307 #endif