"Fossies" - the Fresh Open Source Software Archive

Member "rawtherapee-5.7/rtgui/dynamicprofilepanel.h" (10 Sep 2019, 4738 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 "dynamicprofilepanel.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 /* -*- C++ -*-
    2  *  This file is part of RawTherapee.
    3  *
    4  *  Copyright (c) 2017 Alberto Griggio
    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 _DYNAMICPROFILEPANEL_H_
   20 #define _DYNAMICPROFILEPANEL_H_
   21 
   22 #include <gtkmm.h>
   23 #include "../rtengine/dynamicprofile.h"
   24 #include "profilestorecombobox.h"
   25 
   26 class DynamicProfilePanel: public Gtk::VBox
   27 {
   28 public:
   29     DynamicProfilePanel();
   30     void save();
   31 
   32 private:
   33     void update_rule (Gtk::TreeModel::Row row, const DynamicProfileRule &rule);
   34     void add_rule (const DynamicProfileRule &rule);
   35     DynamicProfileRule to_rule (Gtk::TreeModel::Row row, int serial = 0);
   36 
   37     void on_button_quit();
   38     void on_button_up();
   39     void on_button_down();
   40     void on_button_new();
   41     void on_button_edit();
   42     void on_button_delete();
   43 
   44     class DynamicProfileColumns: public Gtk::TreeModel::ColumnRecord
   45     {
   46     public:
   47         DynamicProfileColumns()
   48         {
   49             add (iso);
   50             add (fnumber);
   51             add (focallen);
   52             add (shutterspeed);
   53             add (expcomp);
   54             add (camera);
   55             add (lens);
   56             add (profilepath);
   57             add (imagetype);
   58         }
   59 
   60         Gtk::TreeModelColumn<DynamicProfileRule::Range<int>> iso;
   61         Gtk::TreeModelColumn<DynamicProfileRule::Range<double>> fnumber;
   62         Gtk::TreeModelColumn<DynamicProfileRule::Range<double>> focallen;
   63         Gtk::TreeModelColumn<DynamicProfileRule::Range<double>> shutterspeed;
   64         Gtk::TreeModelColumn<DynamicProfileRule::Range<double>> expcomp;
   65         Gtk::TreeModelColumn<DynamicProfileRule::Optional> camera;
   66         Gtk::TreeModelColumn<DynamicProfileRule::Optional> lens;
   67         Gtk::TreeModelColumn<DynamicProfileRule::Optional> imagetype;
   68         Gtk::TreeModelColumn<Glib::ustring> profilepath;
   69     };
   70 
   71     // cell renderers
   72     void render_iso (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   73     void render_fnumber (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   74     void render_focallen (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   75     void render_shutterspeed (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   76     void render_expcomp (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   77     void render_camera (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   78     void render_lens (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   79     void render_imagetype (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   80     void render_profilepath (Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
   81 
   82     class EditDialog: public Gtk::Dialog
   83     {
   84     public:
   85         EditDialog (const Glib::ustring &title, Gtk::Window &parent);
   86         void set_rule (const DynamicProfileRule &rule);
   87         DynamicProfileRule get_rule();
   88 
   89     private:
   90         void set_ranges();
   91         void add_range (const Glib::ustring &name, Gtk::SpinButton *&from, Gtk::SpinButton *&to);
   92         void add_optional (const Glib::ustring &name, Gtk::CheckButton *&check, Gtk::Entry *&field);
   93 
   94         Gtk::SpinButton *iso_min_;
   95         Gtk::SpinButton *iso_max_;
   96 
   97         Gtk::SpinButton *fnumber_min_;
   98         Gtk::SpinButton *fnumber_max_;
   99 
  100         Gtk::SpinButton *focallen_min_;
  101         Gtk::SpinButton *focallen_max_;
  102 
  103         Gtk::SpinButton *shutterspeed_min_;
  104         Gtk::SpinButton *shutterspeed_max_;
  105 
  106         Gtk::SpinButton *expcomp_min_;
  107         Gtk::SpinButton *expcomp_max_;
  108 
  109         Gtk::CheckButton *has_camera_;
  110         Gtk::Entry *camera_;
  111 
  112         Gtk::CheckButton *has_lens_;
  113         Gtk::Entry *lens_;
  114 
  115         MyComboBoxText *imagetype_;
  116 
  117         ProfileStoreComboBox *profilepath_;
  118     };
  119 
  120     DynamicProfileColumns columns_;
  121 
  122     //Child widgets:
  123     Gtk::Box vbox_;
  124 
  125     Gtk::ScrolledWindow scrolledwindow_;
  126     Gtk::TreeView treeview_;
  127     Glib::RefPtr<Gtk::ListStore> treemodel_;
  128 
  129     Gtk::ButtonBox buttonbox_;
  130     Gtk::Button button_up_;
  131     Gtk::Button button_down_;
  132     Gtk::Button button_new_;
  133     Gtk::Button button_edit_;
  134     Gtk::Button button_delete_;
  135 };
  136 
  137 #endif // _DYNAMICPROFILEPANEL_H_