"Fossies" - the Fresh Open Source Software Archive

Member "rawtherapee-5.7/rtgui/toolbar.h" (10 Sep 2019, 2744 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 "toolbar.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 __TOOLBAR_H__
   20 #define __TOOLBAR_H__
   21 
   22 #include <gtkmm.h>
   23 #include "toolenum.h"
   24 #include "rtimage.h"
   25 #include "lockablecolorpicker.h"
   26 
   27 class ToolBarListener
   28 {
   29 
   30 public:
   31     virtual ~ToolBarListener() = default;
   32     /// Callback when a tool is selected
   33     virtual void toolSelected(ToolMode tool) = 0;
   34 
   35     /// Callback when the Edit mode is stopped
   36     virtual void editModeSwitchedOff() = 0;
   37 };
   38 
   39 class ToolBar : public Gtk::HBox
   40 {
   41 private:
   42     std::unique_ptr<RTImage> handimg;
   43     std::unique_ptr<RTImage> editinghandimg;
   44     std::unique_ptr<RTImage> showcolpickersimg;
   45     std::unique_ptr<RTImage> hidecolpickersimg;
   46     bool showColPickers;
   47 
   48     void hand_pressed ();
   49     void wb_pressed ();
   50     void colPicker_pressed (GdkEventButton* event);
   51     void crop_pressed ();
   52     void stra_pressed ();
   53     bool showColorPickers(bool showCP);
   54     void switchColorPickersVisibility();
   55 
   56 protected:
   57     Gtk::ToggleButton* handTool;
   58     Gtk::ToggleButton* wbTool;
   59     Gtk::ToggleButton* colPickerTool;
   60     Gtk::ToggleButton* cropTool;
   61     Gtk::ToggleButton* straTool;
   62     ToolBarListener* listener;
   63     LockablePickerToolListener* pickerListener;
   64     ToolMode current;
   65     bool allowNoTool;
   66     bool editingMode;  // true if the cursor is being used to remotely edit tool's values
   67     sigc::connection  handConn;
   68     sigc::connection  wbConn;
   69     sigc::connection  cpConn;
   70     sigc::connection  cropConn;
   71     sigc::connection  straConn;
   72 
   73 public:
   74     ToolBar ();
   75 
   76     void     setTool (ToolMode tool);
   77     ToolMode getTool ()
   78     {
   79         return current;
   80     }
   81 
   82     bool showColorPickers() {
   83         return showColPickers;
   84     }
   85 
   86     void setToolBarListener (ToolBarListener* tpl)
   87     {
   88         listener = tpl;
   89     }
   90 
   91     void setLockablePickerToolListener (LockablePickerToolListener* lptl)
   92     {
   93         pickerListener = lptl;
   94     }
   95 
   96     void startEditMode();
   97     void stopEditMode();
   98 
   99     bool handleShortcutKey (GdkEventKey* event);
  100     void setBatchMode();
  101 };
  102 
  103 #endif