2 * This file is part of RawTherapee.
4 * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
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.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _THUMBNAILBROWSERBASE_
20 #define _THUMBNAILBROWSERBASE_
23 #include <thumbbrowserentrybase.h>
25 class ThumbBrowserBase
: public Gtk::DrawingArea
{
29 enum Arrangement
{TB_Horizontal
, TB_Vertical
};
33 Glib::RefPtr
<Gdk::GC
> gc_
;
35 std::vector
<ThumbBrowserEntryBase
*> fd
;
36 std::vector
<ThumbBrowserEntryBase
*> selected
;
37 ThumbBrowserEntryBase
* lastClicked
;
41 Glib::ustring fileInEditor
;
42 Arrangement arrangement
;
50 void setPreviewHeight (int h
);
51 const std::vector
<ThumbBrowserEntryBase
*>& getEntries () { return fd
; }
52 void styleChanged (const Glib::RefPtr
<Gtk::Style
>& style
);
53 void redraw (); // arrange files and draw area
54 void refreshAll (); // refresh thumbnail sizes, re-generate thumbnail images, arrange and draw
55 void resized (Gtk::Allocation
& req
);
56 void setOpenedFileName (const Glib::ustring
& fname
);
58 virtual void on_realize();
59 virtual bool on_expose_event(GdkEventExpose
* event
);
60 virtual bool on_button_press_event (GdkEventButton
* event
);
61 virtual bool on_button_release_event (GdkEventButton
* event
);
62 virtual bool on_motion_notify_event (GdkEventMotion
* event
);
64 void setArrangement (Arrangement a
);
65 virtual bool checkFilter (ThumbBrowserEntryBase
* entry
) { return true; }
66 virtual void rightClicked (ThumbBrowserEntryBase
* entry
) {}
67 virtual void doubleClicked (ThumbBrowserEntryBase
* entry
) {}