"Fossies" - the Fresh Open Source Software Archive

Member "rawtherapee-5.7/rtgui/imagearea.h" (10 Sep 2019, 5817 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 "imagearea.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 __IMAGEAREA_H__
   20 #define __IMAGEAREA_H__
   21 
   22 #include <gtkmm.h>
   23 #include "cropguilistener.h"
   24 #include "imageareapanel.h"
   25 #include "editenums.h"
   26 #include "toolbar.h"
   27 #include "previewhandler.h"
   28 #include "imageareatoollistener.h"
   29 #include "cropwindow.h"
   30 #include "editcallbacks.h"
   31 #include "zoompanel.h"
   32 #include "indclippedpanel.h"
   33 #include "previewmodepanel.h"
   34 
   35 class ImageAreaPanel;
   36 class ImageArea : public Gtk::DrawingArea, public CropWindowListener, public EditDataProvider, public LockablePickerToolListener
   37 {
   38 
   39     friend class ZoomPanel;
   40 
   41 protected:
   42 
   43     Glib::ustring infotext;
   44     Glib::RefPtr<Pango::Layout> deglayout;
   45     BackBuffer iBackBuffer;
   46     bool showClippedH, showClippedS;
   47 
   48     ImageAreaPanel* parent;
   49 
   50     std::list<CropWindow*> cropWins;
   51     PreviewHandler* previewHandler;
   52     rtengine::StagedImageProcessor* ipc;
   53 
   54     bool        dirty;
   55     CropWindow* focusGrabber;
   56     CropGUIListener* cropgl;
   57     PointerMotionListener* pmlistener;
   58     PointerMotionListener* pmhlistener;
   59     ImageAreaToolListener* listener;
   60 
   61     CropWindow* getCropWindow (int x, int y);
   62     Gtk::SizeRequestMode get_request_mode_vfunc () const override;
   63     void get_preferred_height_vfunc (int &minimum_height, int &natural_height) const override;
   64     void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const override;
   65     void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const override;
   66     void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const override;
   67 
   68     int fullImageWidth, fullImageHeight;
   69 public:
   70     CropWindow* mainCropWindow;
   71     CropWindow* flawnOverWindow;
   72     ZoomPanel* zoomPanel;
   73     IndicateClippedPanel* indClippedPanel;
   74     PreviewModePanel* previewModePanel;
   75     ImageArea* iLinkedImageArea; // used to set a reference to the Before image area, which is set when before/after view is enabled
   76 
   77     explicit ImageArea (ImageAreaPanel* p);
   78     ~ImageArea () override;
   79 
   80     rtengine::StagedImageProcessor* getImProcCoordinator() const;
   81     void setImProcCoordinator(rtengine::StagedImageProcessor* ipc_);
   82     void setPreviewModePanel(PreviewModePanel* previewModePanel_)
   83     {
   84         previewModePanel = previewModePanel_;
   85     };
   86     void setIndicateClippedPanel(IndicateClippedPanel* indClippedPanel_)
   87     {
   88         indClippedPanel = indClippedPanel_;
   89     };
   90 
   91     void getScrollImageSize (int& w, int& h);
   92     void getScrollPosition  (int& x, int& y);
   93     void setScrollPosition  (int x, int y);     // called by the imageareapanel when the scrollbars have been changed
   94 
   95     // enabling and setting text of info area
   96     void setInfoText (Glib::ustring text);
   97     void infoEnabled (bool e);
   98 
   99     // widget base events
  100     void on_realize () override;
  101     bool on_draw                 (const ::Cairo::RefPtr< Cairo::Context> &cr) override;
  102     bool on_motion_notify_event  (GdkEventMotion* event) override;
  103     bool on_button_press_event   (GdkEventButton* event) override;
  104     bool on_button_release_event (GdkEventButton* event) override;
  105     bool on_scroll_event         (GdkEventScroll* event) override;
  106     bool on_leave_notify_event   (GdkEventCrossing* event) override;
  107     void on_resized              (Gtk::Allocation& req);
  108     void on_style_updated        () override;
  109     void syncBeforeAfterViews    ();
  110 
  111     void            setCropGUIListener       (CropGUIListener* l);
  112     void            setPointerMotionListener  (PointerMotionListener* pml);
  113     void            setPointerMotionHListener (PointerMotionListener* pml);
  114     void            setImageAreaToolListener (ImageAreaToolListener* l)
  115     {
  116         listener = l;
  117     }
  118     void            setPreviewHandler        (PreviewHandler* ph);
  119     PreviewHandler* getPreviewHandler        ()
  120     {
  121         return previewHandler;
  122     }
  123 
  124     void grabFocus          (CropWindow* cw);
  125     void unGrabFocus        ();
  126     void addCropWindow      ();
  127     void cropWindowSelected (CropWindow* cw);
  128     void cropWindowClosed   (CropWindow* cw);
  129     ToolMode getToolMode    ();
  130     bool showColorPickers   ();
  131     void setToolHand        ();
  132     void straightenReady    (double rotDeg);
  133     void spotWBSelected     (int x, int y);
  134     void sharpMaskSelected  (bool sharpMask);
  135     int  getSpotWBRectSize  ();
  136     void redraw             ();
  137 
  138     void zoomFit     ();
  139     double getZoom   ();
  140     void   setZoom   (double zoom);
  141 
  142     // EditDataProvider interface
  143     void subscribe(EditSubscriber *subscriber) override;
  144     void unsubscribe() override;
  145     void getImageSize (int &w, int&h) override;
  146 
  147     // CropWindowListener interface
  148     void cropPositionChanged   (CropWindow* cw) override;
  149     void cropWindowSizeChanged (CropWindow* cw) override;
  150     void cropZoomChanged       (CropWindow* cw) override;
  151     void initialImageArrived   () override;
  152 
  153     // LockablePickerToolListener interface
  154     void switchPickerVisibility (bool isVisible) override;
  155 
  156     CropWindow* getMainCropWindow ()
  157     {
  158         return mainCropWindow;
  159     }
  160 };
  161 
  162 
  163 
  164 #endif